aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exresolv.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/executer/exresolv.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/executer/exresolv.c')
-rw-r--r--drivers/acpi/executer/exresolv.c63
1 files changed, 41 insertions, 22 deletions
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 7be604911156..3de45672379a 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -54,6 +54,13 @@
54#define _COMPONENT ACPI_EXECUTER 54#define _COMPONENT ACPI_EXECUTER
55 ACPI_MODULE_NAME ("exresolv") 55 ACPI_MODULE_NAME ("exresolv")
56 56
57/* Local prototypes */
58
59static acpi_status
60acpi_ex_resolve_object_to_value (
61 union acpi_operand_object **stack_ptr,
62 struct acpi_walk_state *walk_state);
63
57 64
58/******************************************************************************* 65/*******************************************************************************
59 * 66 *
@@ -96,6 +103,11 @@ acpi_ex_resolve_to_value (
96 if (ACPI_FAILURE (status)) { 103 if (ACPI_FAILURE (status)) {
97 return_ACPI_STATUS (status); 104 return_ACPI_STATUS (status);
98 } 105 }
106
107 if (!*stack_ptr) {
108 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n"));
109 return_ACPI_STATUS (AE_AML_NO_OPERAND);
110 }
99 } 111 }
100 112
101 /* 113 /*
@@ -120,18 +132,17 @@ acpi_ex_resolve_to_value (
120 * 132 *
121 * FUNCTION: acpi_ex_resolve_object_to_value 133 * FUNCTION: acpi_ex_resolve_object_to_value
122 * 134 *
123 * PARAMETERS: stack_ptr - Pointer to a stack location that contains a 135 * PARAMETERS: stack_ptr - Pointer to an internal object
124 * ptr to an internal object.
125 * walk_state - Current method state 136 * walk_state - Current method state
126 * 137 *
127 * RETURN: Status 138 * RETURN: Status
128 * 139 *
129 * DESCRIPTION: Retrieve the value from an internal object. The Reference type 140 * DESCRIPTION: Retrieve the value from an internal object. The Reference type
130 * uses the associated AML opcode to determine the value. 141 * uses the associated AML opcode to determine the value.
131 * 142 *
132 ******************************************************************************/ 143 ******************************************************************************/
133 144
134acpi_status 145static acpi_status
135acpi_ex_resolve_object_to_value ( 146acpi_ex_resolve_object_to_value (
136 union acpi_operand_object **stack_ptr, 147 union acpi_operand_object **stack_ptr,
137 struct acpi_walk_state *walk_state) 148 struct acpi_walk_state *walk_state)
@@ -159,7 +170,7 @@ acpi_ex_resolve_object_to_value (
159 case AML_NAME_OP: 170 case AML_NAME_OP:
160 171
161 /* 172 /*
162 * Convert indirect name ptr to a direct name ptr. 173 * Convert name reference to a namespace node
163 * Then, acpi_ex_resolve_node_to_value can be used to get the value 174 * Then, acpi_ex_resolve_node_to_value can be used to get the value
164 */ 175 */
165 temp_node = stack_desc->reference.object; 176 temp_node = stack_desc->reference.object;
@@ -168,7 +179,7 @@ acpi_ex_resolve_object_to_value (
168 179
169 acpi_ut_remove_reference (stack_desc); 180 acpi_ut_remove_reference (stack_desc);
170 181
171 /* Put direct name pointer onto stack and exit */ 182 /* Return the namespace node */
172 183
173 (*stack_ptr) = temp_node; 184 (*stack_ptr) = temp_node;
174 break; 185 break;
@@ -255,10 +266,19 @@ acpi_ex_resolve_object_to_value (
255 266
256 break; 267 break;
257 268
269 case AML_INT_NAMEPATH_OP: /* Reference to a named object */
270
271 /* Get the object pointed to by the namespace node */
272
273 *stack_ptr = (stack_desc->reference.node)->object;
274 acpi_ut_add_reference (*stack_ptr);
275 acpi_ut_remove_reference (stack_desc);
276 break;
258 277
259 default: 278 default:
260 279
261 ACPI_REPORT_ERROR (("During resolve, Unknown Reference opcode %X (%s) in %p\n", 280 ACPI_REPORT_ERROR ((
281 "During resolve, Unknown Reference opcode %X (%s) in %p\n",
262 opcode, acpi_ps_get_opcode_name (opcode), stack_desc)); 282 opcode, acpi_ps_get_opcode_name (opcode), stack_desc));
263 status = AE_AML_INTERNAL; 283 status = AE_AML_INTERNAL;
264 break; 284 break;
@@ -278,9 +298,8 @@ acpi_ex_resolve_object_to_value (
278 break; 298 break;
279 299
280 300
281 /* 301 /* These cases may never happen here, but just in case.. */
282 * These cases may never happen here, but just in case.. 302
283 */
284 case ACPI_TYPE_BUFFER_FIELD: 303 case ACPI_TYPE_BUFFER_FIELD:
285 case ACPI_TYPE_LOCAL_REGION_FIELD: 304 case ACPI_TYPE_LOCAL_REGION_FIELD:
286 case ACPI_TYPE_LOCAL_BANK_FIELD: 305 case ACPI_TYPE_LOCAL_BANK_FIELD:
@@ -333,9 +352,8 @@ acpi_ex_resolve_multiple (
333 ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple"); 352 ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple");
334 353
335 354
336 /* 355 /* Operand can be either a namespace node or an operand descriptor */
337 * Operand can be either a namespace node or an operand descriptor 356
338 */
339 switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { 357 switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) {
340 case ACPI_DESC_TYPE_OPERAND: 358 case ACPI_DESC_TYPE_OPERAND:
341 type = obj_desc->common.type; 359 type = obj_desc->common.type;
@@ -357,10 +375,8 @@ acpi_ex_resolve_multiple (
357 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); 375 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
358 } 376 }
359 377
378 /* If type is anything other than a reference, we are done */
360 379
361 /*
362 * If type is anything other than a reference, we are done
363 */
364 if (type != ACPI_TYPE_LOCAL_REFERENCE) { 380 if (type != ACPI_TYPE_LOCAL_REFERENCE) {
365 goto exit; 381 goto exit;
366 } 382 }
@@ -382,8 +398,9 @@ acpi_ex_resolve_multiple (
382 /* All "References" point to a NS node */ 398 /* All "References" point to a NS node */
383 399
384 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { 400 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
385 ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", 401 ACPI_REPORT_ERROR ((
386 node, acpi_ut_get_descriptor_name (node))); 402 "acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
403 node, acpi_ut_get_descriptor_name (node)));
387 return_ACPI_STATUS (AE_AML_INTERNAL); 404 return_ACPI_STATUS (AE_AML_INTERNAL);
388 } 405 }
389 406
@@ -440,8 +457,9 @@ acpi_ex_resolve_multiple (
440 /* All "References" point to a NS node */ 457 /* All "References" point to a NS node */
441 458
442 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { 459 if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
443 ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", 460 ACPI_REPORT_ERROR ((
444 node, acpi_ut_get_descriptor_name (node))); 461 "acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
462 node, acpi_ut_get_descriptor_name (node)));
445 return_ACPI_STATUS (AE_AML_INTERNAL); 463 return_ACPI_STATUS (AE_AML_INTERNAL);
446 } 464 }
447 465
@@ -468,7 +486,7 @@ acpi_ex_resolve_multiple (
468 486
469 if (return_desc) { 487 if (return_desc) {
470 status = acpi_ds_method_data_get_value (obj_desc->reference.opcode, 488 status = acpi_ds_method_data_get_value (obj_desc->reference.opcode,
471 obj_desc->reference.offset, walk_state, &obj_desc); 489 obj_desc->reference.offset, walk_state, &obj_desc);
472 if (ACPI_FAILURE (status)) { 490 if (ACPI_FAILURE (status)) {
473 return_ACPI_STATUS (status); 491 return_ACPI_STATUS (status);
474 } 492 }
@@ -500,7 +518,8 @@ acpi_ex_resolve_multiple (
500 518
501 default: 519 default:
502 520
503 ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Unknown Reference subtype %X\n", 521 ACPI_REPORT_ERROR ((
522 "acpi_ex_resolve_multiple: Unknown Reference subtype %X\n",
504 obj_desc->reference.opcode)); 523 obj_desc->reference.opcode));
505 return_ACPI_STATUS (AE_AML_INTERNAL); 524 return_ACPI_STATUS (AE_AML_INTERNAL);
506 } 525 }