diff options
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r-- | sys/dev/acpica/acpi.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 43dca2a..33cb20c 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -51,6 +51,7 @@ #include "acpi.h" #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> +#include <contrib/dev/acpica/acnamesp.h> MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); @@ -2054,6 +2055,27 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) return (error); } +/* Inform devctl(4) when we receive a Notify. */ +void +acpi_UserNotify(const char *subsystem, ACPI_HANDLE h, uint8_t notify) +{ + char notify_buf[16]; + ACPI_BUFFER handle_buf; + ACPI_STATUS status; + + if (subsystem == NULL) + return; + + handle_buf.Pointer = NULL; + handle_buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiNsHandleToPathname(h, &handle_buf); + if (ACPI_FAILURE(status)) + return; + snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", notify); + devctl_notify("ACPI", subsystem, handle_buf.Pointer, notify_buf); + AcpiOsFree(handle_buf.Pointer); +} + #ifdef ACPI_DEBUG /* * Support for parsing debug options from the kernel environment. |