From nobody Tue Oct 22 14:56:28 2024 X-Original-To: dev-commits-src-main@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 4XXwHJ34Hrz5PYDT; Tue, 22 Oct 2024 14:56:28 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXwHJ2Vffz4DtR; Tue, 22 Oct 2024 14:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729608988; 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=ZI0DMnhrX8hemQWcsc4EgAv1b+vLL4HqUkdllRK/mE8=; b=oHdQjwTgURNKlqYHupvjtTTILDLi4+6AaNVTlCuSW/vKApjv5DaTNZf2HgZGbr1nshGjqB Q80cj+sHvWikqyn/AfJi14wRUHh5ki+Rwzz19oy9s8AehXH0S/EJYLPDnhbZ6GbXJNZpm4 tFa5ba62DATTmOP+anZicPza7RbidIQjBVDNbK+ud5eLcxlL6uSN5TyfiKkvLiv2vpHg+E UHO+r6qQmaeDIxkMTucQho/zjYUHfu7uzLFO2lwYEuOT0PtukODhsvxKwBNpqkBM1Af2O0 fg1iowhLrgUW1kQI7n/70sP5Ip0WBvwfQ+9EbTeqbQxBMamaoyfu6WZ54kJCpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729608988; 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=ZI0DMnhrX8hemQWcsc4EgAv1b+vLL4HqUkdllRK/mE8=; b=VykdggbZ54jjT4OFJ1b0s8rKdR8BvcDaGL6z1qpHcdphzHCReX1sqQJImCXfTnHqj1E8Ph A3QCT97eQ4AxS9CvnHXTz9KNGgFV5An749/6IY28dj4K+LDU31Gg6cFiWsOh3mCPDwa22z UGy2+uEAkFCcBLzK6Baore9FIgGu7Anw/TR3aSTltiXD5oeT1my9tYd5eC7k5RCbNwsl5P JSCIQjuHYZ57VqnfyS3nndCugbcHJmod18CWqJQeeAuOdbgBhESCtIqv0+wbS4YMO8DlL6 +JAr4j4DCij+TEknA+IgEZ35XG2r6oBfrNn/DOcPT/A4pROj7Id6NJ3HrDl3hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729608988; a=rsa-sha256; cv=none; b=IpO9/A0UNhf25jDOAnCaFJy4E16j5dWHMqyxmOK7q7yote3pZZ+6fBrf4KPCh8GilvmIcv U0Dcj+pKnpGnbTdsiMI+//PZqMBZKLKF3UlWT9O2GI+Rx5amyRlG/2sr1seX5eSmNPD64q 7/m7BamelPp02kXhTIqrjApHrQcAba772wH0l570+D+LV052c3pzXKglWeyCuE4tVslJOB ATmiL9vDWuqy9yzpPX2YgWDjq2RsT4CFafLuvZq1bITH3Rz/byX8P+fvvpt7V2U/TOJ19E M5mPk7K/LgOcyJHeqBKJagG3sF9dc4jD00/OfFqClZ2Nek1yivXwxqKWq17Kdg== 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 4XXwHJ25fQzJZq; Tue, 22 Oct 2024 14:56:28 +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 49MEuSaS097912; Tue, 22 Oct 2024 14:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49MEuSdP097909; Tue, 22 Oct 2024 14:56:28 GMT (envelope-from git) Date: Tue, 22 Oct 2024 14:56:28 GMT Message-Id: <202410221456.49MEuSdP097909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: f41ef9d80b3d - main - ACPI: Implement power button on !x86 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066 commit f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066 Author: Colin Percival AuthorDate: 2024-10-12 17:27:39 +0000 Commit: Colin Percival CommitDate: 2024-10-22 14:56:20 +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 --- 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 b7d7277eb310..ea95f57fc22e 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -3903,13 +3903,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); }