Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2011 19:26:39 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217279 - head/sys/dev/acpica
Message-ID:  <201101111926.p0BJQdcX032359@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Jan 11 19:26:39 2011
New Revision: 217279
URL: http://svn.freebsd.org/changeset/base/217279

Log:
  Work around a witness(4) panic introduced in r217238.
  
  Reported by:	jh

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Tue Jan 11 19:20:01 2011	(r217278)
+++ head/sys/dev/acpica/acpi.c	Tue Jan 11 19:26:39 2011	(r217279)
@@ -3044,6 +3044,20 @@ acpi_system_eventhandler_wakeup(void *ar
 /* 
  * ACPICA Event Handlers (FixedEvent, also called from button notify handler)
  */
+static void
+acpi_invoke_sleep_eventhandler(void *context)
+{
+
+    EVENTHANDLER_INVOKE(acpi_sleep_event, *(int *)context);
+}
+
+static void
+acpi_invoke_wake_eventhandler(void *context)
+{
+
+    EVENTHANDLER_INVOKE(acpi_wakeup_event, *(int *)context);
+}
+
 UINT32
 acpi_event_power_button_sleep(void *context)
 {
@@ -3051,8 +3065,9 @@ acpi_event_power_button_sleep(void *cont
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
-    EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_power_button_sx);
-
+    if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER,
+	acpi_invoke_sleep_eventhandler, &sc->acpi_power_button_sx)))
+	return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
     return_VALUE (ACPI_INTERRUPT_HANDLED);
 }
 
@@ -3063,8 +3078,9 @@ acpi_event_power_button_wake(void *conte
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
-    EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_power_button_sx);
-
+    if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER,
+	acpi_invoke_wake_eventhandler, &sc->acpi_power_button_sx)))
+	return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
     return_VALUE (ACPI_INTERRUPT_HANDLED);
 }
 
@@ -3075,8 +3091,9 @@ acpi_event_sleep_button_sleep(void *cont
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
-    EVENTHANDLER_INVOKE(acpi_sleep_event, sc->acpi_sleep_button_sx);
-
+    if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER,
+	acpi_invoke_sleep_eventhandler, &sc->acpi_sleep_button_sx)))
+	return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
     return_VALUE (ACPI_INTERRUPT_HANDLED);
 }
 
@@ -3087,8 +3104,9 @@ acpi_event_sleep_button_wake(void *conte
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
-    EVENTHANDLER_INVOKE(acpi_wakeup_event, sc->acpi_sleep_button_sx);
-
+    if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER,
+	acpi_invoke_wake_eventhandler, &sc->acpi_sleep_button_sx)))
+	return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
     return_VALUE (ACPI_INTERRUPT_HANDLED);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101111926.p0BJQdcX032359>