patch-2.4.22 linux-2.4.22/drivers/acpi/dispatcher/dswscope.c

Next file: linux-2.4.22/drivers/acpi/dispatcher/dswstate.c
Previous file: linux-2.4.22/drivers/acpi/dispatcher/dswload.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/acpi/dispatcher/dswscope.c linux-2.4.22/drivers/acpi/dispatcher/dswscope.c
@@ -1,36 +1,53 @@
 /******************************************************************************
  *
  * Module Name: dswscope - Scope stack manipulation
- *              $Revision: 49 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ * Copyright (C) 2000 - 2003, R. Byron Moore
+ * All rights reserved.
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
  */
 
 
-#include "acpi.h"
-#include "acinterp.h"
-#include "acdispat.h"
+#include <acpi/acpi.h>
+#include <acpi/acdispat.h>
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dswscope")
+	 ACPI_MODULE_NAME    ("dswscope")
 
 
 #define STACK_POP(head) head
@@ -38,7 +55,7 @@
 
 /****************************************************************************
  *
- * FUNCTION:    Acpi_ds_scope_stack_clear
+ * FUNCTION:    acpi_ds_scope_stack_clear
  *
  * PARAMETERS:  None
  *
@@ -49,11 +66,11 @@
 
 void
 acpi_ds_scope_stack_clear (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_generic_state      *scope_info;
+	union acpi_generic_state        *scope_info;
 
-	PROC_NAME ("Ds_scope_stack_clear");
+	ACPI_FUNCTION_NAME ("ds_scope_stack_clear");
 
 
 	while (walk_state->scope_info) {
@@ -63,7 +80,7 @@
 		walk_state->scope_info = scope_info->scope.next;
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-			"Popped object type %X\n", scope_info->common.value));
+			"Popped object type (%s)\n", acpi_ut_get_type_name (scope_info->common.value)));
 		acpi_ut_delete_generic_state (scope_info);
 	}
 }
@@ -71,7 +88,7 @@
 
 /****************************************************************************
  *
- * FUNCTION:    Acpi_ds_scope_stack_push
+ * FUNCTION:    acpi_ds_scope_stack_push
  *
  * PARAMETERS:  *Node,              - Name to be made current
  *              Type,               - Type of frame being pushed
@@ -83,27 +100,28 @@
 
 acpi_status
 acpi_ds_scope_stack_push (
-	acpi_namespace_node     *node,
-	acpi_object_type8       type,
-	acpi_walk_state         *walk_state)
+	struct acpi_namespace_node      *node,
+	acpi_object_type                type,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_generic_state      *scope_info;
+	union acpi_generic_state        *scope_info;
+	union acpi_generic_state        *old_scope_info;
 
 
-	FUNCTION_TRACE ("Ds_scope_stack_push");
+	ACPI_FUNCTION_TRACE ("ds_scope_stack_push");
 
 
 	if (!node) {
 		/* Invalid scope   */
 
-		REPORT_ERROR (("Ds_scope_stack_push: null scope passed\n"));
+		ACPI_REPORT_ERROR (("ds_scope_stack_push: null scope passed\n"));
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 	/* Make sure object type is valid */
 
-	if (!acpi_ex_validate_object_type (type)) {
-		REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n"));
+	if (!acpi_ut_valid_object_type (type)) {
+		ACPI_REPORT_WARNING (("ds_scope_stack_push: type code out of range\n"));
 	}
 
 
@@ -120,6 +138,28 @@
 	scope_info->scope.node      = node;
 	scope_info->common.value    = (u16) type;
 
+	walk_state->scope_depth++;
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+		"[%.2d] Pushed scope ", (u32) walk_state->scope_depth));
+
+	old_scope_info = walk_state->scope_info;
+	if (old_scope_info) {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
+			"[%4.4s] (%10s)",
+			old_scope_info->scope.node->name.ascii,
+			acpi_ut_get_type_name (old_scope_info->common.value)));
+	}
+	else {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
+			"[\\___] (%10s)", "ROOT"));
+	}
+
+	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
+		", New scope -> [%4.4s] (%s)\n",
+		scope_info->scope.node->name.ascii,
+		acpi_ut_get_type_name (scope_info->common.value)));
+
 	/* Push new scope object onto stack */
 
 	acpi_ut_push_generic_state (&walk_state->scope_info, scope_info);
@@ -130,7 +170,7 @@
 
 /****************************************************************************
  *
- * FUNCTION:    Acpi_ds_scope_stack_pop
+ * FUNCTION:    acpi_ds_scope_stack_pop
  *
  * PARAMETERS:  Type                - The type of frame to be found
  *
@@ -147,12 +187,13 @@
 
 acpi_status
 acpi_ds_scope_stack_pop (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_generic_state      *scope_info;
+	union acpi_generic_state        *scope_info;
+	union acpi_generic_state        *new_scope_info;
 
 
-	FUNCTION_TRACE ("Ds_scope_stack_pop");
+	ACPI_FUNCTION_TRACE ("ds_scope_stack_pop");
 
 
 	/*
@@ -163,8 +204,25 @@
 		return_ACPI_STATUS (AE_STACK_UNDERFLOW);
 	}
 
+	walk_state->scope_depth--;
+
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-		"Popped object type %X\n", scope_info->common.value));
+		"[%.2d] Popped scope [%4.4s] (%10s), New scope -> ",
+		(u32) walk_state->scope_depth,
+		scope_info->scope.node->name.ascii,
+		acpi_ut_get_type_name (scope_info->common.value)));
+
+	new_scope_info = walk_state->scope_info;
+	if (new_scope_info) {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
+			"[%4.4s] (%s)\n",
+			new_scope_info->scope.node->name.ascii,
+			acpi_ut_get_type_name (new_scope_info->common.value)));
+	}
+	else {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
+			"[\\___] (ROOT)\n"));
+	}
 
 	acpi_ut_delete_generic_state (scope_info);
 

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