patch-2.4.10 linux/drivers/acpi/parser/psargs.c

Next file: linux/drivers/acpi/parser/psfind.c
Previous file: linux/drivers/acpi/ospm/thermal/tzpolicy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/parser/psargs.c linux/drivers/acpi/parser/psargs.c
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: psargs - Parse AML opcode arguments
- *              $Revision: 47 $
+ *              $Revision: 51 $
  *
  *****************************************************************************/
 
@@ -48,12 +48,15 @@
 
 u32
 acpi_ps_get_next_package_length (
-	ACPI_PARSE_STATE        *parser_state)
+	acpi_parse_state        *parser_state)
 {
 	u32                     encoded_length;
 	u32                     length = 0;
 
 
+	FUNCTION_TRACE ("Ps_get_next_package_length");
+
+
 	encoded_length = (u32) GET8 (parser_state->aml);
 	parser_state->aml++;
 
@@ -92,7 +95,7 @@
 		break;
 	}
 
-	return (length);
+	return_VALUE (length);
 }
 
 
@@ -111,15 +114,18 @@
 
 u8 *
 acpi_ps_get_next_package_end (
-	ACPI_PARSE_STATE        *parser_state)
+	acpi_parse_state        *parser_state)
 {
 	u8                      *start = parser_state->aml;
 	NATIVE_UINT             length;
 
 
+	FUNCTION_TRACE ("Ps_get_next_package_end");
+
+
 	length = (NATIVE_UINT) acpi_ps_get_next_package_length (parser_state);
 
-	return (start + length); /* end of package */
+	return_PTR (start + length); /* end of package */
 }
 
 
@@ -140,13 +146,16 @@
 
 NATIVE_CHAR *
 acpi_ps_get_next_namestring (
-	ACPI_PARSE_STATE        *parser_state)
+	acpi_parse_state        *parser_state)
 {
 	u8                       *start = parser_state->aml;
 	u8                       *end = parser_state->aml;
 	u32                     length;
 
 
+	FUNCTION_TRACE ("Ps_get_next_namestring");
+
+
 	/* Handle multiple prefix characters */
 
 	while (acpi_ps_is_prefix_char (GET8 (end))) {
@@ -197,7 +206,7 @@
 
 	parser_state->aml = (u8*) end;
 
-	return ((NATIVE_CHAR *) start);
+	return_PTR ((NATIVE_CHAR *) start);
 }
 
 
@@ -227,15 +236,18 @@
 
 void
 acpi_ps_get_next_namepath (
-	ACPI_PARSE_STATE        *parser_state,
-	ACPI_PARSE_OBJECT       *arg,
+	acpi_parse_state        *parser_state,
+	acpi_parse_object       *arg,
 	u32                     *arg_count,
 	u8                      method_call)
 {
 	NATIVE_CHAR             *path;
-	ACPI_PARSE_OBJECT       *name_op;
-	ACPI_PARSE_OBJECT       *op;
-	ACPI_PARSE_OBJECT       *count;
+	acpi_parse_object       *name_op;
+	acpi_parse_object       *op;
+	acpi_parse_object       *count;
+
+
+	FUNCTION_TRACE ("Ps_get_next_namepath");
 
 
 	path = acpi_ps_get_next_namestring (parser_state);
@@ -244,7 +256,7 @@
 
 		acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
 		arg->value.name = path;
-		return;
+		return_VOID;
 	}
 
 
@@ -252,7 +264,6 @@
 		/*
 		 * Lookup the name in the parsed namespace
 		 */
-
 		op = NULL;
 		if (method_call) {
 			op = acpi_ps_find (acpi_ps_get_parent_scope (parser_state),
@@ -267,7 +278,6 @@
 				 * associated with this method, and 2) Change the NAMEPATH
 				 * object into a METHODCALL object.
 				 */
-
 				count = acpi_ps_get_arg (op, 0);
 				if (count && count->opcode == AML_BYTE_OP) {
 					name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
@@ -280,15 +290,15 @@
 
 						/* Point METHODCALL/NAME to the METHOD Node */
 
-						name_op->node = (ACPI_NAMESPACE_NODE *) op;
+						name_op->node = (acpi_namespace_node *) op;
 						acpi_ps_append_arg (arg, name_op);
 
-						*arg_count = count->value.integer &
+						*arg_count = (u32) count->value.integer &
 								 METHOD_FLAGS_ARG_COUNT;
 					}
 				}
 
-				return;
+				return_VOID;
 			}
 
 			/*
@@ -299,18 +309,16 @@
 		}
 	}
 
-
 	/*
 	 * Either we didn't find the object in the namespace, or the object is
 	 * something other than a control method.  Just initialize the Op with the
 	 * pathname
 	 */
-
 	acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
 	arg->value.name = path;
 
 
-	return;
+	return_VOID;
 }
 
 
@@ -319,17 +327,20 @@
 
 void
 acpi_ps_get_next_namepath (
-	ACPI_PARSE_STATE        *parser_state,
-	ACPI_PARSE_OBJECT       *arg,
+	acpi_parse_state        *parser_state,
+	acpi_parse_object       *arg,
 	u32                     *arg_count,
 	u8                      method_call)
 {
 	NATIVE_CHAR             *path;
-	ACPI_PARSE_OBJECT       *name_op;
-	ACPI_STATUS             status;
-	ACPI_NAMESPACE_NODE     *method_node = NULL;
-	ACPI_NAMESPACE_NODE     *node;
-	ACPI_GENERIC_STATE      scope_info;
+	acpi_parse_object       *name_op;
+	acpi_status             status;
+	acpi_namespace_node     *method_node = NULL;
+	acpi_namespace_node     *node;
+	acpi_generic_state      scope_info;
+
+
+	FUNCTION_TRACE ("Ps_get_next_namepath");
 
 
 	path = acpi_ps_get_next_namestring (parser_state);
@@ -338,7 +349,7 @@
 
 		acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
 		arg->value.name = path;
-		return;
+		return_VOID;
 	}
 
 
@@ -358,13 +369,15 @@
 		 * parent tree, but don't open a new scope -- we just want to lookup the
 		 * object  (MUST BE mode EXECUTE to perform upsearch)
 		 */
-
 		status = acpi_ns_lookup (&scope_info, path, ACPI_TYPE_ANY, IMODE_EXECUTE,
 				 NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, NULL,
 				 &node);
 		if (ACPI_SUCCESS (status)) {
 			if (node->type == ACPI_TYPE_METHOD) {
 				method_node = node;
+				ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "method - %p Path=%p\n",
+					method_node, path));
+
 				name_op = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
 				if (name_op) {
 					/* Change arg into a METHOD CALL and attach name to it */
@@ -378,14 +391,14 @@
 					name_op->node = method_node;
 					acpi_ps_append_arg (arg, name_op);
 
-					if (!(ACPI_OPERAND_OBJECT  *) method_node->object) {
-						return;
+					if (!(acpi_operand_object  *) method_node->object) {
+						return_VOID;
 					}
 
-					*arg_count = ((ACPI_OPERAND_OBJECT *) method_node->object)->method.param_count;
+					*arg_count = ((acpi_operand_object *) method_node->object)->method.param_count;
 				}
 
-				return;
+				return_VOID;
 			}
 
 			/*
@@ -401,12 +414,11 @@
 	 * something other than a control method.  Just initialize the Op with the
 	 * pathname.
 	 */
-
 	acpi_ps_init_op (arg, AML_INT_NAMEPATH_OP);
 	arg->value.name = path;
 
 
-	return;
+	return_VOID;
 }
 
 #endif
@@ -427,11 +439,13 @@
 
 void
 acpi_ps_get_next_simple_arg (
-	ACPI_PARSE_STATE        *parser_state,
+	acpi_parse_state        *parser_state,
 	u32                     arg_type,
-	ACPI_PARSE_OBJECT       *arg)
+	acpi_parse_object       *arg)
 {
 
+	FUNCTION_TRACE_U32 ("Ps_get_next_simple_arg", arg_type);
+
 
 	switch (arg_type) {
 
@@ -465,6 +479,17 @@
 		break;
 
 
+	case ARGP_QWORDDATA:
+
+		acpi_ps_init_op (arg, AML_QWORD_OP);
+
+		/* Get 8 bytes from the AML stream */
+
+		MOVE_UNALIGNED64_TO_64 (&arg->value.integer, parser_state->aml);
+		parser_state->aml += 8;
+		break;
+
+
 	case ARGP_CHARLIST:
 
 		acpi_ps_init_op (arg, AML_STRING_OP);
@@ -485,7 +510,7 @@
 		break;
 	}
 
-	return;
+	return_VOID;
 }
 
 
@@ -501,17 +526,20 @@
  *
  ******************************************************************************/
 
-ACPI_PARSE_OBJECT *
+acpi_parse_object *
 acpi_ps_get_next_field (
-	ACPI_PARSE_STATE        *parser_state)
+	acpi_parse_state        *parser_state)
 {
 	u32                     aml_offset = parser_state->aml -
 			 parser_state->aml_start;
-	ACPI_PARSE_OBJECT       *field;
+	acpi_parse_object       *field;
 	u16                     opcode;
 	u32                     name;
 
 
+	FUNCTION_TRACE ("Ps_get_next_field");
+
+
 	/* determine field type */
 
 	switch (GET8 (parser_state->aml)) {
@@ -579,7 +607,7 @@
 		}
 	}
 
-	return (field);
+	return_PTR (field);
 }
 
 
@@ -599,18 +627,21 @@
  *
  ******************************************************************************/
 
-ACPI_PARSE_OBJECT *
+acpi_parse_object *
 acpi_ps_get_next_arg (
-	ACPI_PARSE_STATE        *parser_state,
+	acpi_parse_state        *parser_state,
 	u32                     arg_type,
 	u32                     *arg_count)
 {
-	ACPI_PARSE_OBJECT       *arg = NULL;
-	ACPI_PARSE_OBJECT       *prev = NULL;
-	ACPI_PARSE_OBJECT       *field;
+	acpi_parse_object       *arg = NULL;
+	acpi_parse_object       *prev = NULL;
+	acpi_parse_object       *field;
 	u32                     subop;
 
 
+	FUNCTION_TRACE_PTR ("Ps_get_next_arg", parser_state);
+
+
 	switch (arg_type) {
 	case ARGP_BYTEDATA:
 	case ARGP_WORDDATA:
@@ -675,7 +706,7 @@
 				/* fill in bytelist data */
 
 				arg->value.size = (parser_state->pkg_end - parser_state->aml);
-				((ACPI_PARSE2_OBJECT *) arg)->data = parser_state->aml;
+				((acpi_parse2_object *) arg)->data = parser_state->aml;
 			}
 
 			/* skip to End of byte data */
@@ -729,5 +760,5 @@
 		break;
 	}
 
-	return (arg);
+	return_PTR (arg);
 }

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