aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/acpi/dispatcher/dsmthdat.c83
-rw-r--r--drivers/acpi/dispatcher/dsobject.c56
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c2
-rw-r--r--drivers/acpi/dispatcher/dswexec.c8
-rw-r--r--drivers/acpi/executer/exconfig.c3
-rw-r--r--drivers/acpi/executer/exdump.c74
-rw-r--r--drivers/acpi/executer/exmisc.c14
-rw-r--r--drivers/acpi/executer/exoparg1.c26
-rw-r--r--drivers/acpi/executer/exoparg2.c4
-rw-r--r--drivers/acpi/executer/exresnte.c16
-rw-r--r--drivers/acpi/executer/exresolv.c60
-rw-r--r--drivers/acpi/executer/exresop.c50
-rw-r--r--drivers/acpi/executer/exstore.c57
-rw-r--r--drivers/acpi/executer/exstoren.c3
-rw-r--r--drivers/acpi/namespace/nsdump.c5
-rw-r--r--drivers/acpi/namespace/nsxfeval.c7
-rw-r--r--drivers/acpi/resources/rscalc.c5
-rw-r--r--drivers/acpi/resources/rscreate.c10
-rw-r--r--drivers/acpi/utilities/utcopy.c29
-rw-r--r--drivers/acpi/utilities/utdelete.c5
-rw-r--r--drivers/acpi/utilities/utglobal.c35
-rw-r--r--drivers/acpi/utilities/utobject.c9
-rw-r--r--include/acpi/acdebug.h4
-rw-r--r--include/acpi/acdispat.h6
-rw-r--r--include/acpi/acobject.h31
25 files changed, 310 insertions, 292 deletions
diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
index 13c43eac35db..d03f81bd1bcb 100644
--- a/drivers/acpi/dispatcher/dsmthdat.c
+++ b/drivers/acpi/dispatcher/dsmthdat.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acdispat.h> 45#include <acpi/acdispat.h>
46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
48#include <acpi/acinterp.h> 47#include <acpi/acinterp.h>
49 48
@@ -52,11 +51,11 @@ ACPI_MODULE_NAME("dsmthdat")
52 51
53/* Local prototypes */ 52/* Local prototypes */
54static void 53static void
55acpi_ds_method_data_delete_value(u16 opcode, 54acpi_ds_method_data_delete_value(u8 type,
56 u32 index, struct acpi_walk_state *walk_state); 55 u32 index, struct acpi_walk_state *walk_state);
57 56
58static acpi_status 57static acpi_status
59acpi_ds_method_data_set_value(u16 opcode, 58acpi_ds_method_data_set_value(u8 type,
60 u32 index, 59 u32 index,
61 union acpi_operand_object *object, 60 union acpi_operand_object *object,
62 struct acpi_walk_state *walk_state); 61 struct acpi_walk_state *walk_state);
@@ -216,7 +215,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
216 * Store the argument in the method/walk descriptor. 215 * Store the argument in the method/walk descriptor.
217 * Do not copy the arg in order to implement call by reference 216 * Do not copy the arg in order to implement call by reference
218 */ 217 */
219 status = acpi_ds_method_data_set_value(AML_ARG_OP, index, 218 status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
220 params[index], 219 params[index],
221 walk_state); 220 walk_state);
222 if (ACPI_FAILURE(status)) { 221 if (ACPI_FAILURE(status)) {
@@ -234,7 +233,8 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
234 * 233 *
235 * FUNCTION: acpi_ds_method_data_get_node 234 * FUNCTION: acpi_ds_method_data_get_node
236 * 235 *
237 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP 236 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
237 * ACPI_REFCLASS_ARG
238 * Index - Which Local or Arg whose type to get 238 * Index - Which Local or Arg whose type to get
239 * walk_state - Current walk state object 239 * walk_state - Current walk state object
240 * Node - Where the node is returned. 240 * Node - Where the node is returned.
@@ -246,7 +246,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
246 ******************************************************************************/ 246 ******************************************************************************/
247 247
248acpi_status 248acpi_status
249acpi_ds_method_data_get_node(u16 opcode, 249acpi_ds_method_data_get_node(u8 type,
250 u32 index, 250 u32 index,
251 struct acpi_walk_state *walk_state, 251 struct acpi_walk_state *walk_state,
252 struct acpi_namespace_node **node) 252 struct acpi_namespace_node **node)
@@ -256,8 +256,8 @@ acpi_ds_method_data_get_node(u16 opcode,
256 /* 256 /*
257 * Method Locals and Arguments are supported 257 * Method Locals and Arguments are supported
258 */ 258 */
259 switch (opcode) { 259 switch (type) {
260 case AML_LOCAL_OP: 260 case ACPI_REFCLASS_LOCAL:
261 261
262 if (index > ACPI_METHOD_MAX_LOCAL) { 262 if (index > ACPI_METHOD_MAX_LOCAL) {
263 ACPI_ERROR((AE_INFO, 263 ACPI_ERROR((AE_INFO,
@@ -271,7 +271,7 @@ acpi_ds_method_data_get_node(u16 opcode,
271 *node = &walk_state->local_variables[index]; 271 *node = &walk_state->local_variables[index];
272 break; 272 break;
273 273
274 case AML_ARG_OP: 274 case ACPI_REFCLASS_ARG:
275 275
276 if (index > ACPI_METHOD_MAX_ARG) { 276 if (index > ACPI_METHOD_MAX_ARG) {
277 ACPI_ERROR((AE_INFO, 277 ACPI_ERROR((AE_INFO,
@@ -286,8 +286,8 @@ acpi_ds_method_data_get_node(u16 opcode,
286 break; 286 break;
287 287
288 default: 288 default:
289 ACPI_ERROR((AE_INFO, "Opcode %d is invalid", opcode)); 289 ACPI_ERROR((AE_INFO, "Type %d is invalid", type));
290 return_ACPI_STATUS(AE_AML_BAD_OPCODE); 290 return_ACPI_STATUS(AE_TYPE);
291 } 291 }
292 292
293 return_ACPI_STATUS(AE_OK); 293 return_ACPI_STATUS(AE_OK);
@@ -297,7 +297,8 @@ acpi_ds_method_data_get_node(u16 opcode,
297 * 297 *
298 * FUNCTION: acpi_ds_method_data_set_value 298 * FUNCTION: acpi_ds_method_data_set_value
299 * 299 *
300 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP 300 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
301 * ACPI_REFCLASS_ARG
301 * Index - Which Local or Arg to get 302 * Index - Which Local or Arg to get
302 * Object - Object to be inserted into the stack entry 303 * Object - Object to be inserted into the stack entry
303 * walk_state - Current walk state object 304 * walk_state - Current walk state object
@@ -310,7 +311,7 @@ acpi_ds_method_data_get_node(u16 opcode,
310 ******************************************************************************/ 311 ******************************************************************************/
311 312
312static acpi_status 313static acpi_status
313acpi_ds_method_data_set_value(u16 opcode, 314acpi_ds_method_data_set_value(u8 type,
314 u32 index, 315 u32 index,
315 union acpi_operand_object *object, 316 union acpi_operand_object *object,
316 struct acpi_walk_state *walk_state) 317 struct acpi_walk_state *walk_state)
@@ -321,13 +322,13 @@ acpi_ds_method_data_set_value(u16 opcode,
321 ACPI_FUNCTION_TRACE(ds_method_data_set_value); 322 ACPI_FUNCTION_TRACE(ds_method_data_set_value);
322 323
323 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 324 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
324 "NewObj %p Opcode %X, Refs=%d [%s]\n", object, 325 "NewObj %p Type %2.2X, Refs=%d [%s]\n", object,
325 opcode, object->common.reference_count, 326 type, object->common.reference_count,
326 acpi_ut_get_type_name(object->common.type))); 327 acpi_ut_get_type_name(object->common.type)));
327 328
328 /* Get the namespace node for the arg/local */ 329 /* Get the namespace node for the arg/local */
329 330
330 status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node); 331 status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
331 if (ACPI_FAILURE(status)) { 332 if (ACPI_FAILURE(status)) {
332 return_ACPI_STATUS(status); 333 return_ACPI_STATUS(status);
333 } 334 }
@@ -350,7 +351,8 @@ acpi_ds_method_data_set_value(u16 opcode,
350 * 351 *
351 * FUNCTION: acpi_ds_method_data_get_value 352 * FUNCTION: acpi_ds_method_data_get_value
352 * 353 *
353 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP 354 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
355 * ACPI_REFCLASS_ARG
354 * Index - Which local_var or argument to get 356 * Index - Which local_var or argument to get
355 * walk_state - Current walk state object 357 * walk_state - Current walk state object
356 * dest_desc - Where Arg or Local value is returned 358 * dest_desc - Where Arg or Local value is returned
@@ -363,7 +365,7 @@ acpi_ds_method_data_set_value(u16 opcode,
363 ******************************************************************************/ 365 ******************************************************************************/
364 366
365acpi_status 367acpi_status
366acpi_ds_method_data_get_value(u16 opcode, 368acpi_ds_method_data_get_value(u8 type,
367 u32 index, 369 u32 index,
368 struct acpi_walk_state *walk_state, 370 struct acpi_walk_state *walk_state,
369 union acpi_operand_object **dest_desc) 371 union acpi_operand_object **dest_desc)
@@ -383,7 +385,7 @@ acpi_ds_method_data_get_value(u16 opcode,
383 385
384 /* Get the namespace node for the arg/local */ 386 /* Get the namespace node for the arg/local */
385 387
386 status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node); 388 status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
387 if (ACPI_FAILURE(status)) { 389 if (ACPI_FAILURE(status)) {
388 return_ACPI_STATUS(status); 390 return_ACPI_STATUS(status);
389 } 391 }
@@ -419,8 +421,8 @@ acpi_ds_method_data_get_value(u16 opcode,
419 /* Otherwise, return the error */ 421 /* Otherwise, return the error */
420 422
421 else 423 else
422 switch (opcode) { 424 switch (type) {
423 case AML_ARG_OP: 425 case ACPI_REFCLASS_ARG:
424 426
425 ACPI_ERROR((AE_INFO, 427 ACPI_ERROR((AE_INFO,
426 "Uninitialized Arg[%d] at node %p", 428 "Uninitialized Arg[%d] at node %p",
@@ -428,7 +430,7 @@ acpi_ds_method_data_get_value(u16 opcode,
428 430
429 return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG); 431 return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);
430 432
431 case AML_LOCAL_OP: 433 case ACPI_REFCLASS_LOCAL:
432 434
433 ACPI_ERROR((AE_INFO, 435 ACPI_ERROR((AE_INFO,
434 "Uninitialized Local[%d] at node %p", 436 "Uninitialized Local[%d] at node %p",
@@ -437,9 +439,10 @@ acpi_ds_method_data_get_value(u16 opcode,
437 return_ACPI_STATUS(AE_AML_UNINITIALIZED_LOCAL); 439 return_ACPI_STATUS(AE_AML_UNINITIALIZED_LOCAL);
438 440
439 default: 441 default:
442
440 ACPI_ERROR((AE_INFO, 443 ACPI_ERROR((AE_INFO,
441 "Not a Arg/Local opcode: %X", 444 "Not a Arg/Local opcode: %X",
442 opcode)); 445 type));
443 return_ACPI_STATUS(AE_AML_INTERNAL); 446 return_ACPI_STATUS(AE_AML_INTERNAL);
444 } 447 }
445 } 448 }
@@ -458,7 +461,8 @@ acpi_ds_method_data_get_value(u16 opcode,
458 * 461 *
459 * FUNCTION: acpi_ds_method_data_delete_value 462 * FUNCTION: acpi_ds_method_data_delete_value
460 * 463 *
461 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP 464 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
465 * ACPI_REFCLASS_ARG
462 * Index - Which local_var or argument to delete 466 * Index - Which local_var or argument to delete
463 * walk_state - Current walk state object 467 * walk_state - Current walk state object
464 * 468 *
@@ -470,7 +474,7 @@ acpi_ds_method_data_get_value(u16 opcode,
470 ******************************************************************************/ 474 ******************************************************************************/
471 475
472static void 476static void
473acpi_ds_method_data_delete_value(u16 opcode, 477acpi_ds_method_data_delete_value(u8 type,
474 u32 index, struct acpi_walk_state *walk_state) 478 u32 index, struct acpi_walk_state *walk_state)
475{ 479{
476 acpi_status status; 480 acpi_status status;
@@ -481,7 +485,7 @@ acpi_ds_method_data_delete_value(u16 opcode,
481 485
482 /* Get the namespace node for the arg/local */ 486 /* Get the namespace node for the arg/local */
483 487
484 status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node); 488 status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
485 if (ACPI_FAILURE(status)) { 489 if (ACPI_FAILURE(status)) {
486 return_VOID; 490 return_VOID;
487 } 491 }
@@ -514,7 +518,8 @@ acpi_ds_method_data_delete_value(u16 opcode,
514 * 518 *
515 * FUNCTION: acpi_ds_store_object_to_local 519 * FUNCTION: acpi_ds_store_object_to_local
516 * 520 *
517 * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP 521 * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
522 * ACPI_REFCLASS_ARG
518 * Index - Which Local or Arg to set 523 * Index - Which Local or Arg to set
519 * obj_desc - Value to be stored 524 * obj_desc - Value to be stored
520 * walk_state - Current walk state 525 * walk_state - Current walk state
@@ -528,7 +533,7 @@ acpi_ds_method_data_delete_value(u16 opcode,
528 ******************************************************************************/ 533 ******************************************************************************/
529 534
530acpi_status 535acpi_status
531acpi_ds_store_object_to_local(u16 opcode, 536acpi_ds_store_object_to_local(u8 type,
532 u32 index, 537 u32 index,
533 union acpi_operand_object *obj_desc, 538 union acpi_operand_object *obj_desc,
534 struct acpi_walk_state *walk_state) 539 struct acpi_walk_state *walk_state)
@@ -539,8 +544,8 @@ acpi_ds_store_object_to_local(u16 opcode,
539 union acpi_operand_object *new_obj_desc; 544 union acpi_operand_object *new_obj_desc;
540 545
541 ACPI_FUNCTION_TRACE(ds_store_object_to_local); 546 ACPI_FUNCTION_TRACE(ds_store_object_to_local);
542 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Opcode=%X Index=%d Obj=%p\n", 547 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Type=%2.2X Index=%d Obj=%p\n",
543 opcode, index, obj_desc)); 548 type, index, obj_desc));
544 549
545 /* Parameter validation */ 550 /* Parameter validation */
546 551
@@ -550,7 +555,7 @@ acpi_ds_store_object_to_local(u16 opcode,
550 555
551 /* Get the namespace node for the arg/local */ 556 /* Get the namespace node for the arg/local */
552 557
553 status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node); 558 status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
554 if (ACPI_FAILURE(status)) { 559 if (ACPI_FAILURE(status)) {
555 return_ACPI_STATUS(status); 560 return_ACPI_STATUS(status);
556 } 561 }
@@ -602,7 +607,7 @@ acpi_ds_store_object_to_local(u16 opcode,
602 * 607 *
603 * Weird, but true. 608 * Weird, but true.
604 */ 609 */
605 if (opcode == AML_ARG_OP) { 610 if (type == ACPI_REFCLASS_ARG) {
606 /* 611 /*
607 * If we have a valid reference object that came from ref_of(), 612 * If we have a valid reference object that came from ref_of(),
608 * do the indirect store 613 * do the indirect store
@@ -611,8 +616,8 @@ acpi_ds_store_object_to_local(u16 opcode,
611 ACPI_DESC_TYPE_OPERAND) 616 ACPI_DESC_TYPE_OPERAND)
612 && (current_obj_desc->common.type == 617 && (current_obj_desc->common.type ==
613 ACPI_TYPE_LOCAL_REFERENCE) 618 ACPI_TYPE_LOCAL_REFERENCE)
614 && (current_obj_desc->reference.opcode == 619 && (current_obj_desc->reference.class ==
615 AML_REF_OF_OP)) { 620 ACPI_REFCLASS_REFOF)) {
616 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 621 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
617 "Arg (%p) is an ObjRef(Node), storing in node %p\n", 622 "Arg (%p) is an ObjRef(Node), storing in node %p\n",
618 new_obj_desc, 623 new_obj_desc,
@@ -640,11 +645,9 @@ acpi_ds_store_object_to_local(u16 opcode,
640 } 645 }
641 } 646 }
642 647
643 /* 648 /* Delete the existing object before storing the new one */
644 * Delete the existing object 649
645 * before storing the new one 650 acpi_ds_method_data_delete_value(type, index, walk_state);
646 */
647 acpi_ds_method_data_delete_value(opcode, index, walk_state);
648 } 651 }
649 652
650 /* 653 /*
@@ -653,7 +656,7 @@ acpi_ds_store_object_to_local(u16 opcode,
653 * (increments the object reference count by one) 656 * (increments the object reference count by one)
654 */ 657 */
655 status = 658 status =
656 acpi_ds_method_data_set_value(opcode, index, new_obj_desc, 659 acpi_ds_method_data_set_value(type, index, new_obj_desc,
657 walk_state); 660 walk_state);
658 661
659 /* Remove local reference if we copied the object above */ 662 /* Remove local reference if we copied the object above */
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 09af39fff1a3..4f08e599d07e 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -731,36 +731,35 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
731 switch (op_info->type) { 731 switch (op_info->type) {
732 case AML_TYPE_LOCAL_VARIABLE: 732 case AML_TYPE_LOCAL_VARIABLE:
733 733
734 /* Split the opcode into a base opcode + offset */ 734 /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */
735 735
736 obj_desc->reference.opcode = AML_LOCAL_OP; 736 obj_desc->reference.value = opcode - AML_LOCAL_OP;
737 obj_desc->reference.offset = opcode - AML_LOCAL_OP; 737 obj_desc->reference.class = ACPI_REFCLASS_LOCAL;
738 738
739#ifndef ACPI_NO_METHOD_EXECUTION 739#ifndef ACPI_NO_METHOD_EXECUTION
740 status = acpi_ds_method_data_get_node(AML_LOCAL_OP, 740 status =
741 obj_desc-> 741 acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL,
742 reference.offset, 742 obj_desc->reference.
743 walk_state, 743 value, walk_state,
744 ACPI_CAST_INDIRECT_PTR 744 ACPI_CAST_INDIRECT_PTR
745 (struct 745 (struct
746 acpi_namespace_node, 746 acpi_namespace_node,
747 &obj_desc-> 747 &obj_desc->reference.
748 reference. 748 object));
749 object));
750#endif 749#endif
751 break; 750 break;
752 751
753 case AML_TYPE_METHOD_ARGUMENT: 752 case AML_TYPE_METHOD_ARGUMENT:
754 753
755 /* Split the opcode into a base opcode + offset */ 754 /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
756 755
757 obj_desc->reference.opcode = AML_ARG_OP; 756 obj_desc->reference.value = opcode - AML_ARG_OP;
758 obj_desc->reference.offset = opcode - AML_ARG_OP; 757 obj_desc->reference.class = ACPI_REFCLASS_ARG;
759 758
760#ifndef ACPI_NO_METHOD_EXECUTION 759#ifndef ACPI_NO_METHOD_EXECUTION
761 status = acpi_ds_method_data_get_node(AML_ARG_OP, 760 status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG,
762 obj_desc-> 761 obj_desc->
763 reference.offset, 762 reference.value,
764 walk_state, 763 walk_state,
765 ACPI_CAST_INDIRECT_PTR 764 ACPI_CAST_INDIRECT_PTR
766 (struct 765 (struct
@@ -771,18 +770,31 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
771#endif 770#endif
772 break; 771 break;
773 772
774 default: /* Other literals, etc.. */ 773 default: /* Object name or Debug object */
775 774
776 if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { 775 switch (op->common.aml_opcode) {
776 case AML_INT_NAMEPATH_OP:
777 777
778 /* Node was saved in Op */ 778 /* Node was saved in Op */
779 779
780 obj_desc->reference.node = op->common.node; 780 obj_desc->reference.node = op->common.node;
781 obj_desc->reference.object = 781 obj_desc->reference.object =
782 op->common.node->object; 782 op->common.node->object;
783 } 783 obj_desc->reference.class = ACPI_REFCLASS_NAME;
784 break;
785
786 case AML_DEBUG_OP:
784 787
785 obj_desc->reference.opcode = opcode; 788 obj_desc->reference.class = ACPI_REFCLASS_DEBUG;
789 break;
790
791 default:
792
793 ACPI_ERROR((AE_INFO,
794 "Unimplemented reference type for AML opcode: %4.4X",
795 opcode));
796 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
797 }
786 break; 798 break;
787 } 799 }
788 break; 800 break;
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index 6a81c4400edf..69fae5905bb8 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -1330,7 +1330,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
1330 (walk_state->results->results.obj_desc[0]) == 1330 (walk_state->results->results.obj_desc[0]) ==
1331 ACPI_TYPE_LOCAL_REFERENCE) 1331 ACPI_TYPE_LOCAL_REFERENCE)
1332 && ((walk_state->results->results.obj_desc[0])-> 1332 && ((walk_state->results->results.obj_desc[0])->
1333 reference.opcode != AML_INDEX_OP)) { 1333 reference.class != ACPI_REFCLASS_INDEX)) {
1334 status = 1334 status =
1335 acpi_ex_resolve_to_value(&walk_state-> 1335 acpi_ex_resolve_to_value(&walk_state->
1336 results->results. 1336 results->results.
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index b5072fa9c920..5b2419197b9b 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -429,10 +429,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
429 ACPI_TYPE_LOCAL_REFERENCE) 429 ACPI_TYPE_LOCAL_REFERENCE)
430 && (walk_state->operands[1]->common.type == 430 && (walk_state->operands[1]->common.type ==
431 ACPI_TYPE_LOCAL_REFERENCE) 431 ACPI_TYPE_LOCAL_REFERENCE)
432 && (walk_state->operands[0]->reference.opcode == 432 && (walk_state->operands[0]->reference.class ==
433 walk_state->operands[1]->reference.opcode) 433 walk_state->operands[1]->reference.class)
434 && (walk_state->operands[0]->reference.offset == 434 && (walk_state->operands[0]->reference.value ==
435 walk_state->operands[1]->reference.offset)) { 435 walk_state->operands[1]->reference.value)) {
436 status = AE_OK; 436 status = AE_OK;
437 } else { 437 } else {
438 ACPI_EXCEPTION((AE_INFO, status, 438 ACPI_EXCEPTION((AE_INFO, status,
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 5f2b1ebf70a3..74da6fa52ef1 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acinterp.h> 45#include <acpi/acinterp.h>
46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
48#include <acpi/actables.h> 47#include <acpi/actables.h>
49#include <acpi/acdispat.h> 48#include <acpi/acdispat.h>
@@ -91,7 +90,7 @@ acpi_ex_add_table(u32 table_index,
91 90
92 /* Init the table handle */ 91 /* Init the table handle */
93 92
94 obj_desc->reference.opcode = AML_LOAD_OP; 93 obj_desc->reference.class = ACPI_REFCLASS_TABLE;
95 *ddb_handle = obj_desc; 94 *ddb_handle = obj_desc;
96 95
97 /* Install the new table into the local data structures */ 96 /* Install the new table into the local data structures */
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 7d4123256cf1..d087a7d28aa5 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -45,7 +45,6 @@
45#include <acpi/acinterp.h> 45#include <acpi/acinterp.h>
46#include <acpi/amlcode.h> 46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
48#include <acpi/acparser.h>
49 48
50#define _COMPONENT ACPI_EXECUTER 49#define _COMPONENT ACPI_EXECUTER
51ACPI_MODULE_NAME("exdump") 50ACPI_MODULE_NAME("exdump")
@@ -216,8 +215,8 @@ static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
216 215
217static struct acpi_exdump_info acpi_ex_dump_reference[8] = { 216static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
218 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL}, 217 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
218 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
219 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"}, 219 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
220 {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.offset), "Offset"},
221 {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"}, 220 {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
222 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"}, 221 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
223 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"}, 222 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"},
@@ -414,10 +413,10 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
414 413
415 case ACPI_EXD_REFERENCE: 414 case ACPI_EXD_REFERENCE:
416 415
417 acpi_ex_out_string("Opcode", 416 acpi_ex_out_string("Class Name",
418 (acpi_ps_get_opcode_info 417 (char *)
419 (obj_desc->reference.opcode))-> 418 acpi_ut_get_reference_name
420 name); 419 (obj_desc));
421 acpi_ex_dump_reference_obj(obj_desc); 420 acpi_ex_dump_reference_obj(obj_desc);
422 break; 421 break;
423 422
@@ -495,40 +494,41 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
495 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { 494 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
496 case ACPI_TYPE_LOCAL_REFERENCE: 495 case ACPI_TYPE_LOCAL_REFERENCE:
497 496
498 switch (obj_desc->reference.opcode) { 497 acpi_os_printf("Reference: [%s] ",
499 case AML_DEBUG_OP: 498 acpi_ut_get_reference_name(obj_desc));
499
500 switch (obj_desc->reference.class) {
501 case ACPI_REFCLASS_DEBUG:
500 502
501 acpi_os_printf("Reference: [Debug]\n"); 503 acpi_os_printf("\n");
502 break; 504 break;
503 505
504 case AML_INDEX_OP: 506 case ACPI_REFCLASS_INDEX:
505 507
506 acpi_os_printf("Reference: [Index] %p\n", 508 acpi_os_printf("%p\n", obj_desc->reference.object);
507 obj_desc->reference.object);
508 break; 509 break;
509 510
510 case AML_LOAD_OP: 511 case ACPI_REFCLASS_TABLE:
511 512
512 acpi_os_printf("Reference: [DdbHandle] TableIndex %X\n", 513 acpi_os_printf("Table Index %X\n",
513 obj_desc->reference.value); 514 obj_desc->reference.value);
514 break; 515 break;
515 516
516 case AML_REF_OF_OP: 517 case ACPI_REFCLASS_REFOF:
517 518
518 acpi_os_printf("Reference: [RefOf] %p [%s]\n", 519 acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
519 obj_desc->reference.object,
520 acpi_ut_get_type_name(((union 520 acpi_ut_get_type_name(((union
521 acpi_operand_object 521 acpi_operand_object
522 *)obj_desc-> 522 *)
523 obj_desc->
523 reference. 524 reference.
524 object)->common. 525 object)->common.
525 type)); 526 type));
526 break; 527 break;
527 528
528 case AML_ARG_OP: 529 case ACPI_REFCLASS_ARG:
529 530
530 acpi_os_printf("Reference: [Arg%d]", 531 acpi_os_printf("%X", obj_desc->reference.value);
531 obj_desc->reference.offset);
532 532
533 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 533 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
534 534
@@ -543,10 +543,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
543 acpi_os_printf("\n"); 543 acpi_os_printf("\n");
544 break; 544 break;
545 545
546 case AML_LOCAL_OP: 546 case ACPI_REFCLASS_LOCAL:
547 547
548 acpi_os_printf("Reference: [Local%d]", 548 acpi_os_printf("%X", obj_desc->reference.value);
549 obj_desc->reference.offset);
550 549
551 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 550 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
552 551
@@ -561,21 +560,16 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
561 acpi_os_printf("\n"); 560 acpi_os_printf("\n");
562 break; 561 break;
563 562
564 case AML_INT_NAMEPATH_OP: 563 case ACPI_REFCLASS_NAME:
565 564
566 acpi_os_printf("Reference: [Namepath] %X [%4.4s]\n", 565 acpi_os_printf("- [%4.4s]\n",
567 obj_desc->reference.node->name.integer,
568 obj_desc->reference.node->name.ascii); 566 obj_desc->reference.node->name.ascii);
569 break; 567 break;
570 568
571 default: 569 default: /* Unknown reference class */
572
573 /* Unknown opcode */
574 570
575 acpi_os_printf("Unknown Reference opcode=%X\n", 571 acpi_os_printf("%2.2X\n", obj_desc->reference.class);
576 obj_desc->reference.opcode);
577 break; 572 break;
578
579 } 573 }
580 break; 574 break;
581 575
@@ -866,8 +860,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
866 860
867 ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER; 861 ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
868 862
869 if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) { 863 if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
870 acpi_os_printf(" Named Object %p ", obj_desc->reference.node); 864 acpi_os_printf(" %p ", obj_desc->reference.node);
871 865
872 status = 866 status =
873 acpi_ns_handle_to_pathname(obj_desc->reference.node, 867 acpi_ns_handle_to_pathname(obj_desc->reference.node,
@@ -883,8 +877,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
883 ACPI_DESC_TYPE_OPERAND) { 877 ACPI_DESC_TYPE_OPERAND) {
884 acpi_os_printf(" Target: %p", 878 acpi_os_printf(" Target: %p",
885 obj_desc->reference.object); 879 obj_desc->reference.object);
886 if (obj_desc->reference.opcode == AML_LOAD_OP) { 880 if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
887 acpi_os_printf(" [DDBHandle] Table Index: %X\n", 881 acpi_os_printf(" Table Index: %X\n",
888 obj_desc->reference.value); 882 obj_desc->reference.value);
889 } else { 883 } else {
890 acpi_os_printf(" Target: %p [%s]\n", 884 acpi_os_printf(" Target: %p [%s]\n",
@@ -987,9 +981,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
987 981
988 case ACPI_TYPE_LOCAL_REFERENCE: 982 case ACPI_TYPE_LOCAL_REFERENCE:
989 983
990 acpi_os_printf("[Object Reference] %s", 984 acpi_os_printf("[Object Reference] Type [%s] %2.2X",
991 (acpi_ps_get_opcode_info 985 acpi_ut_get_reference_name(obj_desc),
992 (obj_desc->reference.opcode))->name); 986 obj_desc->reference.class);
993 acpi_ex_dump_reference_obj(obj_desc); 987 acpi_ex_dump_reference_obj(obj_desc);
994 break; 988 break;
995 989
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index 731414a581a6..efb191340059 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -86,10 +86,10 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
86 /* 86 /*
87 * Must be a reference to a Local or Arg 87 * Must be a reference to a Local or Arg
88 */ 88 */
89 switch (obj_desc->reference.opcode) { 89 switch (obj_desc->reference.class) {
90 case AML_LOCAL_OP: 90 case ACPI_REFCLASS_LOCAL:
91 case AML_ARG_OP: 91 case ACPI_REFCLASS_ARG:
92 case AML_DEBUG_OP: 92 case ACPI_REFCLASS_DEBUG:
93 93
94 /* The referenced object is the pseudo-node for the local/arg */ 94 /* The referenced object is the pseudo-node for the local/arg */
95 95
@@ -98,8 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
98 98
99 default: 99 default:
100 100
101 ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", 101 ACPI_ERROR((AE_INFO, "Unknown Reference Class %2.2X",
102 obj_desc->reference.opcode)); 102 obj_desc->reference.class));
103 return_ACPI_STATUS(AE_AML_INTERNAL); 103 return_ACPI_STATUS(AE_AML_INTERNAL);
104 } 104 }
105 break; 105 break;
@@ -127,7 +127,7 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
127 return_ACPI_STATUS(AE_NO_MEMORY); 127 return_ACPI_STATUS(AE_NO_MEMORY);
128 } 128 }
129 129
130 reference_obj->reference.opcode = AML_REF_OF_OP; 130 reference_obj->reference.class = ACPI_REFCLASS_REFOF;
131 reference_obj->reference.object = referenced_obj; 131 reference_obj->reference.object = referenced_obj;
132 *return_desc = reference_obj; 132 *return_desc = reference_obj;
133 133
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 7c3bea575e02..f622f9eac8a1 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -825,16 +825,16 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
825 * 825 *
826 * Must resolve/dereference the local/arg reference first 826 * Must resolve/dereference the local/arg reference first
827 */ 827 */
828 switch (operand[0]->reference.opcode) { 828 switch (operand[0]->reference.class) {
829 case AML_LOCAL_OP: 829 case ACPI_REFCLASS_LOCAL:
830 case AML_ARG_OP: 830 case ACPI_REFCLASS_ARG:
831 831
832 /* Set Operand[0] to the value of the local/arg */ 832 /* Set Operand[0] to the value of the local/arg */
833 833
834 status = 834 status =
835 acpi_ds_method_data_get_value 835 acpi_ds_method_data_get_value
836 (operand[0]->reference.opcode, 836 (operand[0]->reference.class,
837 operand[0]->reference.offset, 837 operand[0]->reference.value,
838 walk_state, &temp_desc); 838 walk_state, &temp_desc);
839 if (ACPI_FAILURE(status)) { 839 if (ACPI_FAILURE(status)) {
840 goto cleanup; 840 goto cleanup;
@@ -848,7 +848,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
848 operand[0] = temp_desc; 848 operand[0] = temp_desc;
849 break; 849 break;
850 850
851 case AML_REF_OF_OP: 851 case ACPI_REFCLASS_REFOF:
852 852
853 /* Get the object to which the reference refers */ 853 /* Get the object to which the reference refers */
854 854
@@ -928,8 +928,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
928 * This must be a reference object produced by either the 928 * This must be a reference object produced by either the
929 * Index() or ref_of() operator 929 * Index() or ref_of() operator
930 */ 930 */
931 switch (operand[0]->reference.opcode) { 931 switch (operand[0]->reference.class) {
932 case AML_INDEX_OP: 932 case ACPI_REFCLASS_INDEX:
933 933
934 /* 934 /*
935 * The target type for the Index operator must be 935 * The target type for the Index operator must be
@@ -965,7 +965,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
965 return_desc->integer.value = 965 return_desc->integer.value =
966 temp_desc->buffer. 966 temp_desc->buffer.
967 pointer[operand[0]->reference. 967 pointer[operand[0]->reference.
968 offset]; 968 value];
969 break; 969 break;
970 970
971 case ACPI_TYPE_PACKAGE: 971 case ACPI_TYPE_PACKAGE:
@@ -985,7 +985,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
985 default: 985 default:
986 986
987 ACPI_ERROR((AE_INFO, 987 ACPI_ERROR((AE_INFO,
988 "Unknown Index TargetType %X in obj %p", 988 "Unknown Index TargetType %X in reference object %p",
989 operand[0]->reference. 989 operand[0]->reference.
990 target_type, operand[0])); 990 target_type, operand[0]));
991 status = AE_AML_OPERAND_TYPE; 991 status = AE_AML_OPERAND_TYPE;
@@ -993,7 +993,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
993 } 993 }
994 break; 994 break;
995 995
996 case AML_REF_OF_OP: 996 case ACPI_REFCLASS_REFOF:
997 997
998 return_desc = operand[0]->reference.object; 998 return_desc = operand[0]->reference.object;
999 999
@@ -1013,9 +1013,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
1013 1013
1014 default: 1014 default:
1015 ACPI_ERROR((AE_INFO, 1015 ACPI_ERROR((AE_INFO,
1016 "Unknown opcode in reference(%p) - %X", 1016 "Unknown class in reference(%p) - %2.2X",
1017 operand[0], 1017 operand[0],
1018 operand[0]->reference.opcode)); 1018 operand[0]->reference.class));
1019 1019
1020 status = AE_TYPE; 1020 status = AE_TYPE;
1021 goto cleanup; 1021 goto cleanup;
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 8e8bbb6ccebd..368def5dffce 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -391,8 +391,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
391 /* Initialize the Index reference object */ 391 /* Initialize the Index reference object */
392 392
393 index = operand[1]->integer.value; 393 index = operand[1]->integer.value;
394 return_desc->reference.offset = (u32) index; 394 return_desc->reference.value = (u32) index;
395 return_desc->reference.opcode = AML_INDEX_OP; 395 return_desc->reference.class = ACPI_REFCLASS_INDEX;
396 396
397 /* 397 /*
398 * At this point, the Source operand is a String, Buffer, or Package. 398 * At this point, the Source operand is a String, Buffer, or Package.
diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index 5596f42c9676..423ad3635f3d 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -46,8 +46,6 @@
46#include <acpi/acdispat.h> 46#include <acpi/acdispat.h>
47#include <acpi/acinterp.h> 47#include <acpi/acinterp.h>
48#include <acpi/acnamesp.h> 48#include <acpi/acnamesp.h>
49#include <acpi/acparser.h>
50#include <acpi/amlcode.h>
51 49
52#define _COMPONENT ACPI_EXECUTER 50#define _COMPONENT ACPI_EXECUTER
53ACPI_MODULE_NAME("exresnte") 51ACPI_MODULE_NAME("exresnte")
@@ -238,10 +236,10 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
238 236
239 case ACPI_TYPE_LOCAL_REFERENCE: 237 case ACPI_TYPE_LOCAL_REFERENCE:
240 238
241 switch (source_desc->reference.opcode) { 239 switch (source_desc->reference.class) {
242 case AML_LOAD_OP: /* This is a ddb_handle */ 240 case ACPI_REFCLASS_TABLE: /* This is a ddb_handle */
243 case AML_REF_OF_OP: 241 case ACPI_REFCLASS_REFOF:
244 case AML_INDEX_OP: 242 case ACPI_REFCLASS_INDEX:
245 243
246 /* Return an additional reference to the object */ 244 /* Return an additional reference to the object */
247 245
@@ -253,10 +251,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
253 /* No named references are allowed here */ 251 /* No named references are allowed here */
254 252
255 ACPI_ERROR((AE_INFO, 253 ACPI_ERROR((AE_INFO,
256 "Unsupported Reference opcode %X (%s)", 254 "Unsupported Reference type %X",
257 source_desc->reference.opcode, 255 source_desc->reference.class));
258 acpi_ps_get_opcode_name(source_desc->
259 reference.opcode)));
260 256
261 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 257 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
262 } 258 }
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index b35f7c817acf..89571b92a522 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -47,7 +47,6 @@
47#include <acpi/acdispat.h> 47#include <acpi/acdispat.h>
48#include <acpi/acinterp.h> 48#include <acpi/acinterp.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("exresolv") 52ACPI_MODULE_NAME("exresolv")
@@ -141,7 +140,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
141 acpi_status status = AE_OK; 140 acpi_status status = AE_OK;
142 union acpi_operand_object *stack_desc; 141 union acpi_operand_object *stack_desc;
143 union acpi_operand_object *obj_desc = NULL; 142 union acpi_operand_object *obj_desc = NULL;
144 u16 opcode; 143 u8 ref_type;
145 144
146 ACPI_FUNCTION_TRACE(ex_resolve_object_to_value); 145 ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
147 146
@@ -152,19 +151,19 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
152 switch (ACPI_GET_OBJECT_TYPE(stack_desc)) { 151 switch (ACPI_GET_OBJECT_TYPE(stack_desc)) {
153 case ACPI_TYPE_LOCAL_REFERENCE: 152 case ACPI_TYPE_LOCAL_REFERENCE:
154 153
155 opcode = stack_desc->reference.opcode; 154 ref_type = stack_desc->reference.class;
156 155
157 switch (opcode) { 156 switch (ref_type) {
158 case AML_LOCAL_OP: 157 case ACPI_REFCLASS_LOCAL:
159 case AML_ARG_OP: 158 case ACPI_REFCLASS_ARG:
160 159
161 /* 160 /*
162 * Get the local from the method's state info 161 * Get the local from the method's state info
163 * Note: this increments the local's object reference count 162 * Note: this increments the local's object reference count
164 */ 163 */
165 status = acpi_ds_method_data_get_value(opcode, 164 status = acpi_ds_method_data_get_value(ref_type,
166 stack_desc-> 165 stack_desc->
167 reference.offset, 166 reference.value,
168 walk_state, 167 walk_state,
169 &obj_desc); 168 &obj_desc);
170 if (ACPI_FAILURE(status)) { 169 if (ACPI_FAILURE(status)) {
@@ -173,7 +172,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
173 172
174 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 173 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
175 "[Arg/Local %X] ValueObj is %p\n", 174 "[Arg/Local %X] ValueObj is %p\n",
176 stack_desc->reference.offset, 175 stack_desc->reference.value,
177 obj_desc)); 176 obj_desc));
178 177
179 /* 178 /*
@@ -184,7 +183,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
184 *stack_ptr = obj_desc; 183 *stack_ptr = obj_desc;
185 break; 184 break;
186 185
187 case AML_INDEX_OP: 186 case ACPI_REFCLASS_INDEX:
188 187
189 switch (stack_desc->reference.target_type) { 188 switch (stack_desc->reference.target_type) {
190 case ACPI_TYPE_BUFFER_FIELD: 189 case ACPI_TYPE_BUFFER_FIELD:
@@ -239,15 +238,15 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
239 } 238 }
240 break; 239 break;
241 240
242 case AML_REF_OF_OP: 241 case ACPI_REFCLASS_REFOF:
243 case AML_DEBUG_OP: 242 case ACPI_REFCLASS_DEBUG:
244 case AML_LOAD_OP: 243 case ACPI_REFCLASS_TABLE:
245 244
246 /* Just leave the object as-is, do not dereference */ 245 /* Just leave the object as-is, do not dereference */
247 246
248 break; 247 break;
249 248
250 case AML_INT_NAMEPATH_OP: /* Reference to a named object */ 249 case ACPI_REFCLASS_NAME: /* Reference to a named object */
251 250
252 /* Dereference the name */ 251 /* Dereference the name */
253 252
@@ -273,8 +272,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
273 default: 272 default:
274 273
275 ACPI_ERROR((AE_INFO, 274 ACPI_ERROR((AE_INFO,
276 "Unknown Reference opcode %X (%s) in %p", 275 "Unknown Reference type %X in %p", ref_type,
277 opcode, acpi_ps_get_opcode_name(opcode),
278 stack_desc)); 276 stack_desc));
279 status = AE_AML_INTERNAL; 277 status = AE_AML_INTERNAL;
280 break; 278 break;
@@ -388,13 +386,13 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
388 * traversing the list of possibly many nested references. 386 * traversing the list of possibly many nested references.
389 */ 387 */
390 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { 388 while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
391 switch (obj_desc->reference.opcode) { 389 switch (obj_desc->reference.class) {
392 case AML_REF_OF_OP: 390 case ACPI_REFCLASS_REFOF:
393 case AML_INT_NAMEPATH_OP: 391 case ACPI_REFCLASS_NAME:
394 392
395 /* Dereference the reference pointer */ 393 /* Dereference the reference pointer */
396 394
397 if (obj_desc->reference.opcode == AML_REF_OF_OP) { 395 if (obj_desc->reference.class == ACPI_REFCLASS_REFOF) {
398 node = obj_desc->reference.object; 396 node = obj_desc->reference.object;
399 } else { /* AML_INT_NAMEPATH_OP */ 397 } else { /* AML_INT_NAMEPATH_OP */
400 398
@@ -429,7 +427,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
429 } 427 }
430 break; 428 break;
431 429
432 case AML_INDEX_OP: 430 case ACPI_REFCLASS_INDEX:
433 431
434 /* Get the type of this reference (index into another object) */ 432 /* Get the type of this reference (index into another object) */
435 433
@@ -455,22 +453,22 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
455 } 453 }
456 break; 454 break;
457 455
458 case AML_LOAD_OP: 456 case ACPI_REFCLASS_TABLE:
459 457
460 type = ACPI_TYPE_DDB_HANDLE; 458 type = ACPI_TYPE_DDB_HANDLE;
461 goto exit; 459 goto exit;
462 460
463 case AML_LOCAL_OP: 461 case ACPI_REFCLASS_LOCAL:
464 case AML_ARG_OP: 462 case ACPI_REFCLASS_ARG:
465 463
466 if (return_desc) { 464 if (return_desc) {
467 status = 465 status =
468 acpi_ds_method_data_get_value(obj_desc-> 466 acpi_ds_method_data_get_value(obj_desc->
469 reference. 467 reference.
470 opcode, 468 class,
471 obj_desc-> 469 obj_desc->
472 reference. 470 reference.
473 offset, 471 value,
474 walk_state, 472 walk_state,
475 &obj_desc); 473 &obj_desc);
476 if (ACPI_FAILURE(status)) { 474 if (ACPI_FAILURE(status)) {
@@ -481,10 +479,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
481 status = 479 status =
482 acpi_ds_method_data_get_node(obj_desc-> 480 acpi_ds_method_data_get_node(obj_desc->
483 reference. 481 reference.
484 opcode, 482 class,
485 obj_desc-> 483 obj_desc->
486 reference. 484 reference.
487 offset, 485 value,
488 walk_state, 486 walk_state,
489 &node); 487 &node);
490 if (ACPI_FAILURE(status)) { 488 if (ACPI_FAILURE(status)) {
@@ -499,7 +497,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
499 } 497 }
500 break; 498 break;
501 499
502 case AML_DEBUG_OP: 500 case ACPI_REFCLASS_DEBUG:
503 501
504 /* The Debug Object is of type "DebugObject" */ 502 /* The Debug Object is of type "DebugObject" */
505 503
@@ -509,8 +507,8 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
509 default: 507 default:
510 508
511 ACPI_ERROR((AE_INFO, 509 ACPI_ERROR((AE_INFO,
512 "Unknown Reference subtype %X", 510 "Unknown Reference Class %2.2X",
513 obj_desc->reference.opcode)); 511 obj_desc->reference.class));
514 return_ACPI_STATUS(AE_AML_INTERNAL); 512 return_ACPI_STATUS(AE_AML_INTERNAL);
515 } 513 }
516 } 514 }
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index 54085f16ec28..0bb82593da72 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -225,41 +225,36 @@ acpi_ex_resolve_operands(u16 opcode,
225 225
226 if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) { 226 if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
227 227
228 /* Decode the Reference */ 228 /* Validate the Reference */
229 229
230 op_info = acpi_ps_get_opcode_info(opcode); 230 switch (obj_desc->reference.class) {
231 if (op_info->class == AML_CLASS_UNKNOWN) { 231 case ACPI_REFCLASS_DEBUG:
232 return_ACPI_STATUS(AE_AML_BAD_OPCODE);
233 }
234 232
235 switch (obj_desc->reference.opcode) {
236 case AML_DEBUG_OP:
237 target_op = AML_DEBUG_OP; 233 target_op = AML_DEBUG_OP;
238 234
239 /*lint -fallthrough */ 235 /*lint -fallthrough */
240 236
241 case AML_INDEX_OP: 237 case ACPI_REFCLASS_ARG:
242 case AML_REF_OF_OP: 238 case ACPI_REFCLASS_LOCAL:
243 case AML_ARG_OP: 239 case ACPI_REFCLASS_INDEX:
244 case AML_LOCAL_OP: 240 case ACPI_REFCLASS_REFOF:
245 case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ 241 case ACPI_REFCLASS_TABLE: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
246 case AML_INT_NAMEPATH_OP: /* Reference to a named object */ 242 case ACPI_REFCLASS_NAME: /* Reference to a named object */
247 243
248 ACPI_DEBUG_ONLY_MEMBERS(ACPI_DEBUG_PRINT 244 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
249 ((ACPI_DB_EXEC, 245 "Operand is a Reference, Class [%s] %2.2X\n",
250 "Operand is a Reference, RefOpcode [%s]\n", 246 acpi_ut_get_reference_name
251 (acpi_ps_get_opcode_info 247 (obj_desc),
252 (obj_desc-> 248 obj_desc->reference.
253 reference. 249 class));
254 opcode))->
255 name)));
256 break; 250 break;
257 251
258 default: 252 default:
253
259 ACPI_ERROR((AE_INFO, 254 ACPI_ERROR((AE_INFO,
260 "Operand is a Reference, Unknown Reference Opcode: %X", 255 "Unknown Reference Class %2.2X in %p",
261 obj_desc->reference. 256 obj_desc->reference.class,
262 opcode)); 257 obj_desc));
263 258
264 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 259 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
265 } 260 }
@@ -270,8 +265,7 @@ acpi_ex_resolve_operands(u16 opcode,
270 265
271 /* Invalid descriptor */ 266 /* Invalid descriptor */
272 267
273 ACPI_ERROR((AE_INFO, 268 ACPI_ERROR((AE_INFO, "Invalid descriptor %p [%s]",
274 "Invalid descriptor %p [%s]",
275 obj_desc, 269 obj_desc,
276 acpi_ut_get_descriptor_name(obj_desc))); 270 acpi_ut_get_descriptor_name(obj_desc)));
277 271
@@ -343,7 +337,7 @@ acpi_ex_resolve_operands(u16 opcode,
343 if ((opcode == AML_STORE_OP) && 337 if ((opcode == AML_STORE_OP) &&
344 (ACPI_GET_OBJECT_TYPE(*stack_ptr) == 338 (ACPI_GET_OBJECT_TYPE(*stack_ptr) ==
345 ACPI_TYPE_LOCAL_REFERENCE) 339 ACPI_TYPE_LOCAL_REFERENCE)
346 && ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) { 340 && ((*stack_ptr)->reference.class == ACPI_REFCLASS_INDEX)) {
347 goto next_operand; 341 goto next_operand;
348 } 342 }
349 break; 343 break;
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 20b4893e06ed..3318df4cbd98 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:
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
index a6d2168b81f9..eef61a00803e 100644
--- a/drivers/acpi/executer/exstoren.c
+++ b/drivers/acpi/executer/exstoren.c
@@ -121,7 +121,8 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
121 (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) && 121 (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) &&
122 !((ACPI_GET_OBJECT_TYPE(source_desc) == 122 !((ACPI_GET_OBJECT_TYPE(source_desc) ==
123 ACPI_TYPE_LOCAL_REFERENCE) 123 ACPI_TYPE_LOCAL_REFERENCE)
124 && (source_desc->reference.opcode == AML_LOAD_OP))) { 124 && (source_desc->reference.class ==
125 ACPI_REFCLASS_TABLE))) {
125 126
126 /* Conversion successful but still not a valid type */ 127 /* Conversion successful but still not a valid type */
127 128
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 0ab22004728a..cc0ae39440e4 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/acparser.h>
47 46
48#define _COMPONENT ACPI_NAMESPACE 47#define _COMPONENT ACPI_NAMESPACE
49ACPI_MODULE_NAME("nsdump") 48ACPI_MODULE_NAME("nsdump")
@@ -334,9 +333,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
334 case ACPI_TYPE_LOCAL_REFERENCE: 333 case ACPI_TYPE_LOCAL_REFERENCE:
335 334
336 acpi_os_printf("[%s]\n", 335 acpi_os_printf("[%s]\n",
337 acpi_ps_get_opcode_name(obj_desc-> 336 acpi_ut_get_reference_name(obj_desc));
338 reference.
339 opcode));
340 break; 337 break;
341 338
342 case ACPI_TYPE_BUFFER_FIELD: 339 case ACPI_TYPE_BUFFER_FIELD:
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index f3cc37624537..a085cc39c055 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -45,7 +45,6 @@
45#include <acpi/acpi.h> 45#include <acpi/acpi.h>
46#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
47#include <acpi/acinterp.h> 47#include <acpi/acinterp.h>
48#include <acpi/amlcode.h>
49 48
50#define _COMPONENT ACPI_NAMESPACE 49#define _COMPONENT ACPI_NAMESPACE
51ACPI_MODULE_NAME("nsxfeval") 50ACPI_MODULE_NAME("nsxfeval")
@@ -399,13 +398,13 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
399 * (AML_LOAD_OP) cannot be dereferenced, nor can it be converted to 398 * (AML_LOAD_OP) cannot be dereferenced, nor can it be converted to
400 * an union acpi_object. 399 * an union acpi_object.
401 */ 400 */
402 switch (info->return_object->reference.opcode) { 401 switch (info->return_object->reference.class) {
403 case AML_INDEX_OP: 402 case ACPI_REFCLASS_INDEX:
404 403
405 obj_desc = *(info->return_object->reference.where); 404 obj_desc = *(info->return_object->reference.where);
406 break; 405 break;
407 406
408 case AML_REF_OF_OP: 407 case ACPI_REFCLASS_REFOF:
409 408
410 node = info->return_object->reference.object; 409 node = info->return_object->reference.object;
411 if (node) { 410 if (node) {
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index d9063ea414e3..8eaaecf92009 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acresrc.h> 45#include <acpi/acresrc.h>
46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
48 47
49#define _COMPONENT ACPI_RESOURCES 48#define _COMPONENT ACPI_RESOURCES
@@ -560,8 +559,8 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
560 ACPI_GET_OBJECT_TYPE(*sub_object_list)) || 559 ACPI_GET_OBJECT_TYPE(*sub_object_list)) ||
561 ((ACPI_TYPE_LOCAL_REFERENCE == 560 ((ACPI_TYPE_LOCAL_REFERENCE ==
562 ACPI_GET_OBJECT_TYPE(*sub_object_list)) && 561 ACPI_GET_OBJECT_TYPE(*sub_object_list)) &&
563 ((*sub_object_list)->reference.opcode == 562 ((*sub_object_list)->reference.class ==
564 AML_INT_NAMEPATH_OP)))) { 563 ACPI_REFCLASS_NAME)))) {
565 name_found = TRUE; 564 name_found = TRUE;
566 } else { 565 } else {
567 /* Look at the next element */ 566 /* Look at the next element */
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index 7804a8c40e7a..c0bbfa2c4193 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acresrc.h> 45#include <acpi/acresrc.h>
46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
48 47
49#define _COMPONENT ACPI_RESOURCES 48#define _COMPONENT ACPI_RESOURCES
@@ -310,13 +309,12 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
310 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { 309 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
311 case ACPI_TYPE_LOCAL_REFERENCE: 310 case ACPI_TYPE_LOCAL_REFERENCE:
312 311
313 if (obj_desc->reference.opcode != 312 if (obj_desc->reference.class !=
314 AML_INT_NAMEPATH_OP) { 313 ACPI_REFCLASS_NAME) {
315 ACPI_ERROR((AE_INFO, 314 ACPI_ERROR((AE_INFO,
316 "(PRT[%X].Source) Need name, found reference op %X", 315 "(PRT[%X].Source) Need name, found Reference Class %X",
317 index, 316 index,
318 obj_desc->reference. 317 obj_desc->reference.class));
319 opcode));
320 return_ACPI_STATUS(AE_BAD_DATA); 318 return_ACPI_STATUS(AE_BAD_DATA);
321 } 319 }
322 320
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 53499ac90988..5b2f7c27b705 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -42,7 +42,6 @@
42 */ 42 */
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/amlcode.h>
46#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
47 46
48 47
@@ -176,20 +175,24 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
176 175
177 /* This is an object reference. */ 176 /* This is an object reference. */
178 177
179 switch (internal_object->reference.opcode) { 178 switch (internal_object->reference.class) {
180 case AML_INT_NAMEPATH_OP: 179 case ACPI_REFCLASS_NAME:
181
182 /* For namepath, return the object handle ("reference") */
183
184 default:
185
186 /* We are referring to the namespace node */
187 180
181 /*
182 * For namepath, return the object handle ("reference")
183 * We are referring to the namespace node
184 */
188 external_object->reference.handle = 185 external_object->reference.handle =
189 internal_object->reference.node; 186 internal_object->reference.node;
190 external_object->reference.actual_type = 187 external_object->reference.actual_type =
191 acpi_ns_get_type(internal_object->reference.node); 188 acpi_ns_get_type(internal_object->reference.node);
192 break; 189 break;
190
191 default:
192
193 /* All other reference types are unsupported */
194
195 return_ACPI_STATUS(AE_TYPE);
193 } 196 }
194 break; 197 break;
195 198
@@ -533,7 +536,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
533 536
534 /* TBD: should validate incoming handle */ 537 /* TBD: should validate incoming handle */
535 538
536 internal_object->reference.opcode = AML_INT_NAMEPATH_OP; 539 internal_object->reference.class = ACPI_REFCLASS_NAME;
537 internal_object->reference.node = 540 internal_object->reference.node =
538 external_object->reference.handle; 541 external_object->reference.handle;
539 break; 542 break;
@@ -743,11 +746,11 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
743 * We copied the reference object, so we now must add a reference 746 * We copied the reference object, so we now must add a reference
744 * to the object pointed to by the reference 747 * to the object pointed to by the reference
745 * 748 *
746 * DDBHandle reference (from Load/load_table is a special reference, 749 * DDBHandle reference (from Load/load_table) is a special reference,
747 * it's Reference.Object is the table index, so does not need to 750 * it does not have a Reference.Object, so does not need to
748 * increase the reference count 751 * increase the reference count
749 */ 752 */
750 if (source_desc->reference.opcode == AML_LOAD_OP) { 753 if (source_desc->reference.class == ACPI_REFCLASS_TABLE) {
751 break; 754 break;
752 } 755 }
753 756
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 42609d3a8aa9..5c219758c226 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -45,7 +45,6 @@
45#include <acpi/acinterp.h> 45#include <acpi/acinterp.h>
46#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
47#include <acpi/acevents.h> 47#include <acpi/acevents.h>
48#include <acpi/amlcode.h>
49 48
50#define _COMPONENT ACPI_UTILITIES 49#define _COMPONENT ACPI_UTILITIES
51ACPI_MODULE_NAME("utdelete") 50ACPI_MODULE_NAME("utdelete")
@@ -548,8 +547,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
548 * reference must track changes to the ref count of the index or 547 * reference must track changes to the ref count of the index or
549 * target object. 548 * target object.
550 */ 549 */
551 if ((object->reference.opcode == AML_INDEX_OP) || 550 if ((object->reference.class == ACPI_REFCLASS_INDEX) ||
552 (object->reference.opcode == AML_INT_NAMEPATH_OP)) { 551 (object->reference.class == ACPI_REFCLASS_NAME)) {
553 next_object = object->reference.object; 552 next_object = object->reference.object;
554 } 553 }
555 break; 554 break;
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index bcace577183b..0b1e493a8374 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -45,7 +45,6 @@
45 45
46#include <acpi/acpi.h> 46#include <acpi/acpi.h>
47#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
48#include <acpi/amlcode.h>
49 48
50ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) 49ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
51#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
@@ -590,25 +589,31 @@ char *acpi_ut_get_descriptor_name(void *object)
590 589
591/* Printable names of reference object sub-types */ 590/* Printable names of reference object sub-types */
592 591
592static const char *acpi_gbl_ref_class_names[] = {
593 /* 00 */ "Local",
594 /* 01 */ "Argument",
595 /* 02 */ "RefOf",
596 /* 03 */ "Index",
597 /* 04 */ "DdbHandle",
598 /* 05 */ "Named Object",
599 /* 06 */ "Debug"
600};
601
593const char *acpi_ut_get_reference_name(union acpi_operand_object *object) 602const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
594{ 603{
604 if (!object)
605 return "NULL Object";
595 606
596 switch (object->reference.opcode) { 607 if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND)
597 case AML_INT_NAMEPATH_OP: 608 return "Not an Operand object";
598 return "Name";
599 609
600 case AML_LOAD_OP: 610 if (object->common.type != ACPI_TYPE_LOCAL_REFERENCE)
601 return "DDB-Handle"; 611 return "Not a Reference object";
602 612
603 case AML_REF_OF_OP: 613 if (object->reference.class > ACPI_REFCLASS_MAX)
604 return "RefOf"; 614 return "Unknown Reference class";
605 615
606 case AML_INDEX_OP: 616 return acpi_gbl_ref_class_names[object->reference.class];
607 return "Index";
608
609 default:
610 return "Unknown";
611 }
612} 617}
613 618
614#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 619#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
@@ -812,4 +817,4 @@ acpi_status acpi_ut_init_globals(void)
812} 817}
813 818
814ACPI_EXPORT_SYMBOL(acpi_dbg_level) 819ACPI_EXPORT_SYMBOL(acpi_dbg_level)
815 ACPI_EXPORT_SYMBOL(acpi_dbg_layer) 820ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 924d05af94d2..c354e7a42bcd 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/amlcode.h>
47 46
48#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utobject") 48ACPI_MODULE_NAME("utobject")
@@ -478,8 +477,8 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
478 477
479 case ACPI_TYPE_LOCAL_REFERENCE: 478 case ACPI_TYPE_LOCAL_REFERENCE:
480 479
481 switch (internal_object->reference.opcode) { 480 switch (internal_object->reference.class) {
482 case AML_INT_NAMEPATH_OP: 481 case ACPI_REFCLASS_NAME:
483 482
484 /* 483 /*
485 * Get the actual length of the full pathname to this object. 484 * Get the actual length of the full pathname to this object.
@@ -504,9 +503,9 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
504 */ 503 */
505 ACPI_ERROR((AE_INFO, 504 ACPI_ERROR((AE_INFO,
506 "Cannot convert to external object - " 505 "Cannot convert to external object - "
507 "unsupported Reference type [%s] %X in object %p", 506 "unsupported Reference Class [%s] %X in object %p",
508 acpi_ut_get_reference_name(internal_object), 507 acpi_ut_get_reference_name(internal_object),
509 internal_object->reference.opcode, 508 internal_object->reference.class,
510 internal_object)); 509 internal_object));
511 status = AE_TYPE; 510 status = AE_TYPE;
512 break; 511 break;
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index c5a1b50d8d94..a4fb001d96f1 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -123,6 +123,10 @@ void acpi_db_check_integrity(void);
123 123
124void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); 124void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
125 125
126void acpi_db_check_predefined_names(void);
127
128void acpi_db_batch_execute(void);
129
126/* 130/*
127 * dbdisply - debug display commands 131 * dbdisply - debug display commands
128 */ 132 */
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 21a73a105d0a..6291904be01e 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -157,7 +157,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number);
157 * dsmthdat - method data (locals/args) 157 * dsmthdat - method data (locals/args)
158 */ 158 */
159acpi_status 159acpi_status
160acpi_ds_store_object_to_local(u16 opcode, 160acpi_ds_store_object_to_local(u8 type,
161 u32 index, 161 u32 index,
162 union acpi_operand_object *src_desc, 162 union acpi_operand_object *src_desc,
163 struct acpi_walk_state *walk_state); 163 struct acpi_walk_state *walk_state);
@@ -173,7 +173,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state);
173u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); 173u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc);
174 174
175acpi_status 175acpi_status
176acpi_ds_method_data_get_value(u16 opcode, 176acpi_ds_method_data_get_value(u8 type,
177 u32 index, 177 u32 index,
178 struct acpi_walk_state *walk_state, 178 struct acpi_walk_state *walk_state,
179 union acpi_operand_object **dest_desc); 179 union acpi_operand_object **dest_desc);
@@ -184,7 +184,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
184 struct acpi_walk_state *walk_state); 184 struct acpi_walk_state *walk_state);
185 185
186acpi_status 186acpi_status
187acpi_ds_method_data_get_node(u16 opcode, 187acpi_ds_method_data_get_node(u8 type,
188 u32 index, 188 u32 index,
189 struct acpi_walk_state *walk_state, 189 struct acpi_walk_state *walk_state,
190 struct acpi_namespace_node **node); 190 struct acpi_namespace_node **node);
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 7a8a652ffb78..eb6f038b03d9 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -308,19 +308,34 @@ struct acpi_object_addr_handler {
308 *****************************************************************************/ 308 *****************************************************************************/
309 309
310/* 310/*
311 * The Reference object type is used for these opcodes: 311 * The Reference object is used for these opcodes:
312 * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op 312 * Arg[0-6], Local[0-7], index_op, name_op, ref_of_op, load_op, load_table_op, debug_op
313 * The Reference.Class differentiates these types.
313 */ 314 */
314struct acpi_object_reference { 315struct acpi_object_reference {
315 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ 316 ACPI_OBJECT_COMMON_HEADER u8 class; /* Reference Class */
316 u16 opcode; 317 u8 target_type; /* Used for Index Op */
318 u8 reserved;
317 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ 319 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
318 struct acpi_namespace_node *node; 320 struct acpi_namespace_node *node; /* ref_of or Namepath */
319 union acpi_operand_object **where; 321 union acpi_operand_object **where; /* Target of Index */
320 u32 offset; /* Used for arg_op, local_op, and index_op */ 322 u32 value; /* Used for Local/Arg/Index/ddb_handle */
321 u32 value; /* Used for ddb_handle */
322}; 323};
323 324
325/* Values for Reference.Class above */
326
327typedef enum {
328 ACPI_REFCLASS_LOCAL = 0, /* Method local */
329 ACPI_REFCLASS_ARG = 1, /* Method argument */
330 ACPI_REFCLASS_REFOF = 2, /* Result of ref_of() TBD: Split to Ref/Node and Ref/operand_obj? */
331 ACPI_REFCLASS_INDEX = 3, /* Result of Index() */
332 ACPI_REFCLASS_TABLE = 4, /* ddb_handle - Load(), load_table() */
333 ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
334 ACPI_REFCLASS_DEBUG = 6, /* Debug object */
335
336 ACPI_REFCLASS_MAX = 6
337} ACPI_REFERENCE_CLASSES;
338
324/* 339/*
325 * Extra object is used as additional storage for types that 340 * Extra object is used as additional storage for types that
326 * have AML code in their declarations (term_args) that must be 341 * have AML code in their declarations (term_args) that must be