[ACPI] ACPICA 20051117

Fixed a problem in the AML parser where the method thread
count could be decremented below zero if any errors
occurred during the method parse phase. This should
eliminate AE_AML_METHOD_LIMIT exceptions seen on some
machines. This also fixed a related regression with the
mechanism that detects and corrects methods that cannot
properly handle reentrancy (related to the deployment of
the new OwnerId mechanism.)

Eliminated the pre-parsing of control methods (to detect
errors) during table load. Related to the problem above,
this was causing unwind issues if any errors occurred
during the parse, and it seemed to be overkill. A table
load should not be aborted if there are problems with
any single control method, thus rendering this feature
rather pointless.

Fixed a problem with the new table-driven resource manager
where an internal buffer overflow could occur for small
resource templates.

Implemented a new external interface, acpi_get_vendor_resource()
This interface will find and return a vendor-defined
resource descriptor within a _CRS or _PRS
method via an ACPI 3.0 UUID match. (from Bjorn Helgaas)

Removed the length limit (200) on string objects as
per the upcoming ACPI 3.0A specification. This affects
the following areas of the interpreter: 1) any implicit
conversion of a Buffer to a String, 2) a String object
result of the ASL Concatentate operator, 3) the String
object result of the ASL ToString operator.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index f617ca8..cebd890 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -383,7 +383,7 @@
 
 	while (count) {
 		previous_target = target;
-		target = ((u8 *) resource) + table->offset;
+		target = ACPI_ADD_PTR(u8, resource, table->offset);
 		name = table->name;
 
 		switch (table->opcode) {
@@ -410,22 +410,19 @@
 			/* Data items, 8/16/32/64 bit */
 
 		case ACPI_RSD_UINT8:
-			acpi_rs_out_integer8(name, *ACPI_CAST_PTR(u8, target));
+			acpi_rs_out_integer8(name, ACPI_GET8(target));
 			break;
 
 		case ACPI_RSD_UINT16:
-			acpi_rs_out_integer16(name,
-					      *ACPI_CAST_PTR(u16, target));
+			acpi_rs_out_integer16(name, ACPI_GET16(target));
 			break;
 
 		case ACPI_RSD_UINT32:
-			acpi_rs_out_integer32(name,
-					      *ACPI_CAST_PTR(u32, target));
+			acpi_rs_out_integer32(name, ACPI_GET32(target));
 			break;
 
 		case ACPI_RSD_UINT64:
-			acpi_rs_out_integer64(name,
-					      *ACPI_CAST_PTR(u64, target));
+			acpi_rs_out_integer64(name, ACPI_GET64(target));
 			break;
 
 			/* Flags: 1-bit and 2-bit flags supported */
@@ -462,8 +459,8 @@
 			 * Note: The list length is obtained from the previous table entry
 			 */
 			if (previous_target) {
-				acpi_rs_dump_byte_list(*ACPI_CAST_PTR
-						       (u16, previous_target),
+				acpi_rs_dump_byte_list(ACPI_GET16
+						       (previous_target),
 						       target);
 			}
 			break;
@@ -634,7 +631,7 @@
 		/* Point to the next resource structure */
 
 		resource_list =
-		    ACPI_PTR_ADD(struct acpi_resource, resource_list,
+		    ACPI_ADD_PTR(struct acpi_resource, resource_list,
 				 resource_list->length);
 
 		/* Exit when END_TAG descriptor is reached */
@@ -675,9 +672,8 @@
 			       count);
 		acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
 
-		prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table,
-					    ((u8 *) prt_element) +
-					    prt_element->length);
+		prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
+					   prt_element, prt_element->length);
 	}
 }