Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPICA 20050526 from Bob Moore <robert.moore@intel.com>

Implemented support to execute Type 1 and Type 2 AML
opcodes appearing at the module level (not within a control
method.) These opcodes are executed exactly once at the
time the table is loaded. This type of code was legal up
until the release of ACPI 2.0B (2002) and is now supported
within ACPI CA in order to provide backwards compatibility
with earlier BIOS implementations. This eliminates the
"Encountered executable code at module level" warning that
was previously generated upon detection of such code.

Fixed a problem in the interpreter where an AE_NOT_FOUND
exception could inadvertently be generated during the
lookup of namespace objects in the second pass parse of
ACPI tables and control methods. It appears that this
problem could occur during the resolution of forward
references to namespace objects.

Added the ACPI_MUTEX_DEBUG #ifdef to the
acpi_ut_release_mutex function, corresponding to the same
the deadlock detection debug code to be compiled out in
the normal case, improving mutex performance (and overall
subsystem performance) considerably. As suggested by
Alexey Starikovskiy.

Implemented a handful of miscellaneous fixes for possible
memory leaks on error conditions and error handling
control paths. These fixes were suggested by FreeBSD and
the Coverity Prevent source code analysis tool.

Added a check for a null RSDT pointer in
acpi_get_firmware_table (tbxfroot.c) to prevent a fault
in this error case.

Signed-off-by Len Brown <len.brown@intel.com>

authored by

Robert Moore and committed by
Len Brown
88ac00f5 6f42ccf2

+200 -93
+5 -3
drivers/acpi/dispatcher/dsmethod.c
··· 139 139 140 140 walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL); 141 141 if (!walk_state) { 142 - return_ACPI_STATUS (AE_NO_MEMORY); 142 + status = AE_NO_MEMORY; 143 + goto cleanup; 143 144 } 144 145 145 146 status = acpi_ds_init_aml_walk (walk_state, op, node, ··· 148 147 obj_desc->method.aml_length, NULL, 1); 149 148 if (ACPI_FAILURE (status)) { 150 149 acpi_ds_delete_walk_state (walk_state); 151 - return_ACPI_STATUS (status); 150 + goto cleanup; 152 151 } 153 152 154 153 /* ··· 162 161 */ 163 162 status = acpi_ps_parse_aml (walk_state); 164 163 if (ACPI_FAILURE (status)) { 165 - return_ACPI_STATUS (status); 164 + goto cleanup; 166 165 } 167 166 168 167 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, 169 168 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n", 170 169 acpi_ut_get_node_name (obj_handle), obj_handle, op)); 171 170 171 + cleanup: 172 172 acpi_ps_delete_parse_tree (op); 173 173 return_ACPI_STATUS (status); 174 174 }
+9 -6
drivers/acpi/dispatcher/dsopcode.c
··· 119 119 120 120 walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); 121 121 if (!walk_state) { 122 - return_ACPI_STATUS (AE_NO_MEMORY); 122 + status = AE_NO_MEMORY; 123 + goto cleanup; 123 124 } 124 125 125 126 status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, 126 127 aml_length, NULL, 1); 127 128 if (ACPI_FAILURE (status)) { 128 129 acpi_ds_delete_walk_state (walk_state); 129 - return_ACPI_STATUS (status); 130 + goto cleanup; 130 131 } 131 132 132 133 /* Mark this parse as a deferred opcode */ ··· 139 138 140 139 status = acpi_ps_parse_aml (walk_state); 141 140 if (ACPI_FAILURE (status)) { 142 - acpi_ps_delete_parse_tree (op); 143 - return_ACPI_STATUS (status); 141 + goto cleanup; 144 142 } 145 143 146 144 /* Get and init the Op created above */ ··· 160 160 161 161 walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); 162 162 if (!walk_state) { 163 - return_ACPI_STATUS (AE_NO_MEMORY); 163 + status = AE_NO_MEMORY; 164 + goto cleanup; 164 165 } 165 166 166 167 /* Execute the opcode and arguments */ ··· 170 169 aml_length, NULL, 3); 171 170 if (ACPI_FAILURE (status)) { 172 171 acpi_ds_delete_walk_state (walk_state); 173 - return_ACPI_STATUS (status); 172 + goto cleanup; 174 173 } 175 174 176 175 /* Mark this execution as a deferred opcode */ 177 176 178 177 walk_state->deferred_node = node; 179 178 status = acpi_ps_parse_aml (walk_state); 179 + 180 + cleanup: 180 181 acpi_ps_delete_parse_tree (op); 181 182 return_ACPI_STATUS (status); 182 183 }
+37 -19
drivers/acpi/dispatcher/dswload.c
··· 145 145 146 146 if (op) { 147 147 if (!(walk_state->op_info->flags & AML_NAMED)) { 148 - #if 0 149 - if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || 150 - (walk_state->op_info->class == AML_CLASS_CONTROL)) { 151 - acpi_os_printf ("\n\n***EXECUTABLE OPCODE %s***\n\n", 152 - walk_state->op_info->name); 153 - *out_op = op; 154 - return (AE_CTRL_SKIP); 155 - } 156 - #endif 157 148 *out_op = op; 158 149 return (AE_OK); 159 150 } ··· 477 486 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); 478 487 479 488 if (op) { 489 + if ((walk_state->control_state) && 490 + (walk_state->control_state->common.state == 491 + ACPI_CONTROL_CONDITIONAL_EXECUTING)) { 492 + /* We are executing a while loop outside of a method */ 493 + 494 + status = acpi_ds_exec_begin_op (walk_state, out_op); 495 + return_ACPI_STATUS (status); 496 + } 497 + 480 498 /* We only care about Namespace opcodes here */ 481 499 482 500 if ((!(walk_state->op_info->flags & AML_NSOPCODE) && ··· 493 493 (!(walk_state->op_info->flags & AML_NAMED))) { 494 494 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || 495 495 (walk_state->op_info->class == AML_CLASS_CONTROL)) { 496 - ACPI_REPORT_WARNING (( 497 - "Encountered executable code at module level, [%s]\n", 498 - acpi_ps_get_opcode_name (walk_state->opcode))); 496 + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 497 + "Begin/EXEC: %s (fl %8.8X)\n", walk_state->op_info->name, 498 + walk_state->op_info->flags)); 499 + 500 + /* Executing a type1 or type2 opcode outside of a method */ 501 + 502 + status = acpi_ds_exec_begin_op (walk_state, out_op); 503 + return_ACPI_STATUS (status); 499 504 } 500 505 return_ACPI_STATUS (AE_OK); 501 506 } ··· 662 657 break; 663 658 } 664 659 660 + /* Add new entry into namespace */ 661 + 665 662 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, 666 - ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, 663 + ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, 667 664 walk_state, &(node)); 668 665 break; 669 666 } ··· 674 667 ACPI_REPORT_NSERROR (buffer_ptr, status); 675 668 return_ACPI_STATUS (status); 676 669 } 677 - 678 670 679 671 if (!op) { 680 672 /* Create a new op */ ··· 688 682 if (node) { 689 683 op->named.name = node->name.integer; 690 684 } 691 - if (out_op) { 692 - *out_op = op; 693 - } 685 + *out_op = op; 694 686 } 695 687 696 688 /* ··· 735 731 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n", 736 732 walk_state->op_info->name, op, walk_state)); 737 733 738 - /* Only interested in opcodes that have namespace objects */ 734 + /* Check if opcode had an associated namespace object */ 739 735 740 736 if (!(walk_state->op_info->flags & AML_NSOBJECT)) { 737 + #ifndef ACPI_NO_METHOD_EXECUTION 738 + /* No namespace object. Executable opcode? */ 739 + 740 + if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || 741 + (walk_state->op_info->class == AML_CLASS_CONTROL)) { 742 + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 743 + "End/EXEC: %s (fl %8.8X)\n", walk_state->op_info->name, 744 + walk_state->op_info->flags)); 745 + 746 + /* Executing a type1 or type2 opcode outside of a method */ 747 + 748 + status = acpi_ds_exec_end_op (walk_state); 749 + return_ACPI_STATUS (status); 750 + } 751 + #endif 741 752 return_ACPI_STATUS (AE_OK); 742 753 } 743 754 ··· 760 741 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 761 742 "Ending scope Op=%p State=%p\n", op, walk_state)); 762 743 } 763 - 764 744 765 745 object_type = walk_state->op_info->object_type; 766 746
+1
drivers/acpi/dispatcher/dswstate.c
··· 762 762 /* The next_op of the next_walk will be the beginning of the method */ 763 763 764 764 walk_state->next_op = NULL; 765 + walk_state->pass_number = (u8) pass_number; 765 766 766 767 if (info) { 767 768 if (info->parameter_type == ACPI_PARAM_GPE) {
+17 -12
drivers/acpi/executer/exconfig.c
··· 376 376 */ 377 377 status = acpi_ex_read_data_from_field (walk_state, obj_desc, &buffer_desc); 378 378 if (ACPI_FAILURE (status)) { 379 - goto cleanup; 379 + return_ACPI_STATUS (status); 380 380 } 381 381 382 382 table_ptr = ACPI_CAST_PTR (struct acpi_table_header, 383 383 buffer_desc->buffer.pointer); 384 384 385 - /* Sanity check the table length */ 385 + /* All done with the buffer_desc, delete it */ 386 + 387 + buffer_desc->buffer.pointer = NULL; 388 + acpi_ut_remove_reference (buffer_desc); 389 + 390 + /* Sanity check the table length */ 386 391 387 392 if (table_ptr->length < sizeof (struct acpi_table_header)) { 388 - return_ACPI_STATUS (AE_BAD_HEADER); 393 + status = AE_BAD_HEADER; 394 + goto cleanup; 389 395 } 390 396 break; 391 397 ··· 419 413 420 414 status = acpi_ex_add_table (table_ptr, acpi_gbl_root_node, &ddb_handle); 421 415 if (ACPI_FAILURE (status)) { 422 - goto cleanup; 416 + /* On error, table_ptr was deallocated above */ 417 + 418 + return_ACPI_STATUS (status); 423 419 } 424 420 425 421 /* Store the ddb_handle into the Target operand */ ··· 429 421 status = acpi_ex_store (ddb_handle, target, walk_state); 430 422 if (ACPI_FAILURE (status)) { 431 423 (void) acpi_ex_unload_table (ddb_handle); 424 + 425 + /* table_ptr was deallocated above */ 426 + 427 + return_ACPI_STATUS (status); 432 428 } 433 - 434 - return_ACPI_STATUS (status); 435 - 436 429 437 430 cleanup: 438 - 439 - if (buffer_desc) { 440 - acpi_ut_remove_reference (buffer_desc); 441 - } 442 - else { 431 + if (ACPI_FAILURE (status)) { 443 432 ACPI_MEM_FREE (table_ptr); 444 433 } 445 434 return_ACPI_STATUS (status);
+4 -1
drivers/acpi/executer/exfield.c
··· 87 87 if (!obj_desc) { 88 88 return_ACPI_STATUS (AE_AML_NO_OPERAND); 89 89 } 90 + if (!ret_buffer_desc) { 91 + return_ACPI_STATUS (AE_BAD_PARAMETER); 92 + } 90 93 91 94 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) { 92 95 /* ··· 185 182 if (ACPI_FAILURE (status)) { 186 183 acpi_ut_remove_reference (buffer_desc); 187 184 } 188 - else if (ret_buffer_desc) { 185 + else { 189 186 *ret_buffer_desc = buffer_desc; 190 187 } 191 188
+7
drivers/acpi/executer/exnames.c
··· 438 438 status = AE_AML_BAD_NAME; 439 439 } 440 440 441 + if (ACPI_FAILURE (status)) { 442 + if (name_string) { 443 + ACPI_MEM_FREE (name_string); 444 + } 445 + return_ACPI_STATUS (status); 446 + } 447 + 441 448 *out_name_string = name_string; 442 449 *out_name_length = (u32) (aml_address - in_aml_address); 443 450
+6 -5
drivers/acpi/executer/exoparg1.c
··· 127 127 128 128 cleanup: 129 129 130 - if (!walk_state->result_obj) { 131 - walk_state->result_obj = return_desc; 132 - } 133 - 134 130 /* Delete return object on error */ 135 131 136 - if (ACPI_FAILURE (status)) { 132 + if ((ACPI_FAILURE (status)) || walk_state->result_obj) { 137 133 acpi_ut_remove_reference (return_desc); 134 + } 135 + else { 136 + /* Save the return value */ 137 + 138 + walk_state->result_obj = return_desc; 138 139 } 139 140 140 141 return_ACPI_STATUS (status);
+2
drivers/acpi/namespace/nsparse.c
··· 146 146 * to service the entire parse. The second pass of the parse then 147 147 * performs another complete parse of the AML.. 148 148 */ 149 + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n")); 149 150 status = acpi_ns_one_complete_parse (1, table_desc); 150 151 if (ACPI_FAILURE (status)) { 151 152 return_ACPI_STATUS (status); ··· 161 160 * overhead of this is compensated for by the fact that the 162 161 * parse objects are all cached. 163 162 */ 163 + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n")); 164 164 status = acpi_ns_one_complete_parse (2, table_desc); 165 165 if (ACPI_FAILURE (status)) { 166 166 return_ACPI_STATUS (status);
+83 -26
drivers/acpi/parser/psparse.c
··· 66 66 67 67 /* Local prototypes */ 68 68 69 - static void 69 + static acpi_status 70 70 acpi_ps_complete_this_op ( 71 71 struct acpi_walk_state *walk_state, 72 72 union acpi_parse_object *op); ··· 152 152 * PARAMETERS: walk_state - Current State 153 153 * Op - Op to complete 154 154 * 155 - * RETURN: None. 155 + * RETURN: Status 156 156 * 157 157 * DESCRIPTION: Perform any cleanup at the completion of an Op. 158 158 * 159 159 ******************************************************************************/ 160 160 161 - static void 161 + static acpi_status 162 162 acpi_ps_complete_this_op ( 163 163 struct acpi_walk_state *walk_state, 164 164 union acpi_parse_object *op) ··· 175 175 /* Check for null Op, can happen if AML code is corrupt */ 176 176 177 177 if (!op) { 178 - return_VOID; 178 + return_ACPI_STATUS (AE_OK); /* OK for now */ 179 179 } 180 180 181 181 /* Delete this op and the subtree below it if asked to */ 182 182 183 183 if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) || 184 184 (walk_state->op_info->class == AML_CLASS_ARGUMENT)) { 185 - return_VOID; 185 + return_ACPI_STATUS (AE_OK); 186 186 } 187 187 188 188 /* Make sure that we only delete this subtree */ 189 189 190 190 if (op->common.parent) { 191 + prev = op->common.parent->common.value.arg; 192 + if (!prev) { 193 + /* Nothing more to do */ 194 + 195 + goto cleanup; 196 + } 197 + 191 198 /* 192 199 * Check if we need to replace the operator and its subtree 193 200 * with a return value op (placeholder op) ··· 213 206 */ 214 207 replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); 215 208 if (!replacement_op) { 216 - goto cleanup; 209 + goto allocate_error; 217 210 } 218 211 break; 219 212 ··· 230 223 (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { 231 224 replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); 232 225 if (!replacement_op) { 233 - goto cleanup; 226 + goto allocate_error; 234 227 } 235 228 } 236 - 237 - if ((op->common.parent->common.aml_opcode == AML_NAME_OP) && 238 - (walk_state->descending_callback != acpi_ds_exec_begin_op)) { 229 + else if ((op->common.parent->common.aml_opcode == AML_NAME_OP) && 230 + (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2)) { 239 231 if ((op->common.aml_opcode == AML_BUFFER_OP) || 240 232 (op->common.aml_opcode == AML_PACKAGE_OP) || 241 233 (op->common.aml_opcode == AML_VAR_PACKAGE_OP)) { 242 234 replacement_op = acpi_ps_alloc_op (op->common.aml_opcode); 243 235 if (!replacement_op) { 244 - goto cleanup; 236 + goto allocate_error; 245 237 } 246 238 247 239 replacement_op->named.data = op->named.data; ··· 250 244 break; 251 245 252 246 default: 247 + 253 248 replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP); 254 249 if (!replacement_op) { 255 - goto cleanup; 250 + goto allocate_error; 256 251 } 257 252 } 258 253 259 254 /* We must unlink this op from the parent tree */ 260 255 261 - prev = op->common.parent->common.value.arg; 262 256 if (prev == op) { 263 257 /* This op is the first in the list */ 264 258 ··· 304 298 /* Now we can actually delete the subtree rooted at Op */ 305 299 306 300 acpi_ps_delete_parse_tree (op); 307 - return_VOID; 301 + return_ACPI_STATUS (AE_OK); 302 + 303 + 304 + allocate_error: 305 + 306 + /* Always delete the subtree, even on error */ 307 + 308 + acpi_ps_delete_parse_tree (op); 309 + return_ACPI_STATUS (AE_NO_MEMORY); 308 310 } 309 311 310 312 ··· 457 443 struct acpi_walk_state *walk_state) 458 444 { 459 445 acpi_status status = AE_OK; 446 + acpi_status status2; 460 447 union acpi_parse_object *op = NULL; /* current op */ 461 448 union acpi_parse_object *arg = NULL; 462 449 union acpi_parse_object *pre_op = NULL; ··· 759 744 break; 760 745 761 746 default: 762 - 763 747 /* 764 748 * Op is not a constant or string, append each argument 765 749 * to the Op ··· 783 769 } 784 770 785 771 /* Special processing for certain opcodes */ 772 + 773 + if (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) { 774 + switch (op->common.aml_opcode) { 775 + case AML_IF_OP: 776 + case AML_ELSE_OP: 777 + case AML_WHILE_OP: 778 + 779 + /* Skip body of if/else/while in pass 1 */ 780 + 781 + parser_state->aml = parser_state->pkg_end; 782 + walk_state->arg_count = 0; 783 + break; 784 + 785 + default: 786 + break; 787 + } 788 + } 786 789 787 790 switch (op->common.aml_opcode) { 788 791 case AML_METHOD_OP: ··· 827 796 828 797 if ((op->common.parent) && 829 798 (op->common.parent->common.aml_opcode == AML_NAME_OP) && 830 - (walk_state->descending_callback != acpi_ds_exec_begin_op)) { 799 + (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2)) { 831 800 /* 832 801 * Skip parsing of Buffers and Packages 833 802 * because we don't have enough info in the first pass ··· 931 900 */ 932 901 parser_state->scope->parse_scope.arg_count--; 933 902 934 - /* Close this Op (will result in parse subtree deletion) */ 903 + /* Finished with pre_op */ 935 904 936 - acpi_ps_complete_this_op (walk_state, op); 937 - op = NULL; 938 905 if (pre_op) { 939 906 acpi_ps_free_op (pre_op); 940 907 pre_op = NULL; 941 908 } 909 + 910 + /* Close this Op (will result in parse subtree deletion) */ 911 + 912 + status2 = acpi_ps_complete_this_op (walk_state, op); 913 + if (ACPI_FAILURE (status2)) { 914 + return_ACPI_STATUS (status2); 915 + } 916 + op = NULL; 942 917 943 918 switch (status) { 944 919 case AE_OK: ··· 973 936 status = walk_state->ascending_callback (walk_state); 974 937 status = acpi_ps_next_parse_state (walk_state, op, status); 975 938 976 - acpi_ps_complete_this_op (walk_state, op); 939 + status2 = acpi_ps_complete_this_op (walk_state, op); 940 + if (ACPI_FAILURE (status2)) { 941 + return_ACPI_STATUS (status2); 942 + } 977 943 op = NULL; 978 944 } 979 945 status = AE_OK; ··· 1002 962 status = walk_state->ascending_callback (walk_state); 1003 963 status = acpi_ps_next_parse_state (walk_state, op, status); 1004 964 1005 - acpi_ps_complete_this_op (walk_state, op); 965 + status2 = acpi_ps_complete_this_op (walk_state, op); 966 + if (ACPI_FAILURE (status2)) { 967 + return_ACPI_STATUS (status2); 968 + } 1006 969 op = NULL; 1007 970 1008 971 status = AE_OK; ··· 1019 976 /* Clean up */ 1020 977 do { 1021 978 if (op) { 1022 - acpi_ps_complete_this_op (walk_state, op); 979 + status2 = acpi_ps_complete_this_op (walk_state, op); 980 + if (ACPI_FAILURE (status2)) { 981 + return_ACPI_STATUS (status2); 982 + } 1023 983 } 1024 984 acpi_ps_pop_scope (parser_state, &op, 1025 985 &walk_state->arg_types, &walk_state->arg_count); ··· 1036 990 1037 991 do { 1038 992 if (op) { 1039 - acpi_ps_complete_this_op (walk_state, op); 993 + status2 = acpi_ps_complete_this_op (walk_state, op); 994 + if (ACPI_FAILURE (status2)) { 995 + return_ACPI_STATUS (status2); 996 + } 1040 997 } 1041 998 acpi_ps_pop_scope (parser_state, &op, 1042 999 &walk_state->arg_types, &walk_state->arg_count); ··· 1102 1053 /* Clean up */ 1103 1054 do { 1104 1055 if (op) { 1105 - acpi_ps_complete_this_op (walk_state, op); 1056 + status2 = acpi_ps_complete_this_op (walk_state, op); 1057 + if (ACPI_FAILURE (status2)) { 1058 + return_ACPI_STATUS (status2); 1059 + } 1106 1060 } 1107 1061 1108 1062 acpi_ps_pop_scope (parser_state, &op, ··· 1117 1065 } 1118 1066 1119 1067 else if (ACPI_FAILURE (status)) { 1120 - acpi_ps_complete_this_op (walk_state, op); 1068 + /* First error is most important */ 1069 + 1070 + (void) acpi_ps_complete_this_op (walk_state, op); 1121 1071 return_ACPI_STATUS (status); 1122 1072 } 1123 1073 } 1124 1074 1125 - acpi_ps_complete_this_op (walk_state, op); 1075 + status2 = acpi_ps_complete_this_op (walk_state, op); 1076 + if (ACPI_FAILURE (status2)) { 1077 + return_ACPI_STATUS (status2); 1078 + } 1126 1079 } 1127 1080 1128 1081 acpi_ps_pop_scope (parser_state, &op, &walk_state->arg_types,
+4 -2
drivers/acpi/tables/tbxfroot.c
··· 331 331 332 332 333 333 cleanup: 334 - acpi_os_unmap_memory (rsdt_info->pointer, 335 - (acpi_size) rsdt_info->pointer->length); 334 + if (rsdt_info->pointer) { 335 + acpi_os_unmap_memory (rsdt_info->pointer, 336 + (acpi_size) rsdt_info->pointer->length); 337 + } 336 338 ACPI_MEM_FREE (rsdt_info); 337 339 338 340 if (header) {
+23 -17
drivers/acpi/utilities/utmisc.c
··· 787 787 acpi_mutex_handle mutex_id) 788 788 { 789 789 acpi_status status; 790 - u32 i; 791 790 u32 this_thread_id; 792 791 793 792 ··· 813 814 return (AE_NOT_ACQUIRED); 814 815 } 815 816 816 - /* 817 - * Deadlock prevention. Check if this thread owns any mutexes of value 818 - * greater than this one. If so, the thread has violated the mutex 819 - * ordering rule. This indicates a coding error somewhere in 820 - * the ACPI subsystem code. 821 - */ 822 - for (i = mutex_id; i < MAX_MUTEX; i++) { 823 - if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { 824 - if (i == mutex_id) { 825 - continue; 817 + #ifdef ACPI_MUTEX_DEBUG 818 + { 819 + u32 i; 820 + /* 821 + * Mutex debug code, for internal debugging only. 822 + * 823 + * Deadlock prevention. Check if this thread owns any mutexes of value 824 + * greater than this one. If so, the thread has violated the mutex 825 + * ordering rule. This indicates a coding error somewhere in 826 + * the ACPI subsystem code. 827 + */ 828 + for (i = mutex_id; i < MAX_MUTEX; i++) { 829 + if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) { 830 + if (i == mutex_id) { 831 + continue; 832 + } 833 + 834 + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 835 + "Invalid release order: owns [%s], releasing [%s]\n", 836 + acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id))); 837 + 838 + return (AE_RELEASE_DEADLOCK); 826 839 } 827 - 828 - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 829 - "Invalid release order: owns [%s], releasing [%s]\n", 830 - acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id))); 831 - 832 - return (AE_RELEASE_DEADLOCK); 833 840 } 834 841 } 842 + #endif 835 843 836 844 /* Mark unlocked FIRST */ 837 845
+1 -1
include/acpi/acconfig.h
··· 64 64 65 65 /* Version string */ 66 66 67 - #define ACPI_CA_VERSION 0x20050513 67 + #define ACPI_CA_VERSION 0x20050526 68 68 69 69 /* 70 70 * OS name, used for the _OS object. The _OS object is essentially obsolete,
+1 -1
include/acpi/acstruct.h
··· 78 78 u8 return_used; 79 79 u16 opcode; /* Current AML opcode */ 80 80 u8 scope_depth; 81 - u8 reserved1; 81 + u8 pass_number; /* Parse pass during table load */ 82 82 u32 arg_count; /* push for fixed or var args */ 83 83 u32 aml_offset; 84 84 u32 arg_types;