aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
committerLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
commit5d2a22079c825669d91a3a200332f1053b4b61b0 (patch)
tree2e6e88bbcc3e17535fdf3103540b246b3658e20b /drivers/acpi/namespace
parent1c5ad84516ae7ea4ec868436a910a6bd8d20215a (diff)
parentbd6dbdf3c7b9784fbf5d8500e427a954e27a976a (diff)
/home/lenb/src/to-akpm branch 'acpi-2.6.12'
Diffstat (limited to 'drivers/acpi/namespace')
-rw-r--r--drivers/acpi/namespace/nsaccess.c13
-rw-r--r--drivers/acpi/namespace/nsalloc.c130
-rw-r--r--drivers/acpi/namespace/nsdump.c80
-rw-r--r--drivers/acpi/namespace/nseval.c10
-rw-r--r--drivers/acpi/namespace/nsload.c42
-rw-r--r--drivers/acpi/namespace/nsparse.c6
6 files changed, 82 insertions, 199 deletions
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index ece7a9dedd5c..7589e1fdf25a 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -159,19 +159,20 @@ acpi_ns_root_initialize (
159 obj_desc->method.param_count = (u8) ACPI_TO_INTEGER (val); 159 obj_desc->method.param_count = (u8) ACPI_TO_INTEGER (val);
160 obj_desc->common.flags |= AOPOBJ_DATA_VALID; 160 obj_desc->common.flags |= AOPOBJ_DATA_VALID;
161 161
162#if defined (_ACPI_ASL_COMPILER) || defined (_ACPI_DUMP_App) 162#if defined (ACPI_ASL_COMPILER)
163 163
164 /* 164 /* save the parameter count for the i_aSL compiler */
165 * i_aSL Compiler cheats by putting parameter count 165
166 * in the owner_iD 166 new_node->value = obj_desc->method.param_count;
167 */
168 new_node->owner_id = obj_desc->method.param_count;
169#else 167#else
170 /* Mark this as a very SPECIAL method */ 168 /* Mark this as a very SPECIAL method */
171 169
172 obj_desc->method.method_flags = AML_METHOD_INTERNAL_ONLY; 170 obj_desc->method.method_flags = AML_METHOD_INTERNAL_ONLY;
171
172#ifndef ACPI_DUMP_APP
173 obj_desc->method.implementation = acpi_ut_osi_implementation; 173 obj_desc->method.implementation = acpi_ut_osi_implementation;
174#endif 174#endif
175#endif
175 break; 176 break;
176 177
177 case ACPI_TYPE_INTEGER: 178 case ACPI_TYPE_INTEGER:
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index 5653a19d7172..21d560decbf9 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -83,7 +83,7 @@ acpi_ns_create_node (
83 return_PTR (NULL); 83 return_PTR (NULL);
84 } 84 }
85 85
86 ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_allocated++); 86 ACPI_MEM_TRACKING (acpi_gbl_ns_node_list->total_allocated++);
87 87
88 node->name.integer = name; 88 node->name.integer = name;
89 node->reference_count = 1; 89 node->reference_count = 1;
@@ -151,7 +151,7 @@ acpi_ns_delete_node (
151 } 151 }
152 } 152 }
153 153
154 ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++); 154 ACPI_MEM_TRACKING (acpi_gbl_ns_node_list->total_freed++);
155 155
156 /* 156 /*
157 * Detach an object if there is one then delete the node 157 * Detach an object if there is one then delete the node
@@ -176,10 +176,9 @@ acpi_ns_delete_node (
176 * DESCRIPTION: Initialize a new namespace node and install it amongst 176 * DESCRIPTION: Initialize a new namespace node and install it amongst
177 * its peers. 177 * its peers.
178 * 178 *
179 * Note: Current namespace lookup is linear search. However, the 179 * Note: Current namespace lookup is linear search. This appears
180 * nodes are linked in alphabetical order to 1) put all reserved 180 * to be sufficient as namespace searches consume only a small
181 * names (start with underscore) first, and to 2) make a readable 181 * fraction of the execution time of the ACPI subsystem.
182 * namespace dump.
183 * 182 *
184 ******************************************************************************/ 183 ******************************************************************************/
185 184
@@ -190,12 +189,8 @@ acpi_ns_install_node (
190 struct acpi_namespace_node *node, /* New Child*/ 189 struct acpi_namespace_node *node, /* New Child*/
191 acpi_object_type type) 190 acpi_object_type type)
192{ 191{
193 u16 owner_id = 0; 192 acpi_owner_id owner_id = 0;
194 struct acpi_namespace_node *child_node; 193 struct acpi_namespace_node *child_node;
195#ifdef ACPI_ALPHABETIC_NAMESPACE
196
197 struct acpi_namespace_node *previous_child_node;
198#endif
199 194
200 195
201 ACPI_FUNCTION_TRACE ("ns_install_node"); 196 ACPI_FUNCTION_TRACE ("ns_install_node");
@@ -219,57 +214,6 @@ acpi_ns_install_node (
219 node->peer = parent_node; 214 node->peer = parent_node;
220 } 215 }
221 else { 216 else {
222#ifdef ACPI_ALPHABETIC_NAMESPACE
223 /*
224 * Walk the list whilst searching for the correct
225 * alphabetic placement.
226 */
227 previous_child_node = NULL;
228 while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node),
229 acpi_ut_get_node_name (node)) < 0) {
230 if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
231 /* Last peer; Clear end-of-list flag */
232
233 child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
234
235 /* This node is the new peer to the child node */
236
237 child_node->peer = node;
238
239 /* This node is the new end-of-list */
240
241 node->flags |= ANOBJ_END_OF_PEER_LIST;
242 node->peer = parent_node;
243 break;
244 }
245
246 /* Get next peer */
247
248 previous_child_node = child_node;
249 child_node = child_node->peer;
250 }
251
252 /* Did the node get inserted at the end-of-list? */
253
254 if (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
255 /*
256 * Loop above terminated without reaching the end-of-list.
257 * Insert the new node at the current location
258 */
259 if (previous_child_node) {
260 /* Insert node alphabetically */
261
262 node->peer = child_node;
263 previous_child_node->peer = node;
264 }
265 else {
266 /* Insert node alphabetically at start of list */
267
268 node->peer = child_node;
269 parent_node->child = node;
270 }
271 }
272#else
273 while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) { 217 while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) {
274 child_node = child_node->peer; 218 child_node = child_node->peer;
275 } 219 }
@@ -279,9 +223,8 @@ acpi_ns_install_node (
279 /* Clear end-of-list flag */ 223 /* Clear end-of-list flag */
280 224
281 child_node->flags &= ~ANOBJ_END_OF_PEER_LIST; 225 child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
282 node->flags |= ANOBJ_END_OF_PEER_LIST; 226 node->flags |= ANOBJ_END_OF_PEER_LIST;
283 node->peer = parent_node; 227 node->peer = parent_node;
284#endif
285 } 228 }
286 229
287 /* Init the new entry */ 230 /* Init the new entry */
@@ -362,7 +305,7 @@ acpi_ns_delete_children (
362 305
363 /* Now we can free this child object */ 306 /* Now we can free this child object */
364 307
365 ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].total_freed++); 308 ACPI_MEM_TRACKING (acpi_gbl_ns_node_list->total_freed++);
366 309
367 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n", 310 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
368 child_node, acpi_gbl_current_node_count)); 311 child_node, acpi_gbl_current_node_count));
@@ -559,7 +502,7 @@ acpi_ns_remove_reference (
559 502
560void 503void
561acpi_ns_delete_namespace_by_owner ( 504acpi_ns_delete_namespace_by_owner (
562 u16 owner_id) 505 acpi_owner_id owner_id)
563{ 506{
564 struct acpi_namespace_node *child_node; 507 struct acpi_namespace_node *child_node;
565 struct acpi_namespace_node *deletion_node; 508 struct acpi_namespace_node *deletion_node;
@@ -570,6 +513,10 @@ acpi_ns_delete_namespace_by_owner (
570 ACPI_FUNCTION_TRACE_U32 ("ns_delete_namespace_by_owner", owner_id); 513 ACPI_FUNCTION_TRACE_U32 ("ns_delete_namespace_by_owner", owner_id);
571 514
572 515
516 if (owner_id == 0) {
517 return_VOID;
518 }
519
573 parent_node = acpi_gbl_root_node; 520 parent_node = acpi_gbl_root_node;
574 child_node = NULL; 521 child_node = NULL;
575 deletion_node = NULL; 522 deletion_node = NULL;
@@ -639,54 +586,3 @@ acpi_ns_delete_namespace_by_owner (
639} 586}
640 587
641 588
642#ifdef ACPI_ALPHABETIC_NAMESPACE
643/*******************************************************************************
644 *
645 * FUNCTION: acpi_ns_compare_names
646 *
647 * PARAMETERS: Name1 - First name to compare
648 * Name2 - Second name to compare
649 *
650 * RETURN: value from strncmp
651 *
652 * DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
653 * underscore are forced to be alphabetically first.
654 *
655 ******************************************************************************/
656
657int
658acpi_ns_compare_names (
659 char *name1,
660 char *name2)
661{
662 char reversed_name1[ACPI_NAME_SIZE];
663 char reversed_name2[ACPI_NAME_SIZE];
664 u32 i;
665 u32 j;
666
667
668 /*
669 * Replace all instances of "underscore" with a value that is smaller so
670 * that all names that are prefixed with underscore(s) are alphabetically
671 * first.
672 *
673 * Reverse the name bytewise so we can just do a 32-bit compare instead
674 * of a strncmp.
675 */
676 for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--) {
677 reversed_name1[j] = name1[i];
678 if (name1[i] == '_') {
679 reversed_name1[j] = '*';
680 }
681
682 reversed_name2[j] = name2[i];
683 if (name2[i] == '_') {
684 reversed_name2[j] = '*';
685 }
686 }
687
688 return (*(int *) reversed_name1 - *(int *) reversed_name2);
689}
690#endif
691
692
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 6c2aef0e0dd4..5d25add6b031 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -85,6 +85,9 @@ acpi_ns_print_pathname (
85 u32 num_segments, 85 u32 num_segments,
86 char *pathname) 86 char *pathname)
87{ 87{
88 acpi_native_uint i;
89
90
88 ACPI_FUNCTION_NAME ("ns_print_pathname"); 91 ACPI_FUNCTION_NAME ("ns_print_pathname");
89 92
90 93
@@ -97,9 +100,13 @@ acpi_ns_print_pathname (
97 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); 100 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
98 101
99 while (num_segments) { 102 while (num_segments) {
100 acpi_os_printf ("%4.4s", pathname); 103 for (i = 0; i < 4; i++) {
101 pathname += ACPI_NAME_SIZE; 104 ACPI_IS_PRINT (pathname[i]) ?
105 acpi_os_printf ("%c", pathname[i]) :
106 acpi_os_printf ("?");
107 }
102 108
109 pathname += ACPI_NAME_SIZE;
103 num_segments--; 110 num_segments--;
104 if (num_segments) { 111 if (num_segments) {
105 acpi_os_printf ("."); 112 acpi_os_printf (".");
@@ -203,38 +210,42 @@ acpi_ns_dump_one_object (
203 210
204 /* Check if the owner matches */ 211 /* Check if the owner matches */
205 212
206 if ((info->owner_id != ACPI_UINT32_MAX) && 213 if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
207 (info->owner_id != this_node->owner_id)) { 214 (info->owner_id != this_node->owner_id)) {
208 return (AE_OK); 215 return (AE_OK);
209 } 216 }
210 217
211 /* Indent the object according to the level */ 218 if (!(info->display_type & ACPI_DISPLAY_SHORT)) {
219 /* Indent the object according to the level */
212 220
213 acpi_os_printf ("%2d%*s", (u32) level - 1, (int) level * 2, " "); 221 acpi_os_printf ("%2d%*s", (u32) level - 1, (int) level * 2, " ");
214 222
215 /* Check the node type and name */ 223 /* Check the node type and name */
216 224
217 if (type > ACPI_TYPE_LOCAL_MAX) { 225 if (type > ACPI_TYPE_LOCAL_MAX) {
218 ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type)); 226 ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type));
219 } 227 }
220 228
221 if (!acpi_ut_valid_acpi_name (this_node->name.integer)) { 229 if (!acpi_ut_valid_acpi_name (this_node->name.integer)) {
222 ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", 230 ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n",
223 this_node->name.integer)); 231 this_node->name.integer));
232 }
233
234 acpi_os_printf ("%4.4s", acpi_ut_get_node_name (this_node));
224 } 235 }
225 236
226 /* 237 /*
227 * Now we can print out the pertinent information 238 * Now we can print out the pertinent information
228 */ 239 */
229 acpi_os_printf ("%4.4s %-12s %p ", 240 acpi_os_printf (" %-12s %p ",
230 acpi_ut_get_node_name (this_node), acpi_ut_get_type_name (type), this_node); 241 acpi_ut_get_type_name (type), this_node);
231 242
232 dbg_level = acpi_dbg_level; 243 dbg_level = acpi_dbg_level;
233 acpi_dbg_level = 0; 244 acpi_dbg_level = 0;
234 obj_desc = acpi_ns_get_attached_object (this_node); 245 obj_desc = acpi_ns_get_attached_object (this_node);
235 acpi_dbg_level = dbg_level; 246 acpi_dbg_level = dbg_level;
236 247
237 switch (info->display_type) { 248 switch (info->display_type & ACPI_DISPLAY_MASK) {
238 case ACPI_DISPLAY_SUMMARY: 249 case ACPI_DISPLAY_SUMMARY:
239 250
240 if (!obj_desc) { 251 if (!obj_desc) {
@@ -475,7 +486,7 @@ acpi_ns_dump_one_object (
475 486
476 while (obj_desc) { 487 while (obj_desc) {
477 obj_type = ACPI_TYPE_INVALID; 488 obj_type = ACPI_TYPE_INVALID;
478 acpi_os_printf (" Attached Object %p: ", obj_desc); 489 acpi_os_printf ("Attached Object %p: ", obj_desc);
479 490
480 /* Decode the type of attached object and dump the contents */ 491 /* Decode the type of attached object and dump the contents */
481 492
@@ -484,9 +495,9 @@ acpi_ns_dump_one_object (
484 495
485 acpi_os_printf ("(Ptr to Node)\n"); 496 acpi_os_printf ("(Ptr to Node)\n");
486 bytes_to_dump = sizeof (struct acpi_namespace_node); 497 bytes_to_dump = sizeof (struct acpi_namespace_node);
498 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump);
487 break; 499 break;
488 500
489
490 case ACPI_DESC_TYPE_OPERAND: 501 case ACPI_DESC_TYPE_OPERAND:
491 502
492 obj_type = ACPI_GET_OBJECT_TYPE (obj_desc); 503 obj_type = ACPI_GET_OBJECT_TYPE (obj_desc);
@@ -497,24 +508,19 @@ acpi_ns_dump_one_object (
497 bytes_to_dump = 32; 508 bytes_to_dump = 32;
498 } 509 }
499 else { 510 else {
500 acpi_os_printf ("(Ptr to ACPI Object type %s, %X)\n", 511 acpi_os_printf ("(Ptr to ACPI Object type %X [%s])\n",
501 acpi_ut_get_type_name (obj_type), obj_type); 512 obj_type, acpi_ut_get_type_name (obj_type));
502 bytes_to_dump = sizeof (union acpi_operand_object); 513 bytes_to_dump = sizeof (union acpi_operand_object);
503 } 514 }
504 break;
505 515
516 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump);
517 break;
506 518
507 default: 519 default:
508 520
509 acpi_os_printf (
510 "(String or Buffer ptr - not an object descriptor) [%s]\n",
511 acpi_ut_get_descriptor_name (obj_desc));
512 bytes_to_dump = 16;
513 break; 521 break;
514 } 522 }
515 523
516 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump);
517
518 /* If value is NOT an internal object, we are done */ 524 /* If value is NOT an internal object, we are done */
519 525
520 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { 526 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
@@ -525,13 +531,17 @@ acpi_ns_dump_one_object (
525 * Valid object, get the pointer to next level, if any 531 * Valid object, get the pointer to next level, if any
526 */ 532 */
527 switch (obj_type) { 533 switch (obj_type) {
534 case ACPI_TYPE_BUFFER:
528 case ACPI_TYPE_STRING: 535 case ACPI_TYPE_STRING:
536 /*
537 * NOTE: takes advantage of common fields between string/buffer
538 */
539 bytes_to_dump = obj_desc->string.length;
529 obj_desc = (void *) obj_desc->string.pointer; 540 obj_desc = (void *) obj_desc->string.pointer;
530 break; 541 acpi_os_printf ( "(Buffer/String pointer %p length %X)\n",
531 542 obj_desc, bytes_to_dump);
532 case ACPI_TYPE_BUFFER: 543 ACPI_DUMP_BUFFER (obj_desc, bytes_to_dump);
533 obj_desc = (void *) obj_desc->buffer.pointer; 544 goto cleanup;
534 break;
535 545
536 case ACPI_TYPE_BUFFER_FIELD: 546 case ACPI_TYPE_BUFFER_FIELD:
537 obj_desc = (union acpi_operand_object *) obj_desc->buffer_field.buffer_obj; 547 obj_desc = (union acpi_operand_object *) obj_desc->buffer_field.buffer_obj;
@@ -595,7 +605,7 @@ acpi_ns_dump_objects (
595 acpi_object_type type, 605 acpi_object_type type,
596 u8 display_type, 606 u8 display_type,
597 u32 max_depth, 607 u32 max_depth,
598 u32 owner_id, 608 acpi_owner_id owner_id,
599 acpi_handle start_handle) 609 acpi_handle start_handle)
600{ 610{
601 struct acpi_walk_info info; 611 struct acpi_walk_info info;
@@ -640,14 +650,14 @@ acpi_ns_dump_entry (
640 650
641 651
642 info.debug_level = debug_level; 652 info.debug_level = debug_level;
643 info.owner_id = ACPI_UINT32_MAX; 653 info.owner_id = ACPI_OWNER_ID_MAX;
644 info.display_type = ACPI_DISPLAY_SUMMARY; 654 info.display_type = ACPI_DISPLAY_SUMMARY;
645 655
646 (void) acpi_ns_dump_one_object (handle, 1, &info, NULL); 656 (void) acpi_ns_dump_one_object (handle, 1, &info, NULL);
647} 657}
648 658
649 659
650#ifdef _ACPI_ASL_COMPILER 660#ifdef ACPI_ASL_COMPILER
651/******************************************************************************* 661/*******************************************************************************
652 * 662 *
653 * FUNCTION: acpi_ns_dump_tables 663 * FUNCTION: acpi_ns_dump_tables
@@ -691,7 +701,7 @@ acpi_ns_dump_tables (
691 } 701 }
692 702
693 acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, 703 acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
694 ACPI_UINT32_MAX, search_handle); 704 ACPI_OWNER_ID_MAX, search_handle);
695 return_VOID; 705 return_VOID;
696} 706}
697#endif /* _ACPI_ASL_COMPILER */ 707#endif /* _ACPI_ASL_COMPILER */
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
index 1ae89a1c8826..908cffd5e720 100644
--- a/drivers/acpi/namespace/nseval.c
+++ b/drivers/acpi/namespace/nseval.c
@@ -365,6 +365,7 @@ acpi_ns_evaluate_by_handle (
365 * 365 *
366 * PARAMETERS: Info - Method info block, contains: 366 * PARAMETERS: Info - Method info block, contains:
367 * Node - Method Node to execute 367 * Node - Method Node to execute
368 * obj_desc - Method object
368 * Parameters - List of parameters to pass to the method, 369 * Parameters - List of parameters to pass to the method,
369 * terminated by NULL. Params itself may be 370 * terminated by NULL. Params itself may be
370 * NULL if no parameters are being passed. 371 * NULL if no parameters are being passed.
@@ -387,7 +388,6 @@ acpi_ns_execute_control_method (
387 struct acpi_parameter_info *info) 388 struct acpi_parameter_info *info)
388{ 389{
389 acpi_status status; 390 acpi_status status;
390 union acpi_operand_object *obj_desc;
391 391
392 392
393 ACPI_FUNCTION_TRACE ("ns_execute_control_method"); 393 ACPI_FUNCTION_TRACE ("ns_execute_control_method");
@@ -395,8 +395,8 @@ acpi_ns_execute_control_method (
395 395
396 /* Verify that there is a method associated with this object */ 396 /* Verify that there is a method associated with this object */
397 397
398 obj_desc = acpi_ns_get_attached_object (info->node); 398 info->obj_desc = acpi_ns_get_attached_object (info->node);
399 if (!obj_desc) { 399 if (!info->obj_desc) {
400 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n")); 400 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));
401 401
402 (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); 402 (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
@@ -407,7 +407,7 @@ acpi_ns_execute_control_method (
407 ACPI_LV_INFO, _COMPONENT); 407 ACPI_LV_INFO, _COMPONENT);
408 408
409 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n", 409 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n",
410 obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1)); 410 info->obj_desc->method.aml_start + 1, info->obj_desc->method.aml_length - 1));
411 411
412 /* 412 /*
413 * Unlock the namespace before execution. This allows namespace access 413 * Unlock the namespace before execution. This allows namespace access
@@ -430,7 +430,7 @@ acpi_ns_execute_control_method (
430 return_ACPI_STATUS (status); 430 return_ACPI_STATUS (status);
431 } 431 }
432 432
433 status = acpi_psx_execute (info); 433 status = acpi_ps_execute_method (info);
434 acpi_ex_exit_interpreter (); 434 acpi_ex_exit_interpreter ();
435 435
436 return_ACPI_STATUS (status); 436 return_ACPI_STATUS (status);
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 34e497016601..1428a84a31e6 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -198,7 +198,7 @@ acpi_ns_load_table_by_type (
198 switch (table_type) { 198 switch (table_type) {
199 case ACPI_TABLE_DSDT: 199 case ACPI_TABLE_DSDT:
200 200
201 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n")); 201 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: DSDT\n"));
202 202
203 table_desc = acpi_gbl_table_lists[ACPI_TABLE_DSDT].next; 203 table_desc = acpi_gbl_table_lists[ACPI_TABLE_DSDT].next;
204 204
@@ -218,17 +218,18 @@ acpi_ns_load_table_by_type (
218 218
219 219
220 case ACPI_TABLE_SSDT: 220 case ACPI_TABLE_SSDT:
221 case ACPI_TABLE_PSDT:
221 222
222 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d SSDTs\n", 223 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: %d SSDT or PSDTs\n",
223 acpi_gbl_table_lists[ACPI_TABLE_SSDT].count)); 224 acpi_gbl_table_lists[table_type].count));
224 225
225 /* 226 /*
226 * Traverse list of SSDT tables 227 * Traverse list of SSDT or PSDT tables
227 */ 228 */
228 table_desc = acpi_gbl_table_lists[ACPI_TABLE_SSDT].next; 229 table_desc = acpi_gbl_table_lists[table_type].next;
229 for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_SSDT].count; i++) { 230 for (i = 0; i < acpi_gbl_table_lists[table_type].count; i++) {
230 /* 231 /*
231 * Only attempt to load table if it is not 232 * Only attempt to load table into namespace if it is not
232 * already loaded! 233 * already loaded!
233 */ 234 */
234 if (!table_desc->loaded_into_namespace) { 235 if (!table_desc->loaded_into_namespace) {
@@ -245,33 +246,6 @@ acpi_ns_load_table_by_type (
245 break; 246 break;
246 247
247 248
248 case ACPI_TABLE_PSDT:
249
250 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d PSDTs\n",
251 acpi_gbl_table_lists[ACPI_TABLE_PSDT].count));
252
253 /*
254 * Traverse list of PSDT tables
255 */
256 table_desc = acpi_gbl_table_lists[ACPI_TABLE_PSDT].next;
257
258 for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_PSDT].count; i++) {
259 /* Only attempt to load table if it is not already loaded! */
260
261 if (!table_desc->loaded_into_namespace) {
262 status = acpi_ns_load_table (table_desc, acpi_gbl_root_node);
263 if (ACPI_FAILURE (status)) {
264 break;
265 }
266
267 table_desc->loaded_into_namespace = TRUE;
268 }
269
270 table_desc = table_desc->next;
271 }
272 break;
273
274
275 default: 249 default:
276 status = AE_SUPPORT; 250 status = AE_SUPPORT;
277 break; 251 break;
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index a0e13e8d3764..24bed931d39d 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -67,7 +67,7 @@
67 67
68acpi_status 68acpi_status
69acpi_ns_one_complete_parse ( 69acpi_ns_one_complete_parse (
70 u32 pass_number, 70 u8 pass_number,
71 struct acpi_table_desc *table_desc) 71 struct acpi_table_desc *table_desc)
72{ 72{
73 union acpi_parse_object *parse_root; 73 union acpi_parse_object *parse_root;
@@ -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);
@@ -146,6 +146,7 @@ acpi_ns_parse_table (
146 * to service the entire parse. The second pass of the parse then 146 * to service the entire parse. The second pass of the parse then
147 * performs another complete parse of the AML.. 147 * performs another complete parse of the AML..
148 */ 148 */
149 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
149 status = acpi_ns_one_complete_parse (1, table_desc); 150 status = acpi_ns_one_complete_parse (1, table_desc);
150 if (ACPI_FAILURE (status)) { 151 if (ACPI_FAILURE (status)) {
151 return_ACPI_STATUS (status); 152 return_ACPI_STATUS (status);
@@ -160,6 +161,7 @@ acpi_ns_parse_table (
160 * overhead of this is compensated for by the fact that the 161 * overhead of this is compensated for by the fact that the
161 * parse objects are all cached. 162 * parse objects are all cached.
162 */ 163 */
164 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
163 status = acpi_ns_one_complete_parse (2, table_desc); 165 status = acpi_ns_one_complete_parse (2, table_desc);
164 if (ACPI_FAILURE (status)) { 166 if (ACPI_FAILURE (status)) {
165 return_ACPI_STATUS (status); 167 return_ACPI_STATUS (status);