From owner-svn-src-all@FreeBSD.ORG Tue Jan 11 19:26:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A671065673; Tue, 11 Jan 2011 19:26:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB058FC13; Tue, 11 Jan 2011 19:26:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0BJQdco032361; Tue, 11 Jan 2011 19:26:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0BJQdcX032359; Tue, 11 Jan 2011 19:26:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101111926.p0BJQdcX032359@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 11 Jan 2011 19:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217279 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 19:26:39 -0000 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); }