diff options
author | Bob Moore <robert.moore@intel.com> | 2008-09-26 23:08:41 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-22 23:14:45 -0400 |
commit | 1044f1f65b7df2aae979e397904c4985eeb99ba2 (patch) | |
tree | 8feb6f2db4f36b75d8c7126d51a7b35e57e13194 /drivers/acpi/executer/exresop.c | |
parent | 2425a0967f29b196fad5d4f726c9502679284656 (diff) |
ACPICA: Cleanup for internal Reference Object
Fix some sloppiness in the Reference object. No longer use AML
opcodes to differentiate the types, introduce new reference
Class. Cleanup the debug output code.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exresop.c')
-rw-r--r-- | drivers/acpi/executer/exresop.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c index 54085f16ec28..0bb82593da72 100644 --- a/drivers/acpi/executer/exresop.c +++ b/drivers/acpi/executer/exresop.c | |||
@@ -225,41 +225,36 @@ acpi_ex_resolve_operands(u16 opcode, | |||
225 | 225 | ||
226 | if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) { | 226 | if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) { |
227 | 227 | ||
228 | /* Decode the Reference */ | 228 | /* Validate the Reference */ |
229 | 229 | ||
230 | op_info = acpi_ps_get_opcode_info(opcode); | 230 | switch (obj_desc->reference.class) { |
231 | if (op_info->class == AML_CLASS_UNKNOWN) { | 231 | case ACPI_REFCLASS_DEBUG: |
232 | return_ACPI_STATUS(AE_AML_BAD_OPCODE); | ||
233 | } | ||
234 | 232 | ||
235 | switch (obj_desc->reference.opcode) { | ||
236 | case AML_DEBUG_OP: | ||
237 | target_op = AML_DEBUG_OP; | 233 | target_op = AML_DEBUG_OP; |
238 | 234 | ||
239 | /*lint -fallthrough */ | 235 | /*lint -fallthrough */ |
240 | 236 | ||
241 | case AML_INDEX_OP: | 237 | case ACPI_REFCLASS_ARG: |
242 | case AML_REF_OF_OP: | 238 | case ACPI_REFCLASS_LOCAL: |
243 | case AML_ARG_OP: | 239 | case ACPI_REFCLASS_INDEX: |
244 | case AML_LOCAL_OP: | 240 | case ACPI_REFCLASS_REFOF: |
245 | case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ | 241 | case ACPI_REFCLASS_TABLE: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ |
246 | case AML_INT_NAMEPATH_OP: /* Reference to a named object */ | 242 | case ACPI_REFCLASS_NAME: /* Reference to a named object */ |
247 | 243 | ||
248 | ACPI_DEBUG_ONLY_MEMBERS(ACPI_DEBUG_PRINT | 244 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
249 | ((ACPI_DB_EXEC, | 245 | "Operand is a Reference, Class [%s] %2.2X\n", |
250 | "Operand is a Reference, RefOpcode [%s]\n", | 246 | acpi_ut_get_reference_name |
251 | (acpi_ps_get_opcode_info | 247 | (obj_desc), |
252 | (obj_desc-> | 248 | obj_desc->reference. |
253 | reference. | 249 | class)); |
254 | opcode))-> | ||
255 | name))); | ||
256 | break; | 250 | break; |
257 | 251 | ||
258 | default: | 252 | default: |
253 | |||
259 | ACPI_ERROR((AE_INFO, | 254 | ACPI_ERROR((AE_INFO, |
260 | "Operand is a Reference, Unknown Reference Opcode: %X", | 255 | "Unknown Reference Class %2.2X in %p", |
261 | obj_desc->reference. | 256 | obj_desc->reference.class, |
262 | opcode)); | 257 | obj_desc)); |
263 | 258 | ||
264 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 259 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
265 | } | 260 | } |
@@ -270,8 +265,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
270 | 265 | ||
271 | /* Invalid descriptor */ | 266 | /* Invalid descriptor */ |
272 | 267 | ||
273 | ACPI_ERROR((AE_INFO, | 268 | ACPI_ERROR((AE_INFO, "Invalid descriptor %p [%s]", |
274 | "Invalid descriptor %p [%s]", | ||
275 | obj_desc, | 269 | obj_desc, |
276 | acpi_ut_get_descriptor_name(obj_desc))); | 270 | acpi_ut_get_descriptor_name(obj_desc))); |
277 | 271 | ||
@@ -343,7 +337,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
343 | if ((opcode == AML_STORE_OP) && | 337 | if ((opcode == AML_STORE_OP) && |
344 | (ACPI_GET_OBJECT_TYPE(*stack_ptr) == | 338 | (ACPI_GET_OBJECT_TYPE(*stack_ptr) == |
345 | ACPI_TYPE_LOCAL_REFERENCE) | 339 | ACPI_TYPE_LOCAL_REFERENCE) |
346 | && ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) { | 340 | && ((*stack_ptr)->reference.class == ACPI_REFCLASS_INDEX)) { |
347 | goto next_operand; | 341 | goto next_operand; |
348 | } | 342 | } |
349 | break; | 343 | break; |