aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exstore.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exstore.c')
-rw-r--r--drivers/acpi/executer/exstore.c119
1 files changed, 93 insertions, 26 deletions
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index f4b69a637820..76c875bc3154 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.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
@@ -84,8 +84,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
84 84
85 ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); 85 ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
86 86
87 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", 87 /* Print line header as long as we are not in the middle of an object display */
88 level, " ")); 88
89 if (!((level > 0) && index == 0)) {
90 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s",
91 level, " "));
92 }
89 93
90 /* Display index for package output only */ 94 /* Display index for package output only */
91 95
@@ -95,12 +99,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
95 } 99 }
96 100
97 if (!source_desc) { 101 if (!source_desc) {
98 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "<Null Object>\n")); 102 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[Null Object]\n"));
99 return_VOID; 103 return_VOID;
100 } 104 }
101 105
102 if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { 106 if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
103 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: ", 107 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s ",
104 acpi_ut_get_object_type_name 108 acpi_ut_get_object_type_name
105 (source_desc))); 109 (source_desc)));
106 110
@@ -123,6 +127,8 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
123 return_VOID; 127 return_VOID;
124 } 128 }
125 129
130 /* source_desc is of type ACPI_DESC_TYPE_OPERAND */
131
126 switch (ACPI_GET_OBJECT_TYPE(source_desc)) { 132 switch (ACPI_GET_OBJECT_TYPE(source_desc)) {
127 case ACPI_TYPE_INTEGER: 133 case ACPI_TYPE_INTEGER:
128 134
@@ -147,7 +153,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
147 (u32) source_desc->buffer.length)); 153 (u32) source_desc->buffer.length));
148 ACPI_DUMP_BUFFER(source_desc->buffer.pointer, 154 ACPI_DUMP_BUFFER(source_desc->buffer.pointer,
149 (source_desc->buffer.length < 155 (source_desc->buffer.length <
150 32) ? source_desc->buffer.length : 32); 156 256) ? source_desc->buffer.length : 256);
151 break; 157 break;
152 158
153 case ACPI_TYPE_STRING: 159 case ACPI_TYPE_STRING:
@@ -160,7 +166,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
160 case ACPI_TYPE_PACKAGE: 166 case ACPI_TYPE_PACKAGE:
161 167
162 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, 168 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
163 "[0x%.2X Elements]\n", 169 "[Contains 0x%.2X Elements]\n",
164 source_desc->package.count)); 170 source_desc->package.count));
165 171
166 /* Output the entire contents of the package */ 172 /* Output the entire contents of the package */
@@ -180,12 +186,59 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
180 (source_desc->reference.opcode), 186 (source_desc->reference.opcode),
181 source_desc->reference.offset)); 187 source_desc->reference.offset));
182 } else { 188 } else {
183 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]\n", 189 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]",
184 acpi_ps_get_opcode_name 190 acpi_ps_get_opcode_name
185 (source_desc->reference.opcode))); 191 (source_desc->reference.opcode)));
186 } 192 }
187 193
188 if (source_desc->reference.object) { 194 if (source_desc->reference.opcode == AML_LOAD_OP) { /* Load and load_table */
195 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
196 " Table OwnerId %p\n",
197 source_desc->reference.object));
198 break;
199 }
200
201 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, " "));
202
203 /* Check for valid node first, then valid object */
204
205 if (source_desc->reference.node) {
206 if (ACPI_GET_DESCRIPTOR_TYPE
207 (source_desc->reference.node) !=
208 ACPI_DESC_TYPE_NAMED) {
209 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
210 " %p - Not a valid namespace node\n",
211 source_desc->reference.
212 node));
213 } else {
214 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
215 "Node %p [%4.4s] ",
216 source_desc->reference.
217 node,
218 (source_desc->reference.
219 node)->name.ascii));
220
221 switch ((source_desc->reference.node)->type) {
222
223 /* These types have no attached object */
224
225 case ACPI_TYPE_DEVICE:
226 acpi_os_printf("Device\n");
227 break;
228
229 case ACPI_TYPE_THERMAL:
230 acpi_os_printf("Thermal Zone\n");
231 break;
232
233 default:
234 acpi_ex_do_debug_object((source_desc->
235 reference.
236 node)->object,
237 level + 4, 0);
238 break;
239 }
240 }
241 } else if (source_desc->reference.object) {
189 if (ACPI_GET_DESCRIPTOR_TYPE 242 if (ACPI_GET_DESCRIPTOR_TYPE
190 (source_desc->reference.object) == 243 (source_desc->reference.object) ==
191 ACPI_DESC_TYPE_NAMED) { 244 ACPI_DESC_TYPE_NAMED) {
@@ -198,18 +251,13 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
198 acpi_ex_do_debug_object(source_desc->reference. 251 acpi_ex_do_debug_object(source_desc->reference.
199 object, level + 4, 0); 252 object, level + 4, 0);
200 } 253 }
201 } else if (source_desc->reference.node) {
202 acpi_ex_do_debug_object((source_desc->reference.node)->
203 object, level + 4, 0);
204 } 254 }
205 break; 255 break;
206 256
207 default: 257 default:
208 258
209 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p %s\n", 259 ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p\n",
210 source_desc, 260 source_desc));
211 acpi_ut_get_object_type_name
212 (source_desc)));
213 break; 261 break;
214 } 262 }
215 263
@@ -313,7 +361,6 @@ acpi_ex_store(union acpi_operand_object *source_desc,
313 * 4) Store to the debug object 361 * 4) Store to the debug object
314 */ 362 */
315 switch (ref_desc->reference.opcode) { 363 switch (ref_desc->reference.opcode) {
316 case AML_NAME_OP:
317 case AML_REF_OF_OP: 364 case AML_REF_OF_OP:
318 365
319 /* Storing an object into a Name "container" */ 366 /* Storing an object into a Name "container" */
@@ -415,11 +462,24 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
415 */ 462 */
416 obj_desc = *(index_desc->reference.where); 463 obj_desc = *(index_desc->reference.where);
417 464
418 status = 465 if (ACPI_GET_OBJECT_TYPE(source_desc) ==
419 acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc, 466 ACPI_TYPE_LOCAL_REFERENCE
420 walk_state); 467 && source_desc->reference.opcode == AML_LOAD_OP) {
421 if (ACPI_FAILURE(status)) { 468
422 return_ACPI_STATUS(status); 469 /* This is a DDBHandle, just add a reference to it */
470
471 acpi_ut_add_reference(source_desc);
472 new_desc = source_desc;
473 } else {
474 /* Normal object, copy it */
475
476 status =
477 acpi_ut_copy_iobject_to_iobject(source_desc,
478 &new_desc,
479 walk_state);
480 if (ACPI_FAILURE(status)) {
481 return_ACPI_STATUS(status);
482 }
423 } 483 }
424 484
425 if (obj_desc) { 485 if (obj_desc) {
@@ -571,10 +631,17 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
571 631
572 /* If no implicit conversion, drop into the default case below */ 632 /* If no implicit conversion, drop into the default case below */
573 633
574 if ((!implicit_conversion) || (walk_state->opcode == AML_COPY_OP)) { 634 if ((!implicit_conversion) ||
575 635 ((walk_state->opcode == AML_COPY_OP) &&
576 /* Force execution of default (no implicit conversion) */ 636 (target_type != ACPI_TYPE_LOCAL_REGION_FIELD) &&
577 637 (target_type != ACPI_TYPE_LOCAL_BANK_FIELD) &&
638 (target_type != ACPI_TYPE_LOCAL_INDEX_FIELD))) {
639 /*
640 * Force execution of default (no implicit conversion). Note:
641 * copy_object does not perform an implicit conversion, as per the ACPI
642 * spec -- except in case of region/bank/index fields -- because these
643 * objects must retain their original type permanently.
644 */
578 target_type = ACPI_TYPE_ANY; 645 target_type = ACPI_TYPE_ANY;
579 } 646 }
580 647