aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rscalc.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-11-17 13:07:00 -0500
committerLen Brown <len.brown@intel.com>2005-12-10 00:27:56 -0500
commitc51a4de85de720670f2fbc592a6f8040af72ad87 (patch)
treeccaa60c483fcc904abd63d936ff7dc380bf28e7b /drivers/acpi/resources/rscalc.c
parent96db255c8f014ae3497507104e8df809785a619f (diff)
[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/resources/rscalc.c')
-rw-r--r--drivers/acpi/resources/rscalc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index eca7439ee9da..c2c4d9079c6c 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -300,7 +300,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
300 /* Point to the next object */ 300 /* Point to the next object */
301 301
302 resource = 302 resource =
303 ACPI_PTR_ADD(struct acpi_resource, resource, 303 ACPI_ADD_PTR(struct acpi_resource, resource,
304 resource->length); 304 resource->length);
305 } 305 }
306 306
@@ -374,8 +374,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
374 * Get the number of bits set in the 16-bit IRQ mask 374 * Get the number of bits set in the 16-bit IRQ mask
375 */ 375 */
376 ACPI_MOVE_16_TO_16(&temp16, buffer); 376 ACPI_MOVE_16_TO_16(&temp16, buffer);
377 extra_struct_bytes = 377 extra_struct_bytes = acpi_rs_count_set_bits(temp16);
378 acpi_rs_count_set_bits(temp16) * sizeof(u32);
379 break; 378 break;
380 379
381 case ACPI_RESOURCE_NAME_DMA: 380 case ACPI_RESOURCE_NAME_DMA:
@@ -383,8 +382,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
383 * DMA Resource: 382 * DMA Resource:
384 * Get the number of bits set in the 8-bit DMA mask 383 * Get the number of bits set in the 8-bit DMA mask
385 */ 384 */
386 extra_struct_bytes = 385 extra_struct_bytes = acpi_rs_count_set_bits(*buffer);
387 acpi_rs_count_set_bits(*buffer) * sizeof(u32);
388 break; 386 break;
389 387
390 case ACPI_RESOURCE_NAME_VENDOR_SMALL: 388 case ACPI_RESOURCE_NAME_VENDOR_SMALL:
@@ -399,9 +397,9 @@ acpi_rs_get_list_length(u8 * aml_buffer,
399 397
400 case ACPI_RESOURCE_NAME_END_TAG: 398 case ACPI_RESOURCE_NAME_END_TAG:
401 /* 399 /*
402 * End Tag: This is the normal exit 400 * End Tag: This is the normal exit, add size of end_tag
403 */ 401 */
404 *size_needed = buffer_size; 402 *size_needed = buffer_size + ACPI_RS_SIZE_MIN;
405 return_ACPI_STATUS(AE_OK); 403 return_ACPI_STATUS(AE_OK);
406 404
407 case ACPI_RESOURCE_NAME_VENDOR_LARGE: 405 case ACPI_RESOURCE_NAME_VENDOR_LARGE:
@@ -466,7 +464,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
466 464
467 temp16 = (u16) (acpi_gbl_resource_struct_sizes[resource_index] + 465 temp16 = (u16) (acpi_gbl_resource_struct_sizes[resource_index] +
468 extra_struct_bytes); 466 extra_struct_bytes);
469 buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE(temp16); 467 buffer_size += (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(temp16);
470 468
471 /* 469 /*
472 * Point to the next resource within the stream 470 * Point to the next resource within the stream