aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/dswload.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/acpi/acpica/dswload.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/acpi/acpica/dswload.c')
-rw-r--r--drivers/acpi/acpica/dswload.c116
1 files changed, 73 insertions, 43 deletions
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 6de3a99d4cd4..140a9d002959 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -212,18 +212,19 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
212 case ACPI_TYPE_BUFFER: 212 case ACPI_TYPE_BUFFER:
213 213
214 /* 214 /*
215 * These types we will allow, but we will change the type. This 215 * These types we will allow, but we will change the type.
216 * enables some existing code of the form: 216 * This enables some existing code of the form:
217 * 217 *
218 * Name (DEB, 0) 218 * Name (DEB, 0)
219 * Scope (DEB) { ... } 219 * Scope (DEB) { ... }
220 * 220 *
221 * Note: silently change the type here. On the second pass, we will report 221 * Note: silently change the type here. On the second pass,
222 * a warning 222 * we will report a warning
223 */ 223 */
224 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 224 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
225 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", 225 "Type override - [%4.4s] had invalid type (%s) "
226 path, 226 "for Scope operator, changed to type ANY\n",
227 acpi_ut_get_node_name(node),
227 acpi_ut_get_type_name(node->type))); 228 acpi_ut_get_type_name(node->type)));
228 229
229 node->type = ACPI_TYPE_ANY; 230 node->type = ACPI_TYPE_ANY;
@@ -235,8 +236,10 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
235 /* All other types are an error */ 236 /* All other types are an error */
236 237
237 ACPI_ERROR((AE_INFO, 238 ACPI_ERROR((AE_INFO,
238 "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", 239 "Invalid type (%s) for target of "
239 acpi_ut_get_type_name(node->type), path)); 240 "Scope operator [%4.4s] (Cannot override)",
241 acpi_ut_get_type_name(node->type),
242 acpi_ut_get_node_name(node)));
240 243
241 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 244 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
242 } 245 }
@@ -639,26 +642,42 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
639 break; 642 break;
640 643
641 case AML_SCOPE_OP: 644 case AML_SCOPE_OP:
642 /* 645
643 * The Path is an object reference to an existing object. 646 /* Special case for Scope(\) -> refers to the Root node */
644 * Don't enter the name into the namespace, but look it up 647
645 * for use later. 648 if (op && (op->named.node == acpi_gbl_root_node)) {
646 */ 649 node = op->named.node;
647 status = 650
648 acpi_ns_lookup(walk_state->scope_info, buffer_ptr, 651 status =
649 object_type, ACPI_IMODE_EXECUTE, 652 acpi_ds_scope_stack_push(node, object_type,
650 ACPI_NS_SEARCH_PARENT, walk_state, &(node)); 653 walk_state);
651 if (ACPI_FAILURE(status)) { 654 if (ACPI_FAILURE(status)) {
652#ifdef ACPI_ASL_COMPILER 655 return_ACPI_STATUS(status);
653 if (status == AE_NOT_FOUND) {
654 status = AE_OK;
655 } else {
656 ACPI_ERROR_NAMESPACE(buffer_ptr, status);
657 } 656 }
657 } else {
658 /*
659 * The Path is an object reference to an existing object.
660 * Don't enter the name into the namespace, but look it up
661 * for use later.
662 */
663 status =
664 acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
665 object_type, ACPI_IMODE_EXECUTE,
666 ACPI_NS_SEARCH_PARENT, walk_state,
667 &(node));
668 if (ACPI_FAILURE(status)) {
669#ifdef ACPI_ASL_COMPILER
670 if (status == AE_NOT_FOUND) {
671 status = AE_OK;
672 } else {
673 ACPI_ERROR_NAMESPACE(buffer_ptr,
674 status);
675 }
658#else 676#else
659 ACPI_ERROR_NAMESPACE(buffer_ptr, status); 677 ACPI_ERROR_NAMESPACE(buffer_ptr, status);
660#endif 678#endif
661 return_ACPI_STATUS(status); 679 return_ACPI_STATUS(status);
680 }
662 } 681 }
663 682
664 /* 683 /*
@@ -681,15 +700,16 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
681 case ACPI_TYPE_BUFFER: 700 case ACPI_TYPE_BUFFER:
682 701
683 /* 702 /*
684 * These types we will allow, but we will change the type. This 703 * These types we will allow, but we will change the type.
685 * enables some existing code of the form: 704 * This enables some existing code of the form:
686 * 705 *
687 * Name (DEB, 0) 706 * Name (DEB, 0)
688 * Scope (DEB) { ... } 707 * Scope (DEB) { ... }
689 */ 708 */
690 ACPI_WARNING((AE_INFO, 709 ACPI_WARNING((AE_INFO,
691 "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", 710 "Type override - [%4.4s] had invalid type (%s) "
692 buffer_ptr, 711 "for Scope operator, changed to type ANY\n",
712 acpi_ut_get_node_name(node),
693 acpi_ut_get_type_name(node->type))); 713 acpi_ut_get_type_name(node->type)));
694 714
695 node->type = ACPI_TYPE_ANY; 715 node->type = ACPI_TYPE_ANY;
@@ -701,9 +721,10 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
701 /* All other types are an error */ 721 /* All other types are an error */
702 722
703 ACPI_ERROR((AE_INFO, 723 ACPI_ERROR((AE_INFO,
704 "Invalid type (%s) for target of Scope operator [%4.4s]", 724 "Invalid type (%s) for target of "
725 "Scope operator [%4.4s] (Cannot override)",
705 acpi_ut_get_type_name(node->type), 726 acpi_ut_get_type_name(node->type),
706 buffer_ptr)); 727 acpi_ut_get_node_name(node)));
707 728
708 return (AE_AML_OPERAND_TYPE); 729 return (AE_AML_OPERAND_TYPE);
709 } 730 }
@@ -1031,9 +1052,22 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1031 } 1052 }
1032 1053
1033 /* 1054 /*
1034 * If we are executing a method, initialize the region 1055 * The op_region is not fully parsed at this time. The only valid
1056 * argument is the space_id. (We must save the address of the
1057 * AML of the address and length operands)
1058 *
1059 * If we have a valid region, initialize it. The namespace is
1060 * unlocked at this point.
1061 *
1062 * Need to unlock interpreter if it is locked (if we are running
1063 * a control method), in order to allow _REG methods to be run
1064 * during acpi_ev_initialize_region.
1035 */ 1065 */
1036 if (walk_state->method_node) { 1066 if (walk_state->method_node) {
1067 /*
1068 * Executing a method: initialize the region and unlock
1069 * the interpreter
1070 */
1037 status = 1071 status =
1038 acpi_ex_create_region(op->named.data, 1072 acpi_ex_create_region(op->named.data,
1039 op->named.length, 1073 op->named.length,
@@ -1042,21 +1076,17 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
1042 if (ACPI_FAILURE(status)) { 1076 if (ACPI_FAILURE(status)) {
1043 return (status); 1077 return (status);
1044 } 1078 }
1045 }
1046 1079
1047 /* 1080 acpi_ex_exit_interpreter();
1048 * The op_region is not fully parsed at this time. Only valid 1081 }
1049 * argument is the space_id. (We must save the address of the
1050 * AML of the address and length operands)
1051 */
1052 1082
1053 /*
1054 * If we have a valid region, initialize it
1055 * Namespace is NOT locked at this point.
1056 */
1057 status = 1083 status =
1058 acpi_ev_initialize_region 1084 acpi_ev_initialize_region
1059 (acpi_ns_get_attached_object(node), FALSE); 1085 (acpi_ns_get_attached_object(node), FALSE);
1086 if (walk_state->method_node) {
1087 acpi_ex_enter_interpreter();
1088 }
1089
1060 if (ACPI_FAILURE(status)) { 1090 if (ACPI_FAILURE(status)) {
1061 /* 1091 /*
1062 * If AE_NOT_EXIST is returned, it is not fatal 1092 * If AE_NOT_EXIST is returned, it is not fatal