patch-2.4.0-prerelease linux/drivers/acpi/events/evmisc.c

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

diff -u --recursive --new-file v2.4.0-test12/linux/drivers/acpi/events/evmisc.c linux/drivers/acpi/events/evmisc.c
@@ -2,7 +2,7 @@
  *
  * Module Name: evmisc - ACPI device notification handler dispatch
  *                       and ACPI Global Lock support
- *              $Revision: 13 $
+ *              $Revision: 20 $
  *
  *****************************************************************************/
 
@@ -157,7 +157,7 @@
  *
  **************************************************************************/
 
-void
+static void
 acpi_ev_global_lock_thread (
 	void                    *context)
 {
@@ -185,7 +185,7 @@
  *
  **************************************************************************/
 
-u32
+static u32
 acpi_ev_global_lock_handler (
 	void                    *context)
 {
@@ -199,7 +199,7 @@
 	 * take another interrupt when it becomes free.
 	 */
 
-	global_lock = &acpi_gbl_FACS->global_lock;
+	global_lock = acpi_gbl_FACS->global_lock;
 	ACPI_ACQUIRE_GLOBAL_LOCK (global_lock, acquired);
 	if (acquired) {
 		/* Got the lock, now wake all threads waiting for it */
@@ -275,9 +275,9 @@
 	}
 
 
-	/* We must acquire the actualy hardware lock */
+	/* We must acquire the actual hardware lock */
 
-	global_lock = &acpi_gbl_FACS->global_lock;
+	global_lock = acpi_gbl_FACS->global_lock;
 	ACPI_ACQUIRE_GLOBAL_LOCK (global_lock, acquired);
 	if (acquired) {
 	   /* We got the lock */
@@ -298,11 +298,8 @@
 	  * Since this wait will block, we must release the interpreter
 	  */
 
-	acpi_aml_exit_interpreter ();
 	status = acpi_aml_system_wait_semaphore (acpi_gbl_global_lock_semaphore,
 			  ACPI_UINT32_MAX);
-	acpi_aml_enter_interpreter ();
-
 
 	return (status);
 }
@@ -323,7 +320,8 @@
 	void                    *global_lock;
 
 
-	if (!acpi_gbl_FACS) {
+	if (!acpi_gbl_global_lock_thread_count) {
+		REPORT_WARNING(("Releasing a non-acquired Global Lock\n"));
 		return;
 	}
 
@@ -331,7 +329,6 @@
 
 	acpi_gbl_global_lock_thread_count--;
 
-
 	/* Have all threads released the lock? */
 
 	if (!acpi_gbl_global_lock_thread_count) {
@@ -340,7 +337,7 @@
 		 * release
 		 */
 
-		global_lock = &acpi_gbl_FACS->global_lock;
+		global_lock = acpi_gbl_FACS->global_lock;
 		ACPI_RELEASE_GLOBAL_LOCK (global_lock, pending);
 		acpi_gbl_global_lock_acquired = FALSE;
 
@@ -349,8 +346,8 @@
 		 * register
 		 */
 		if (pending) {
-			acpi_hw_register_access (ACPI_WRITE, ACPI_MTX_LOCK,
-					 PM1_CONTROL | GBL_RLS, 1);
+			acpi_hw_register_bit_access (ACPI_WRITE, ACPI_MTX_LOCK,
+					 GBL_RLS, 1);
 		}
 	}
 

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