From nobody Sun Nov 03 16:16:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVV17Znz5cNWS; Sun, 03 Nov 2024 16:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVT6QZwz4Rcb; Sun, 3 Nov 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMRbB6ehyP90mqhkTtMEnMj1l/pymNco8H4cgbaoI3w=; b=DXmD2v2kNpzwL/GcBLXXF2opjRvIaux/QVhc4BPQHew+3jv+T/r9kcd0ICzUie9PJvOa3c 1P0Rk/avgIWTf+ILoKjE41t6bcDc2728ARAhMxRmqyjL8/N1y1iyUy25uzshV6z3ZJtZ1Z v062McK1h/57S2oh4Sg1qxhK9yGbAPmvs+IWwXqlnNPvn2nb9SKWqFaRNxZn4YwDr5LigA HPCI3qY1lMcCDPHlPglknFSjsbJw0H1Vq4OFvVa1IBZIuFZHmCkKowHahTQeNBgQ6SZG3u OJAlfMPLyI/8QaPX4uSKFM9CqSsC6U1T5PBnWAiF4WzaYiN/SxJZssr+0Sk1Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMRbB6ehyP90mqhkTtMEnMj1l/pymNco8H4cgbaoI3w=; b=lELy6sPy6vmqG6NmXb5c4rZmZ88XqZgN4ec9Sjj2shZq006LrRYADq+jDKs3JANnFFGQuR JPVLAtVub/Vni+f4M3WHX4wO7qbwGqtEmmj48qJA1jSlu6tsgBD6bKxf1gwUBsN6crieok 6T+yUYo4Ug9DSEvQchtuluODmiJb1/ksWMruraQN6Iazv0Q7OuLFsDUvunsaSuv6c3i+jY VkfrAZRwyNGmTcNnBBliFCd38FxsxoTj0fRaiRcMnku/s1vC3vXpMXtwzFN+TBQmStMSop 8rZgcod67EKX2SPyTLB4krycKJnEHmwAHl88LZjCL9TYM2jaBx6WH4tSR4YIhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650609; a=rsa-sha256; cv=none; b=KJFjSLslb79B8X3+tDacEZRLyQipLQ0Zyky8jGfrXFtZIhzp+/SIw1bxZbxjrFIS0QwvDr zHfohJqTPgdWZ0Ohc26T0yxgW+0uyr/OTWQFq0HyVU2B+16tN1Esyl+trvf4CCe7VAAXSi JhwTFP9Q6bfL/GeD4LetYyEUtFqrqiSdCh+zi/KUXHE+zciiDAb6q5Ze3uEOqXdCksn1wP pH6wF99OWfptO8iUZIFZo5lSr/1iuRlbGSKEbqYAA0TlKHSHKcz3VXqUrx1IRdR5w+LmhD VaRj1TUEeQulPB5bkdaAOPichTRFO8tTeeNA7eJ68uxjDmhStvNzBl0w2HfuVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVT61p3zvwv; Sun, 3 Nov 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGnP0036336; Sun, 3 Nov 2024 16:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGnbw036333; Sun, 3 Nov 2024 16:16:49 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:49 GMT Message-Id: <202411031616.4A3GGnbw036333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c90ebd3fa356 - releng/14.2 - ACPI: Implement power button on !x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: c90ebd3fa356406e152fff4475431c9fd66ea84e Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c90ebd3fa356406e152fff4475431c9fd66ea84e commit c90ebd3fa356406e152fff4475431c9fd66ea84e Author: Colin Percival AuthorDate: 2024-10-12 17:27:39 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:12 +0000 ACPI: Implement power button on !x86 ACPI sleep states are only implemented on x86 systems, so having the ACPI power button attempt to enter "S5" (or other state as configured via the hw.acpi.power_button_state sysctl) is not useful. On non-x86 systems, implement the power button with a call to shutdown_nice(RB_POWEROFF) to shut down the system. Reviewed by: Andrew Tested on: Graviton 2 Approved by: re (kib) MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47094 (cherry picked from commit f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066) (cherry picked from commit e177e64294556bdece642442d6691523a4294b67) --- sys/dev/acpica/acpi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 71b19067707b..c2bfe5f2fa5d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -3858,13 +3858,22 @@ acpi_invoke_wake_eventhandler(void *context) UINT32 acpi_event_power_button_sleep(void *context) { +#if defined(__amd64__) || defined(__i386__) struct acpi_softc *sc = (struct acpi_softc *)context; +#else + (void)context; +#endif ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); +#if defined(__amd64__) || defined(__i386__) if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_invoke_sleep_eventhandler, &sc->acpi_power_button_sx))) return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); +#else + shutdown_nice(RB_POWEROFF); +#endif + return_VALUE (ACPI_INTERRUPT_HANDLED); }