[ACPI] ACPICA 20051102

Modified the subsystem initialization sequence to improve
GPE support. The GPE initialization has been split into
two parts in order to defer execution of the _PRW methods
(Power Resources for Wake) until after the hardware is
fully initialized and the SCI handler is installed. This
allows the _PRW methods to access fields protected by the
Global Lock. This will fix systems where a NO_GLOBAL_LOCK
exception has been seen during initialization.

Fixed a regression with the ConcatenateResTemplate()
ASL operator introduced in the 20051021 release.

Implemented support for "local" internal ACPI object
types within the debugger "Object" command and the
acpi_walk_namespace() external interfaces. These local
types include RegionFields, BankFields, IndexFields, Alias,
and reference objects.

Moved common AML resource handling code into a new file,
"utresrc.c". This code is shared by both the Resource
Manager and the AML Debugger.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
index 7613033..a1eac0f 100644
--- a/drivers/acpi/resources/rsutils.c
+++ b/drivers/acpi/resources/rsutils.c
@@ -65,6 +65,8 @@
 	acpi_native_uint i;
 	u8 bit_count;
 
+	ACPI_FUNCTION_ENTRY();
+
 	/* Decode the mask bits */
 
 	for (i = 0, bit_count = 0; mask; i++) {
@@ -97,6 +99,8 @@
 	acpi_native_uint i;
 	u16 mask;
 
+	ACPI_FUNCTION_ENTRY();
+
 	/* Encode the list into a single bitmask */
 
 	for (i = 0, mask = 0; i < count; i++) {
@@ -128,6 +132,8 @@
 {
 	acpi_native_uint i;
 
+	ACPI_FUNCTION_ENTRY();
+
 	/* One move per item */
 
 	for (i = 0; i < item_count; i++) {
@@ -168,53 +174,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_rs_get_resource_info
- *
- * PARAMETERS:  resource_type       - Byte 0 of a resource descriptor
- *
- * RETURN:      Pointer to the resource conversion handler
- *
- * DESCRIPTION: Extract the Resource Type/Name from the first byte of
- *              a resource descriptor.
- *
- ******************************************************************************/
-
-struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type)
-{
-	struct acpi_resource_info *size_info;
-
-	ACPI_FUNCTION_ENTRY();
-
-	/* Determine if this is a small or large resource */
-
-	if (resource_type & ACPI_RESOURCE_NAME_LARGE) {
-		/* Large Resource Type -- bits 6:0 contain the name */
-
-		if (resource_type > ACPI_RESOURCE_NAME_LARGE_MAX) {
-			return (NULL);
-		}
-
-		size_info = &acpi_gbl_lg_resource_info[(resource_type &
-							ACPI_RESOURCE_NAME_LARGE_MASK)];
-	} else {
-		/* Small Resource Type -- bits 6:3 contain the name */
-
-		size_info = &acpi_gbl_sm_resource_info[((resource_type &
-							 ACPI_RESOURCE_NAME_SMALL_MASK)
-							>> 3)];
-	}
-
-	/* Zero entry indicates an invalid resource type */
-
-	if (!size_info->minimum_internal_struct_length) {
-		return (NULL);
-	}
-
-	return (size_info);
-}
-
-/*******************************************************************************
- *
  * FUNCTION:    acpi_rs_set_resource_length
  *
  * PARAMETERS:  total_length        - Length of the AML descriptor, including
@@ -238,25 +197,20 @@
 
 	ACPI_FUNCTION_ENTRY();
 
-	/* Determine if this is a small or large resource */
+	/* Length is the total descriptor length minus the header length */
+
+	resource_length = (acpi_rs_length)
+	    (total_length - acpi_ut_get_resource_header_length(aml));
+
+	/* Length is stored differently for large and small descriptors */
 
 	if (aml->small_header.descriptor_type & ACPI_RESOURCE_NAME_LARGE) {
-		/* Large Resource type -- bytes 1-2 contain the 16-bit length */
-
-		resource_length = (acpi_rs_length)
-		    (total_length - sizeof(struct aml_resource_large_header));
-
-		/* Insert length into the Large descriptor length field */
+		/* Large descriptor -- bytes 1-2 contain the 16-bit length */
 
 		ACPI_MOVE_16_TO_16(&aml->large_header.resource_length,
 				   &resource_length);
 	} else {
-		/* Small Resource type -- bits 2:0 of byte 0 contain the length */
-
-		resource_length = (acpi_rs_length)
-		    (total_length - sizeof(struct aml_resource_small_header));
-
-		/* Insert length into the descriptor type byte */
+		/* Small descriptor -- bits 2:0 of byte 0 contain the length */
 
 		aml->small_header.descriptor_type = (u8)
 
@@ -292,7 +246,7 @@
 {
 	ACPI_FUNCTION_ENTRY();
 
-	/* Set the Descriptor Type */
+	/* Set the Resource Type */
 
 	aml->small_header.descriptor_type = descriptor_type;
 
@@ -409,14 +363,14 @@
 				   (char *)&aml_resource_source[1]);
 
 		return ((acpi_rs_length) total_length);
-	} else {
-		/* resource_source is not present */
-
-		resource_source->index = 0;
-		resource_source->string_length = 0;
-		resource_source->string_ptr = NULL;
-		return (0);
 	}
+
+	/* resource_source is not present */
+
+	resource_source->index = 0;
+	resource_source->string_length = 0;
+	resource_source->string_ptr = NULL;
+	return (0);
 }
 
 /*******************************************************************************