aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exresolv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exresolv.c')
-rw-r--r--drivers/acpi/executer/exresolv.c55
1 files changed, 26 insertions, 29 deletions
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 6c64e55dab0e..b35f7c817acf 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2007, R. Byron Moore 9 * Copyright (C) 2000 - 2008, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -140,7 +140,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
140{ 140{
141 acpi_status status = AE_OK; 141 acpi_status status = AE_OK;
142 union acpi_operand_object *stack_desc; 142 union acpi_operand_object *stack_desc;
143 void *temp_node;
144 union acpi_operand_object *obj_desc = NULL; 143 union acpi_operand_object *obj_desc = NULL;
145 u16 opcode; 144 u16 opcode;
146 145
@@ -156,23 +155,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
156 opcode = stack_desc->reference.opcode; 155 opcode = stack_desc->reference.opcode;
157 156
158 switch (opcode) { 157 switch (opcode) {
159 case AML_NAME_OP:
160
161 /*
162 * Convert name reference to a namespace node
163 * Then, acpi_ex_resolve_node_to_value can be used to get the value
164 */
165 temp_node = stack_desc->reference.object;
166
167 /* Delete the Reference Object */
168
169 acpi_ut_remove_reference(stack_desc);
170
171 /* Return the namespace node */
172
173 (*stack_ptr) = temp_node;
174 break;
175
176 case AML_LOCAL_OP: 158 case AML_LOCAL_OP:
177 case AML_ARG_OP: 159 case AML_ARG_OP:
178 160
@@ -207,15 +189,25 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
207 switch (stack_desc->reference.target_type) { 189 switch (stack_desc->reference.target_type) {
208 case ACPI_TYPE_BUFFER_FIELD: 190 case ACPI_TYPE_BUFFER_FIELD:
209 191
210 /* Just return - leave the Reference on the stack */ 192 /* Just return - do not dereference */
211 break; 193 break;
212 194
213 case ACPI_TYPE_PACKAGE: 195 case ACPI_TYPE_PACKAGE:
214 196
197 /* If method call or copy_object - do not dereference */
198
199 if ((walk_state->opcode ==
200 AML_INT_METHODCALL_OP)
201 || (walk_state->opcode == AML_COPY_OP)) {
202 break;
203 }
204
205 /* Otherwise, dereference the package_index to a package element */
206
215 obj_desc = *stack_desc->reference.where; 207 obj_desc = *stack_desc->reference.where;
216 if (obj_desc) { 208 if (obj_desc) {
217 /* 209 /*
218 * Valid obj descriptor, copy pointer to return value 210 * Valid object descriptor, copy pointer to return value
219 * (i.e., dereference the package index) 211 * (i.e., dereference the package index)
220 * Delete the ref object, increment the returned object 212 * Delete the ref object, increment the returned object
221 */ 213 */
@@ -224,11 +216,11 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
224 *stack_ptr = obj_desc; 216 *stack_ptr = obj_desc;
225 } else { 217 } else {
226 /* 218 /*
227 * A NULL object descriptor means an unitialized element of 219 * A NULL object descriptor means an uninitialized element of
228 * the package, can't dereference it 220 * the package, can't dereference it
229 */ 221 */
230 ACPI_ERROR((AE_INFO, 222 ACPI_ERROR((AE_INFO,
231 "Attempt to deref an Index to NULL pkg element Idx=%p", 223 "Attempt to dereference an Index to NULL package element Idx=%p",
232 stack_desc)); 224 stack_desc));
233 status = AE_AML_UNINITIALIZED_ELEMENT; 225 status = AE_AML_UNINITIALIZED_ELEMENT;
234 } 226 }
@@ -239,7 +231,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
239 /* Invalid reference object */ 231 /* Invalid reference object */
240 232
241 ACPI_ERROR((AE_INFO, 233 ACPI_ERROR((AE_INFO,
242 "Unknown TargetType %X in Index/Reference obj %p", 234 "Unknown TargetType %X in Index/Reference object %p",
243 stack_desc->reference.target_type, 235 stack_desc->reference.target_type,
244 stack_desc)); 236 stack_desc));
245 status = AE_AML_INTERNAL; 237 status = AE_AML_INTERNAL;
@@ -251,7 +243,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
251 case AML_DEBUG_OP: 243 case AML_DEBUG_OP:
252 case AML_LOAD_OP: 244 case AML_LOAD_OP:
253 245
254 /* Just leave the object as-is */ 246 /* Just leave the object as-is, do not dereference */
255 247
256 break; 248 break;
257 249
@@ -390,10 +382,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
390 } 382 }
391 383
392 /* 384 /*
393 * For reference objects created via the ref_of or Index operators, 385 * For reference objects created via the ref_of, Index, or Load/load_table
394 * we need to get to the base object (as per the ACPI specification 386 * operators, we need to get to the base object (as per the ACPI
395 * of the object_type and size_of operators). This means traversing 387 * specification of the object_type and size_of operators). This means
396 * the list of possibly many nested references. 388 * traversing the list of possibly many nested references.
397 */ 389 */
398 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { 390 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
399 switch (obj_desc->reference.opcode) { 391 switch (obj_desc->reference.opcode) {
@@ -463,6 +455,11 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
463 } 455 }
464 break; 456 break;
465 457
458 case AML_LOAD_OP:
459
460 type = ACPI_TYPE_DDB_HANDLE;
461 goto exit;
462
466 case AML_LOCAL_OP: 463 case AML_LOCAL_OP:
467 case AML_ARG_OP: 464 case AML_ARG_OP:
468 465