summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utresrc.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-11-17 19:07:00 +0100
committerLen Brown <len.brown@intel.com>2005-12-10 06:27:56 +0100
commitc51a4de85de720670f2fbc592a6f8040af72ad87 (patch)
treeccaa60c483fcc904abd63d936ff7dc380bf28e7b /drivers/acpi/utilities/utresrc.c
parent[ACPI] ACPICA 20051102 (diff)
downloadlinux-c51a4de85de720670f2fbc592a6f8040af72ad87.tar.xz
linux-c51a4de85de720670f2fbc592a6f8040af72ad87.zip
[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>
Diffstat (limited to 'drivers/acpi/utilities/utresrc.c')
-rw-r--r--drivers/acpi/utilities/utresrc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/acpi/utilities/utresrc.c b/drivers/acpi/utilities/utresrc.c
index 07a314c710d8..6c0ce7b12194 100644
--- a/drivers/acpi/utilities/utresrc.c
+++ b/drivers/acpi/utilities/utresrc.c
@@ -157,7 +157,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
/*
* 1) Validate the resource_type field (Byte 0)
*/
- resource_type = *((u8 *) aml);
+ resource_type = ACPI_GET8(aml);
/*
* Byte 0 contains the descriptor name (Resource Type)
@@ -266,14 +266,14 @@ u8 acpi_ut_get_resource_type(void *aml)
* Byte 0 contains the descriptor name (Resource Type)
* Examine the large/small bit in the resource header
*/
- if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
+ if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
/* Large Resource Type -- bits 6:0 contain the name */
- return (*((u8 *) aml));
+ return (ACPI_GET8(aml));
} else {
/* Small Resource Type -- bits 6:3 contain the name */
- return ((u8) (*((u8 *) aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
+ return ((u8) (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
}
}
@@ -301,15 +301,15 @@ u16 acpi_ut_get_resource_length(void *aml)
* Byte 0 contains the descriptor name (Resource Type)
* Examine the large/small bit in the resource header
*/
- if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
+ if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
/* Large Resource type -- bytes 1-2 contain the 16-bit length */
- ACPI_MOVE_16_TO_16(&resource_length, &((u8 *) aml)[1]);
+ ACPI_MOVE_16_TO_16(&resource_length, ACPI_ADD_PTR(u8, aml, 1));
} else {
/* Small Resource type -- bits 2:0 of byte 0 contain the length */
- resource_length = (u16) (*((u8 *) aml) &
+ resource_length = (u16) (ACPI_GET8(aml) &
ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
}
@@ -334,7 +334,7 @@ u8 acpi_ut_get_resource_header_length(void *aml)
/* Examine the large/small bit in the resource header */
- if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
+ if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
return (sizeof(struct aml_resource_large_header));
} else {
return (sizeof(struct aml_resource_small_header));
@@ -372,8 +372,9 @@ u32 acpi_ut_get_descriptor_length(void *aml)
* FUNCTION: acpi_ut_get_resource_end_tag
*
* PARAMETERS: obj_desc - The resource template buffer object
+ * end_tag - Where the pointer to the end_tag is returned
*
- * RETURN: Pointer to the end tag
+ * RETURN: Status, pointer to the end tag
*
* DESCRIPTION: Find the end_tag resource descriptor in an AML resource template
*