diff options
Diffstat (limited to 'sys/contrib/dev/acpica/evxface.c')
-rw-r--r-- | sys/contrib/dev/acpica/evxface.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/evxface.c b/sys/contrib/dev/acpica/evxface.c index 03886efc0ae83..4a508e295d889 100644 --- a/sys/contrib/dev/acpica/evxface.c +++ b/sys/contrib/dev/acpica/evxface.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxface - External interfaces for ACPI events - * $Revision: 91 $ + * $Revision: 96 $ * *****************************************************************************/ @@ -179,11 +179,11 @@ AcpiInstallFixedEventHandler ( AcpiGbl_FixedEventHandlers[Event].Handler = Handler; AcpiGbl_FixedEventHandlers[Event].Context = Context; - if (1 != AcpiHwRegisterAccess (ACPI_WRITE, - ACPI_MTX_LOCK, Event + TMR_EN, 1)) + Status = AcpiEnableEvent(Event, ACPI_EVENT_FIXED); + + if (!ACPI_SUCCESS(Status)) { - DEBUG_PRINT (ACPI_WARN, - ("Could not write to fixed event enable register.\n")); + DEBUG_PRINT (ACPI_WARN, ("Could not enable fixed event.\n")); /* Remove the handler */ @@ -239,13 +239,16 @@ AcpiRemoveFixedEventHandler ( /* Disable the event before removing the handler - just in case... */ - if (0 != AcpiHwRegisterAccess (ACPI_WRITE, - ACPI_MTX_LOCK, Event + TMR_EN, 0)) + Status = AcpiDisableEvent(Event, ACPI_EVENT_FIXED); + + if (!ACPI_SUCCESS(Status)) { DEBUG_PRINT (ACPI_WARN, ("Could not write to fixed event enable register.\n")); + Status = AE_ERROR; - goto Cleanup; + AcpiCmReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); } /* Remove the handler */ @@ -255,7 +258,6 @@ AcpiRemoveFixedEventHandler ( DEBUG_PRINT (ACPI_INFO, ("Disabled fixed event %d.\n", Event)); -Cleanup: AcpiCmReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status); } |