diff --git a/sys/dev/acpica/acpi_acad.c b/sys/dev/acpica/acpi_acad.c index 25a88714770..7f4d025b55f 100644 --- a/sys/dev/acpica/acpi_acad.c +++ b/sys/dev/acpica/acpi_acad.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -115,6 +116,7 @@ acpi_acad_get_status(void *context) ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "%s Line\n", newstatus ? "On" : "Off"); acpi_UserNotify("ACAD", h, newstatus); + EVENTHANDLER_INVOKE(acpi_acad_event, newstatus); } else ACPI_SERIAL_END(acad); } diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c index 1d49168d7ba..5ef751f14a9 100644 --- a/sys/dev/acpica/acpi_video.c +++ b/sys/dev/acpica/acpi_video.c @@ -350,6 +350,12 @@ acpi_video_shutdown(device_t dev) return (0); } +static void +acpi_video_invoke_event_handler(void *context) +{ + EVENTHANDLER_INVOKE(acpi_video_event, (int)(intptr_t)context); +} + static void acpi_video_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context) { @@ -402,6 +408,8 @@ acpi_video_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context) device_printf(sc->device, "unknown notify event 0x%x\n", notify); } + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_video_invoke_event_handler, + (void *)(uintptr_t)notify); } static void @@ -752,6 +760,9 @@ acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context) out: ACPI_SERIAL_END(video_output); + + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_video_invoke_event_handler, + (void *)(uintptr_t)notify); } /* ARGSUSED */ diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 8e23b9049b8..807a851afa7 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -433,6 +433,8 @@ typedef void (*acpi_event_handler_t)(void *, int); EVENTHANDLER_DECLARE(acpi_sleep_event, acpi_event_handler_t); EVENTHANDLER_DECLARE(acpi_wakeup_event, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_acad_event, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable);