From nobody Sun Nov 03 16:02:22 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 4XhK9q04JYz5cMRh; Sun, 03 Nov 2024 16:02:23 +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 4XhK9p56cnz4MqC; Sun, 3 Nov 2024 16:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649742; 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=18KE5IYkpWnGTYfUKV9+LTET1nBukFHIDWvv2c/WawY=; b=iClTvurjdg72PS52Qc7U5qJwGqsKPVbzLVBVxP0RpslPtW6iyQMf/jHUKN+4PnlqWYiEg/ qelYKIQGBzRuAtclsiJr8tFcJNlKjVSDbTKjOEVi0yq6ffvrtFp7+X8t/fJlLa2lmgjPCT T7aK7HWj/g9I1I4Q+1uONYluxvX8PzD6CvcUeeBozR7ZG4XRqdEHI9BPR0Lnyius81AmDZ 0T/yMNN6+I4jQjJbv7qjcrlAPRriUL//H4m1WDWl5Rn92fN194A00sPjIn5Q4B+iVUE2vp Nnm84frtpOMX0rbBNd58PXcdjWSdOMXIlKhdS/qnIqNJq0Dlwaisz77yWX8+kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649742; 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=18KE5IYkpWnGTYfUKV9+LTET1nBukFHIDWvv2c/WawY=; b=YD8/gu0gzvIQHGkwo5tUks8bVUSgx0JSWdurtg2gd1rF4aXE4a6cNloT8/X443O0qZWrMk mbEhoSRjqVmLlGXx+MITUcV2vYsbJ1PSWGi5r0im8v2Wf86dPCvZaQ0wZivATTtG44PDeR TDcRLDGnpcndMF6RFrJ5SewjSSf8ILqUfAZkS/7QSISWGEhlEm5jn5q/Qi11FZftAbhYU4 tsdVakBnmfo+PkrDvLXZYaflgxvyyGlFcl5zbtDiDmE19NiQZ+nWOl0mjZqoF81PeyqsMG 6yGNxVuHBQiCh85Od9p+Pq2XwWJHFfIkFvM2lc9xC3JFcWOmwVzrXojaICMD2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649742; a=rsa-sha256; cv=none; b=Kjtl8zkHWZnGWiaul6nA+1gcPFmWmMDoZySPnZ3Dp171w0Vh/sn08a/yHEGkNT3oOStfEy oX+pivTK9tyE2nNF9NJb7wIGFNcKuz0nFlkHPGuiT9aQJpCRyxPNnMbNGatlqCA3i5yEw7 PcrO8Qco/WiFVsOMp2G2dY6VPNqfON/LdRfEw9X5SUIlx3NFmJfp/WOXGsm/9mIvujkxIU ihdF7tutlZP5AzseGTlD2+fjImAVRc01JyU4bNIIpIeGCP1fACy/UHwlUmdHe8ehBk0Mln EybMp7g/VMOTvcKXONwdFBaaW2Ws21XSjG+y92oJYhQCguJ2MFlH9aZE0A7fhw== 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 4XhK9p40Khzw7L; Sun, 3 Nov 2024 16:02:22 +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 4A3G2MXa015544; Sun, 3 Nov 2024 16:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2M5K015541; Sun, 3 Nov 2024 16:02:22 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:22 GMT Message-Id: <202411031602.4A3G2M5K015541@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: e177e6429455 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e177e64294556bdece642442d6691523a4294b67 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e177e64294556bdece642442d6691523a4294b67 commit e177e64294556bdece642442d6691523a4294b67 Author: Colin Percival AuthorDate: 2024-10-12 17:27:39 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +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 MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47094 (cherry picked from commit f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066) --- 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); }