diff options
| author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2020-10-31 20:14:28 +0000 | 
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2020-10-31 20:14:28 +0000 | 
| commit | ae2b074bbbeafb9ab9bc3242341997446ed00906 (patch) | |
| tree | 21da0a9a0dc24e6eddaa0fc226524496f49aaeb4 | |
| parent | fe64ff3c0404bc2a6eae884cc86ff4755ed21483 (diff) | |
Notes
| -rw-r--r-- | sys/dev/acpica/acpi_acad.c | 2 | ||||
| -rw-r--r-- | sys/dev/acpica/acpi_video.c | 11 | ||||
| -rw-r--r-- | sys/dev/acpica/acpivar.h | 2 | 
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_acad.c b/sys/dev/acpica/acpi_acad.c index 25a8871477091..7f4d025b55f42 100644 --- a/sys/dev/acpica/acpi_acad.c +++ b/sys/dev/acpica/acpi_acad.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");  #include <machine/bus.h>  #include <sys/rman.h> +#include <sys/eventhandler.h>  #include <sys/ioccom.h>  #include <sys/malloc.h>  #include <sys/module.h> @@ -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 1d49168d7ba6c..5ef751f14a95e 100644 --- a/sys/dev/acpica/acpi_video.c +++ b/sys/dev/acpica/acpi_video.c @@ -351,6 +351,12 @@ acpi_video_shutdown(device_t dev)  }  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)  {  	struct acpi_video_softc *sc; @@ -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 8e23b9049b80b..807a851afa7ba 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);  | 
