patch-2.4.0-test9 linux/drivers/acpi/dispatcher/dsfield.c

Next file: linux/drivers/acpi/dispatcher/dsmethod.c
Previous file: linux/drivers/acpi/dispatcher/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/acpi/dispatcher/dsfield.c linux/drivers/acpi/dispatcher/dsfield.c
@@ -1,7 +1,7 @@
-
 /******************************************************************************
  *
  * Module Name: dsfield - Dispatcher field routines
+ *              $Revision: 29 $
  *
  *****************************************************************************/
 
@@ -26,13 +26,13 @@
 
 #include "acpi.h"
 #include "amlcode.h"
-#include "dispatch.h"
-#include "interp.h"
-#include "namesp.h"
+#include "acdispat.h"
+#include "acinterp.h"
+#include "acnamesp.h"
 
 
 #define _COMPONENT          DISPATCHER
-	 MODULE_NAME         ("dsfield");
+	 MODULE_NAME         ("dsfield")
 
 
 /*
@@ -46,28 +46,28 @@
 #define FIELD_UPDATE_RULE_MASK      0x60
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_ds_create_field
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region          - NTE for the containing Operation Region
+ *              Region_node - Object for the containing Operation Region
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Create a new field in the specified operation region
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 ACPI_STATUS
 acpi_ds_create_field (
-	ACPI_GENERIC_OP         *op,
-	ACPI_HANDLE             region,
+	ACPI_PARSE_OBJECT       *op,
+	ACPI_NAMESPACE_NODE     *region_node,
 	ACPI_WALK_STATE         *walk_state)
 {
 	ACPI_STATUS             status = AE_AML_ERROR;
-	ACPI_GENERIC_OP         *arg;
-	ACPI_NAMED_OBJECT       *entry;
+	ACPI_PARSE_OBJECT       *arg;
+	ACPI_NAMESPACE_NODE     *node;
 	u8                      field_flags;
 	u8                      access_attribute = 0;
 	u32                     field_bit_position = 0;
@@ -76,6 +76,16 @@
 	/* First arg is the name of the parent Op_region */
 
 	arg = op->value.arg;
+	if (!region_node) {
+		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
+				 ACPI_TYPE_REGION, IMODE_EXECUTE,
+				 NS_SEARCH_PARENT, walk_state,
+				 &region_node);
+
+		if (ACPI_FAILURE (status)) {
+			return (status);
+		}
+	}
 
 	/* Second arg is the field flags */
 
@@ -111,32 +121,29 @@
 		case AML_NAMEDFIELD_OP:
 
 			status = acpi_ns_lookup (walk_state->scope_info,
-					  (char *) &((ACPI_NAMED_OP *)arg)->name,
+					  (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)arg)->name,
 					  INTERNAL_TYPE_DEF_FIELD,
 					  IMODE_LOAD_PASS1,
 					  NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-					  NULL, &entry);
+					  NULL, &node);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);
 			}
 
 			/*
-			 * Initialize an object for the new NTE that is on
+			 * Initialize an object for the new Node that is on
 			 * the object stack
 			 */
 
-			status = acpi_aml_prep_def_field_value (entry, region,
-					 field_flags,
-					 access_attribute,
-					 field_bit_position,
-					 arg->value.size);
+			status = acpi_aml_prep_def_field_value (node, region_node, field_flags,
+					  access_attribute, field_bit_position, arg->value.size);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);
 			}
 
-			/* Keep track of bit position for the *next* field */
+			/* Keep track of bit position for *next* field */
 
 			field_bit_position += arg->value.size;
 			break;
@@ -149,29 +156,29 @@
 }
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_ds_create_bank_field
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region          - NTE for the containing Operation Region
+ *              Region_node - Object for the containing Operation Region
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Create a new bank field in the specified operation region
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 ACPI_STATUS
 acpi_ds_create_bank_field (
-	ACPI_GENERIC_OP         *op,
-	ACPI_HANDLE             region,
+	ACPI_PARSE_OBJECT       *op,
+	ACPI_NAMESPACE_NODE     *region_node,
 	ACPI_WALK_STATE         *walk_state)
 {
 	ACPI_STATUS             status = AE_AML_ERROR;
-	ACPI_GENERIC_OP         *arg;
-	ACPI_NAMED_OBJECT       *bank_reg;
-	ACPI_NAMED_OBJECT       *entry;
+	ACPI_PARSE_OBJECT       *arg;
+	ACPI_NAMESPACE_NODE     *register_node;
+	ACPI_NAMESPACE_NODE     *node;
 	u32                     bank_value;
 	u8                      field_flags;
 	u8                      access_attribute = 0;
@@ -181,8 +188,18 @@
 	/* First arg is the name of the parent Op_region */
 
 	arg = op->value.arg;
+	if (!region_node) {
+		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
+				 ACPI_TYPE_REGION, IMODE_EXECUTE,
+				 NS_SEARCH_PARENT, walk_state,
+				 &region_node);
+
+		if (ACPI_FAILURE (status)) {
+			return (status);
+		}
+	}
 
-	/* Socond arg is the Bank Register */
+	/* Second arg is the Bank Register */
 
 	arg = arg->next;
 
@@ -190,7 +207,7 @@
 			 INTERNAL_TYPE_BANK_FIELD_DEFN,
 			 IMODE_LOAD_PASS1,
 			 NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-			 NULL, &bank_reg);
+			 NULL, &register_node);
 
 	if (ACPI_FAILURE (status)) {
 		return (status);
@@ -236,27 +253,24 @@
 		case AML_NAMEDFIELD_OP:
 
 			status = acpi_ns_lookup (walk_state->scope_info,
-					  (char *) &((ACPI_NAMED_OP *)arg)->name,
+					  (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)arg)->name,
 					  INTERNAL_TYPE_DEF_FIELD,
 					  IMODE_LOAD_PASS1,
 					  NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-					  NULL, &entry);
+					  NULL, &node);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);
 			}
 
 			/*
-			 * Initialize an object for the new NTE that is on
+			 * Initialize an object for the new Node that is on
 			 * the object stack
 			 */
 
-			status = acpi_aml_prep_bank_field_value (entry, region,
-					 bank_reg, bank_value,
-					 field_flags,
-					 access_attribute,
-					 field_bit_position,
-					 arg->value.size);
+			status = acpi_aml_prep_bank_field_value (node, region_node, register_node,
+					  bank_value, field_flags, access_attribute,
+					  field_bit_position, arg->value.size);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);
@@ -276,30 +290,30 @@
 }
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_ds_create_index_field
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region          - NTE for the containing Operation Region
+ *              Region_node - Object for the containing Operation Region
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Create a new index field in the specified operation region
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 ACPI_STATUS
 acpi_ds_create_index_field (
-	ACPI_GENERIC_OP         *op,
-	ACPI_HANDLE             region,
+	ACPI_PARSE_OBJECT       *op,
+	ACPI_HANDLE             region_node,
 	ACPI_WALK_STATE         *walk_state)
 {
 	ACPI_STATUS             status;
-	ACPI_GENERIC_OP         *arg;
-	ACPI_NAMED_OBJECT       *entry;
-	ACPI_NAMED_OBJECT       *index_reg;
-	ACPI_NAMED_OBJECT       *data_reg;
+	ACPI_PARSE_OBJECT       *arg;
+	ACPI_NAMESPACE_NODE     *node;
+	ACPI_NAMESPACE_NODE     *index_register_node;
+	ACPI_NAMESPACE_NODE     *data_register_node;
 	u8                      field_flags;
 	u8                      access_attribute = 0;
 	u32                     field_bit_position = 0;
@@ -312,7 +326,7 @@
 	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
 			 ACPI_TYPE_ANY, IMODE_LOAD_PASS1,
 			 NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-			 NULL, &index_reg);
+			 NULL, &index_register_node);
 
 	if (ACPI_FAILURE (status)) {
 		return (status);
@@ -326,7 +340,7 @@
 			 INTERNAL_TYPE_INDEX_FIELD_DEFN,
 			 IMODE_LOAD_PASS1,
 			 NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-			 NULL, &data_reg);
+			 NULL, &data_register_node);
 
 	if (ACPI_FAILURE (status)) {
 		return (status);
@@ -368,26 +382,24 @@
 		case AML_NAMEDFIELD_OP:
 
 			status = acpi_ns_lookup (walk_state->scope_info,
-					 (char *) &((ACPI_NAMED_OP *)arg)->name,
+					 (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)arg)->name,
 					 INTERNAL_TYPE_INDEX_FIELD,
 					 IMODE_LOAD_PASS1,
 					 NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-					 NULL, &entry);
+					 NULL, &node);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);
 			}
 
 			/*
-			 * Initialize an object for the new NTE that is on
+			 * Initialize an object for the new Node that is on
 			 * the object stack
 			 */
 
-			status = acpi_aml_prep_index_field_value (entry, index_reg,
-					 data_reg, field_flags,
-					 access_attribute,
-					 field_bit_position,
-					 arg->value.size);
+			status = acpi_aml_prep_index_field_value (node, index_register_node, data_register_node,
+					  field_flags, access_attribute,
+					  field_bit_position, arg->value.size);
 
 			if (ACPI_FAILURE (status)) {
 				return (status);

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