aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utobject.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/utilities/utobject.c
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/utobject.c')
-rw-r--r--drivers/acpi/utilities/utobject.c68
1 files changed, 47 insertions, 21 deletions
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 9ee40a484e07..cd3899b9cc5a 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -50,6 +50,25 @@
50#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
51 ACPI_MODULE_NAME ("utobject") 51 ACPI_MODULE_NAME ("utobject")
52 52
53/* Local prototypes */
54
55static acpi_status
56acpi_ut_get_simple_object_size (
57 union acpi_operand_object *obj,
58 acpi_size *obj_length);
59
60static acpi_status
61acpi_ut_get_package_object_size (
62 union acpi_operand_object *obj,
63 acpi_size *obj_length);
64
65static acpi_status
66acpi_ut_get_element_length (
67 u8 object_type,
68 union acpi_operand_object *source_object,
69 union acpi_generic_state *state,
70 void *context);
71
53 72
54/******************************************************************************* 73/*******************************************************************************
55 * 74 *
@@ -60,7 +79,7 @@
60 * component_id - Component type of caller 79 * component_id - Component type of caller
61 * Type - ACPI Type of the new object 80 * Type - ACPI Type of the new object
62 * 81 *
63 * RETURN: Object - The new object. Null on failure 82 * RETURN: A new internal object, null on failure
64 * 83 *
65 * DESCRIPTION: Create and initialize a new internal object. 84 * DESCRIPTION: Create and initialize a new internal object.
66 * 85 *
@@ -83,7 +102,8 @@ acpi_ut_create_internal_object_dbg (
83 union acpi_operand_object *second_object; 102 union acpi_operand_object *second_object;
84 103
85 104
86 ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg", acpi_ut_get_type_name (type)); 105 ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg",
106 acpi_ut_get_type_name (type));
87 107
88 108
89 /* Allocate the raw object descriptor */ 109 /* Allocate the raw object descriptor */
@@ -99,7 +119,8 @@ acpi_ut_create_internal_object_dbg (
99 119
100 /* These types require a secondary object */ 120 /* These types require a secondary object */
101 121
102 second_object = acpi_ut_allocate_object_desc_dbg (module_name, line_number, component_id); 122 second_object = acpi_ut_allocate_object_desc_dbg (module_name,
123 line_number, component_id);
103 if (!second_object) { 124 if (!second_object) {
104 acpi_ut_delete_object_desc (object); 125 acpi_ut_delete_object_desc (object);
105 return_PTR (NULL); 126 return_PTR (NULL);
@@ -138,7 +159,7 @@ acpi_ut_create_internal_object_dbg (
138 * 159 *
139 * PARAMETERS: buffer_size - Size of buffer to be created 160 * PARAMETERS: buffer_size - Size of buffer to be created
140 * 161 *
141 * RETURN: Pointer to a new Buffer object 162 * RETURN: Pointer to a new Buffer object, null on failure
142 * 163 *
143 * DESCRIPTION: Create a fully initialized buffer object 164 * DESCRIPTION: Create a fully initialized buffer object
144 * 165 *
@@ -192,9 +213,9 @@ acpi_ut_create_buffer_object (
192 * 213 *
193 * FUNCTION: acpi_ut_create_string_object 214 * FUNCTION: acpi_ut_create_string_object
194 * 215 *
195 * PARAMETERS: string_size - Size of string to be created. Does not 216 * PARAMETERS: string_size - Size of string to be created. Does not
196 * include NULL terminator, this is added 217 * include NULL terminator, this is added
197 * automatically. 218 * automatically.
198 * 219 *
199 * RETURN: Pointer to a new String object 220 * RETURN: Pointer to a new String object
200 * 221 *
@@ -249,7 +270,9 @@ acpi_ut_create_string_object (
249 * 270 *
250 * PARAMETERS: Object - Object to be validated 271 * PARAMETERS: Object - Object to be validated
251 * 272 *
252 * RETURN: Validate a pointer to be an union acpi_operand_object 273 * RETURN: TRUE if object is valid, FALSE otherwise
274 *
275 * DESCRIPTION: Validate a pointer to be an union acpi_operand_object
253 * 276 *
254 ******************************************************************************/ 277 ******************************************************************************/
255 278
@@ -399,8 +422,8 @@ acpi_ut_delete_object_cache (
399 * 422 *
400 * FUNCTION: acpi_ut_get_simple_object_size 423 * FUNCTION: acpi_ut_get_simple_object_size
401 * 424 *
402 * PARAMETERS: *internal_object - Pointer to the object we are examining 425 * PARAMETERS: internal_object - An ACPI operand object
403 * *obj_length - Where the length is returned 426 * obj_length - Where the length is returned
404 * 427 *
405 * RETURN: Status 428 * RETURN: Status
406 * 429 *
@@ -412,7 +435,7 @@ acpi_ut_delete_object_cache (
412 * 435 *
413 ******************************************************************************/ 436 ******************************************************************************/
414 437
415acpi_status 438static acpi_status
416acpi_ut_get_simple_object_size ( 439acpi_ut_get_simple_object_size (
417 union acpi_operand_object *internal_object, 440 union acpi_operand_object *internal_object,
418 acpi_size *obj_length) 441 acpi_size *obj_length)
@@ -424,8 +447,10 @@ acpi_ut_get_simple_object_size (
424 ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object); 447 ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object);
425 448
426 449
427 /* Handle a null object (Could be a uninitialized package element -- which is legal) */ 450 /*
428 451 * Handle a null object (Could be a uninitialized package
452 * element -- which is legal)
453 */
429 if (!internal_object) { 454 if (!internal_object) {
430 *obj_length = 0; 455 *obj_length = 0;
431 return_ACPI_STATUS (AE_OK); 456 return_ACPI_STATUS (AE_OK);
@@ -480,7 +505,8 @@ acpi_ut_get_simple_object_size (
480 * Get the actual length of the full pathname to this object. 505 * Get the actual length of the full pathname to this object.
481 * The reference will be converted to the pathname to the object 506 * The reference will be converted to the pathname to the object
482 */ 507 */
483 length += ACPI_ROUND_UP_TO_NATIVE_WORD (acpi_ns_get_pathname_length (internal_object->reference.node)); 508 length += ACPI_ROUND_UP_TO_NATIVE_WORD (
509 acpi_ns_get_pathname_length (internal_object->reference.node));
484 break; 510 break;
485 511
486 default: 512 default:
@@ -530,7 +556,7 @@ acpi_ut_get_simple_object_size (
530 * 556 *
531 ******************************************************************************/ 557 ******************************************************************************/
532 558
533acpi_status 559static acpi_status
534acpi_ut_get_element_length ( 560acpi_ut_get_element_length (
535 u8 object_type, 561 u8 object_type,
536 union acpi_operand_object *source_object, 562 union acpi_operand_object *source_object,
@@ -582,8 +608,8 @@ acpi_ut_get_element_length (
582 * 608 *
583 * FUNCTION: acpi_ut_get_package_object_size 609 * FUNCTION: acpi_ut_get_package_object_size
584 * 610 *
585 * PARAMETERS: *internal_object - Pointer to the object we are examining 611 * PARAMETERS: internal_object - An ACPI internal object
586 * *obj_length - Where the length is returned 612 * obj_length - Where the length is returned
587 * 613 *
588 * RETURN: Status 614 * RETURN: Status
589 * 615 *
@@ -595,7 +621,7 @@ acpi_ut_get_element_length (
595 * 621 *
596 ******************************************************************************/ 622 ******************************************************************************/
597 623
598acpi_status 624static acpi_status
599acpi_ut_get_package_object_size ( 625acpi_ut_get_package_object_size (
600 union acpi_operand_object *internal_object, 626 union acpi_operand_object *internal_object,
601 acpi_size *obj_length) 627 acpi_size *obj_length)
@@ -636,8 +662,8 @@ acpi_ut_get_package_object_size (
636 * 662 *
637 * FUNCTION: acpi_ut_get_object_size 663 * FUNCTION: acpi_ut_get_object_size
638 * 664 *
639 * PARAMETERS: *internal_object - Pointer to the object we are examining 665 * PARAMETERS: internal_object - An ACPI internal object
640 * *obj_length - Where the length will be returned 666 * obj_length - Where the length will be returned
641 * 667 *
642 * RETURN: Status 668 * RETURN: Status
643 * 669 *
@@ -647,7 +673,7 @@ acpi_ut_get_package_object_size (
647 ******************************************************************************/ 673 ******************************************************************************/
648 674
649acpi_status 675acpi_status
650acpi_ut_get_object_size( 676acpi_ut_get_object_size (
651 union acpi_operand_object *internal_object, 677 union acpi_operand_object *internal_object,
652 acpi_size *obj_length) 678 acpi_size *obj_length)
653{ 679{