patch-2.4.0-test9 linux/drivers/acpi/events/evxfevnt.c

Next file: linux/drivers/acpi/events/evxfregn.c
Previous file: linux/drivers/acpi/events/evxface.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/acpi/events/evxfevnt.c linux/drivers/acpi/events/evxfevnt.c
@@ -1,6 +1,7 @@
 /******************************************************************************
  *
  * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
+ *              $Revision: 19 $
  *
  *****************************************************************************/
 
@@ -24,16 +25,24 @@
 
 
 #include "acpi.h"
-#include "hardware.h"
-#include "namesp.h"
-#include "events.h"
+#include "achware.h"
+#include "acnamesp.h"
+#include "acevents.h"
 #include "amlcode.h"
-#include "interp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          EVENT_HANDLING
-	 MODULE_NAME         ("evxfevnt");
+	 MODULE_NAME         ("evxfevnt")
 
 
+ACPI_STATUS
+acpi_ev_find_pci_root_buses (
+	void);
+
+ACPI_STATUS
+acpi_ev_init_devices (
+	void);
+
 /**************************************************************************
  *
  * FUNCTION:    Acpi_enable
@@ -60,12 +69,27 @@
 		return (AE_NO_ACPI_TABLES);
 	}
 
+	/* Init the hardware */
+
+	/*
+	 * With the advent of a 3-pass parser, we need to be
+	 *  prepared to execute on initialized HW before the
+	 *  namespace has completed its load.
+	 */
+
+	status = acpi_cm_hardware_initialize ();
+	if (ACPI_FAILURE (status)) {
+		return (status);
+	}
+
+
 	/* Make sure the BIOS supports ACPI mode */
 
 	if (SYS_MODE_LEGACY == acpi_hw_get_mode_capabilities()) {
 		return (AE_ERROR);
 	}
 
+
 	acpi_gbl_original_mode = acpi_hw_get_mode();
 
 	/*
@@ -74,24 +98,28 @@
 	 * before handers are installed.
 	 */
 
-	if (ACPI_FAILURE (acpi_ev_fixed_event_initialize ())) {
-		return (AE_ERROR);
+	status = acpi_ev_fixed_event_initialize ();
+	if (ACPI_FAILURE (status)) {
+		return (status);
 	}
 
-	if (ACPI_FAILURE (acpi_ev_gpe_initialize())) {
-		return (AE_ERROR);
+	status = acpi_ev_gpe_initialize ();
+	if (ACPI_FAILURE (status)) {
+		return (status);
 	}
 
 	/* Install the SCI handler */
 
-	if (ACPI_FAILURE (acpi_ev_install_sci_handler ())) {
-		return (AE_ERROR);
+	status = acpi_ev_install_sci_handler ();
+	if (ACPI_FAILURE (status)) {
+		return (status);
 	}
 
 	/* Transition to ACPI mode */
 
-	if (AE_OK != acpi_hw_set_mode (SYS_MODE_ACPI)) {
-		return (AE_ERROR);
+	status = acpi_hw_set_mode (SYS_MODE_ACPI);
+	if (ACPI_FAILURE (status)) {
+		return (status);
 	}
 
 	/* Install handlers for control method GPE handlers (_Lxx, _Exx) */
@@ -100,6 +128,26 @@
 
 	status = acpi_ev_init_global_lock_handler ();
 
+	/*
+	 * Perform additional initialization that may cause control methods
+	 * to be executed
+	 *
+	 * It may be wise to move this code to a new interface
+	 */
+
+
+	/*
+	 *  Install PCI config space handler for all PCI root bridges.  A PCI root
+	 *  bridge is found by searching for devices containing a HID with the value
+	 *  EISAID("PNP0A03")
+	 */
+
+	acpi_ev_find_pci_root_buses ();
+
+	/* Call _INI on all devices */
+
+	acpi_ev_init_devices ();
+
 	return (status);
 }
 
@@ -120,12 +168,14 @@
 ACPI_STATUS
 acpi_disable (void)
 {
+	ACPI_STATUS             status;
 
 
 	/* Restore original mode  */
 
-	if (AE_OK != acpi_hw_set_mode (acpi_gbl_original_mode)) {
-		return (AE_ERROR);
+	status = acpi_hw_set_mode (acpi_gbl_original_mode);
+	if (ACPI_FAILURE (status)) {
+		return (status);
 	}
 
 	/* Unload the SCI interrupt handler  */
@@ -133,7 +183,7 @@
 	acpi_ev_remove_sci_handler ();
 	acpi_ev_restore_acpi_state ();
 
-	return (AE_OK);
+	return (status);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)