ACPICA: Restructure includes into public/private
[safe/jmp/linux-2.6] / drivers / acpi / events / evevent.c
index c9ac05c..86bf083 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include <acpi/accommon.h>
 #include <acpi/acevents.h>
 
 #define _COMPONENT          ACPI_EVENTS
@@ -68,19 +69,12 @@ acpi_status acpi_ev_initialize_events(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ev_initialize_events");
-
-       /* Make sure we have ACPI tables */
-
-       if (!acpi_gbl_DSDT) {
-               ACPI_WARNING((AE_INFO, "No ACPI tables present!"));
-               return_ACPI_STATUS(AE_NO_ACPI_TABLES);
-       }
+       ACPI_FUNCTION_TRACE(ev_initialize_events);
 
        /*
         * Initialize the Fixed and General Purpose Events. This is done prior to
-        * enabling SCIs to prevent interrupts from occurring before the handlers are
-        * installed.
+        * enabling SCIs to prevent interrupts from occurring before the handlers
+        * are installed.
         */
        status = acpi_ev_fixed_event_initialize();
        if (ACPI_FAILURE(status)) {
@@ -118,7 +112,7 @@ acpi_status acpi_ev_install_fadt_gpes(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ev_install_fadt_gpes");
+       ACPI_FUNCTION_TRACE(ev_install_fadt_gpes);
 
        /* Namespace must be locked */
 
@@ -157,7 +151,7 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("ev_install_xrupt_handlers");
+       ACPI_FUNCTION_TRACE(ev_install_xrupt_handlers);
 
        /* Install the SCI handler */
 
@@ -195,12 +189,12 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
 
 static acpi_status acpi_ev_fixed_event_initialize(void)
 {
-       acpi_native_uint i;
+       u32 i;
        acpi_status status;
 
        /*
-        * Initialize the structure that keeps track of fixed event handlers
-        * and enable the fixed events.
+        * Initialize the structure that keeps track of fixed event handlers and
+        * enable the fixed events.
         */
        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
                acpi_gbl_fixed_event_handlers[i].handler = NULL;
@@ -211,8 +205,7 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
                if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) {
                        status =
                            acpi_set_register(acpi_gbl_fixed_event_info[i].
-                                             enable_register_id, 0,
-                                             ACPI_MTX_LOCK);
+                                             enable_register_id, 0);
                        if (ACPI_FAILURE(status)) {
                                return (status);
                        }
@@ -239,18 +232,16 @@ u32 acpi_ev_fixed_event_detect(void)
        u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
        u32 fixed_status;
        u32 fixed_enable;
-       acpi_native_uint i;
+       u32 i;
 
-       ACPI_FUNCTION_NAME("ev_fixed_event_detect");
+       ACPI_FUNCTION_NAME(ev_fixed_event_detect);
 
        /*
         * Read the fixed feature status and enable registers, as all the cases
-        * depend on their values.  Ignore errors here.
+        * depend on their values. Ignore errors here.
         */
-       (void)acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
-                                   ACPI_REGISTER_PM1_STATUS, &fixed_status);
-       (void)acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
-                                   ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
+       (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
+       (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
 
        ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
                          "Fixed Event Block: Enable %08X Status %08X\n",
@@ -260,15 +251,17 @@ u32 acpi_ev_fixed_event_detect(void)
         * Check for all possible Fixed Events and dispatch those that are active
         */
        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
+
                /* Both the status and enable bits must be on for this event */
 
                if ((fixed_status & acpi_gbl_fixed_event_info[i].
                     status_bit_mask)
                    && (fixed_enable & acpi_gbl_fixed_event_info[i].
                        enable_bit_mask)) {
-                       /* Found an active (signalled) event */
 
-                       int_status |= acpi_ev_fixed_event_dispatch((u32) i);
+                       /* Found an active (signalled) event */
+                       acpi_os_fixed_event_count(i);
+                       int_status |= acpi_ev_fixed_event_dispatch(i);
                }
        }
 
@@ -296,16 +289,15 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
        /* Clear the status bit */
 
        (void)acpi_set_register(acpi_gbl_fixed_event_info[event].
-                               status_register_id, 1, ACPI_MTX_DO_NOT_LOCK);
+                               status_register_id, 1);
 
        /*
-        * Make sure we've got a handler.  If not, report an error.
-        * The event is disabled to prevent further interrupts.
+        * Make sure we've got a handler. If not, report an error. The event is
+        * disabled to prevent further interrupts.
         */
        if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
                (void)acpi_set_register(acpi_gbl_fixed_event_info[event].
-                                       enable_register_id, 0,
-                                       ACPI_MTX_DO_NOT_LOCK);
+                                       enable_register_id, 0);
 
                ACPI_ERROR((AE_INFO,
                            "No installed handler for fixed event [%08X]",