aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exstore.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-09-26 23:08:41 -0400
committerLen Brown <len.brown@intel.com>2008-10-22 23:14:45 -0400
commit1044f1f65b7df2aae979e397904c4985eeb99ba2 (patch)
tree8feb6f2db4f36b75d8c7126d51a7b35e57e13194 /drivers/acpi/executer/exstore.c
parent2425a0967f29b196fad5d4f726c9502679284656 (diff)
ACPICA: Cleanup for internal Reference Object
Fix some sloppiness in the Reference object. No longer use AML opcodes to differentiate the types, introduce new reference Class. Cleanup the debug output code. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exstore.c')
-rw-r--r--drivers/acpi/executer/exstore.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 20b4893e06e..3318df4cbd9 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -47,7 +47,6 @@
47#include <acpi/acinterp.h> 47#include <acpi/acinterp.h>
48#include <acpi/amlcode.h> 48#include <acpi/amlcode.h>
49#include <acpi/acnamesp.h> 49#include <acpi/acnamesp.h>
50#include <acpi/acparser.h>
51 50
52#define _COMPONENT ACPI_EXECUTER 51#define _COMPONENT ACPI_EXECUTER
53ACPI_MODULE_NAME("exstore") 52ACPI_MODULE_NAME("exstore")
@@ -179,23 +178,27 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
179 178
180 case ACPI_TYPE_LOCAL_REFERENCE: 179 case ACPI_TYPE_LOCAL_REFERENCE:
181 180
182 if (source_desc->reference.opcode == AML_INDEX_OP) { 181 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s] ",
183 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, 182 acpi_ut_get_reference_name(source_desc)));
184 "[%s, 0x%X]\n", 183
185 acpi_ps_get_opcode_name 184 /* Decode the reference */
186 (source_desc->reference.opcode), 185
187 source_desc->reference.offset)); 186 switch (source_desc->reference.class) {
188 } else { 187 case ACPI_REFCLASS_INDEX:
189 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]", 188
190 acpi_ps_get_opcode_name 189 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "0x%X\n",
191 (source_desc->reference.opcode))); 190 source_desc->reference.value));
192 } 191 break;
192
193 case ACPI_REFCLASS_TABLE:
193 194
194 if (source_desc->reference.opcode == AML_LOAD_OP) { /* Load and load_table */
195 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, 195 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
196 " Table Index %X\n", 196 "Table Index 0x%X\n",
197 source_desc->reference.value)); 197 source_desc->reference.value));
198 break; 198 break;
199
200 default:
201 break;
199 } 202 }
200 203
201 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, " ")); 204 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, " "));
@@ -347,15 +350,15 @@ acpi_ex_store(union acpi_operand_object *source_desc,
347 } 350 }
348 351
349 /* 352 /*
350 * Examine the Reference opcode. These cases are handled: 353 * Examine the Reference class. These cases are handled:
351 * 354 *
352 * 1) Store to Name (Change the object associated with a name) 355 * 1) Store to Name (Change the object associated with a name)
353 * 2) Store to an indexed area of a Buffer or Package 356 * 2) Store to an indexed area of a Buffer or Package
354 * 3) Store to a Method Local or Arg 357 * 3) Store to a Method Local or Arg
355 * 4) Store to the debug object 358 * 4) Store to the debug object
356 */ 359 */
357 switch (ref_desc->reference.opcode) { 360 switch (ref_desc->reference.class) {
358 case AML_REF_OF_OP: 361 case ACPI_REFCLASS_REFOF:
359 362
360 /* Storing an object into a Name "container" */ 363 /* Storing an object into a Name "container" */
361 364
@@ -365,7 +368,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
365 ACPI_IMPLICIT_CONVERSION); 368 ACPI_IMPLICIT_CONVERSION);
366 break; 369 break;
367 370
368 case AML_INDEX_OP: 371 case ACPI_REFCLASS_INDEX:
369 372
370 /* Storing to an Index (pointer into a packager or buffer) */ 373 /* Storing to an Index (pointer into a packager or buffer) */
371 374
@@ -374,18 +377,18 @@ acpi_ex_store(union acpi_operand_object *source_desc,
374 walk_state); 377 walk_state);
375 break; 378 break;
376 379
377 case AML_LOCAL_OP: 380 case ACPI_REFCLASS_LOCAL:
378 case AML_ARG_OP: 381 case ACPI_REFCLASS_ARG:
379 382
380 /* Store to a method local/arg */ 383 /* Store to a method local/arg */
381 384
382 status = 385 status =
383 acpi_ds_store_object_to_local(ref_desc->reference.opcode, 386 acpi_ds_store_object_to_local(ref_desc->reference.class,
384 ref_desc->reference.offset, 387 ref_desc->reference.value,
385 source_desc, walk_state); 388 source_desc, walk_state);
386 break; 389 break;
387 390
388 case AML_DEBUG_OP: 391 case ACPI_REFCLASS_DEBUG:
389 392
390 /* 393 /*
391 * Storing to the Debug object causes the value stored to be 394 * Storing to the Debug object causes the value stored to be
@@ -401,8 +404,8 @@ acpi_ex_store(union acpi_operand_object *source_desc,
401 404
402 default: 405 default:
403 406
404 ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", 407 ACPI_ERROR((AE_INFO, "Unknown Reference Class %2.2X",
405 ref_desc->reference.opcode)); 408 ref_desc->reference.class));
406 ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_INFO); 409 ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_INFO);
407 410
408 status = AE_AML_INTERNAL; 411 status = AE_AML_INTERNAL;
@@ -458,7 +461,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
458 461
459 if (ACPI_GET_OBJECT_TYPE(source_desc) == 462 if (ACPI_GET_OBJECT_TYPE(source_desc) ==
460 ACPI_TYPE_LOCAL_REFERENCE 463 ACPI_TYPE_LOCAL_REFERENCE
461 && source_desc->reference.opcode == AML_LOAD_OP) { 464 && source_desc->reference.class == ACPI_REFCLASS_TABLE) {
462 465
463 /* This is a DDBHandle, just add a reference to it */ 466 /* This is a DDBHandle, just add a reference to it */
464 467
@@ -553,7 +556,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
553 556
554 /* Store the source value into the target buffer byte */ 557 /* Store the source value into the target buffer byte */
555 558
556 obj_desc->buffer.pointer[index_desc->reference.offset] = value; 559 obj_desc->buffer.pointer[index_desc->reference.value] = value;
557 break; 560 break;
558 561
559 default: 562 default: