aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-07-08 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-14 00:42:23 -0400
commitf9f4601f331aa1226d7a798a01950efbb388f07f (patch)
tree62e079a9275749d16a4a0da56a427be201e15d27
parent4c3ffbd79529b680b3c3ef2b6f42f0c89c694ec5 (diff)
ACPICA 20050708 from Bob Moore <robert.moore@intel.com>
The use of the CPU stack in the debug version of the subsystem has been considerably reduced. Previously, a debug structure was declared in every function that used the debug macros. This structure has been removed in favor of declaring the individual elements as parameters to the debug functions. This reduces the cumulative stack use during nested execution of ACPI function calls at the cost of a small increase in the code size of the debug version of the subsystem. With assistance from Alexey Starikovskiy and Len Brown. Added the ACPI_GET_FUNCTION_NAME macro to enable the compiler-dependent headers to define a macro that will return the current function name at runtime (such as __FUNCTION__ or _func_, etc.) The function name is used by the debug trace output. If ACPI_GET_FUNCTION_NAME is not defined in the compiler-dependent header, the function name is saved on the CPU stack (one pointer per function.) This mechanism is used because apparently there exists no standard ANSI-C defined macro that that returns the function name. Alexey Starikovskiy redesigned and reimplemented the "Owner ID" mechanism used to track namespace objects created/deleted by ACPI tables and control method execution. A bitmap is now used to allocate and free the IDs, thus solving the wraparound problem present in the previous implementation. The size of the namespace node descriptor was reduced by 2 bytes as a result. Removed the UINT32_BIT and UINT16_BIT types that were used for the bitfield flag definitions within the headers for the predefined ACPI tables. These have been replaced by UINT8_BIT in order to increase the code portability of the subsystem. If the use of UINT8 remains a problem, we may be forced to eliminate bitfields entirely because of a lack of portability. Alexey Starikovksiy enhanced the performance of acpi_ut_update_object_reference. This is a frequently used function and this improvement increases the performance of the entire subsystem. Alexey Starikovskiy fixed several possible memory leaks and the inverse - premature object deletion. Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/dispatcher/dsinit.c6
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c35
-rw-r--r--drivers/acpi/executer/exconfig.c2
-rw-r--r--drivers/acpi/executer/exdump.c2
-rw-r--r--drivers/acpi/executer/exoparg1.c15
-rw-r--r--drivers/acpi/executer/exresop.c16
-rw-r--r--drivers/acpi/namespace/nsaccess.c2
-rw-r--r--drivers/acpi/namespace/nsalloc.c5
-rw-r--r--drivers/acpi/namespace/nsdump.c8
-rw-r--r--drivers/acpi/namespace/nsparse.c2
-rw-r--r--drivers/acpi/parser/psloop.c9
-rw-r--r--drivers/acpi/parser/psxface.c7
-rw-r--r--drivers/acpi/tables/tbinstal.c12
-rw-r--r--drivers/acpi/tables/tbrsdt.c25
-rw-r--r--drivers/acpi/tables/tbxface.c3
-rw-r--r--drivers/acpi/tables/tbxfroot.c106
-rw-r--r--drivers/acpi/utilities/utcache.c12
-rw-r--r--drivers/acpi/utilities/utdebug.c169
-rw-r--r--drivers/acpi/utilities/utdelete.c98
-rw-r--r--drivers/acpi/utilities/utglobal.c72
-rw-r--r--drivers/acpi/utilities/utmisc.c94
-rw-r--r--drivers/acpi/utilities/utmutex.c10
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acdisasm.h2
-rw-r--r--include/acpi/acexcep.h6
-rw-r--r--include/acpi/acglobal.h3
-rw-r--r--include/acpi/aclocal.h57
-rw-r--r--include/acpi/acmacros.h100
-rw-r--r--include/acpi/acnamesp.h4
-rw-r--r--include/acpi/acobject.h2
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acstruct.h11
-rw-r--r--include/acpi/actables.h4
-rw-r--r--include/acpi/actbl.h58
-rw-r--r--include/acpi/actbl1.h52
-rw-r--r--include/acpi/actbl2.h109
-rw-r--r--include/acpi/actypes.h18
-rw-r--r--include/acpi/acutils.h56
-rw-r--r--include/acpi/platform/acgcc.h8
39 files changed, 664 insertions, 540 deletions
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index d7790db50178..ebc07aab710c 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -99,7 +99,7 @@ acpi_ds_init_one_object (
99 * was just loaded 99 * was just loaded
100 */ 100 */
101 if (((struct acpi_namespace_node *) obj_handle)->owner_id != 101 if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
102 info->table_desc->table_id) { 102 info->table_desc->owner_id) {
103 return (AE_OK); 103 return (AE_OK);
104 } 104 }
105 105
@@ -168,7 +168,7 @@ acpi_ds_init_one_object (
168 */ 168 */
169 acpi_ns_delete_namespace_subtree (obj_handle); 169 acpi_ns_delete_namespace_subtree (obj_handle);
170 acpi_ns_delete_namespace_by_owner ( 170 acpi_ns_delete_namespace_by_owner (
171 ((struct acpi_namespace_node *) obj_handle)->object->method.owning_id); 171 ((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
172 break; 172 break;
173 173
174 174
@@ -237,7 +237,7 @@ acpi_ds_initialize_objects (
237 237
238 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, 238 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
239 "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n", 239 "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
240 table_desc->pointer->signature, table_desc->table_id, info.object_count, 240 table_desc->pointer->signature, table_desc->owner_id, info.object_count,
241 info.device_count, info.method_count, info.op_region_count)); 241 info.device_count, info.method_count, info.op_region_count));
242 242
243 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 243 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index c9d9a6c45ae3..1b90813cbde1 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -77,7 +77,6 @@ acpi_ds_parse_method (
77 union acpi_operand_object *obj_desc; 77 union acpi_operand_object *obj_desc;
78 union acpi_parse_object *op; 78 union acpi_parse_object *op;
79 struct acpi_namespace_node *node; 79 struct acpi_namespace_node *node;
80 acpi_owner_id owner_id;
81 struct acpi_walk_state *walk_state; 80 struct acpi_walk_state *walk_state;
82 81
83 82
@@ -132,15 +131,18 @@ acpi_ds_parse_method (
132 * objects (such as Operation Regions) can be created during the 131 * objects (such as Operation Regions) can be created during the
133 * first pass parse. 132 * first pass parse.
134 */ 133 */
135 owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD); 134 status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
136 obj_desc->method.owning_id = owner_id; 135 if (ACPI_FAILURE (status)) {
136 goto cleanup;
137 }
137 138
138 /* Create and initialize a new walk state */ 139 /* Create and initialize a new walk state */
139 140
140 walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL); 141 walk_state = acpi_ds_create_walk_state (
142 obj_desc->method.owner_id, NULL, NULL, NULL);
141 if (!walk_state) { 143 if (!walk_state) {
142 status = AE_NO_MEMORY; 144 status = AE_NO_MEMORY;
143 goto cleanup; 145 goto cleanup2;
144 } 146 }
145 147
146 status = acpi_ds_init_aml_walk (walk_state, op, node, 148 status = acpi_ds_init_aml_walk (walk_state, op, node,
@@ -148,7 +150,7 @@ acpi_ds_parse_method (
148 obj_desc->method.aml_length, NULL, 1); 150 obj_desc->method.aml_length, NULL, 1);
149 if (ACPI_FAILURE (status)) { 151 if (ACPI_FAILURE (status)) {
150 acpi_ds_delete_walk_state (walk_state); 152 acpi_ds_delete_walk_state (walk_state);
151 goto cleanup; 153 goto cleanup2;
152 } 154 }
153 155
154 /* 156 /*
@@ -162,13 +164,16 @@ acpi_ds_parse_method (
162 */ 164 */
163 status = acpi_ps_parse_aml (walk_state); 165 status = acpi_ps_parse_aml (walk_state);
164 if (ACPI_FAILURE (status)) { 166 if (ACPI_FAILURE (status)) {
165 goto cleanup; 167 goto cleanup2;
166 } 168 }
167 169
168 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, 170 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
169 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n", 171 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
170 acpi_ut_get_node_name (obj_handle), obj_handle, op)); 172 acpi_ut_get_node_name (obj_handle), obj_handle, op));
171 173
174cleanup2:
175 (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
176
172cleanup: 177cleanup:
173 acpi_ps_delete_parse_tree (op); 178 acpi_ps_delete_parse_tree (op);
174 return_ACPI_STATUS (status); 179 return_ACPI_STATUS (status);
@@ -265,7 +270,7 @@ acpi_ds_call_control_method (
265{ 270{
266 acpi_status status; 271 acpi_status status;
267 struct acpi_namespace_node *method_node; 272 struct acpi_namespace_node *method_node;
268 struct acpi_walk_state *next_walk_state; 273 struct acpi_walk_state *next_walk_state = NULL;
269 union acpi_operand_object *obj_desc; 274 union acpi_operand_object *obj_desc;
270 struct acpi_parameter_info info; 275 struct acpi_parameter_info info;
271 u32 i; 276 u32 i;
@@ -289,20 +294,23 @@ acpi_ds_call_control_method (
289 return_ACPI_STATUS (AE_NULL_OBJECT); 294 return_ACPI_STATUS (AE_NULL_OBJECT);
290 } 295 }
291 296
292 obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD); 297 status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
298 if (ACPI_FAILURE (status)) {
299 return_ACPI_STATUS (status);
300 }
293 301
294 /* Init for new method, wait on concurrency semaphore */ 302 /* Init for new method, wait on concurrency semaphore */
295 303
296 status = acpi_ds_begin_method_execution (method_node, obj_desc, 304 status = acpi_ds_begin_method_execution (method_node, obj_desc,
297 this_walk_state->method_node); 305 this_walk_state->method_node);
298 if (ACPI_FAILURE (status)) { 306 if (ACPI_FAILURE (status)) {
299 return_ACPI_STATUS (status); 307 goto cleanup;
300 } 308 }
301 309
302 if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) { 310 if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
303 /* 1) Parse: Create a new walk state for the preempting walk */ 311 /* 1) Parse: Create a new walk state for the preempting walk */
304 312
305 next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, 313 next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
306 op, obj_desc, NULL); 314 op, obj_desc, NULL);
307 if (!next_walk_state) { 315 if (!next_walk_state) {
308 return_ACPI_STATUS (AE_NO_MEMORY); 316 return_ACPI_STATUS (AE_NO_MEMORY);
@@ -332,7 +340,7 @@ acpi_ds_call_control_method (
332 340
333 /* 2) Execute: Create a new state for the preempting walk */ 341 /* 2) Execute: Create a new state for the preempting walk */
334 342
335 next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, 343 next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
336 NULL, obj_desc, thread); 344 NULL, obj_desc, thread);
337 if (!next_walk_state) { 345 if (!next_walk_state) {
338 status = AE_NO_MEMORY; 346 status = AE_NO_MEMORY;
@@ -383,6 +391,7 @@ acpi_ds_call_control_method (
383 /* On error, we must delete the new walk state */ 391 /* On error, we must delete the new walk state */
384 392
385cleanup: 393cleanup:
394 (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
386 if (next_walk_state && (next_walk_state->method_desc)) { 395 if (next_walk_state && (next_walk_state->method_desc)) {
387 /* Decrement the thread count on the method parse tree */ 396 /* Decrement the thread count on the method parse tree */
388 397
@@ -584,7 +593,7 @@ acpi_ds_terminate_control_method (
584 * Delete any namespace entries created anywhere else within 593 * Delete any namespace entries created anywhere else within
585 * the namespace 594 * the namespace
586 */ 595 */
587 acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id); 596 acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
588 status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); 597 status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
589 if (ACPI_FAILURE (status)) { 598 if (ACPI_FAILURE (status)) {
590 return_ACPI_STATUS (status); 599 return_ACPI_STATUS (status);
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 8bfa6effaa0c..76c6ebd0231f 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -487,7 +487,7 @@ acpi_ex_unload_table (
487 * Delete the entire namespace under this table Node 487 * Delete the entire namespace under this table Node
488 * (Offset contains the table_id) 488 * (Offset contains the table_id)
489 */ 489 */
490 acpi_ns_delete_namespace_by_owner (table_info->table_id); 490 acpi_ns_delete_namespace_by_owner (table_info->owner_id);
491 491
492 /* Delete the table itself */ 492 /* Delete the table itself */
493 493
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 7007abb6051e..6158f5193f4a 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -819,7 +819,7 @@ acpi_ex_dump_object_descriptor (
819 acpi_ex_out_integer ("param_count", obj_desc->method.param_count); 819 acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
820 acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency); 820 acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
821 acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore); 821 acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
822 acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id); 822 acpi_ex_out_integer ("owner_id", obj_desc->method.owner_id);
823 acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length); 823 acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
824 acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start); 824 acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
825 break; 825 break;
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 131f49acb1df..c1ba8b48228e 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -904,6 +904,7 @@ acpi_ex_opcode_1A_0T_1R (
904 */ 904 */
905 return_desc = acpi_ns_get_attached_object ( 905 return_desc = acpi_ns_get_attached_object (
906 (struct acpi_namespace_node *) operand[0]); 906 (struct acpi_namespace_node *) operand[0]);
907 acpi_ut_add_reference (return_desc);
907 } 908 }
908 else { 909 else {
909 /* 910 /*
@@ -953,20 +954,10 @@ acpi_ex_opcode_1A_0T_1R (
953 * add another reference to the referenced object, however. 954 * add another reference to the referenced object, however.
954 */ 955 */
955 return_desc = *(operand[0]->reference.where); 956 return_desc = *(operand[0]->reference.where);
956 if (!return_desc) { 957 if (return_desc) {
957 /* 958 acpi_ut_add_reference (return_desc);
958 * We can't return a NULL dereferenced value. This is
959 * an uninitialized package element and is thus a
960 * severe error.
961 */
962 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
963 "NULL package element obj %p\n",
964 operand[0]));
965 status = AE_AML_UNINITIALIZED_ELEMENT;
966 goto cleanup;
967 } 959 }
968 960
969 acpi_ut_add_reference (return_desc);
970 break; 961 break;
971 962
972 963
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index d8b470eefe7a..aaba7abcb52d 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -426,6 +426,10 @@ acpi_ex_resolve_operands (
426 426
427 return_ACPI_STATUS (status); 427 return_ACPI_STATUS (status);
428 } 428 }
429
430 if (obj_desc != *stack_ptr) {
431 acpi_ut_remove_reference (obj_desc);
432 }
429 goto next_operand; 433 goto next_operand;
430 434
431 435
@@ -448,6 +452,10 @@ acpi_ex_resolve_operands (
448 452
449 return_ACPI_STATUS (status); 453 return_ACPI_STATUS (status);
450 } 454 }
455
456 if (obj_desc != *stack_ptr) {
457 acpi_ut_remove_reference (obj_desc);
458 }
451 goto next_operand; 459 goto next_operand;
452 460
453 461
@@ -471,6 +479,10 @@ acpi_ex_resolve_operands (
471 479
472 return_ACPI_STATUS (status); 480 return_ACPI_STATUS (status);
473 } 481 }
482
483 if (obj_desc != *stack_ptr) {
484 acpi_ut_remove_reference (obj_desc);
485 }
474 goto next_operand; 486 goto next_operand;
475 487
476 488
@@ -515,6 +527,10 @@ acpi_ex_resolve_operands (
515 if (ACPI_FAILURE (status)) { 527 if (ACPI_FAILURE (status)) {
516 return_ACPI_STATUS (status); 528 return_ACPI_STATUS (status);
517 } 529 }
530
531 if (obj_desc != *stack_ptr) {
532 acpi_ut_remove_reference (obj_desc);
533 }
518 break; 534 break;
519 535
520 default: 536 default:
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index 9df0a64ba9e9..0bda88d18685 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -163,7 +163,7 @@ acpi_ns_root_initialize (
163 163
164 /* 164 /*
165 * i_aSL Compiler cheats by putting parameter count 165 * i_aSL Compiler cheats by putting parameter count
166 * in the owner_iD 166 * in the owner_iD (param_count max is 7)
167 */ 167 */
168 new_node->owner_id = obj_desc->method.param_count; 168 new_node->owner_id = obj_desc->method.param_count;
169#else 169#else
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index 3f94b0806ecf..edbf1db36b68 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -190,7 +190,7 @@ acpi_ns_install_node (
190 struct acpi_namespace_node *node, /* New Child*/ 190 struct acpi_namespace_node *node, /* New Child*/
191 acpi_object_type type) 191 acpi_object_type type)
192{ 192{
193 u16 owner_id = 0; 193 acpi_owner_id owner_id = 0;
194 struct acpi_namespace_node *child_node; 194 struct acpi_namespace_node *child_node;
195#ifdef ACPI_ALPHABETIC_NAMESPACE 195#ifdef ACPI_ALPHABETIC_NAMESPACE
196 196
@@ -559,7 +559,7 @@ acpi_ns_remove_reference (
559 559
560void 560void
561acpi_ns_delete_namespace_by_owner ( 561acpi_ns_delete_namespace_by_owner (
562 u16 owner_id) 562 acpi_owner_id owner_id)
563{ 563{
564 struct acpi_namespace_node *child_node; 564 struct acpi_namespace_node *child_node;
565 struct acpi_namespace_node *deletion_node; 565 struct acpi_namespace_node *deletion_node;
@@ -635,6 +635,7 @@ acpi_ns_delete_namespace_by_owner (
635 } 635 }
636 } 636 }
637 637
638 (void) acpi_ut_release_owner_id (owner_id);
638 return_VOID; 639 return_VOID;
639} 640}
640 641
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index c9f35dd7a431..d86ccbc8a134 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -203,7 +203,7 @@ acpi_ns_dump_one_object (
203 203
204 /* Check if the owner matches */ 204 /* Check if the owner matches */
205 205
206 if ((info->owner_id != ACPI_UINT32_MAX) && 206 if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
207 (info->owner_id != this_node->owner_id)) { 207 (info->owner_id != this_node->owner_id)) {
208 return (AE_OK); 208 return (AE_OK);
209 } 209 }
@@ -598,7 +598,7 @@ acpi_ns_dump_objects (
598 acpi_object_type type, 598 acpi_object_type type,
599 u8 display_type, 599 u8 display_type,
600 u32 max_depth, 600 u32 max_depth,
601 u32 owner_id, 601 acpi_owner_id owner_id,
602 acpi_handle start_handle) 602 acpi_handle start_handle)
603{ 603{
604 struct acpi_walk_info info; 604 struct acpi_walk_info info;
@@ -643,7 +643,7 @@ acpi_ns_dump_entry (
643 643
644 644
645 info.debug_level = debug_level; 645 info.debug_level = debug_level;
646 info.owner_id = ACPI_UINT32_MAX; 646 info.owner_id = ACPI_OWNER_ID_MAX;
647 info.display_type = ACPI_DISPLAY_SUMMARY; 647 info.display_type = ACPI_DISPLAY_SUMMARY;
648 648
649 (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); 649 (void) acpi_ns_dump_one_object (handle, 1, &info, NULL);
@@ -694,7 +694,7 @@ acpi_ns_dump_tables (
694 } 694 }
695 695
696 acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, 696 acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
697 ACPI_UINT32_MAX, search_handle); 697 ACPI_OWNER_ID_MAX, search_handle);
698 return_VOID; 698 return_VOID;
699} 699}
700#endif /* _ACPI_ASL_COMPILER */ 700#endif /* _ACPI_ASL_COMPILER */
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index f81b836e77f1..64e0b2b9f55c 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -87,7 +87,7 @@ acpi_ns_one_complete_parse (
87 87
88 /* Create and initialize a new walk state */ 88 /* Create and initialize a new walk state */
89 89
90 walk_state = acpi_ds_create_walk_state (table_desc->table_id, 90 walk_state = acpi_ds_create_walk_state (table_desc->owner_id,
91 NULL, NULL, NULL); 91 NULL, NULL, NULL);
92 if (!walk_state) { 92 if (!walk_state) {
93 acpi_ps_free_op (parse_root); 93 acpi_ps_free_op (parse_root);
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index decb2e9a049d..095672a1a722 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -407,9 +407,14 @@ acpi_ps_parse_loop (
407 INCREMENT_ARG_LIST (walk_state->arg_types); 407 INCREMENT_ARG_LIST (walk_state->arg_types);
408 } 408 }
409 409
410
410 /* Special processing for certain opcodes */ 411 /* Special processing for certain opcodes */
411 412
412 if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) && 413 /* TBD (remove): Temporary mechanism to disable this code if needed */
414
415#ifndef ACPI_NO_MODULE_LEVEL_CODE
416
417 if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
413 ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) { 418 ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
414 /* 419 /*
415 * We want to skip If/Else/While constructs during Pass1 420 * We want to skip If/Else/While constructs during Pass1
@@ -434,7 +439,7 @@ acpi_ps_parse_loop (
434 break; 439 break;
435 } 440 }
436 } 441 }
437 442#endif
438 switch (op->common.aml_opcode) { 443 switch (op->common.aml_opcode) {
439 case AML_METHOD_OP: 444 case AML_METHOD_OP:
440 445
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
index dba893648e84..5279b51e7787 100644
--- a/drivers/acpi/parser/psxface.c
+++ b/drivers/acpi/parser/psxface.c
@@ -138,11 +138,14 @@ acpi_psx_execute (
138 * objects (such as Operation Regions) can be created during the 138 * objects (such as Operation Regions) can be created during the
139 * first pass parse. 139 * first pass parse.
140 */ 140 */
141 obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD); 141 status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
142 if (ACPI_FAILURE (status)) {
143 goto cleanup2;
144 }
142 145
143 /* Create and initialize a new walk state */ 146 /* Create and initialize a new walk state */
144 147
145 walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, 148 walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
146 NULL, NULL, NULL); 149 NULL, NULL, NULL);
147 if (!walk_state) { 150 if (!walk_state) {
148 status = AE_NO_MEMORY; 151 status = AE_NO_MEMORY;
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 629b64c8193d..2ad72f204551 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -251,6 +251,7 @@ acpi_tb_init_table_descriptor (
251{ 251{
252 struct acpi_table_list *list_head; 252 struct acpi_table_list *list_head;
253 struct acpi_table_desc *table_desc; 253 struct acpi_table_desc *table_desc;
254 acpi_status status;
254 255
255 256
256 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type); 257 ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
@@ -263,6 +264,13 @@ acpi_tb_init_table_descriptor (
263 return_ACPI_STATUS (AE_NO_MEMORY); 264 return_ACPI_STATUS (AE_NO_MEMORY);
264 } 265 }
265 266
267 /* Get a new owner ID for the table */
268
269 status = acpi_ut_allocate_owner_id (&table_desc->owner_id);
270 if (ACPI_FAILURE (status)) {
271 return_ACPI_STATUS (status);
272 }
273
266 /* Install the table into the global data structure */ 274 /* Install the table into the global data structure */
267 275
268 list_head = &acpi_gbl_table_lists[table_type]; 276 list_head = &acpi_gbl_table_lists[table_type];
@@ -325,8 +333,6 @@ acpi_tb_init_table_descriptor (
325 table_desc->aml_start = (u8 *) (table_desc->pointer + 1), 333 table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
326 table_desc->aml_length = (u32) (table_desc->length - 334 table_desc->aml_length = (u32) (table_desc->length -
327 (u32) sizeof (struct acpi_table_header)); 335 (u32) sizeof (struct acpi_table_header));
328 table_desc->table_id = acpi_ut_allocate_owner_id (
329 ACPI_OWNER_TYPE_TABLE);
330 table_desc->loaded_into_namespace = FALSE; 336 table_desc->loaded_into_namespace = FALSE;
331 337
332 /* 338 /*
@@ -339,7 +345,7 @@ acpi_tb_init_table_descriptor (
339 345
340 /* Return Data */ 346 /* Return Data */
341 347
342 table_info->table_id = table_desc->table_id; 348 table_info->owner_id = table_desc->owner_id;
343 table_info->installed_desc = table_desc; 349 table_info->installed_desc = table_desc;
344 350
345 return_ACPI_STATUS (AE_OK); 351 return_ACPI_STATUS (AE_OK);
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index 13c6ddb2f546..069d498465d0 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -96,32 +96,13 @@ acpi_tb_verify_rsdp (
96 return_ACPI_STATUS (AE_BAD_PARAMETER); 96 return_ACPI_STATUS (AE_BAD_PARAMETER);
97 } 97 }
98 98
99 /* 99 /* Verify RSDP signature and checksum */
100 * The signature and checksum must both be correct
101 */
102 if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
103 /* Nope, BAD Signature */
104
105 status = AE_BAD_SIGNATURE;
106 goto cleanup;
107 }
108
109 /* Check the standard checksum */
110 100
111 if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) { 101 status = acpi_tb_validate_rsdp (rsdp);
112 status = AE_BAD_CHECKSUM; 102 if (ACPI_FAILURE (status)) {
113 goto cleanup; 103 goto cleanup;
114 } 104 }
115 105
116 /* Check extended checksum if table version >= 2 */
117
118 if (rsdp->revision >= 2) {
119 if (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0) {
120 status = AE_BAD_CHECKSUM;
121 goto cleanup;
122 }
123 }
124
125 /* The RSDP supplied is OK */ 106 /* The RSDP supplied is OK */
126 107
127 table_info.pointer = ACPI_CAST_PTR (struct acpi_table_header, rsdp); 108 table_info.pointer = ACPI_CAST_PTR (struct acpi_table_header, rsdp);
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 0c0b9085dbeb..ca2dbdd23ed3 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -260,8 +260,7 @@ acpi_unload_table (
260 * "Scope" operator. Thus, we need to track ownership by an ID, not 260 * "Scope" operator. Thus, we need to track ownership by an ID, not
261 * simply a position within the hierarchy 261 * simply a position within the hierarchy
262 */ 262 */
263 acpi_ns_delete_namespace_by_owner (table_desc->table_id); 263 acpi_ns_delete_namespace_by_owner (table_desc->owner_id);
264
265 table_desc = table_desc->next; 264 table_desc = table_desc->next;
266 } 265 }
267 266
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index fe9c8317df46..abb4c9346560 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -65,6 +65,51 @@ acpi_tb_scan_memory_for_rsdp (
65 65
66/******************************************************************************* 66/*******************************************************************************
67 * 67 *
68 * FUNCTION: acpi_tb_validate_rsdp
69 *
70 * PARAMETERS: Rsdp - Pointer to unvalidated RSDP
71 *
72 * RETURN: Status
73 *
74 * DESCRIPTION: Validate the RSDP (ptr)
75 *
76 ******************************************************************************/
77
78acpi_status
79acpi_tb_validate_rsdp (
80 struct rsdp_descriptor *rsdp)
81{
82 ACPI_FUNCTION_ENTRY ();
83
84
85 /*
86 * The signature and checksum must both be correct
87 */
88 if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
89 /* Nope, BAD Signature */
90
91 return (AE_BAD_SIGNATURE);
92 }
93
94 /* Check the standard checksum */
95
96 if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
97 return (AE_BAD_CHECKSUM);
98 }
99
100 /* Check extended checksum if table version >= 2 */
101
102 if ((rsdp->revision >= 2) &&
103 (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
104 return (AE_BAD_CHECKSUM);
105 }
106
107 return (AE_OK);
108}
109
110
111/*******************************************************************************
112 *
68 * FUNCTION: acpi_tb_find_table 113 * FUNCTION: acpi_tb_find_table
69 * 114 *
70 * PARAMETERS: Signature - String with ACPI table signature 115 * PARAMETERS: Signature - String with ACPI table signature
@@ -218,19 +263,11 @@ acpi_get_firmware_table (
218 acpi_gbl_RSDP = address.pointer.logical; 263 acpi_gbl_RSDP = address.pointer.logical;
219 } 264 }
220 265
221 /* The signature and checksum must both be correct */ 266 /* The RDSP signature and checksum must both be correct */
222
223 if (ACPI_STRNCMP ((char *) acpi_gbl_RSDP, RSDP_SIG,
224 sizeof (RSDP_SIG)-1) != 0) {
225 /* Nope, BAD Signature */
226 267
227 return_ACPI_STATUS (AE_BAD_SIGNATURE); 268 status = acpi_tb_validate_rsdp (acpi_gbl_RSDP);
228 } 269 if (ACPI_FAILURE (status)) {
229 270 return_ACPI_STATUS (status);
230 if (acpi_tb_checksum (acpi_gbl_RSDP, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
231 /* Nope, BAD Checksum */
232
233 return_ACPI_STATUS (AE_BAD_CHECKSUM);
234 } 271 }
235 } 272 }
236 273
@@ -414,9 +451,9 @@ acpi_tb_scan_memory_for_rsdp (
414 u8 *start_address, 451 u8 *start_address,
415 u32 length) 452 u32 length)
416{ 453{
454 acpi_status status;
417 u8 *mem_rover; 455 u8 *mem_rover;
418 u8 *end_address; 456 u8 *end_address;
419 u8 checksum;
420 457
421 458
422 ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp"); 459 ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp");
@@ -428,45 +465,25 @@ acpi_tb_scan_memory_for_rsdp (
428 465
429 for (mem_rover = start_address; mem_rover < end_address; 466 for (mem_rover = start_address; mem_rover < end_address;
430 mem_rover += ACPI_RSDP_SCAN_STEP) { 467 mem_rover += ACPI_RSDP_SCAN_STEP) {
431 /* The signature and checksum must both be correct */ 468 /* The RSDP signature and checksum must both be correct */
432 469
433 if (ACPI_STRNCMP ((char *) mem_rover, 470 status = acpi_tb_validate_rsdp (ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover));
434 RSDP_SIG, sizeof (RSDP_SIG) - 1) != 0) { 471 if (ACPI_SUCCESS (status)) {
435 /* No signature match, keep looking */ 472 /* Sig and checksum valid, we have found a real RSDP */
436
437 continue;
438 }
439
440 /* Signature matches, check the appropriate checksum */
441
442 if ((ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover))->revision < 2) {
443 /* ACPI version 1.0 */
444
445 checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH);
446 }
447 else {
448 /* Post ACPI 1.0, use extended_checksum */
449
450 checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_XCHECKSUM_LENGTH);
451 }
452
453 if (checksum == 0) {
454 /* Checksum valid, we have found a valid RSDP */
455 473
456 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, 474 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
457 "RSDP located at physical address %p\n", mem_rover)); 475 "RSDP located at physical address %p\n", mem_rover));
458 return_PTR (mem_rover); 476 return_PTR (mem_rover);
459 } 477 }
460 478
461 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, 479 /* No sig match or bad checksum, keep searching */
462 "Found an RSDP at physical address %p, but it has a bad checksum\n",
463 mem_rover));
464 } 480 }
465 481
466 /* Searched entire block, no RSDP was found */ 482 /* Searched entire block, no RSDP was found */
467 483
468 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, 484 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
469 "Searched entire block, no valid RSDP was found.\n")); 485 "Searched entire block from %p, valid RSDP was not found\n",
486 start_address));
470 return_PTR (NULL); 487 return_PTR (NULL);
471} 488}
472 489
@@ -554,7 +571,7 @@ acpi_tb_find_rsdp (
554 acpi_os_unmap_memory (table_ptr, ACPI_EBDA_WINDOW_SIZE); 571 acpi_os_unmap_memory (table_ptr, ACPI_EBDA_WINDOW_SIZE);
555 572
556 if (mem_rover) { 573 if (mem_rover) {
557 /* Found it, return the physical address */ 574 /* Return the physical address */
558 575
559 physical_address += ACPI_PTR_DIFF (mem_rover, table_ptr); 576 physical_address += ACPI_PTR_DIFF (mem_rover, table_ptr);
560 577
@@ -583,7 +600,7 @@ acpi_tb_find_rsdp (
583 acpi_os_unmap_memory (table_ptr, ACPI_HI_RSDP_WINDOW_SIZE); 600 acpi_os_unmap_memory (table_ptr, ACPI_HI_RSDP_WINDOW_SIZE);
584 601
585 if (mem_rover) { 602 if (mem_rover) {
586 /* Found it, return the physical address */ 603 /* Return the physical address */
587 604
588 physical_address = 605 physical_address =
589 ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (mem_rover, table_ptr); 606 ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (mem_rover, table_ptr);
@@ -614,7 +631,7 @@ acpi_tb_find_rsdp (
614 ACPI_PHYSADDR_TO_PTR (physical_address), 631 ACPI_PHYSADDR_TO_PTR (physical_address),
615 ACPI_EBDA_WINDOW_SIZE); 632 ACPI_EBDA_WINDOW_SIZE);
616 if (mem_rover) { 633 if (mem_rover) {
617 /* Found it, return the physical address */ 634 /* Return the physical address */
618 635
619 table_info->physical_address = ACPI_TO_INTEGER (mem_rover); 636 table_info->physical_address = ACPI_TO_INTEGER (mem_rover);
620 return_ACPI_STATUS (AE_OK); 637 return_ACPI_STATUS (AE_OK);
@@ -634,8 +651,9 @@ acpi_tb_find_rsdp (
634 } 651 }
635 } 652 }
636 653
637 /* RSDP signature was not found */ 654 /* A valid RSDP was not found */
638 655
656 ACPI_REPORT_ERROR (("No valid RSDP was found\n"));
639 return_ACPI_STATUS (AE_NOT_FOUND); 657 return_ACPI_STATUS (AE_NOT_FOUND);
640} 658}
641 659
diff --git a/drivers/acpi/utilities/utcache.c b/drivers/acpi/utilities/utcache.c
index 07588812e72d..c0df0585c683 100644
--- a/drivers/acpi/utilities/utcache.c
+++ b/drivers/acpi/utilities/utcache.c
@@ -74,6 +74,9 @@ acpi_os_create_cache (
74 struct acpi_memory_list *cache; 74 struct acpi_memory_list *cache;
75 75
76 76
77 ACPI_FUNCTION_ENTRY ();
78
79
77 if (!cache_name || !return_cache || (object_size < 16)) { 80 if (!cache_name || !return_cache || (object_size < 16)) {
78 return (AE_BAD_PARAMETER); 81 return (AE_BAD_PARAMETER);
79 } 82 }
@@ -161,7 +164,10 @@ acpi_os_delete_cache (
161 acpi_status status; 164 acpi_status status;
162 165
163 166
164 /* Purge all objects in the cache */ 167 ACPI_FUNCTION_ENTRY ();
168
169
170 /* Purge all objects in the cache */
165 171
166 status = acpi_os_purge_cache (cache); 172 status = acpi_os_purge_cache (cache);
167 if (ACPI_FAILURE (status)) { 173 if (ACPI_FAILURE (status)) {
@@ -259,7 +265,7 @@ acpi_os_acquire_object (
259 void *object; 265 void *object;
260 266
261 267
262 ACPI_FUNCTION_NAME ("ut_acquire_from_cache"); 268 ACPI_FUNCTION_NAME ("os_acquire_object");
263 269
264 270
265 if (!cache) { 271 if (!cache) {
@@ -286,7 +292,7 @@ acpi_os_acquire_object (
286 292
287 ACPI_MEM_TRACKING (cache->hits++); 293 ACPI_MEM_TRACKING (cache->hits++);
288 ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 294 ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
289 "Object %p from %s\n", object, cache->list_name))); 295 "Object %p from %s cache\n", object, cache->list_name)));
290 296
291 status = acpi_ut_release_mutex (ACPI_MTX_CACHES); 297 status = acpi_ut_release_mutex (ACPI_MTX_CACHES);
292 if (ACPI_FAILURE (status)) { 298 if (ACPI_FAILURE (status)) {
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 08362f686ec1..3d5fbc810b0b 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -116,10 +116,9 @@ acpi_ut_track_stack_ptr (
116 * 116 *
117 * PARAMETERS: requested_debug_level - Requested debug print level 117 * PARAMETERS: requested_debug_level - Requested debug print level
118 * line_number - Caller's line number (for error output) 118 * line_number - Caller's line number (for error output)
119 * dbg_info - Contains: 119 * function_name - Caller's procedure name
120 * proc_name - Caller's procedure name 120 * module_name - Caller's module name
121 * module_name - Caller's module name 121 * component_id - Caller's component ID
122 * component_id - Caller's component ID
123 * Format - Printf format field 122 * Format - Printf format field
124 * ... - Optional printf arguments 123 * ... - Optional printf arguments
125 * 124 *
@@ -134,7 +133,9 @@ void ACPI_INTERNAL_VAR_XFACE
134acpi_ut_debug_print ( 133acpi_ut_debug_print (
135 u32 requested_debug_level, 134 u32 requested_debug_level,
136 u32 line_number, 135 u32 line_number,
137 struct acpi_debug_print_info *dbg_info, 136 char *function_name,
137 char *module_name,
138 u32 component_id,
138 char *format, 139 char *format,
139 ...) 140 ...)
140{ 141{
@@ -146,7 +147,7 @@ acpi_ut_debug_print (
146 * Stay silent if the debug level or component ID is disabled 147 * Stay silent if the debug level or component ID is disabled
147 */ 148 */
148 if (!(requested_debug_level & acpi_dbg_level) || 149 if (!(requested_debug_level & acpi_dbg_level) ||
149 !(dbg_info->component_id & acpi_dbg_layer)) { 150 !(component_id & acpi_dbg_layer)) {
150 return; 151 return;
151 } 152 }
152 153
@@ -169,14 +170,14 @@ acpi_ut_debug_print (
169 * Display the module name, current line number, thread ID (if requested), 170 * Display the module name, current line number, thread ID (if requested),
170 * current procedure nesting level, and the current procedure name 171 * current procedure nesting level, and the current procedure name
171 */ 172 */
172 acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number); 173 acpi_os_printf ("%8s-%04ld ", module_name, line_number);
173 174
174 if (ACPI_LV_THREADS & acpi_dbg_level) { 175 if (ACPI_LV_THREADS & acpi_dbg_level) {
175 acpi_os_printf ("[%04lX] ", thread_id); 176 acpi_os_printf ("[%04lX] ", thread_id);
176 } 177 }
177 178
178 acpi_os_printf ("[%02ld] %-22.22s: ", 179 acpi_os_printf ("[%02ld] %-22.22s: ",
179 acpi_gbl_nesting_level, dbg_info->proc_name); 180 acpi_gbl_nesting_level, function_name);
180 181
181 va_start (args, format); 182 va_start (args, format);
182 acpi_os_vprintf (format, args); 183 acpi_os_vprintf (format, args);
@@ -190,10 +191,9 @@ EXPORT_SYMBOL(acpi_ut_debug_print);
190 * 191 *
191 * PARAMETERS: requested_debug_level - Requested debug print level 192 * PARAMETERS: requested_debug_level - Requested debug print level
192 * line_number - Caller's line number 193 * line_number - Caller's line number
193 * dbg_info - Contains: 194 * function_name - Caller's procedure name
194 * proc_name - Caller's procedure name 195 * module_name - Caller's module name
195 * module_name - Caller's module name 196 * component_id - Caller's component ID
196 * component_id - Caller's component ID
197 * Format - Printf format field 197 * Format - Printf format field
198 * ... - Optional printf arguments 198 * ... - Optional printf arguments
199 * 199 *
@@ -208,7 +208,9 @@ void ACPI_INTERNAL_VAR_XFACE
208acpi_ut_debug_print_raw ( 208acpi_ut_debug_print_raw (
209 u32 requested_debug_level, 209 u32 requested_debug_level,
210 u32 line_number, 210 u32 line_number,
211 struct acpi_debug_print_info *dbg_info, 211 char *function_name,
212 char *module_name,
213 u32 component_id,
212 char *format, 214 char *format,
213 ...) 215 ...)
214{ 216{
@@ -216,7 +218,7 @@ acpi_ut_debug_print_raw (
216 218
217 219
218 if (!(requested_debug_level & acpi_dbg_level) || 220 if (!(requested_debug_level & acpi_dbg_level) ||
219 !(dbg_info->component_id & acpi_dbg_layer)) { 221 !(component_id & acpi_dbg_layer)) {
220 return; 222 return;
221 } 223 }
222 224
@@ -231,10 +233,9 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw);
231 * FUNCTION: acpi_ut_trace 233 * FUNCTION: acpi_ut_trace
232 * 234 *
233 * PARAMETERS: line_number - Caller's line number 235 * PARAMETERS: line_number - Caller's line number
234 * dbg_info - Contains: 236 * function_name - Caller's procedure name
235 * proc_name - Caller's procedure name 237 * module_name - Caller's module name
236 * module_name - Caller's module name 238 * component_id - Caller's component ID
237 * component_id - Caller's component ID
238 * 239 *
239 * RETURN: None 240 * RETURN: None
240 * 241 *
@@ -246,14 +247,17 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw);
246void 247void
247acpi_ut_trace ( 248acpi_ut_trace (
248 u32 line_number, 249 u32 line_number,
249 struct acpi_debug_print_info *dbg_info) 250 char *function_name,
251 char *module_name,
252 u32 component_id)
250{ 253{
251 254
252 acpi_gbl_nesting_level++; 255 acpi_gbl_nesting_level++;
253 acpi_ut_track_stack_ptr (); 256 acpi_ut_track_stack_ptr ();
254 257
255 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 258 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
256 "%s\n", acpi_gbl_fn_entry_str); 259 line_number, function_name, module_name, component_id,
260 "%s\n", acpi_gbl_fn_entry_str);
257} 261}
258EXPORT_SYMBOL(acpi_ut_trace); 262EXPORT_SYMBOL(acpi_ut_trace);
259 263
@@ -263,10 +267,9 @@ EXPORT_SYMBOL(acpi_ut_trace);
263 * FUNCTION: acpi_ut_trace_ptr 267 * FUNCTION: acpi_ut_trace_ptr
264 * 268 *
265 * PARAMETERS: line_number - Caller's line number 269 * PARAMETERS: line_number - Caller's line number
266 * dbg_info - Contains: 270 * function_name - Caller's procedure name
267 * proc_name - Caller's procedure name 271 * module_name - Caller's module name
268 * module_name - Caller's module name 272 * component_id - Caller's component ID
269 * component_id - Caller's component ID
270 * Pointer - Pointer to display 273 * Pointer - Pointer to display
271 * 274 *
272 * RETURN: None 275 * RETURN: None
@@ -279,14 +282,17 @@ EXPORT_SYMBOL(acpi_ut_trace);
279void 282void
280acpi_ut_trace_ptr ( 283acpi_ut_trace_ptr (
281 u32 line_number, 284 u32 line_number,
282 struct acpi_debug_print_info *dbg_info, 285 char *function_name,
286 char *module_name,
287 u32 component_id,
283 void *pointer) 288 void *pointer)
284{ 289{
285 acpi_gbl_nesting_level++; 290 acpi_gbl_nesting_level++;
286 acpi_ut_track_stack_ptr (); 291 acpi_ut_track_stack_ptr ();
287 292
288 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 293 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
289 "%s %p\n", acpi_gbl_fn_entry_str, pointer); 294 line_number, function_name, module_name, component_id,
295 "%s %p\n", acpi_gbl_fn_entry_str, pointer);
290} 296}
291 297
292 298
@@ -295,10 +301,9 @@ acpi_ut_trace_ptr (
295 * FUNCTION: acpi_ut_trace_str 301 * FUNCTION: acpi_ut_trace_str
296 * 302 *
297 * PARAMETERS: line_number - Caller's line number 303 * PARAMETERS: line_number - Caller's line number
298 * dbg_info - Contains: 304 * function_name - Caller's procedure name
299 * proc_name - Caller's procedure name 305 * module_name - Caller's module name
300 * module_name - Caller's module name 306 * component_id - Caller's component ID
301 * component_id - Caller's component ID
302 * String - Additional string to display 307 * String - Additional string to display
303 * 308 *
304 * RETURN: None 309 * RETURN: None
@@ -311,15 +316,18 @@ acpi_ut_trace_ptr (
311void 316void
312acpi_ut_trace_str ( 317acpi_ut_trace_str (
313 u32 line_number, 318 u32 line_number,
314 struct acpi_debug_print_info *dbg_info, 319 char *function_name,
320 char *module_name,
321 u32 component_id,
315 char *string) 322 char *string)
316{ 323{
317 324
318 acpi_gbl_nesting_level++; 325 acpi_gbl_nesting_level++;
319 acpi_ut_track_stack_ptr (); 326 acpi_ut_track_stack_ptr ();
320 327
321 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 328 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
322 "%s %s\n", acpi_gbl_fn_entry_str, string); 329 line_number, function_name, module_name, component_id,
330 "%s %s\n", acpi_gbl_fn_entry_str, string);
323} 331}
324 332
325 333
@@ -328,10 +336,9 @@ acpi_ut_trace_str (
328 * FUNCTION: acpi_ut_trace_u32 336 * FUNCTION: acpi_ut_trace_u32
329 * 337 *
330 * PARAMETERS: line_number - Caller's line number 338 * PARAMETERS: line_number - Caller's line number
331 * dbg_info - Contains: 339 * function_name - Caller's procedure name
332 * proc_name - Caller's procedure name 340 * module_name - Caller's module name
333 * module_name - Caller's module name 341 * component_id - Caller's component ID
334 * component_id - Caller's component ID
335 * Integer - Integer to display 342 * Integer - Integer to display
336 * 343 *
337 * RETURN: None 344 * RETURN: None
@@ -344,15 +351,18 @@ acpi_ut_trace_str (
344void 351void
345acpi_ut_trace_u32 ( 352acpi_ut_trace_u32 (
346 u32 line_number, 353 u32 line_number,
347 struct acpi_debug_print_info *dbg_info, 354 char *function_name,
355 char *module_name,
356 u32 component_id,
348 u32 integer) 357 u32 integer)
349{ 358{
350 359
351 acpi_gbl_nesting_level++; 360 acpi_gbl_nesting_level++;
352 acpi_ut_track_stack_ptr (); 361 acpi_ut_track_stack_ptr ();
353 362
354 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 363 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
355 "%s %08X\n", acpi_gbl_fn_entry_str, integer); 364 line_number, function_name, module_name, component_id,
365 "%s %08X\n", acpi_gbl_fn_entry_str, integer);
356} 366}
357 367
358 368
@@ -361,10 +371,9 @@ acpi_ut_trace_u32 (
361 * FUNCTION: acpi_ut_exit 371 * FUNCTION: acpi_ut_exit
362 * 372 *
363 * PARAMETERS: line_number - Caller's line number 373 * PARAMETERS: line_number - Caller's line number
364 * dbg_info - Contains: 374 * function_name - Caller's procedure name
365 * proc_name - Caller's procedure name 375 * module_name - Caller's module name
366 * module_name - Caller's module name 376 * component_id - Caller's component ID
367 * component_id - Caller's component ID
368 * 377 *
369 * RETURN: None 378 * RETURN: None
370 * 379 *
@@ -376,11 +385,14 @@ acpi_ut_trace_u32 (
376void 385void
377acpi_ut_exit ( 386acpi_ut_exit (
378 u32 line_number, 387 u32 line_number,
379 struct acpi_debug_print_info *dbg_info) 388 char *function_name,
389 char *module_name,
390 u32 component_id)
380{ 391{
381 392
382 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 393 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
383 "%s\n", acpi_gbl_fn_exit_str); 394 line_number, function_name, module_name, component_id,
395 "%s\n", acpi_gbl_fn_exit_str);
384 396
385 acpi_gbl_nesting_level--; 397 acpi_gbl_nesting_level--;
386} 398}
@@ -392,10 +404,9 @@ EXPORT_SYMBOL(acpi_ut_exit);
392 * FUNCTION: acpi_ut_status_exit 404 * FUNCTION: acpi_ut_status_exit
393 * 405 *
394 * PARAMETERS: line_number - Caller's line number 406 * PARAMETERS: line_number - Caller's line number
395 * dbg_info - Contains: 407 * function_name - Caller's procedure name
396 * proc_name - Caller's procedure name 408 * module_name - Caller's module name
397 * module_name - Caller's module name 409 * component_id - Caller's component ID
398 * component_id - Caller's component ID
399 * Status - Exit status code 410 * Status - Exit status code
400 * 411 *
401 * RETURN: None 412 * RETURN: None
@@ -408,19 +419,23 @@ EXPORT_SYMBOL(acpi_ut_exit);
408void 419void
409acpi_ut_status_exit ( 420acpi_ut_status_exit (
410 u32 line_number, 421 u32 line_number,
411 struct acpi_debug_print_info *dbg_info, 422 char *function_name,
423 char *module_name,
424 u32 component_id,
412 acpi_status status) 425 acpi_status status)
413{ 426{
414 427
415 if (ACPI_SUCCESS (status)) { 428 if (ACPI_SUCCESS (status)) {
416 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 429 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
417 "%s %s\n", acpi_gbl_fn_exit_str, 430 line_number, function_name, module_name, component_id,
418 acpi_format_exception (status)); 431 "%s %s\n", acpi_gbl_fn_exit_str,
432 acpi_format_exception (status));
419 } 433 }
420 else { 434 else {
421 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 435 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
422 "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str, 436 line_number, function_name, module_name, component_id,
423 acpi_format_exception (status)); 437 "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str,
438 acpi_format_exception (status));
424 } 439 }
425 440
426 acpi_gbl_nesting_level--; 441 acpi_gbl_nesting_level--;
@@ -433,10 +448,9 @@ EXPORT_SYMBOL(acpi_ut_status_exit);
433 * FUNCTION: acpi_ut_value_exit 448 * FUNCTION: acpi_ut_value_exit
434 * 449 *
435 * PARAMETERS: line_number - Caller's line number 450 * PARAMETERS: line_number - Caller's line number
436 * dbg_info - Contains: 451 * function_name - Caller's procedure name
437 * proc_name - Caller's procedure name 452 * module_name - Caller's module name
438 * module_name - Caller's module name 453 * component_id - Caller's component ID
439 * component_id - Caller's component ID
440 * Value - Value to be printed with exit msg 454 * Value - Value to be printed with exit msg
441 * 455 *
442 * RETURN: None 456 * RETURN: None
@@ -449,13 +463,16 @@ EXPORT_SYMBOL(acpi_ut_status_exit);
449void 463void
450acpi_ut_value_exit ( 464acpi_ut_value_exit (
451 u32 line_number, 465 u32 line_number,
452 struct acpi_debug_print_info *dbg_info, 466 char *function_name,
467 char *module_name,
468 u32 component_id,
453 acpi_integer value) 469 acpi_integer value)
454{ 470{
455 471
456 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 472 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
457 "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, 473 line_number, function_name, module_name, component_id,
458 ACPI_FORMAT_UINT64 (value)); 474 "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
475 ACPI_FORMAT_UINT64 (value));
459 476
460 acpi_gbl_nesting_level--; 477 acpi_gbl_nesting_level--;
461} 478}
@@ -467,10 +484,9 @@ EXPORT_SYMBOL(acpi_ut_value_exit);
467 * FUNCTION: acpi_ut_ptr_exit 484 * FUNCTION: acpi_ut_ptr_exit
468 * 485 *
469 * PARAMETERS: line_number - Caller's line number 486 * PARAMETERS: line_number - Caller's line number
470 * dbg_info - Contains: 487 * function_name - Caller's procedure name
471 * proc_name - Caller's procedure name 488 * module_name - Caller's module name
472 * module_name - Caller's module name 489 * component_id - Caller's component ID
473 * component_id - Caller's component ID
474 * Ptr - Pointer to display 490 * Ptr - Pointer to display
475 * 491 *
476 * RETURN: None 492 * RETURN: None
@@ -483,12 +499,15 @@ EXPORT_SYMBOL(acpi_ut_value_exit);
483void 499void
484acpi_ut_ptr_exit ( 500acpi_ut_ptr_exit (
485 u32 line_number, 501 u32 line_number,
486 struct acpi_debug_print_info *dbg_info, 502 char *function_name,
503 char *module_name,
504 u32 component_id,
487 u8 *ptr) 505 u8 *ptr)
488{ 506{
489 507
490 acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, 508 acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
491 "%s %p\n", acpi_gbl_fn_exit_str, ptr); 509 line_number, function_name, module_name, component_id,
510 "%s %p\n", acpi_gbl_fn_exit_str, ptr);
492 511
493 acpi_gbl_nesting_level--; 512 acpi_gbl_nesting_level--;
494} 513}
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index be97ada23c3d..eeafb324c504 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -435,35 +435,24 @@ acpi_ut_update_object_reference (
435 union acpi_operand_object *object, 435 union acpi_operand_object *object,
436 u16 action) 436 u16 action)
437{ 437{
438 acpi_status status; 438 acpi_status status = AE_OK;
439 u32 i; 439 union acpi_generic_state *state_list = NULL;
440 union acpi_generic_state *state_list = NULL; 440 union acpi_operand_object *next_object = NULL;
441 union acpi_generic_state *state; 441 union acpi_generic_state *state;
442 acpi_native_uint i;
442 443
443 444
444 ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object); 445 ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
445 446
446 447
447 /* Ignore a null object ptr */ 448 while (object) {
449 /* Make sure that this isn't a namespace handle */
448 450
449 if (!object) { 451 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
450 return_ACPI_STATUS (AE_OK); 452 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
451 } 453 "Object %p is NS handle\n", object));
452 454 return_ACPI_STATUS (AE_OK);
453 /* Make sure that this isn't a namespace handle */ 455 }
454
455 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
456 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
457 "Object %p is NS handle\n", object));
458 return_ACPI_STATUS (AE_OK);
459 }
460
461 state = acpi_ut_create_update_state (object, action);
462
463 while (state) {
464 object = state->update.object;
465 action = state->update.value;
466 acpi_ut_delete_generic_state (state);
467 456
468 /* 457 /*
469 * All sub-objects must have their reference count incremented also. 458 * All sub-objects must have their reference count incremented also.
@@ -476,12 +465,10 @@ acpi_ut_update_object_reference (
476 acpi_ut_update_ref_count (object->device.device_notify, action); 465 acpi_ut_update_ref_count (object->device.device_notify, action);
477 break; 466 break;
478 467
479
480 case ACPI_TYPE_PACKAGE: 468 case ACPI_TYPE_PACKAGE:
481
482 /* 469 /*
483 * We must update all the sub-objects of the package 470 * We must update all the sub-objects of the package,
484 * (Each of whom may have their own sub-objects, etc. 471 * each of whom may have their own sub-objects.
485 */ 472 */
486 for (i = 0; i < object->package.count; i++) { 473 for (i = 0; i < object->package.count; i++) {
487 /* 474 /*
@@ -497,35 +484,19 @@ acpi_ut_update_object_reference (
497 } 484 }
498 break; 485 break;
499 486
500
501 case ACPI_TYPE_BUFFER_FIELD: 487 case ACPI_TYPE_BUFFER_FIELD:
502 488
503 status = acpi_ut_create_update_state_and_push ( 489 next_object = object->buffer_field.buffer_obj;
504 object->buffer_field.buffer_obj, action, &state_list);
505 if (ACPI_FAILURE (status)) {
506 goto error_exit;
507 }
508 break; 490 break;
509 491
510
511 case ACPI_TYPE_LOCAL_REGION_FIELD: 492 case ACPI_TYPE_LOCAL_REGION_FIELD:
512 493
513 status = acpi_ut_create_update_state_and_push ( 494 next_object = object->field.region_obj;
514 object->field.region_obj, action, &state_list); 495 break;
515 if (ACPI_FAILURE (status)) {
516 goto error_exit;
517 }
518 break;
519
520 496
521 case ACPI_TYPE_LOCAL_BANK_FIELD: 497 case ACPI_TYPE_LOCAL_BANK_FIELD:
522 498
523 status = acpi_ut_create_update_state_and_push ( 499 next_object = object->bank_field.bank_obj;
524 object->bank_field.bank_obj, action, &state_list);
525 if (ACPI_FAILURE (status)) {
526 goto error_exit;
527 }
528
529 status = acpi_ut_create_update_state_and_push ( 500 status = acpi_ut_create_update_state_and_push (
530 object->bank_field.region_obj, action, &state_list); 501 object->bank_field.region_obj, action, &state_list);
531 if (ACPI_FAILURE (status)) { 502 if (ACPI_FAILURE (status)) {
@@ -533,15 +504,9 @@ acpi_ut_update_object_reference (
533 } 504 }
534 break; 505 break;
535 506
536
537 case ACPI_TYPE_LOCAL_INDEX_FIELD: 507 case ACPI_TYPE_LOCAL_INDEX_FIELD:
538 508
539 status = acpi_ut_create_update_state_and_push ( 509 next_object = object->index_field.index_obj;
540 object->index_field.index_obj, action, &state_list);
541 if (ACPI_FAILURE (status)) {
542 goto error_exit;
543 }
544
545 status = acpi_ut_create_update_state_and_push ( 510 status = acpi_ut_create_update_state_and_push (
546 object->index_field.data_obj, action, &state_list); 511 object->index_field.data_obj, action, &state_list);
547 if (ACPI_FAILURE (status)) { 512 if (ACPI_FAILURE (status)) {
@@ -549,28 +514,19 @@ acpi_ut_update_object_reference (
549 } 514 }
550 break; 515 break;
551 516
552
553 case ACPI_TYPE_LOCAL_REFERENCE: 517 case ACPI_TYPE_LOCAL_REFERENCE:
554
555 /* 518 /*
556 * The target of an Index (a package, string, or buffer) must track 519 * The target of an Index (a package, string, or buffer) must track
557 * changes to the ref count of the index. 520 * changes to the ref count of the index.
558 */ 521 */
559 if (object->reference.opcode == AML_INDEX_OP) { 522 if (object->reference.opcode == AML_INDEX_OP) {
560 status = acpi_ut_create_update_state_and_push ( 523 next_object = object->reference.object;
561 object->reference.object, action, &state_list);
562 if (ACPI_FAILURE (status)) {
563 goto error_exit;
564 }
565 } 524 }
566 break; 525 break;
567 526
568
569 case ACPI_TYPE_REGION: 527 case ACPI_TYPE_REGION:
570 default: 528 default:
571 529 break;/* No subobjects */
572 /* No subobjects */
573 break;
574 } 530 }
575 531
576 /* 532 /*
@@ -579,15 +535,23 @@ acpi_ut_update_object_reference (
579 * main object to be deleted. 535 * main object to be deleted.
580 */ 536 */
581 acpi_ut_update_ref_count (object, action); 537 acpi_ut_update_ref_count (object, action);
538 object = NULL;
582 539
583 /* Move on to the next object to be updated */ 540 /* Move on to the next object to be updated */
584 541
585 state = acpi_ut_pop_generic_state (&state_list); 542 if (next_object) {
543 object = next_object;
544 next_object = NULL;
545 }
546 else if (state_list) {
547 state = acpi_ut_pop_generic_state (&state_list);
548 object = state->update.object;
549 acpi_ut_delete_generic_state (state);
550 }
586 } 551 }
587 552
588 return_ACPI_STATUS (AE_OK); 553 return_ACPI_STATUS (AE_OK);
589 554
590
591error_exit: 555error_exit:
592 556
593 ACPI_REPORT_ERROR (("Could not update object reference count, %s\n", 557 ACPI_REPORT_ERROR (("Could not update object reference count, %s\n",
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 8653dda4f813..0e4161c81076 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -738,73 +738,6 @@ acpi_ut_valid_object_type (
738 738
739/******************************************************************************* 739/*******************************************************************************
740 * 740 *
741 * FUNCTION: acpi_ut_allocate_owner_id
742 *
743 * PARAMETERS: id_type - Type of ID (method or table)
744 *
745 * DESCRIPTION: Allocate a table or method owner id
746 *
747 * NOTE: this algorithm has a wraparound problem at 64_k method invocations, and
748 * should be revisited (TBD)
749 *
750 ******************************************************************************/
751
752acpi_owner_id
753acpi_ut_allocate_owner_id (
754 u32 id_type)
755{
756 acpi_owner_id owner_id = 0xFFFF;
757
758
759 ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
760
761
762 if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES)))
763 {
764 return (0);
765 }
766
767 switch (id_type)
768 {
769 case ACPI_OWNER_TYPE_TABLE:
770
771 owner_id = acpi_gbl_next_table_owner_id;
772 acpi_gbl_next_table_owner_id++;
773
774 /* Check for wraparound */
775
776 if (acpi_gbl_next_table_owner_id == ACPI_FIRST_METHOD_ID)
777 {
778 acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID;
779 ACPI_REPORT_WARNING (("Table owner ID wraparound\n"));
780 }
781 break;
782
783
784 case ACPI_OWNER_TYPE_METHOD:
785
786 owner_id = acpi_gbl_next_method_owner_id;
787 acpi_gbl_next_method_owner_id++;
788
789 if (acpi_gbl_next_method_owner_id == ACPI_FIRST_TABLE_ID)
790 {
791 /* Check for wraparound */
792
793 acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID;
794 }
795 break;
796
797 default:
798 break;
799 }
800
801 (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
802 return_VALUE (owner_id);
803}
804
805
806/*******************************************************************************
807 *
808 * FUNCTION: acpi_ut_init_globals 741 * FUNCTION: acpi_ut_init_globals
809 * 742 *
810 * PARAMETERS: None 743 * PARAMETERS: None
@@ -848,7 +781,7 @@ acpi_ut_init_globals (
848 for (i = 0; i < NUM_MUTEX; i++) 781 for (i = 0; i < NUM_MUTEX; i++)
849 { 782 {
850 acpi_gbl_mutex_info[i].mutex = NULL; 783 acpi_gbl_mutex_info[i].mutex = NULL;
851 acpi_gbl_mutex_info[i].owner_id = ACPI_MUTEX_NOT_ACQUIRED; 784 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
852 acpi_gbl_mutex_info[i].use_count = 0; 785 acpi_gbl_mutex_info[i].use_count = 0;
853 } 786 }
854 787
@@ -889,8 +822,7 @@ acpi_ut_init_globals (
889 acpi_gbl_ns_lookup_count = 0; 822 acpi_gbl_ns_lookup_count = 0;
890 acpi_gbl_ps_find_count = 0; 823 acpi_gbl_ps_find_count = 0;
891 acpi_gbl_acpi_hardware_present = TRUE; 824 acpi_gbl_acpi_hardware_present = TRUE;
892 acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID; 825 acpi_gbl_owner_id_mask = 0;
893 acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID;
894 acpi_gbl_debugger_configuration = DEBUGGER_THREADING; 826 acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
895 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; 827 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
896 828
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 207c836aec64..df715cd89105 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -52,6 +52,100 @@
52 52
53/******************************************************************************* 53/*******************************************************************************
54 * 54 *
55 * FUNCTION: acpi_ut_allocate_owner_id
56 *
57 * PARAMETERS: owner_id - Where the new owner ID is returned
58 *
59 * DESCRIPTION: Allocate a table or method owner id
60 *
61 ******************************************************************************/
62
63acpi_status
64acpi_ut_allocate_owner_id (
65 acpi_owner_id *owner_id)
66{
67 acpi_native_uint i;
68 acpi_status status;
69
70
71 ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
72
73
74 status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
75 if (ACPI_FAILURE (status)) {
76 return_ACPI_STATUS (status);
77 }
78
79 /* Find a free owner ID */
80
81 for (i = 0; i < 32; i++) {
82 if (!(acpi_gbl_owner_id_mask & (1 << i))) {
83 acpi_gbl_owner_id_mask |= (1 << i);
84 *owner_id = (acpi_owner_id) i;
85 goto exit;
86 }
87 }
88
89 /*
90 * If we are here, all owner_ids have been allocated. This probably should
91 * not happen since the IDs are reused after deallocation. The IDs are
92 * allocated upon table load (one per table) and method execution, and
93 * they are released when a table is unloaded or a method completes
94 * execution.
95 */
96 status = AE_OWNER_ID_LIMIT;
97 ACPI_REPORT_ERROR ((
98 "Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n"));
99
100exit:
101 (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
102 return_ACPI_STATUS (status);
103}
104
105
106/*******************************************************************************
107 *
108 * FUNCTION: acpi_ut_release_owner_id
109 *
110 * PARAMETERS: owner_id - A previously allocated owner ID
111 *
112 * DESCRIPTION: Release a table or method owner id
113 *
114 ******************************************************************************/
115
116acpi_status
117acpi_ut_release_owner_id (
118 acpi_owner_id owner_id)
119{
120 acpi_status status;
121
122
123 ACPI_FUNCTION_TRACE ("ut_release_owner_id");
124
125
126 status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
127 if (ACPI_FAILURE (status)) {
128 return_ACPI_STATUS (status);
129 }
130
131 /* Free the owner ID */
132
133 if (acpi_gbl_owner_id_mask & (1 << owner_id)) {
134 acpi_gbl_owner_id_mask ^= (1 << owner_id);
135 }
136 else {
137 /* This owner_id has not been allocated */
138
139 status = AE_NOT_EXIST;
140 }
141
142 (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
143 return_ACPI_STATUS (status);
144}
145
146
147/*******************************************************************************
148 *
55 * FUNCTION: acpi_ut_strupr (strupr) 149 * FUNCTION: acpi_ut_strupr (strupr)
56 * 150 *
57 * PARAMETERS: src_string - The source string to convert 151 * PARAMETERS: src_string - The source string to convert
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index a80b97cb2e56..0699b6be62b6 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -159,7 +159,7 @@ acpi_ut_create_mutex (
159 if (!acpi_gbl_mutex_info[mutex_id].mutex) { 159 if (!acpi_gbl_mutex_info[mutex_id].mutex) {
160 status = acpi_os_create_semaphore (1, 1, 160 status = acpi_os_create_semaphore (1, 1,
161 &acpi_gbl_mutex_info[mutex_id].mutex); 161 &acpi_gbl_mutex_info[mutex_id].mutex);
162 acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED; 162 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
163 acpi_gbl_mutex_info[mutex_id].use_count = 0; 163 acpi_gbl_mutex_info[mutex_id].use_count = 0;
164 } 164 }
165 165
@@ -196,7 +196,7 @@ acpi_ut_delete_mutex (
196 status = acpi_os_delete_semaphore (acpi_gbl_mutex_info[mutex_id].mutex); 196 status = acpi_os_delete_semaphore (acpi_gbl_mutex_info[mutex_id].mutex);
197 197
198 acpi_gbl_mutex_info[mutex_id].mutex = NULL; 198 acpi_gbl_mutex_info[mutex_id].mutex = NULL;
199 acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED; 199 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
200 200
201 return_ACPI_STATUS (status); 201 return_ACPI_STATUS (status);
202} 202}
@@ -274,7 +274,7 @@ acpi_ut_acquire_mutex (
274 this_thread_id, acpi_ut_get_mutex_name (mutex_id))); 274 this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
275 275
276 acpi_gbl_mutex_info[mutex_id].use_count++; 276 acpi_gbl_mutex_info[mutex_id].use_count++;
277 acpi_gbl_mutex_info[mutex_id].owner_id = this_thread_id; 277 acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id;
278 } 278 }
279 else { 279 else {
280 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 280 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
@@ -322,7 +322,7 @@ acpi_ut_release_mutex (
322 /* 322 /*
323 * Mutex must be acquired in order to release it! 323 * Mutex must be acquired in order to release it!
324 */ 324 */
325 if (acpi_gbl_mutex_info[mutex_id].owner_id == ACPI_MUTEX_NOT_ACQUIRED) { 325 if (acpi_gbl_mutex_info[mutex_id].thread_id == ACPI_MUTEX_NOT_ACQUIRED) {
326 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 326 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
327 "Mutex [%s] is not acquired, cannot release\n", 327 "Mutex [%s] is not acquired, cannot release\n",
328 acpi_ut_get_mutex_name (mutex_id))); 328 acpi_ut_get_mutex_name (mutex_id)));
@@ -359,7 +359,7 @@ acpi_ut_release_mutex (
359 359
360 /* Mark unlocked FIRST */ 360 /* Mark unlocked FIRST */
361 361
362 acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED; 362 acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
363 363
364 status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1); 364 status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1);
365 365
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index dd9b70cc9634..aa3c08c6da41 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
64 64
65/* Version string */ 65/* Version string */
66 66
67#define ACPI_CA_VERSION 0x20050624 67#define ACPI_CA_VERSION 0x20050708
68 68
69/* 69/*
70 * OS name, used for the _OS object. The _OS object is essentially obsolete, 70 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index fcc2d507faca..26325430db80 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -211,7 +211,7 @@ acpi_dm_byte_list (
211 union acpi_parse_object *op); 211 union acpi_parse_object *op);
212 212
213void 213void
214acpi_is_eisa_id ( 214acpi_dm_is_eisa_id (
215 union acpi_parse_object *op); 215 union acpi_parse_object *op);
216 216
217void 217void
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 60d737b2d70f..0a6f492f3c8e 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -95,8 +95,9 @@
95#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) 95#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
96#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL) 96#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
97#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL) 97#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
98#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL)
98 99
99#define AE_CODE_ENV_MAX 0x001E 100#define AE_CODE_ENV_MAX 0x001F
100 101
101 102
102/* 103/*
@@ -226,7 +227,8 @@ char const *acpi_gbl_exception_names_env[] =
226 "AE_LOGICAL_ADDRESS", 227 "AE_LOGICAL_ADDRESS",
227 "AE_ABORT_METHOD", 228 "AE_ABORT_METHOD",
228 "AE_SAME_HANDLER", 229 "AE_SAME_HANDLER",
229 "AE_WAKE_ONLY_GPE" 230 "AE_WAKE_ONLY_GPE",
231 "AE_OWNER_ID_LIMIT"
230}; 232};
231 233
232char const *acpi_gbl_exception_names_pgm[] = 234char const *acpi_gbl_exception_names_pgm[] =
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 8d5a397abd6b..e3cf16eadbed 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -218,9 +218,8 @@ ACPI_EXTERN u32 acpi_gbl_original_mode;
218ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 218ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
219ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 219ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
220ACPI_EXTERN u32 acpi_gbl_ps_find_count; 220ACPI_EXTERN u32 acpi_gbl_ps_find_count;
221ACPI_EXTERN u32 acpi_gbl_owner_id_mask;
221ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 222ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
222ACPI_EXTERN u16 acpi_gbl_next_table_owner_id;
223ACPI_EXTERN u16 acpi_gbl_next_method_owner_id;
224ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 223ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
225ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 224ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
226ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; 225ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 58f9ba1a34e7..4d2635698e10 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -56,6 +56,13 @@ typedef u32 acpi_mutex_handle;
56#define AML_NUM_OPCODES 0x7F 56#define AML_NUM_OPCODES 0x7F
57 57
58 58
59/* Forward declarations */
60
61struct acpi_walk_state ;
62struct acpi_obj_mutex;
63union acpi_parse_object ;
64
65
59/***************************************************************************** 66/*****************************************************************************
60 * 67 *
61 * Mutex typedefs and structs 68 * Mutex typedefs and structs
@@ -116,19 +123,24 @@ static char *acpi_gbl_mutex_names[] =
116#endif 123#endif
117 124
118 125
126/* Owner IDs are used to track namespace nodes for selective deletion */
127
128typedef u8 acpi_owner_id;
129#define ACPI_OWNER_ID_MAX 0xFF
130
131/* This Thread ID means that the mutex is not in use (unlocked) */
132
133#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
134
119/* Table for the global mutexes */ 135/* Table for the global mutexes */
120 136
121struct acpi_mutex_info 137struct acpi_mutex_info
122{ 138{
123 acpi_mutex mutex; 139 acpi_mutex mutex;
124 u32 use_count; 140 u32 use_count;
125 u32 owner_id; 141 u32 thread_id;
126}; 142};
127 143
128/* This owner ID means that the mutex is not in use (unlocked) */
129
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1)
131
132 144
133/* Lock flag parameter for various interfaces */ 145/* Lock flag parameter for various interfaces */
134 146
@@ -136,13 +148,6 @@ struct acpi_mutex_info
136#define ACPI_MTX_LOCK 1 148#define ACPI_MTX_LOCK 1
137 149
138 150
139typedef u16 acpi_owner_id;
140#define ACPI_OWNER_TYPE_TABLE 0x0
141#define ACPI_OWNER_TYPE_METHOD 0x1
142#define ACPI_FIRST_METHOD_ID 0x0001
143#define ACPI_FIRST_TABLE_ID 0xF000
144
145
146/* Field access granularities */ 151/* Field access granularities */
147 152
148#define ACPI_FIELD_BYTE_GRANULARITY 1 153#define ACPI_FIELD_BYTE_GRANULARITY 1
@@ -185,13 +190,20 @@ struct acpi_namespace_node
185{ 190{
186 u8 descriptor; /* Used to differentiate object descriptor types */ 191 u8 descriptor; /* Used to differentiate object descriptor types */
187 u8 type; /* Type associated with this name */ 192 u8 type; /* Type associated with this name */
188 u16 owner_id; 193 u16 reference_count; /* Current count of references and children */
189 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 194 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
190 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ 195 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
191 struct acpi_namespace_node *child; /* First child */ 196 struct acpi_namespace_node *child; /* First child */
192 struct acpi_namespace_node *peer; /* Next peer*/ 197 struct acpi_namespace_node *peer; /* Next peer*/
193 u16 reference_count; /* Current count of references and children */ 198 u8 owner_id; /* Who created this node */
194 u8 flags; 199 u8 flags;
200
201 /* Fields used by the ASL compiler only */
202
203#ifdef ACPI_ASL_COMPILER
204 u32 value;
205 union acpi_parse_object *op;
206#endif
195}; 207};
196 208
197 209
@@ -222,7 +234,7 @@ struct acpi_table_desc
222 u64 physical_address; 234 u64 physical_address;
223 u32 aml_length; 235 u32 aml_length;
224 acpi_size length; 236 acpi_size length;
225 acpi_owner_id table_id; 237 acpi_owner_id owner_id;
226 u8 type; 238 u8 type;
227 u8 allocation; 239 u8 allocation;
228 u8 loaded_into_namespace; 240 u8 loaded_into_namespace;
@@ -420,13 +432,6 @@ struct acpi_field_info
420#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 432#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
421 433
422 434
423/* Forward declarations */
424
425struct acpi_walk_state ;
426struct acpi_obj_mutex;
427union acpi_parse_object ;
428
429
430#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 435#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
431 u8 data_type; /* To differentiate various internal objs */\ 436 u8 data_type; /* To differentiate various internal objs */\
432 u8 flags; \ 437 u8 flags; \
@@ -916,14 +921,6 @@ struct acpi_integrity_info
916 * 921 *
917 ****************************************************************************/ 922 ****************************************************************************/
918 923
919struct acpi_debug_print_info
920{
921 u32 component_id;
922 char *proc_name;
923 char *module_name;
924};
925
926
927/* Entry for a memory allocation (debug only) */ 924/* Entry for a memory allocation (debug only) */
928 925
929#define ACPI_MEM_MALLOC 0 926#define ACPI_MEM_MALLOC 0
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 09be937d2c39..5b100cef8dfc 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -437,21 +437,22 @@
437#define ACPI_PARAM_LIST(pl) pl 437#define ACPI_PARAM_LIST(pl) pl
438 438
439/* 439/*
440 * Error reporting. These versions add callers module and line#. Since 440 * Error reporting. These versions add callers module and line#.
441 * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only 441 *
442 * use it in debug mode. 442 * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
443 * isn't defined, only use it in debug mode.
443 */ 444 */
444#ifdef ACPI_DEBUG_OUTPUT 445#ifdef ACPI_DEBUG_OUTPUT
445 446
446#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ 447#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \
447 acpi_os_printf ACPI_PARAM_LIST(fp);} 448 acpi_os_printf ACPI_PARAM_LIST(fp);}
448#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ 449#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \
449 acpi_os_printf ACPI_PARAM_LIST(fp);} 450 acpi_os_printf ACPI_PARAM_LIST(fp);}
450#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ 451#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \
451 acpi_os_printf ACPI_PARAM_LIST(fp);} 452 acpi_os_printf ACPI_PARAM_LIST(fp);}
452#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); 453#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e);
453 454
454#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); 455#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e);
455 456
456#else 457#else
457 458
@@ -480,36 +481,56 @@
480 * Debug macros that are conditionally compiled 481 * Debug macros that are conditionally compiled
481 */ 482 */
482#ifdef ACPI_DEBUG_OUTPUT 483#ifdef ACPI_DEBUG_OUTPUT
484#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
483 485
484#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; 486/*
487 * Common parameters used for debug output functions:
488 * line number, function name, module(file) name, component ID
489 */
490#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
485 491
486/* 492/*
487 * Function entry tracing. 493 * Function entry tracing
488 * The first parameter should be the procedure name as a quoted string. This is declared
489 * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
490 */ 494 */
491#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \ 495
492 _debug_info.component_id = _COMPONENT; \ 496/*
493 _debug_info.proc_name = a; \ 497 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
494 _debug_info.module_name = _THIS_MODULE; 498 * define it now. This is the case where there the compiler does not support
495 499 * a __FUNCTION__ macro or equivalent. We save the function name on the
496#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 500 * local stack.
497 acpi_ut_trace(__LINE__,&_debug_info) 501 */
498#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 502#ifndef ACPI_GET_FUNCTION_NAME
499 acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b) 503#define ACPI_GET_FUNCTION_NAME _acpi_function_name
500#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 504/*
501 acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b) 505 * The Name parameter should be the procedure name as a quoted string.
502#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ 506 * This is declared as a local string ("my_function_name") so that it can
503 acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b) 507 * be also used by the function exit macros below.
504 508 */
505#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() 509#define ACPI_FUNCTION_NAME(name) char *_acpi_function_name = name;
510
511#else
512/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
513
514#define ACPI_FUNCTION_NAME(name)
515#endif
516
517#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
518 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
519#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
520 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
521#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
522 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
523#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
524 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
525
526#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
506 527
507/* 528/*
508 * Function exit tracing. 529 * Function exit tracing.
509 * WARNING: These macros include a return statement. This is usually considered 530 * WARNING: These macros include a return statement. This is usually considered
510 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 531 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
511 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 532 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
512 * so that "_proc_name" is defined. 533 * so that "_acpi_function_name" is defined.
513 */ 534 */
514#ifdef ACPI_USE_DO_WHILE_0 535#ifdef ACPI_USE_DO_WHILE_0
515#define ACPI_DO_WHILE0(a) do a while(0) 536#define ACPI_DO_WHILE0(a) do a while(0)
@@ -517,10 +538,10 @@
517#define ACPI_DO_WHILE0(a) a 538#define ACPI_DO_WHILE0(a) a
518#endif 539#endif
519 540
520#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;}) 541#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;})
521#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));}) 542#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));})
522#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));}) 543#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));})
523#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));}) 544#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));})
524 545
525/* Conditional execution */ 546/* Conditional execution */
526 547
@@ -535,7 +556,7 @@
535/* Stack and buffer dumping */ 556/* Stack and buffer dumping */
536 557
537#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) 558#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0)
538#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) 559#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__)
539 560
540 561
541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 562#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
@@ -572,7 +593,7 @@
572 * leaving no executable debug code! 593 * leaving no executable debug code!
573 */ 594 */
574#define ACPI_MODULE_NAME(name) 595#define ACPI_MODULE_NAME(name)
575#define _THIS_MODULE "" 596#define _acpi_module_name ""
576 597
577#define ACPI_DEBUG_EXEC(a) 598#define ACPI_DEBUG_EXEC(a)
578#define ACPI_NORMAL_EXEC(a) a; 599#define ACPI_NORMAL_EXEC(a) a;
@@ -648,19 +669,18 @@
648 669
649/* Memory allocation */ 670/* Memory allocation */
650 671
651#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 672#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
652#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 673#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
653#define ACPI_MEM_FREE(a) acpi_os_free(a) 674#define ACPI_MEM_FREE(a) acpi_os_free(a)
654#define ACPI_MEM_TRACKING(a) 675#define ACPI_MEM_TRACKING(a)
655 676
656
657#else 677#else
658 678
659/* Memory allocation */ 679/* Memory allocation */
660 680
661#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 681#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
662#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 682#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
663#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) 683#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
664#define ACPI_MEM_TRACKING(a) a 684#define ACPI_MEM_TRACKING(a) a
665 685
666#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 686#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index d1b3ce80056f..870e2544bd9b 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -163,7 +163,7 @@ acpi_ns_delete_namespace_subtree (
163 163
164void 164void
165acpi_ns_delete_namespace_by_owner ( 165acpi_ns_delete_namespace_by_owner (
166 u16 table_id); 166 acpi_owner_id owner_id);
167 167
168void 168void
169acpi_ns_detach_object ( 169acpi_ns_detach_object (
@@ -219,7 +219,7 @@ acpi_ns_dump_objects (
219 acpi_object_type type, 219 acpi_object_type type,
220 u8 display_type, 220 u8 display_type,
221 u32 max_depth, 221 u32 max_depth,
222 u32 ownder_id, 222 acpi_owner_id owner_id,
223 acpi_handle start_handle); 223 acpi_handle start_handle);
224#endif /* ACPI_FUTURE_USAGE */ 224#endif /* ACPI_FUTURE_USAGE */
225 225
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index e079b94e4fce..34f9d1f1f79b 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -199,7 +199,7 @@ struct acpi_object_method
199 ACPI_INTERNAL_METHOD implementation; 199 ACPI_INTERNAL_METHOD implementation;
200 u8 concurrency; 200 u8 concurrency;
201 u8 thread_count; 201 u8 thread_count;
202 acpi_owner_id owning_id; 202 acpi_owner_id owner_id;
203}; 203};
204 204
205 205
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 2fbe180fee6b..d7e828cb84b3 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -136,7 +136,7 @@
136/* 136/*
137 * Debug level macros that are used in the DEBUG_PRINT macros 137 * Debug level macros that are used in the DEBUG_PRINT macros
138 */ 138 */
139#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_debug_info 139#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
140 140
141/* Exception level -- used in the global "debug_level" */ 141/* Exception level -- used in the global "debug_level" */
142 142
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index a2025a8da008..f375c17ad0b6 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -71,7 +71,6 @@ struct acpi_walk_state
71 u8 walk_type; 71 u8 walk_type;
72 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 72 acpi_owner_id owner_id; /* Owner of objects created during the walk */
73 u8 last_predicate; /* Result of last predicate */ 73 u8 last_predicate; /* Result of last predicate */
74 u8 reserved; /* For alignment */
75 u8 current_result; /* */ 74 u8 current_result; /* */
76 u8 next_op_info; /* Info about next_op */ 75 u8 next_op_info; /* Info about next_op */
77 u8 num_operands; /* Stack pointer for Operands[] array */ 76 u8 num_operands; /* Stack pointer for Operands[] array */
@@ -154,17 +153,17 @@ struct acpi_device_walk_info
154struct acpi_walk_info 153struct acpi_walk_info
155{ 154{
156 u32 debug_level; 155 u32 debug_level;
157 u32 owner_id; 156 acpi_owner_id owner_id;
158 u8 display_type; 157 u8 display_type;
159}; 158};
160 159
161/* Display Types */ 160/* Display Types */
162 161
163#define ACPI_DISPLAY_SUMMARY 0 162#define ACPI_DISPLAY_SUMMARY (u8) 0
164#define ACPI_DISPLAY_OBJECTS 1 163#define ACPI_DISPLAY_OBJECTS (u8) 1
165#define ACPI_DISPLAY_MASK 1 164#define ACPI_DISPLAY_MASK (u8) 1
166 165
167#define ACPI_DISPLAY_SHORT 2 166#define ACPI_DISPLAY_SHORT (u8) 2
168 167
169struct acpi_get_devices_info 168struct acpi_get_devices_info
170{ 169{
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 39df92e21a0d..97e6f12da527 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -169,6 +169,10 @@ acpi_status
169acpi_tb_get_table_rsdt ( 169acpi_tb_get_table_rsdt (
170 void); 170 void);
171 171
172acpi_status
173acpi_tb_validate_rsdp (
174 struct rsdp_descriptor *rsdp);
175
172 176
173/* 177/*
174 * tbutils - common table utilities 178 * tbutils - common table utilities
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b5cdcca444c8..c1e9110c3661 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -86,15 +86,15 @@
86 */ 86 */
87struct rsdp_descriptor /* Root System Descriptor Pointer */ 87struct rsdp_descriptor /* Root System Descriptor Pointer */
88{ 88{
89 char signature [8]; /* ACPI signature, contains "RSD PTR " */ 89 char signature[8]; /* ACPI signature, contains "RSD PTR " */
90 u8 checksum; /* To make sum of struct == 0 */ 90 u8 checksum; /* ACPI 1.0 checksum */
91 char oem_id [6]; /* OEM identification */ 91 char oem_id[6]; /* OEM identification */
92 u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ 92 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
93 u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ 93 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
94 u32 length; /* XSDT Length in bytes including hdr */ 94 u32 length; /* XSDT Length in bytes, including header */
95 u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ 95 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
96 u8 extended_checksum; /* Checksum of entire table */ 96 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
97 char reserved [3]; /* Reserved field must be 0 */ 97 char reserved[3]; /* Reserved, must be zero */
98}; 98};
99 99
100 100
@@ -107,15 +107,15 @@ struct acpi_common_facs /* Common FACS for internal use */
107 107
108 108
109#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ 109#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
110 char signature [4]; /* ACPI signature (4 ASCII characters) */\ 110 char signature[4]; /* ASCII table signature */\
111 u32 length; /* Length of table, in bytes, including header */\ 111 u32 length; /* Length of table in bytes, including this header */\
112 u8 revision; /* ACPI Specification minor version # */\ 112 u8 revision; /* ACPI Specification minor version # */\
113 u8 checksum; /* To make sum of entire table == 0 */\ 113 u8 checksum; /* To make sum of entire table == 0 */\
114 char oem_id [6]; /* OEM identification */\ 114 char oem_id[6]; /* ASCII OEM identification */\
115 char oem_table_id [8]; /* OEM table identification */\ 115 char oem_table_id[8]; /* ASCII OEM table identification */\
116 u32 oem_revision; /* OEM revision number */\ 116 u32 oem_revision; /* OEM revision number */\
117 char asl_compiler_id [4]; /* ASL compiler vendor ID */\ 117 char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\
118 u32 asl_compiler_revision; /* ASL compiler revision number */ 118 u32 asl_compiler_revision; /* ASL compiler version */
119 119
120 120
121struct acpi_table_header /* ACPI common table header */ 121struct acpi_table_header /* ACPI common table header */
@@ -139,8 +139,12 @@ struct multiple_apic_table
139{ 139{
140 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 140 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
141 u32 local_apic_address; /* Physical address of local APIC */ 141 u32 local_apic_address; /* Physical address of local APIC */
142 u32 PCATcompat : 1; /* A one indicates system also has dual 8259s */ 142
143 u32 reserved1 : 31; 143 /* Flags (32 bits) */
144
145 u8 PCATcompat : 1; /* 00: System also has dual 8259s */
146 u8 : 7; /* 01-07: Reserved, must be zero */
147 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
144}; 148};
145 149
146/* Values for Type in APIC_HEADER_DEF */ 150/* Values for Type in APIC_HEADER_DEF */
@@ -180,16 +184,18 @@ struct apic_header
180#define TRIGGER_RESERVED 2 184#define TRIGGER_RESERVED 2
181#define TRIGGER_LEVEL 3 185#define TRIGGER_LEVEL 3
182 186
183/* Common flag definitions */ 187/* Common flag definitions (16 bits each) */
184 188
185#define MPS_INTI_FLAGS \ 189#define MPS_INTI_FLAGS \
186 u16 polarity : 2; /* Polarity of APIC I/O input signals */\ 190 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
187 u16 trigger_mode : 2; /* Trigger mode of APIC input signals */\ 191 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
188 u16 reserved1 : 12; /* Reserved, must be zero */ 192 u8 : 4; /* 04-07: Reserved, must be zero */\
193 u8 reserved1; /* 08-15: Reserved, must be zero */
189 194
190#define LOCAL_APIC_FLAGS \ 195#define LOCAL_APIC_FLAGS \
191 u32 processor_enabled: 1; /* Processor is usable if set */\ 196 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
192 u32 reserved2 : 31; /* Reserved, must be zero */ 197 u8 : 7; /* 01-07: Reserved, must be zero */\
198 u8 reserved2; /* 08-15: Reserved, must be zero */
193 199
194/* Sub-structures for MADT */ 200/* Sub-structures for MADT */
195 201
@@ -238,7 +244,7 @@ struct madt_local_apic_nmi
238struct madt_address_override 244struct madt_address_override
239{ 245{
240 APIC_HEADER_DEF 246 APIC_HEADER_DEF
241 u16 reserved; /* Reserved - must be zero */ 247 u16 reserved; /* Reserved, must be zero */
242 u64 address; /* APIC physical address */ 248 u64 address; /* APIC physical address */
243}; 249};
244 250
@@ -246,7 +252,7 @@ struct madt_io_sapic
246{ 252{
247 APIC_HEADER_DEF 253 APIC_HEADER_DEF
248 u8 io_sapic_id; /* I/O SAPIC ID */ 254 u8 io_sapic_id; /* I/O SAPIC ID */
249 u8 reserved; /* Reserved - must be zero */ 255 u8 reserved; /* Reserved, must be zero */
250 u32 interrupt_base; /* Glocal interrupt for SAPIC start */ 256 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
251 u64 address; /* SAPIC physical address */ 257 u64 address; /* SAPIC physical address */
252}; 258};
@@ -257,7 +263,7 @@ struct madt_local_sapic
257 u8 processor_id; /* ACPI processor id */ 263 u8 processor_id; /* ACPI processor id */
258 u8 local_sapic_id; /* SAPIC ID */ 264 u8 local_sapic_id; /* SAPIC ID */
259 u8 local_sapic_eid; /* SAPIC EID */ 265 u8 local_sapic_eid; /* SAPIC EID */
260 u8 reserved [3]; /* Reserved - must be zero */ 266 u8 reserved[3]; /* Reserved, must be zero */
261 LOCAL_APIC_FLAGS 267 LOCAL_APIC_FLAGS
262 u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 268 u32 processor_uID; /* Numeric UID - ACPI 3.0 */
263 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 269 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 33de5f4d2ccc..93c175a4f446 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -52,8 +52,7 @@
52struct rsdt_descriptor_rev1 52struct rsdt_descriptor_rev1
53{ 53{
54 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 54 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
55 u32 table_offset_entry [1]; /* Array of pointers to other */ 55 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
56 /* ACPI tables */
57}; 56};
58 57
59 58
@@ -62,14 +61,19 @@ struct rsdt_descriptor_rev1
62 */ 61 */
63struct facs_descriptor_rev1 62struct facs_descriptor_rev1
64{ 63{
65 char signature[4]; /* ACPI Signature */ 64 char signature[4]; /* ASCII table signature */
66 u32 length; /* Length of structure, in bytes */ 65 u32 length; /* Length of structure in bytes */
67 u32 hardware_signature; /* Hardware configuration signature */ 66 u32 hardware_signature; /* Hardware configuration signature */
68 u32 firmware_waking_vector; /* ACPI OS waking vector */ 67 u32 firmware_waking_vector; /* ACPI OS waking vector */
69 u32 global_lock; /* Global Lock */ 68 u32 global_lock; /* Global Lock */
70 u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ 69
71 u32 reserved1 : 31; /* Must be 0 */ 70 /* Flags (32 bits) */
72 u8 resverved3 [40]; /* Reserved - must be zero */ 71
72 u8 S4bios_f : 1; /* 00: S4BIOS support is present */
73 u8 : 7; /* 01-07: Reserved, must be zero */
74 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
75
76 u8 reserved2[40]; /* Reserved, must be zero */
73}; 77};
74 78
75 79
@@ -82,13 +86,13 @@ struct fadt_descriptor_rev1
82 u32 firmware_ctrl; /* Physical address of FACS */ 86 u32 firmware_ctrl; /* Physical address of FACS */
83 u32 dsdt; /* Physical address of DSDT */ 87 u32 dsdt; /* Physical address of DSDT */
84 u8 model; /* System Interrupt Model */ 88 u8 model; /* System Interrupt Model */
85 u8 reserved1; /* Reserved */ 89 u8 reserved1; /* Reserved, must be zero */
86 u16 sci_int; /* System vector of SCI interrupt */ 90 u16 sci_int; /* System vector of SCI interrupt */
87 u32 smi_cmd; /* Port address of SMI command port */ 91 u32 smi_cmd; /* Port address of SMI command port */
88 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ 92 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
89 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ 93 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
90 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 94 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
91 u8 reserved2; /* Reserved - must be zero */ 95 u8 reserved2; /* Reserved, must be zero */
92 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 96 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
93 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 97 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
94 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 98 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
@@ -104,7 +108,7 @@ struct fadt_descriptor_rev1
104 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 108 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
105 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 109 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
106 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ 110 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */
107 u8 reserved3; /* Reserved */ 111 u8 reserved3; /* Reserved, must be zero */
108 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ 112 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */
109 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ 113 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
110 u16 flush_size; /* Size of area read to flush caches */ 114 u16 flush_size; /* Size of area read to flush caches */
@@ -114,19 +118,21 @@ struct fadt_descriptor_rev1
114 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ 118 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
115 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ 119 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
116 u8 century; /* Index to century in RTC CMOS RAM */ 120 u8 century; /* Index to century in RTC CMOS RAM */
117 u8 reserved4; /* Reserved */ 121 u8 reserved4[3]; /* Reserved, must be zero */
118 u8 reserved4a; /* Reserved */ 122
119 u8 reserved4b; /* Reserved */ 123 /* Flags (32 bits) */
120 u32 wb_invd : 1; /* The wbinvd instruction works properly */ 124
121 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ 125 u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
122 u32 proc_c1 : 1; /* All processors support C1 state */ 126 u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
123 u32 plvl2_up : 1; /* C2 state works on MP system */ 127 u8 proc_c1 : 1; /* 02: All processors support C1 state */
124 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 128 u8 plvl2_up : 1; /* 03: C2 state works on MP system */
125 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 129 u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
126 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 130 u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
127 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 131 u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
128 u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */ 132 u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
129 u32 reserved5 : 23; /* Reserved - must be zero */ 133 u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */
134 u8 : 7; /* 09-15: Reserved, must be zero */
135 u8 reserved5[2]; /* 16-31: Reserved, must be zero */
130}; 136};
131 137
132#pragma pack() 138#pragma pack()
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index e1729c967e05..84ce5abbd6f6 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -73,8 +73,7 @@
73struct rsdt_descriptor_rev2 73struct rsdt_descriptor_rev2
74{ 74{
75 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 75 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
76 u32 table_offset_entry [1]; /* Array of pointers to */ 76 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
77 /* ACPI table headers */
78}; 77};
79 78
80 79
@@ -84,8 +83,7 @@ struct rsdt_descriptor_rev2
84struct xsdt_descriptor_rev2 83struct xsdt_descriptor_rev2
85{ 84{
86 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 85 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
87 u64 table_offset_entry [1]; /* Array of pointers to */ 86 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
88 /* ACPI table headers */
89}; 87};
90 88
91 89
@@ -94,16 +92,21 @@ struct xsdt_descriptor_rev2
94 */ 92 */
95struct facs_descriptor_rev2 93struct facs_descriptor_rev2
96{ 94{
97 char signature[4]; /* ACPI signature */ 95 char signature[4]; /* ASCII table signature */
98 u32 length; /* Length of structure, in bytes */ 96 u32 length; /* Length of structure, in bytes */
99 u32 hardware_signature; /* Hardware configuration signature */ 97 u32 hardware_signature; /* Hardware configuration signature */
100 u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ 98 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
101 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ 99 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
102 u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ 100
103 u32 reserved1 : 31; /* Must be 0 */ 101 /* Flags (32 bits) */
104 u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ 102
103 u8 S4bios_f : 1; /* 00: S4BIOS support is present */
104 u8 : 7; /* 01-07: Reserved, must be zero */
105 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
106
107 u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
105 u8 version; /* Version of this table */ 108 u8 version; /* Version of this table */
106 u8 reserved3 [31]; /* Reserved - must be zero */ 109 u8 reserved3[31]; /* Reserved, must be zero */
107}; 110};
108 111
109 112
@@ -165,35 +168,37 @@ struct fadt_descriptor_rev2
165{ 168{
166 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 169 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
167 FADT_REV2_COMMON 170 FADT_REV2_COMMON
168 u8 reserved2; /* Reserved */ 171 u8 reserved2; /* Reserved, must be zero */
169 u32 wb_invd : 1; /* The wbinvd instruction works properly */ 172
170 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ 173 /* Flags (32 bits) */
171 u32 proc_c1 : 1; /* All processors support C1 state */ 174
172 u32 plvl2_up : 1; /* C2 state works on MP system */ 175 u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
173 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 176 u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
174 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 177 u8 proc_c1 : 1; /* 02: All processors support C1 state */
175 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 178 u8 plvl2_up : 1; /* 03: C2 state works on MP system */
176 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 179 u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
177 u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */ 180 u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
178 u32 dock_cap : 1; /* Supports Docking */ 181 u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
179 u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */ 182 u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
180 u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */ 183 u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */
181 u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */ 184 u8 dock_cap : 1; /* 09: Docking supported */
182 u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ 185 u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */
183 /* must be executed after writing the SLP_TYPx register */ 186 u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */
184 /* ACPI 3.0 flag bits */ 187 u8 headless : 1; /* 12: No local video capabilities or local input devices */
185 188 u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */
186 u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */ 189
187 u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */ 190 u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
188 u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */ 191 u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
189 u32 remote_power_on_capable : 1; /* System is compatible with remote power on */ 192 u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
190 u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */ 193 u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */
191 u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */ 194 u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
192 u32 reserved6 : 12;/* Reserved - must be zero */ 195 u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
196 u8 : 4; /* 20-23: Reserved, must be zero */
197 u8 reserved3; /* 24-31: Reserved, must be zero */
193 198
194 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 199 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
195 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 200 u8 reset_value; /* Value to write to the reset_register port to reset the system */
196 u8 reserved7[3]; /* These three bytes must be zero */ 201 u8 reserved4[3]; /* These three bytes must be zero */
197 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ 202 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
198 u64 Xdsdt; /* 64-bit physical address of DSDT */ 203 u64 Xdsdt; /* 64-bit physical address of DSDT */
199 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ 204 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
@@ -213,11 +218,11 @@ struct fadt_descriptor_rev2_minus
213{ 218{
214 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 219 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
215 FADT_REV2_COMMON 220 FADT_REV2_COMMON
216 u8 reserved2; /* Reserved */ 221 u8 reserved2; /* Reserved, must be zero */
217 u32 flags; 222 u32 flags;
218 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 223 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
219 u8 reset_value; /* Value to write to the reset_register port to reset the system. */ 224 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
220 u8 reserved7[3]; /* These three bytes must be zero */ 225 u8 reserved7[3]; /* Reserved, must be zero */
221}; 226};
222 227
223 228
@@ -242,11 +247,16 @@ struct static_resource_alloc
242 u8 length; 247 u8 length;
243 u8 proximity_domain_lo; 248 u8 proximity_domain_lo;
244 u8 apic_id; 249 u8 apic_id;
245 u32 enabled :1; 250
246 u32 reserved3 :31; 251 /* Flags (32 bits) */
252
253 u8 enabled :1; /* 00: Use affinity structure */
254 u8 :7; /* 01-07: Reserved, must be zero */
255 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
256
247 u8 local_sapic_eid; 257 u8 local_sapic_eid;
248 u8 proximity_domain_hi[3]; 258 u8 proximity_domain_hi[3];
249 u32 reserved4; 259 u32 reserved4; /* Reserved, must be zero */
250}; 260};
251 261
252struct memory_affinity 262struct memory_affinity
@@ -258,18 +268,23 @@ struct memory_affinity
258 u64 base_address; 268 u64 base_address;
259 u64 address_length; 269 u64 address_length;
260 u32 reserved4; 270 u32 reserved4;
261 u32 enabled :1; 271
262 u32 hot_pluggable :1; 272 /* Flags (32 bits) */
263 u32 non_volatile :1; 273
264 u32 reserved5 :29; 274 u8 enabled :1; /* 00: Use affinity structure */
265 u64 reserved6; 275 u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */
276 u8 non_volatile :1; /* 02: Memory is non-volatile */
277 u8 :5; /* 03-07: Reserved, must be zero */
278 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
279
280 u64 reserved6; /* Reserved, must be zero */
266}; 281};
267 282
268struct system_resource_affinity 283struct system_resource_affinity
269{ 284{
270 ACPI_TABLE_HEADER_DEF 285 ACPI_TABLE_HEADER_DEF
271 u32 reserved1; /* Must be value '1' */ 286 u32 reserved1; /* Must be value '1' */
272 u64 reserved2; 287 u64 reserved2; /* Reserved, must be zero */
273}; 288};
274 289
275 290
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 8cd774a20c67..1895b862ce0d 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -205,10 +205,11 @@ typedef u32 acpi_size;
205 205
206 206
207/* 207/*
208 * Miscellaneous common types 208 * This type is used for bitfields in ACPI tables. The only type that is
209 * even remotely portable is u8. Anything else is not portable, so
210 * do not add any more bitfield types.
209 */ 211 */
210typedef u16 UINT16_BIT; 212typedef u8 UINT8_BIT;
211typedef u32 UINT32_BIT;
212typedef acpi_native_uint ACPI_PTRDIFF; 213typedef acpi_native_uint ACPI_PTRDIFF;
213 214
214/* 215/*
@@ -243,10 +244,13 @@ struct acpi_pointer
243#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 244#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
244#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 245#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
245 246
246/* Types for the OS interface layer (OSL) */ 247/*
247 248 * If acpi_cache_t was not defined in the OS-dependent header,
248#ifdef ACPI_USE_LOCAL_CACHE 249 * define it now. This is typically the case where the local cache
249#define acpi_cache_t struct acpi_memory_list 250 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
251 */
252#ifndef acpi_cache_t
253#define acpi_cache_t struct acpi_memory_list
250#endif 254#endif
251 255
252/* 256/*
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index e9c1584dd785..9c05c10e379a 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -120,10 +120,6 @@ u8
120acpi_ut_valid_object_type ( 120acpi_ut_valid_object_type (
121 acpi_object_type type); 121 acpi_object_type type);
122 122
123acpi_owner_id
124acpi_ut_allocate_owner_id (
125 u32 id_type);
126
127 123
128/* 124/*
129 * utinit - miscellaneous initialization and shutdown 125 * utinit - miscellaneous initialization and shutdown
@@ -306,47 +302,63 @@ acpi_ut_track_stack_ptr (
306void 302void
307acpi_ut_trace ( 303acpi_ut_trace (
308 u32 line_number, 304 u32 line_number,
309 struct acpi_debug_print_info *dbg_info); 305 char *function_name,
306 char *module_name,
307 u32 component_id);
310 308
311void 309void
312acpi_ut_trace_ptr ( 310acpi_ut_trace_ptr (
313 u32 line_number, 311 u32 line_number,
314 struct acpi_debug_print_info *dbg_info, 312 char *function_name,
313 char *module_name,
314 u32 component_id,
315 void *pointer); 315 void *pointer);
316 316
317void 317void
318acpi_ut_trace_u32 ( 318acpi_ut_trace_u32 (
319 u32 line_number, 319 u32 line_number,
320 struct acpi_debug_print_info *dbg_info, 320 char *function_name,
321 char *module_name,
322 u32 component_id,
321 u32 integer); 323 u32 integer);
322 324
323void 325void
324acpi_ut_trace_str ( 326acpi_ut_trace_str (
325 u32 line_number, 327 u32 line_number,
326 struct acpi_debug_print_info *dbg_info, 328 char *function_name,
329 char *module_name,
330 u32 component_id,
327 char *string); 331 char *string);
328 332
329void 333void
330acpi_ut_exit ( 334acpi_ut_exit (
331 u32 line_number, 335 u32 line_number,
332 struct acpi_debug_print_info *dbg_info); 336 char *function_name,
337 char *module_name,
338 u32 component_id);
333 339
334void 340void
335acpi_ut_status_exit ( 341acpi_ut_status_exit (
336 u32 line_number, 342 u32 line_number,
337 struct acpi_debug_print_info *dbg_info, 343 char *function_name,
344 char *module_name,
345 u32 component_id,
338 acpi_status status); 346 acpi_status status);
339 347
340void 348void
341acpi_ut_value_exit ( 349acpi_ut_value_exit (
342 u32 line_number, 350 u32 line_number,
343 struct acpi_debug_print_info *dbg_info, 351 char *function_name,
352 char *module_name,
353 u32 component_id,
344 acpi_integer value); 354 acpi_integer value);
345 355
346void 356void
347acpi_ut_ptr_exit ( 357acpi_ut_ptr_exit (
348 u32 line_number, 358 u32 line_number,
349 struct acpi_debug_print_info *dbg_info, 359 char *function_name,
360 char *module_name,
361 u32 component_id,
350 u8 *ptr); 362 u8 *ptr);
351 363
352void 364void
@@ -378,7 +390,9 @@ void ACPI_INTERNAL_VAR_XFACE
378acpi_ut_debug_print ( 390acpi_ut_debug_print (
379 u32 requested_debug_level, 391 u32 requested_debug_level,
380 u32 line_number, 392 u32 line_number,
381 struct acpi_debug_print_info *dbg_info, 393 char *function_name,
394 char *module_name,
395 u32 component_id,
382 char *format, 396 char *format,
383 ...) ACPI_PRINTF_LIKE_FUNC; 397 ...) ACPI_PRINTF_LIKE_FUNC;
384 398
@@ -386,7 +400,9 @@ void ACPI_INTERNAL_VAR_XFACE
386acpi_ut_debug_print_raw ( 400acpi_ut_debug_print_raw (
387 u32 requested_debug_level, 401 u32 requested_debug_level,
388 u32 line_number, 402 u32 line_number,
389 struct acpi_debug_print_info *dbg_info, 403 char *function_name,
404 char *module_name,
405 u32 component_id,
390 char *format, 406 char *format,
391 ...) ACPI_PRINTF_LIKE_FUNC; 407 ...) ACPI_PRINTF_LIKE_FUNC;
392 408
@@ -477,8 +493,8 @@ acpi_ut_allocate_object_desc_dbg (
477 u32 line_number, 493 u32 line_number,
478 u32 component_id); 494 u32 component_id);
479 495
480#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t) 496#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
481#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT) 497#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
482 498
483void 499void
484acpi_ut_delete_object_desc ( 500acpi_ut_delete_object_desc (
@@ -579,6 +595,14 @@ acpi_ut_short_divide (
579 * utmisc 595 * utmisc
580 */ 596 */
581acpi_status 597acpi_status
598acpi_ut_allocate_owner_id (
599 acpi_owner_id *owner_id);
600
601acpi_status
602acpi_ut_release_owner_id (
603 acpi_owner_id owner_id);
604
605acpi_status
582acpi_ut_walk_package_tree ( 606acpi_ut_walk_package_tree (
583 union acpi_operand_object *source_object, 607 union acpi_operand_object *source_object,
584 void *target_object, 608 void *target_object,
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 91fda36b042b..39264127574c 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -44,13 +44,17 @@
44#ifndef __ACGCC_H__ 44#ifndef __ACGCC_H__
45#define __ACGCC_H__ 45#define __ACGCC_H__
46 46
47/* Function name is used for debug output. Non-ANSI, compiler-dependent */
48
49#define ACPI_GET_FUNCTION_NAME __FUNCTION__
50
47/* This macro is used to tag functions as "printf-like" because 51/* This macro is used to tag functions as "printf-like" because
48 * some compilers (like GCC) can catch printf format string problems. 52 * some compilers (like GCC) can catch printf format string problems.
49 */ 53 */
50#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5))) 54#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7)))
51 55
52/* Some compilers complain about unused variables. Sometimes we don't want to 56/* Some compilers complain about unused variables. Sometimes we don't want to
53 * use all the variables (most specifically for _THIS_MODULE). This allow us 57 * use all the variables (for example, _acpi_module_name). This allows us
54 * to to tell the compiler warning in a per-variable manner that a variable 58 * to to tell the compiler warning in a per-variable manner that a variable
55 * is unused. 59 * is unused.
56 */ 60 */