From ef805d956320ffa36d068673d5c5eb2a7d13209b Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Thu, 10 Apr 2008 19:06:41 +0400 Subject: ACPICA: Implemented full argument resolution support for the BankValue argument to BankField Previously, only constants were supported, now any TermArg may be used. http://www.acpica.org/bugzilla/show_bug.cgi?id=387 http://www.acpica.org/bugzilla/show_bug.cgi?id=393 Signed-off-by: Lin Ming Signed-off-by: Bob Moore Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/parser/psloop.c | 19 +++++++++++++++++++ drivers/acpi/parser/psopcode.c | 5 +++-- drivers/acpi/parser/psparse.c | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'drivers/acpi/parser') diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c index a079975f671f..a7c768860648 100644 --- a/drivers/acpi/parser/psloop.c +++ b/drivers/acpi/parser/psloop.c @@ -325,6 +325,15 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, op->named.length = 0; } + if (walk_state->opcode == AML_BANK_FIELD_OP) { + /* + * Backup to beginning of bank_field declaration + * body_length is unknown until we parse the body + */ + op->named.data = aml_op_start; + op->named.length = 0; + } + parent_scope = acpi_ps_get_parent_scope(&(walk_state->parser_state)); acpi_ps_append_arg(parent_scope, op); @@ -1040,6 +1049,16 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) (u32) (parser_state->aml - op->named.data); } + if (op->common.aml_opcode == AML_BANK_FIELD_OP) { + /* + * Backup to beginning of bank_field declaration + * + * body_length is unknown until we parse the body + */ + op->named.length = + (u32) (parser_state->aml - op->named.data); + } + /* This op complete, notify the dispatcher */ if (walk_state->ascending_callback != NULL) { diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c index b273a0a127e6..18ed59dd2a6e 100644 --- a/drivers/acpi/parser/psopcode.c +++ b/drivers/acpi/parser/psopcode.c @@ -520,9 +520,10 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = { AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* 5F */ ACPI_OP("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, - ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, + ACPI_TYPE_LOCAL_BANK_FIELD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, - AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), + AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD | + AML_DEFER), /* Internal opcodes that map to invalid AML opcodes */ diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 1442e55c40d1..a8995ca52ee7 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -204,6 +204,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, AML_BUFFER_OP) || (op->common.parent->common.aml_opcode == AML_PACKAGE_OP) + || (op->common.parent->common.aml_opcode == + AML_BANK_FIELD_OP) || (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) { replacement_op = -- cgit v1.2.3