ACPICA 20050408 from Bob Moore

Fixed three cases in the interpreter where an "index"
argument to an ASL function was still (internally) 32
bits instead of the required 64 bits.  This was the Index
argument to the Index, Mid, and Match operators.

The "strupr" function is now permanently local
(acpi_ut_strupr), since this is not a POSIX-defined
function and not present in most kernel-level C
libraries. References to the C library strupr function
have been removed from the headers.

Completed the deployment of static
functions/prototypes. All prototypes with the static
attribute have been moved from the headers to the owning
C file.

ACPICA 20050329 from Bob Moore

An error is now generated if an attempt is made to create
a Buffer Field of length zero (A CreateField with a length
operand of zero.)

The interpreter now issues a warning whenever executable
code at the module level is detected during ACPI table
load. This will give some idea of the prevalence of this
type of code.

Implemented support for references to named objects (other
than control methods) within package objects.

Enhanced package object output for the debug
object. Package objects are now completely dumped, showing
all elements.

Enhanced miscellaneous object output for the debug
object. Any object can now be written to the debug object
(for example, a device object can be written, and the type
of the object will be displayed.)

The "static" qualifier has been added to all local
functions across the core subsystem.

The number of "long" lines (> 80 chars) within the source
has been significantly reduced, by about 1/3.

Cleaned up all header files to ensure that all CA/iASL
functions are prototyped (even static functions) and the
formatting is consistent.

Two new header files have been added, acopcode.h and
acnames.h.

Removed several obsolete functions that were no longer
used.

Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c
index 2140bd1..d5aafe7 100644
--- a/drivers/acpi/parser/pstree.c
+++ b/drivers/acpi/parser/pstree.c
@@ -49,6 +49,14 @@
 #define _COMPONENT          ACPI_PARSER
 	 ACPI_MODULE_NAME    ("pstree")
 
+/* Local prototypes */
+
+#ifdef ACPI_OBSOLETE_FUNCTIONS
+union acpi_parse_object *
+acpi_ps_get_child (
+	union acpi_parse_object         *op);
+#endif
+
 
 /*******************************************************************************
  *
@@ -57,7 +65,7 @@
  * PARAMETERS:  Op              - Get an argument for this op
  *              Argn            - Nth argument to get
  *
- * RETURN:      The argument (as an Op object).  NULL if argument does not exist
+ * RETURN:      The argument (as an Op object). NULL if argument does not exist
  *
  * DESCRIPTION: Get the specified op's argument.
  *
@@ -152,7 +160,6 @@
 		return;
 	}
 
-
 	/* Append the argument to the linked argument list */
 
 	if (op->common.value.arg) {
@@ -164,14 +171,12 @@
 		}
 		prev_arg->common.next = arg;
 	}
-
 	else {
 		/* No argument list, this will be the first argument */
 
 		op->common.value.arg = arg;
 	}
 
-
 	/* Set the parent in this arg and any args linked after it */
 
 	while (arg) {
@@ -182,7 +187,82 @@
 
 
 #ifdef ACPI_FUTURE_USAGE
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ps_get_depth_next
+ *
+ * PARAMETERS:  Origin          - Root of subtree to search
+ *              Op              - Last (previous) Op that was found
+ *
+ * RETURN:      Next Op found in the search.
+ *
+ * DESCRIPTION: Get next op in tree (walking the tree in depth-first order)
+ *              Return NULL when reaching "origin" or when walking up from root
+ *
+ ******************************************************************************/
 
+union acpi_parse_object *
+acpi_ps_get_depth_next (
+	union acpi_parse_object         *origin,
+	union acpi_parse_object         *op)
+{
+	union acpi_parse_object         *next = NULL;
+	union acpi_parse_object         *parent;
+	union acpi_parse_object         *arg;
+
+
+	ACPI_FUNCTION_ENTRY ();
+
+
+	if (!op) {
+		return (NULL);
+	}
+
+	/* Look for an argument or child */
+
+	next = acpi_ps_get_arg (op, 0);
+	if (next) {
+		return (next);
+	}
+
+	/* Look for a sibling */
+
+	next = op->common.next;
+	if (next) {
+		return (next);
+	}
+
+	/* Look for a sibling of parent */
+
+	parent = op->common.parent;
+
+	while (parent) {
+		arg = acpi_ps_get_arg (parent, 0);
+		while (arg && (arg != origin) && (arg != op)) {
+			arg = arg->common.next;
+		}
+
+		if (arg == origin) {
+			/* Reached parent of origin, end search */
+
+			return (NULL);
+		}
+
+		if (parent->common.next) {
+			/* Found sibling of parent */
+
+			return (parent->common.next);
+		}
+
+		op = parent;
+		parent = parent->common.parent;
+	}
+
+	return (next);
+}
+
+
+#ifdef ACPI_OBSOLETE_FUNCTIONS
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ps_get_child
@@ -194,6 +274,7 @@
  * DESCRIPTION: Get op's children or NULL if none
  *
  ******************************************************************************/
+
 union acpi_parse_object *
 acpi_ps_get_child (
 	union acpi_parse_object         *op)
@@ -247,81 +328,7 @@
 
 	return (child);
 }
-
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ps_get_depth_next
- *
- * PARAMETERS:  Origin          - Root of subtree to search
- *              Op              - Last (previous) Op that was found
- *
- * RETURN:      Next Op found in the search.
- *
- * DESCRIPTION: Get next op in tree (walking the tree in depth-first order)
- *              Return NULL when reaching "origin" or when walking up from root
- *
- ******************************************************************************/
-
-union acpi_parse_object *
-acpi_ps_get_depth_next (
-	union acpi_parse_object         *origin,
-	union acpi_parse_object         *op)
-{
-	union acpi_parse_object         *next = NULL;
-	union acpi_parse_object         *parent;
-	union acpi_parse_object         *arg;
-
-
-	ACPI_FUNCTION_ENTRY ();
-
-
-	if (!op) {
-		return (NULL);
-	}
-
-	/* look for an argument or child */
-
-	next = acpi_ps_get_arg (op, 0);
-	if (next) {
-		return (next);
-	}
-
-	/* look for a sibling */
-
-	next = op->common.next;
-	if (next) {
-		return (next);
-	}
-
-	/* look for a sibling of parent */
-
-	parent = op->common.parent;
-
-	while (parent) {
-		arg = acpi_ps_get_arg (parent, 0);
-		while (arg && (arg != origin) && (arg != op)) {
-			arg = arg->common.next;
-		}
-
-		if (arg == origin) {
-			/* reached parent of origin, end search */
-
-			return (NULL);
-		}
-
-		if (parent->common.next) {
-			/* found sibling of parent */
-
-			return (parent->common.next);
-		}
-
-		op = parent;
-		parent = parent->common.parent;
-	}
-
-	return (next);
-}
+#endif
 
 #endif  /*  ACPI_FUTURE_USAGE  */