summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/interpreter/amresop.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-31 22:22:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-31 22:22:27 +0000
commit825423e4c4f18289df2393951cfd2a7a31fc0464 (patch)
tree4ad80e981c3d9effa910d2247d118d254f9a5d09 /drivers/acpi/interpreter/amresop.c
parentc4693dc4856ab907a5c02187a8d398861bebfc7e (diff)
Merge with Linux 2.4.1.
Diffstat (limited to 'drivers/acpi/interpreter/amresop.c')
-rw-r--r--drivers/acpi/interpreter/amresop.c89
1 files changed, 69 insertions, 20 deletions
diff --git a/drivers/acpi/interpreter/amresop.c b/drivers/acpi/interpreter/amresop.c
index 83fda4455..a837fd66b 100644
--- a/drivers/acpi/interpreter/amresop.c
+++ b/drivers/acpi/interpreter/amresop.c
@@ -2,12 +2,12 @@
/******************************************************************************
*
* Module Name: amresop - AML Interpreter operand/object resolution
- * $Revision: 18 $
+ * $Revision: 22 $
*
*****************************************************************************/
/*
- * Copyright (C) 2000 R. Byron Moore
+ * Copyright (C) 2000, 2001 R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -214,8 +214,13 @@ acpi_aml_resolve_operands (
switch (this_arg_type)
{
- case ARGI_REFERENCE: /* Reference */
- case ARGI_TARGETREF:
+ case ARGI_REFERENCE: /* References */
+ case ARGI_INTEGER_REF:
+ case ARGI_OBJECT_REF:
+ case ARGI_DEVICE_REF:
+ case ARGI_TARGETREF: /* TBD: must implement implicit conversion rules before store */
+ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
+ case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
/* Need an operand of type INTERNAL_TYPE_REFERENCE */
@@ -283,20 +288,6 @@ acpi_aml_resolve_operands (
* For the simple cases, only one type of resolved object
* is allowed
*/
- case ARGI_NUMBER: /* Number */
-
- /* Need an operand of type ACPI_TYPE_NUMBER */
-
- type_needed = ACPI_TYPE_NUMBER;
- break;
-
- case ARGI_BUFFER:
-
- /* Need an operand of type ACPI_TYPE_BUFFER */
-
- type_needed = ACPI_TYPE_BUFFER;
- break;
-
case ARGI_MUTEX:
/* Need an operand of type ACPI_TYPE_MUTEX */
@@ -344,11 +335,69 @@ acpi_aml_resolve_operands (
* The more complex cases allow multiple resolved object types
*/
+ case ARGI_INTEGER: /* Number */
+
+ /*
+ * Need an operand of type ACPI_TYPE_INTEGER,
+ * But we can implicitly convert from a STRING or BUFFER
+ */
+ status = acpi_aml_convert_to_integer (stack_ptr, walk_state);
+ if (ACPI_FAILURE (status)) {
+ if (status == AE_TYPE) {
+ return (AE_AML_OPERAND_TYPE);
+ }
+
+ return (status);
+ }
+
+ goto next_operand;
+ break;
+
+
+ case ARGI_BUFFER:
+
+ /*
+ * Need an operand of type ACPI_TYPE_BUFFER,
+ * But we can implicitly convert from a STRING or INTEGER
+ */
+ status = acpi_aml_convert_to_buffer (stack_ptr, walk_state);
+ if (ACPI_FAILURE (status)) {
+ if (status == AE_TYPE) {
+ return (AE_AML_OPERAND_TYPE);
+ }
+
+ return (status);
+ }
+
+ goto next_operand;
+ break;
+
+
case ARGI_STRING:
- /* Need an operand of type ACPI_TYPE_STRING or ACPI_TYPE_BUFFER */
+ /*
+ * Need an operand of type ACPI_TYPE_STRING,
+ * But we can implicitly convert from a BUFFER or INTEGER
+ */
+ status = acpi_aml_convert_to_string (stack_ptr, walk_state);
+ if (ACPI_FAILURE (status)) {
+ if (status == AE_TYPE) {
+ return (AE_AML_OPERAND_TYPE);
+ }
+
+ return (status);
+ }
+
+ goto next_operand;
+ break;
+
+
+ case ARGI_COMPUTEDATA:
+
+ /* Need an operand of type INTEGER, STRING or BUFFER */
- if ((ACPI_TYPE_STRING != (*stack_ptr)->common.type) &&
+ if ((ACPI_TYPE_INTEGER != (*stack_ptr)->common.type) &&
+ (ACPI_TYPE_STRING != (*stack_ptr)->common.type) &&
(ACPI_TYPE_BUFFER != (*stack_ptr)->common.type))
{
return (AE_AML_OPERAND_TYPE);