diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 14:52:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 14:52:52 -0400 |
commit | 08acd4f8af42affd8cbed81cc1b69fa12ddb213f (patch) | |
tree | 988d15db6233b20db6a500cd5f590c6d2041462d /drivers/acpi/parser | |
parent | ccf2779544eecfcc5447e2028d1029b6d4ff7bb6 (diff) | |
parent | 008238b54ac2350babf195084ecedbcf7851a202 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits)
ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
acpi: fix section mismatch warning in pnpacpi
intel_menlo: fix build warning
ACPI: Cleanup: Remove unneeded, multiple local dummy variables
ACPI: video - fix permissions on some proc entries
ACPI: video - properly handle errors when registering proc elements
ACPI: video - do not store invalid entries in attached_array list
ACPI: re-name acpi_pm_ops to acpi_suspend_ops
ACER_WMI/ASUS_LAPTOP: fix build bug
thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
ACPI: check a return value correctly in acpi_power_get_context()
#if 0 acpi/bay.c:eject_removable_drive()
eeepc-laptop: add hwmon fan control
eeepc-laptop: add backlight
eeepc-laptop: add base driver
ACPI: thinkpad-acpi: bump up version to 0.20
ACPI: thinkpad-acpi: fix selects in Kconfig
ACPI: thinkpad-acpi: use a private workqueue
ACPI: thinkpad-acpi: fluff really minor fix
ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
...
Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
manually.
Diffstat (limited to 'drivers/acpi/parser')
-rw-r--r-- | drivers/acpi/parser/psargs.c | 63 | ||||
-rw-r--r-- | drivers/acpi/parser/psloop.c | 61 | ||||
-rw-r--r-- | drivers/acpi/parser/psopcode.c | 38 | ||||
-rw-r--r-- | drivers/acpi/parser/psparse.c | 45 | ||||
-rw-r--r-- | drivers/acpi/parser/psscope.c | 2 | ||||
-rw-r--r-- | drivers/acpi/parser/pstree.c | 4 | ||||
-rw-r--r-- | drivers/acpi/parser/psutils.c | 2 | ||||
-rw-r--r-- | drivers/acpi/parser/pswalk.c | 2 | ||||
-rw-r--r-- | drivers/acpi/parser/psxface.c | 2 |
9 files changed, 159 insertions, 60 deletions
diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c index c2b9835c890b..f1e8bf65e24e 100644 --- a/drivers/acpi/parser/psargs.c +++ b/drivers/acpi/parser/psargs.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
@@ -230,12 +230,12 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
230 | struct acpi_parse_state *parser_state, | 230 | struct acpi_parse_state *parser_state, |
231 | union acpi_parse_object *arg, u8 possible_method_call) | 231 | union acpi_parse_object *arg, u8 possible_method_call) |
232 | { | 232 | { |
233 | acpi_status status; | ||
233 | char *path; | 234 | char *path; |
234 | union acpi_parse_object *name_op; | 235 | union acpi_parse_object *name_op; |
235 | acpi_status status; | ||
236 | union acpi_operand_object *method_desc; | 236 | union acpi_operand_object *method_desc; |
237 | struct acpi_namespace_node *node; | 237 | struct acpi_namespace_node *node; |
238 | union acpi_generic_state scope_info; | 238 | u8 *start = parser_state->aml; |
239 | 239 | ||
240 | ACPI_FUNCTION_TRACE(ps_get_next_namepath); | 240 | ACPI_FUNCTION_TRACE(ps_get_next_namepath); |
241 | 241 | ||
@@ -249,25 +249,18 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
249 | return_ACPI_STATUS(AE_OK); | 249 | return_ACPI_STATUS(AE_OK); |
250 | } | 250 | } |
251 | 251 | ||
252 | /* Setup search scope info */ | ||
253 | |||
254 | scope_info.scope.node = NULL; | ||
255 | node = parser_state->start_node; | ||
256 | if (node) { | ||
257 | scope_info.scope.node = node; | ||
258 | } | ||
259 | |||
260 | /* | 252 | /* |
261 | * Lookup the name in the internal namespace. We don't want to add | 253 | * Lookup the name in the internal namespace, starting with the current |
262 | * anything new to the namespace here, however, so we use MODE_EXECUTE. | 254 | * scope. We don't want to add anything new to the namespace here, |
255 | * however, so we use MODE_EXECUTE. | ||
263 | * Allow searching of the parent tree, but don't open a new scope - | 256 | * Allow searching of the parent tree, but don't open a new scope - |
264 | * we just want to lookup the object (must be mode EXECUTE to perform | 257 | * we just want to lookup the object (must be mode EXECUTE to perform |
265 | * the upsearch) | 258 | * the upsearch) |
266 | */ | 259 | */ |
267 | status = | 260 | status = acpi_ns_lookup(walk_state->scope_info, path, |
268 | acpi_ns_lookup(&scope_info, path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, | 261 | ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, |
269 | ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, | 262 | ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, |
270 | NULL, &node); | 263 | NULL, &node); |
271 | 264 | ||
272 | /* | 265 | /* |
273 | * If this name is a control method invocation, we must | 266 | * If this name is a control method invocation, we must |
@@ -275,6 +268,16 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
275 | */ | 268 | */ |
276 | if (ACPI_SUCCESS(status) && | 269 | if (ACPI_SUCCESS(status) && |
277 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { | 270 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { |
271 | if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) { | ||
272 | /* | ||
273 | * acpi_ps_get_next_namestring has increased the AML pointer, | ||
274 | * so we need to restore the saved AML pointer for method call. | ||
275 | */ | ||
276 | walk_state->parser_state.aml = start; | ||
277 | walk_state->arg_count = 1; | ||
278 | acpi_ps_init_op(arg, AML_INT_METHODCALL_OP); | ||
279 | return_ACPI_STATUS(AE_OK); | ||
280 | } | ||
278 | 281 | ||
279 | /* This name is actually a control method invocation */ | 282 | /* This name is actually a control method invocation */ |
280 | 283 | ||
@@ -686,9 +689,29 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, | |||
686 | return_ACPI_STATUS(AE_NO_MEMORY); | 689 | return_ACPI_STATUS(AE_NO_MEMORY); |
687 | } | 690 | } |
688 | 691 | ||
689 | status = | 692 | /* To support super_name arg of Unload */ |
690 | acpi_ps_get_next_namepath(walk_state, parser_state, | 693 | |
691 | arg, 0); | 694 | if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) { |
695 | status = | ||
696 | acpi_ps_get_next_namepath(walk_state, | ||
697 | parser_state, arg, | ||
698 | 1); | ||
699 | |||
700 | /* | ||
701 | * If the super_name arg of Unload is a method call, | ||
702 | * we have restored the AML pointer, just free this Arg | ||
703 | */ | ||
704 | if (arg->common.aml_opcode == | ||
705 | AML_INT_METHODCALL_OP) { | ||
706 | acpi_ps_free_op(arg); | ||
707 | arg = NULL; | ||
708 | } | ||
709 | } else { | ||
710 | status = | ||
711 | acpi_ps_get_next_namepath(walk_state, | ||
712 | parser_state, arg, | ||
713 | 0); | ||
714 | } | ||
692 | } else { | 715 | } else { |
693 | /* Single complex argument, nothing returned */ | 716 | /* Single complex argument, nothing returned */ |
694 | 717 | ||
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c index 773aee82fbb8..c06238e55d98 100644 --- a/drivers/acpi/parser/psloop.c +++ b/drivers/acpi/parser/psloop.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
@@ -182,6 +182,7 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state, | |||
182 | ACPI_FUNCTION_TRACE_PTR(ps_build_named_op, walk_state); | 182 | ACPI_FUNCTION_TRACE_PTR(ps_build_named_op, walk_state); |
183 | 183 | ||
184 | unnamed_op->common.value.arg = NULL; | 184 | unnamed_op->common.value.arg = NULL; |
185 | unnamed_op->common.arg_list_length = 0; | ||
185 | unnamed_op->common.aml_opcode = walk_state->opcode; | 186 | unnamed_op->common.aml_opcode = walk_state->opcode; |
186 | 187 | ||
187 | /* | 188 | /* |
@@ -241,7 +242,8 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state, | |||
241 | acpi_ps_append_arg(*op, unnamed_op->common.value.arg); | 242 | acpi_ps_append_arg(*op, unnamed_op->common.value.arg); |
242 | acpi_gbl_depth++; | 243 | acpi_gbl_depth++; |
243 | 244 | ||
244 | if ((*op)->common.aml_opcode == AML_REGION_OP) { | 245 | if ((*op)->common.aml_opcode == AML_REGION_OP || |
246 | (*op)->common.aml_opcode == AML_DATA_REGION_OP) { | ||
245 | /* | 247 | /* |
246 | * Defer final parsing of an operation_region body, because we don't | 248 | * Defer final parsing of an operation_region body, because we don't |
247 | * have enough info in the first pass to parse it correctly (i.e., | 249 | * have enough info in the first pass to parse it correctly (i.e., |
@@ -280,6 +282,9 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
280 | acpi_status status = AE_OK; | 282 | acpi_status status = AE_OK; |
281 | union acpi_parse_object *op; | 283 | union acpi_parse_object *op; |
282 | union acpi_parse_object *named_op = NULL; | 284 | union acpi_parse_object *named_op = NULL; |
285 | union acpi_parse_object *parent_scope; | ||
286 | u8 argument_count; | ||
287 | const struct acpi_opcode_info *op_info; | ||
283 | 288 | ||
284 | ACPI_FUNCTION_TRACE_PTR(ps_create_op, walk_state); | 289 | ACPI_FUNCTION_TRACE_PTR(ps_create_op, walk_state); |
285 | 290 | ||
@@ -320,8 +325,32 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
320 | op->named.length = 0; | 325 | op->named.length = 0; |
321 | } | 326 | } |
322 | 327 | ||
323 | acpi_ps_append_arg(acpi_ps_get_parent_scope | 328 | if (walk_state->opcode == AML_BANK_FIELD_OP) { |
324 | (&(walk_state->parser_state)), op); | 329 | /* |
330 | * Backup to beginning of bank_field declaration | ||
331 | * body_length is unknown until we parse the body | ||
332 | */ | ||
333 | op->named.data = aml_op_start; | ||
334 | op->named.length = 0; | ||
335 | } | ||
336 | |||
337 | parent_scope = acpi_ps_get_parent_scope(&(walk_state->parser_state)); | ||
338 | acpi_ps_append_arg(parent_scope, op); | ||
339 | |||
340 | if (parent_scope) { | ||
341 | op_info = | ||
342 | acpi_ps_get_opcode_info(parent_scope->common.aml_opcode); | ||
343 | if (op_info->flags & AML_HAS_TARGET) { | ||
344 | argument_count = | ||
345 | acpi_ps_get_argument_count(op_info->type); | ||
346 | if (parent_scope->common.arg_list_length > | ||
347 | argument_count) { | ||
348 | op->common.flags |= ACPI_PARSEOP_TARGET; | ||
349 | } | ||
350 | } else if (parent_scope->common.aml_opcode == AML_INCREMENT_OP) { | ||
351 | op->common.flags |= ACPI_PARSEOP_TARGET; | ||
352 | } | ||
353 | } | ||
325 | 354 | ||
326 | if (walk_state->descending_callback != NULL) { | 355 | if (walk_state->descending_callback != NULL) { |
327 | /* | 356 | /* |
@@ -603,13 +632,6 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, | |||
603 | acpi_ps_pop_scope(&(walk_state->parser_state), op, | 632 | acpi_ps_pop_scope(&(walk_state->parser_state), op, |
604 | &walk_state->arg_types, | 633 | &walk_state->arg_types, |
605 | &walk_state->arg_count); | 634 | &walk_state->arg_count); |
606 | |||
607 | if ((*op)->common.aml_opcode != AML_WHILE_OP) { | ||
608 | status2 = acpi_ds_result_stack_pop(walk_state); | ||
609 | if (ACPI_FAILURE(status2)) { | ||
610 | return_ACPI_STATUS(status2); | ||
611 | } | ||
612 | } | ||
613 | } | 635 | } |
614 | 636 | ||
615 | /* Close this iteration of the While loop */ | 637 | /* Close this iteration of the While loop */ |
@@ -640,10 +662,6 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, | |||
640 | if (ACPI_FAILURE(status2)) { | 662 | if (ACPI_FAILURE(status2)) { |
641 | return_ACPI_STATUS(status2); | 663 | return_ACPI_STATUS(status2); |
642 | } | 664 | } |
643 | status2 = acpi_ds_result_stack_pop(walk_state); | ||
644 | if (ACPI_FAILURE(status2)) { | ||
645 | return_ACPI_STATUS(status2); | ||
646 | } | ||
647 | 665 | ||
648 | acpi_ut_delete_generic_state | 666 | acpi_ut_delete_generic_state |
649 | (acpi_ut_pop_generic_state | 667 | (acpi_ut_pop_generic_state |
@@ -1005,7 +1023,8 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
1005 | acpi_gbl_depth--; | 1023 | acpi_gbl_depth--; |
1006 | } | 1024 | } |
1007 | 1025 | ||
1008 | if (op->common.aml_opcode == AML_REGION_OP) { | 1026 | if (op->common.aml_opcode == AML_REGION_OP || |
1027 | op->common.aml_opcode == AML_DATA_REGION_OP) { | ||
1009 | /* | 1028 | /* |
1010 | * Skip parsing of control method or opregion body, | 1029 | * Skip parsing of control method or opregion body, |
1011 | * because we don't have enough info in the first pass | 1030 | * because we don't have enough info in the first pass |
@@ -1030,6 +1049,16 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
1030 | (u32) (parser_state->aml - op->named.data); | 1049 | (u32) (parser_state->aml - op->named.data); |
1031 | } | 1050 | } |
1032 | 1051 | ||
1052 | if (op->common.aml_opcode == AML_BANK_FIELD_OP) { | ||
1053 | /* | ||
1054 | * Backup to beginning of bank_field declaration | ||
1055 | * | ||
1056 | * body_length is unknown until we parse the body | ||
1057 | */ | ||
1058 | op->named.length = | ||
1059 | (u32) (parser_state->aml - op->named.data); | ||
1060 | } | ||
1061 | |||
1033 | /* This op complete, notify the dispatcher */ | 1062 | /* This op complete, notify the dispatcher */ |
1034 | 1063 | ||
1035 | if (walk_state->ascending_callback != NULL) { | 1064 | if (walk_state->ascending_callback != NULL) { |
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c index 9296e86761d7..f425ab30eae8 100644 --- a/drivers/acpi/parser/psopcode.c +++ b/drivers/acpi/parser/psopcode.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
@@ -49,6 +49,9 @@ | |||
49 | #define _COMPONENT ACPI_PARSER | 49 | #define _COMPONENT ACPI_PARSER |
50 | ACPI_MODULE_NAME("psopcode") | 50 | ACPI_MODULE_NAME("psopcode") |
51 | 51 | ||
52 | static const u8 acpi_gbl_argument_count[] = | ||
53 | { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 }; | ||
54 | |||
52 | /******************************************************************************* | 55 | /******************************************************************************* |
53 | * | 56 | * |
54 | * NAME: acpi_gbl_aml_op_info | 57 | * NAME: acpi_gbl_aml_op_info |
@@ -59,6 +62,7 @@ ACPI_MODULE_NAME("psopcode") | |||
59 | * the operand type. | 62 | * the operand type. |
60 | * | 63 | * |
61 | ******************************************************************************/ | 64 | ******************************************************************************/ |
65 | |||
62 | /* | 66 | /* |
63 | * Summary of opcode types/flags | 67 | * Summary of opcode types/flags |
64 | * | 68 | * |
@@ -176,6 +180,7 @@ ACPI_MODULE_NAME("psopcode") | |||
176 | AML_CREATE_QWORD_FIELD_OP | 180 | AML_CREATE_QWORD_FIELD_OP |
177 | 181 | ||
178 | ******************************************************************************/ | 182 | ******************************************************************************/ |
183 | |||
179 | /* | 184 | /* |
180 | * Master Opcode information table. A summary of everything we know about each | 185 | * Master Opcode information table. A summary of everything we know about each |
181 | * opcode, all in one place. | 186 | * opcode, all in one place. |
@@ -515,9 +520,10 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = { | |||
515 | AML_TYPE_NAMED_FIELD, | 520 | AML_TYPE_NAMED_FIELD, |
516 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), | 521 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), |
517 | /* 5F */ ACPI_OP("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, | 522 | /* 5F */ ACPI_OP("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, |
518 | ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, | 523 | ACPI_TYPE_LOCAL_BANK_FIELD, AML_CLASS_NAMED_OBJECT, |
519 | AML_TYPE_NAMED_FIELD, | 524 | AML_TYPE_NAMED_FIELD, |
520 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), | 525 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD | |
526 | AML_DEFER), | ||
521 | 527 | ||
522 | /* Internal opcodes that map to invalid AML opcodes */ | 528 | /* Internal opcodes that map to invalid AML opcodes */ |
523 | 529 | ||
@@ -619,9 +625,9 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = { | |||
619 | AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), | 625 | AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), |
620 | /* 7C */ ACPI_OP("DataTableRegion", ARGP_DATA_REGION_OP, | 626 | /* 7C */ ACPI_OP("DataTableRegion", ARGP_DATA_REGION_OP, |
621 | ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, | 627 | ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, |
622 | AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, | 628 | AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, |
623 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | | 629 | AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | |
624 | AML_NSNODE | AML_NAMED), | 630 | AML_NSNODE | AML_NAMED | AML_DEFER), |
625 | /* 7D */ ACPI_OP("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, | 631 | /* 7D */ ACPI_OP("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, |
626 | ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, | 632 | ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, |
627 | AML_TYPE_NAMED_NO_OBJ, | 633 | AML_TYPE_NAMED_NO_OBJ, |
@@ -779,3 +785,25 @@ char *acpi_ps_get_opcode_name(u16 opcode) | |||
779 | 785 | ||
780 | #endif | 786 | #endif |
781 | } | 787 | } |
788 | |||
789 | /******************************************************************************* | ||
790 | * | ||
791 | * FUNCTION: acpi_ps_get_argument_count | ||
792 | * | ||
793 | * PARAMETERS: op_type - Type associated with the AML opcode | ||
794 | * | ||
795 | * RETURN: Argument count | ||
796 | * | ||
797 | * DESCRIPTION: Obtain the number of expected arguments for an AML opcode | ||
798 | * | ||
799 | ******************************************************************************/ | ||
800 | |||
801 | u8 acpi_ps_get_argument_count(u32 op_type) | ||
802 | { | ||
803 | |||
804 | if (op_type <= AML_TYPE_EXEC_6A_0T_1R) { | ||
805 | return (acpi_gbl_argument_count[op_type]); | ||
806 | } | ||
807 | |||
808 | return (0); | ||
809 | } | ||
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 5d63f48e56b5..15e1702e48d6 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
@@ -205,6 +205,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, | |||
205 | || (op->common.parent->common.aml_opcode == | 205 | || (op->common.parent->common.aml_opcode == |
206 | AML_PACKAGE_OP) | 206 | AML_PACKAGE_OP) |
207 | || (op->common.parent->common.aml_opcode == | 207 | || (op->common.parent->common.aml_opcode == |
208 | AML_BANK_FIELD_OP) | ||
209 | || (op->common.parent->common.aml_opcode == | ||
208 | AML_VAR_PACKAGE_OP)) { | 210 | AML_VAR_PACKAGE_OP)) { |
209 | replacement_op = | 211 | replacement_op = |
210 | acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); | 212 | acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); |
@@ -349,19 +351,13 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, | |||
349 | 351 | ||
350 | parser_state->aml = walk_state->aml_last_while; | 352 | parser_state->aml = walk_state->aml_last_while; |
351 | walk_state->control_state->common.value = FALSE; | 353 | walk_state->control_state->common.value = FALSE; |
352 | status = acpi_ds_result_stack_pop(walk_state); | 354 | status = AE_CTRL_BREAK; |
353 | if (ACPI_SUCCESS(status)) { | ||
354 | status = AE_CTRL_BREAK; | ||
355 | } | ||
356 | break; | 355 | break; |
357 | 356 | ||
358 | case AE_CTRL_CONTINUE: | 357 | case AE_CTRL_CONTINUE: |
359 | 358 | ||
360 | parser_state->aml = walk_state->aml_last_while; | 359 | parser_state->aml = walk_state->aml_last_while; |
361 | status = acpi_ds_result_stack_pop(walk_state); | 360 | status = AE_CTRL_CONTINUE; |
362 | if (ACPI_SUCCESS(status)) { | ||
363 | status = AE_CTRL_CONTINUE; | ||
364 | } | ||
365 | break; | 361 | break; |
366 | 362 | ||
367 | case AE_CTRL_PENDING: | 363 | case AE_CTRL_PENDING: |
@@ -383,10 +379,7 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, | |||
383 | * Just close out this package | 379 | * Just close out this package |
384 | */ | 380 | */ |
385 | parser_state->aml = acpi_ps_get_next_package_end(parser_state); | 381 | parser_state->aml = acpi_ps_get_next_package_end(parser_state); |
386 | status = acpi_ds_result_stack_pop(walk_state); | 382 | status = AE_CTRL_PENDING; |
387 | if (ACPI_SUCCESS(status)) { | ||
388 | status = AE_CTRL_PENDING; | ||
389 | } | ||
390 | break; | 383 | break; |
391 | 384 | ||
392 | case AE_CTRL_FALSE: | 385 | case AE_CTRL_FALSE: |
@@ -541,7 +534,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
541 | if ((status == AE_ALREADY_EXISTS) && | 534 | if ((status == AE_ALREADY_EXISTS) && |
542 | (!walk_state->method_desc->method.mutex)) { | 535 | (!walk_state->method_desc->method.mutex)) { |
543 | ACPI_INFO((AE_INFO, | 536 | ACPI_INFO((AE_INFO, |
544 | "Marking method %4.4s as Serialized", | 537 | "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", |
545 | walk_state->method_node->name. | 538 | walk_state->method_node->name. |
546 | ascii)); | 539 | ascii)); |
547 | 540 | ||
@@ -601,6 +594,30 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
601 | * The object is deleted | 594 | * The object is deleted |
602 | */ | 595 | */ |
603 | if (!previous_walk_state->return_desc) { | 596 | if (!previous_walk_state->return_desc) { |
597 | /* | ||
598 | * In slack mode execution, if there is no return value | ||
599 | * we should implicitly return zero (0) as a default value. | ||
600 | */ | ||
601 | if (acpi_gbl_enable_interpreter_slack && | ||
602 | !previous_walk_state-> | ||
603 | implicit_return_obj) { | ||
604 | previous_walk_state-> | ||
605 | implicit_return_obj = | ||
606 | acpi_ut_create_internal_object | ||
607 | (ACPI_TYPE_INTEGER); | ||
608 | if (!previous_walk_state-> | ||
609 | implicit_return_obj) { | ||
610 | return_ACPI_STATUS | ||
611 | (AE_NO_MEMORY); | ||
612 | } | ||
613 | |||
614 | previous_walk_state-> | ||
615 | implicit_return_obj-> | ||
616 | integer.value = 0; | ||
617 | } | ||
618 | |||
619 | /* Restart the calling control method */ | ||
620 | |||
604 | status = | 621 | status = |
605 | acpi_ds_restart_control_method | 622 | acpi_ds_restart_control_method |
606 | (walk_state, | 623 | (walk_state, |
diff --git a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c index 77cfa4ed0cfe..ee50e67c9443 100644 --- a/drivers/acpi/parser/psscope.c +++ b/drivers/acpi/parser/psscope.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c index 966e7ea2a0c4..1dd355ddd182 100644 --- a/drivers/acpi/parser/pstree.c +++ b/drivers/acpi/parser/pstree.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
@@ -171,6 +171,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg) | |||
171 | while (arg) { | 171 | while (arg) { |
172 | arg->common.parent = op; | 172 | arg->common.parent = op; |
173 | arg = arg->common.next; | 173 | arg = arg->common.next; |
174 | |||
175 | op->common.arg_list_length++; | ||
174 | } | 176 | } |
175 | } | 177 | } |
176 | 178 | ||
diff --git a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c index 8ca52002db55..7cf1f65cd5bb 100644 --- a/drivers/acpi/parser/psutils.c +++ b/drivers/acpi/parser/psutils.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
diff --git a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c index 49f9757434e4..8b86ad5a3201 100644 --- a/drivers/acpi/parser/pswalk.c +++ b/drivers/acpi/parser/pswalk.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c index 94103bced75e..52581454c47c 100644 --- a/drivers/acpi/parser/psxface.c +++ b/drivers/acpi/parser/psxface.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, 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 |