patch-2.4.10 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.9/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: 31 $
+ *              $Revision: 33 $
  *
  *****************************************************************************/
 
@@ -47,15 +47,15 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ev_queue_notify_request (
-	ACPI_NAMESPACE_NODE     *node,
+	acpi_namespace_node     *node,
 	u32                     notify_value)
 {
-	ACPI_OPERAND_OBJECT     *obj_desc;
-	ACPI_OPERAND_OBJECT     *handler_obj = NULL;
-	ACPI_GENERIC_STATE      *notify_info;
-	ACPI_STATUS             status = AE_OK;
+	acpi_operand_object     *obj_desc;
+	acpi_operand_object     *handler_obj = NULL;
+	acpi_generic_state      *notify_info;
+	acpi_status             status = AE_OK;
 
 
 	PROC_NAME ("Ev_queue_notify_request");
@@ -67,21 +67,28 @@
 	 * For value 0x80 (Status Change) on the power button or sleep button,
 	 * initiate soft-off or sleep operation?
 	 */
+	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+		"Dispatching Notify(%X) on node %p\n", notify_value, node));
 
 	switch (notify_value) {
 	case 0:
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Re-enumerate Devices\n"));
 		break;
 
 	case 1:
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Ejection Request\n"));
 		break;
 
 	case 2:
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Device Wake\n"));
 		break;
 
 	case 0x80:
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: Status Change\n"));
 		break;
 
 	default:
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %lx \n", notify_value));
 		break;
 	}
 
@@ -89,7 +96,6 @@
 	/*
 	 * Get the notify object attached to the device Node
 	 */
-
 	obj_desc = acpi_ns_get_attached_object (node);
 	if (obj_desc) {
 
@@ -142,6 +148,7 @@
 	if (!handler_obj) {
 		/* There is no per-device notify handler for this device */
 
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No notify handler for node %p \n", node));
 	}
 
 	return (status);
@@ -165,17 +172,19 @@
 acpi_ev_notify_dispatch (
 	void                    *context)
 {
-	ACPI_GENERIC_STATE      *notify_info = (ACPI_GENERIC_STATE *) context;
+	acpi_generic_state      *notify_info = (acpi_generic_state *) context;
 	ACPI_NOTIFY_HANDLER     global_handler = NULL;
 	void                    *global_context = NULL;
-	ACPI_OPERAND_OBJECT     *handler_obj;
+	acpi_operand_object     *handler_obj;
+
+
+	FUNCTION_ENTRY ();
 
 
 	/*
 	 * We will invoke a global notify handler if installed.
 	 * This is done _before_ we invoke the per-device handler attached to the device.
 	 */
-
 	if (notify_info->notify.value <= MAX_SYS_NOTIFY) {
 		/* Global system notification handler */
 
@@ -209,7 +218,6 @@
 				  handler_obj->notify_handler.context);
 	}
 
-
 	/* All done with the info object */
 
 	acpi_ut_delete_generic_state (notify_info);
@@ -269,7 +277,6 @@
 	 * If we don't get it now, it will be marked pending and we will
 	 * take another interrupt when it becomes free.
 	 */
-
 	global_lock = acpi_gbl_FACS->global_lock;
 	ACPI_ACQUIRE_GLOBAL_LOCK (global_lock, acquired);
 	if (acquired) {
@@ -297,10 +304,13 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ev_init_global_lock_handler (void)
 {
-	ACPI_STATUS             status;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Ev_init_global_lock_handler");
 
 
 	acpi_gbl_global_lock_present = TRUE;
@@ -319,7 +329,7 @@
 		status = AE_OK;
 	}
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -333,18 +343,20 @@
  *
  *****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ev_acquire_global_lock(void)
 {
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
 	u8                      acquired = FALSE;
 	void                    *global_lock;
 
 
+	FUNCTION_TRACE ("Ev_acquire_global_lock");
+
 	/* Make sure that we actually have a global lock */
 
 	if (!acpi_gbl_global_lock_present) {
-		return (AE_NO_GLOBAL_LOCK);
+		return_ACPI_STATUS (AE_NO_GLOBAL_LOCK);
 	}
 
 	/* One more thread wants the global lock */
@@ -355,13 +367,13 @@
 	/* If we (OS side) have the hardware lock already, we are done */
 
 	if (acpi_gbl_global_lock_acquired) {
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 	/* Only if the FACS is valid */
 
 	if (!acpi_gbl_FACS) {
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 
@@ -372,8 +384,10 @@
 	if (acquired) {
 	   /* We got the lock */
 
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Acquired the Global Lock\n"));
+
 		acpi_gbl_global_lock_acquired = TRUE;
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 
@@ -381,15 +395,15 @@
 	 * Did not get the lock.  The pending bit was set above, and we must now
 	 * wait until we get the global lock released interrupt.
 	 */
+	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Waiting for the HW Global Lock\n"));
 
 	 /*
 	  * Acquire the global lock semaphore first.
 	  * Since this wait will block, we must release the interpreter
 	  */
-
 	status = acpi_ex_system_wait_semaphore (acpi_gbl_global_lock_semaphore,
 			  ACPI_UINT32_MAX);
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -408,9 +422,12 @@
 	void                    *global_lock;
 
 
+	FUNCTION_TRACE ("Ev_release_global_lock");
+
+
 	if (!acpi_gbl_global_lock_thread_count) {
 		REPORT_WARNING(("Global Lock has not be acquired, cannot release\n"));
-		return;
+		return_VOID;
 	}
 
    /* One fewer thread has the global lock */
@@ -424,7 +441,6 @@
 		 * No more threads holding lock, we can do the actual hardware
 		 * release
 		 */
-
 		global_lock = acpi_gbl_FACS->global_lock;
 		ACPI_RELEASE_GLOBAL_LOCK (global_lock, pending);
 		acpi_gbl_global_lock_acquired = FALSE;
@@ -439,5 +455,5 @@
 		}
 	}
 
-	return;
+	return_VOID;
 }

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