Skip to content

Commit

Permalink
ACPICA: Temporary fix for BankValue parameter
Browse files Browse the repository at this point in the history
Temporary fix for BankValue parameter of a Bank
Field to support all constant values, including Zero
and One. Must eventually be converted to a full TermArg
evaluation.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Feb 3, 2007
1 parent 6b366e2 commit 9c52657
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions drivers/acpi/dispatcher/dsfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
}
}

/* We could put the returned object (Node) on the object stack for later,
/*
* We could put the returned object (Node) on the object stack for later,
* but for now, we will put it in the "op" object that the parser uses,
* so we can get it again at the end of this scope
*/
Expand Down Expand Up @@ -514,8 +515,33 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,

/* Third arg is the bank_value */

/* TBD: This arg is a term_arg, not a constant, and must be evaluated */

arg = arg->common.next;
info.bank_value = (u32) arg->common.value.integer;

/* Currently, only the following constants are supported */

switch (arg->common.aml_opcode) {
case AML_ZERO_OP:
info.bank_value = 0;
break;

case AML_ONE_OP:
info.bank_value = 1;
break;

case AML_BYTE_OP:
case AML_WORD_OP:
case AML_DWORD_OP:
case AML_QWORD_OP:
info.bank_value = (u32) arg->common.value.integer;
break;

default:
info.bank_value = 0;
ACPI_ERROR((AE_INFO,
"Non-constant BankValue for BankField is not implemented"));
}

/* Fourth arg is the field flags */

Expand Down

0 comments on commit 9c52657

Please sign in to comment.