diff options
| author | Andy Grover <agrover@aracnet.com> | 2002-06-11 02:18:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-06-11 02:18:40 -0700 |
| commit | bbdd8222fa5151349339af24db52d704e285af68 (patch) | |
| tree | d365a2e2729af068439f62761c0d777667862f18 /drivers/acpi/executer | |
| parent | 044aff7a727a6dcfda508abec356d4e36453634f (diff) | |
[PATCH] ACPI [3/3]
ACPI interpreter update
Change non-interpreter code to account for the interpreter changes.
Diffstat (limited to 'drivers/acpi/executer')
| -rw-r--r-- | drivers/acpi/executer/exconfig.c | 9 | ||||
| -rw-r--r-- | drivers/acpi/executer/exconvrt.c | 22 | ||||
| -rw-r--r-- | drivers/acpi/executer/excreate.c | 16 | ||||
| -rw-r--r-- | drivers/acpi/executer/exdump.c | 58 | ||||
| -rw-r--r-- | drivers/acpi/executer/exfield.c | 14 | ||||
| -rw-r--r-- | drivers/acpi/executer/exfldio.c | 12 | ||||
| -rw-r--r-- | drivers/acpi/executer/exmisc.c | 49 | ||||
| -rw-r--r-- | drivers/acpi/executer/exoparg1.c | 23 | ||||
| -rw-r--r-- | drivers/acpi/executer/exoparg2.c | 14 | ||||
| -rw-r--r-- | drivers/acpi/executer/exoparg3.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/executer/exoparg6.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/executer/exprep.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/executer/exresnte.c | 74 | ||||
| -rw-r--r-- | drivers/acpi/executer/exresolv.c | 67 | ||||
| -rw-r--r-- | drivers/acpi/executer/exresop.c | 57 | ||||
| -rw-r--r-- | drivers/acpi/executer/exstore.c | 65 | ||||
| -rw-r--r-- | drivers/acpi/executer/exstoren.c | 22 | ||||
| -rw-r--r-- | drivers/acpi/executer/exutils.c | 10 |
18 files changed, 201 insertions, 323 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index a1b2e4ffee0d..9b11d9d4325e 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) - * $Revision: 65 $ + * $Revision: 66 $ * *****************************************************************************/ @@ -274,7 +274,7 @@ acpi_ex_load_op ( case ACPI_TYPE_REGION: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Region %p %s\n", - obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); + obj_desc, acpi_ut_get_object_type_name (obj_desc))); /* Get the table header */ @@ -319,7 +319,7 @@ acpi_ex_load_op ( case INTERNAL_TYPE_INDEX_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n", - obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); + obj_desc, acpi_ut_get_object_type_name (obj_desc))); /* * The length of the field must be at least as large as the table. @@ -415,8 +415,7 @@ acpi_ex_unload_table ( */ if ((!ddb_handle) || (ACPI_GET_DESCRIPTOR_TYPE (ddb_handle) != ACPI_DESC_TYPE_OPERAND) || - (((acpi_operand_object *)ddb_handle)->common.type != - INTERNAL_TYPE_REFERENCE)) { + (ACPI_GET_OBJECT_TYPE (ddb_handle) != INTERNAL_TYPE_REFERENCE)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c index 014728cbe33d..d3aa268ff15a 100644 --- a/drivers/acpi/executer/exconvrt.c +++ b/drivers/acpi/executer/exconvrt.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconvrt - Object conversion routines - * $Revision: 35 $ + * $Revision: 37 $ * *****************************************************************************/ @@ -64,7 +64,7 @@ acpi_ex_convert_to_integer ( ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_integer", obj_desc); - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_INTEGER: *result_desc = obj_desc; return_ACPI_STATUS (AE_OK); @@ -103,7 +103,7 @@ acpi_ex_convert_to_integer ( /* * String conversion is different than Buffer conversion */ - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_STRING: /* @@ -190,11 +190,11 @@ acpi_ex_convert_to_buffer ( ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_buffer", obj_desc); - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_INTEGER: /* - * Create a new Buffer + * Create a new Buffer object */ ret_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!ret_desc) { @@ -203,7 +203,6 @@ acpi_ex_convert_to_buffer ( /* Need enough space for one integer */ - ret_desc->buffer.length = acpi_gbl_integer_byte_width; new_buf = ACPI_MEM_CALLOCATE (acpi_gbl_integer_byte_width); if (!new_buf) { ACPI_REPORT_ERROR @@ -217,7 +216,12 @@ acpi_ex_convert_to_buffer ( for (i = 0; i < acpi_gbl_integer_byte_width; i++) { new_buf[i] = (u8) (obj_desc->integer.value >> (i * 8)); } + + /* Complete buffer object initialization */ + + ret_desc->buffer.flags |= AOPOBJ_DATA_VALID; ret_desc->buffer.pointer = new_buf; + ret_desc->buffer.length = acpi_gbl_integer_byte_width; /* Return the new buffer descriptor */ @@ -373,7 +377,7 @@ acpi_ex_convert_to_string ( ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_string", obj_desc); - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_INTEGER: string_length = acpi_gbl_integer_byte_width * 2; @@ -565,10 +569,10 @@ acpi_ex_convert_to_target_type ( default: /* No conversion allowed for these types */ - if (destination_type != source_desc->common.type) { + if (destination_type != ACPI_GET_OBJECT_TYPE (source_desc)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Target does not allow conversion of type %s to %s\n", - acpi_ut_get_type_name ((source_desc)->common.type), + acpi_ut_get_object_type_name (source_desc), acpi_ut_get_type_name (destination_type))); status = AE_TYPE; } diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index 4b530a143004..7ea92f53a22b 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: excreate - Named object creation - * $Revision: 91 $ + * $Revision: 92 $ * *****************************************************************************/ @@ -40,8 +40,7 @@ * * FUNCTION: Acpi_ex_create_alias * - * PARAMETERS: Walk_state - Current state, contains List of - * operands for the opcode + * PARAMETERS: Walk_state - Current state, contains operands * * RETURN: Status * @@ -392,9 +391,7 @@ cleanup: * * FUNCTION: Acpi_ex_create_processor * - * PARAMETERS: Op - Op containing the Processor definition and - * args - * Processor_node - Parent Node for the processor object + * PARAMETERS: Walk_state - Current state * * RETURN: Status * @@ -447,9 +444,7 @@ acpi_ex_create_processor ( * * FUNCTION: Acpi_ex_create_power_resource * - * PARAMETERS: Op - Op containing the Power_resource definition - * and args - * Power_node - Parent Node for the power object + * PARAMETERS: Walk_state - Current state * * RETURN: Status * @@ -502,8 +497,7 @@ acpi_ex_create_power_resource ( * * PARAMETERS: Aml_start - First byte of the method's AML * Aml_length - AML byte count for this method - * Method_flags - AML method flag byte - * Method - Method Node + * Walk_state - Current state * * RETURN: Status * diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c index eb414ac3dadb..7cb741f95d95 100644 --- a/drivers/acpi/executer/exdump.c +++ b/drivers/acpi/executer/exdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exdump - Interpreter debug output routines - * $Revision: 153 $ + * $Revision: 155 $ * *****************************************************************************/ @@ -96,34 +96,10 @@ acpi_ex_dump_operand ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case INTERNAL_TYPE_REFERENCE: switch (obj_desc->reference.opcode) { - case AML_ZERO_OP: - - acpi_os_printf ("Reference: Zero\n"); - break; - - - case AML_ONE_OP: - - acpi_os_printf ("Reference: One\n"); - break; - - - case AML_ONES_OP: - - acpi_os_printf ("Reference: Ones\n"); - break; - - - case AML_REVISION_OP: - - acpi_os_printf ("Reference: Revision\n"); - break; - - case AML_DEBUG_OP: acpi_os_printf ("Reference: Debug\n"); @@ -150,7 +126,7 @@ acpi_ex_dump_operand ( acpi_os_printf ("Reference: Arg%d", obj_desc->reference.offset); - if (ACPI_TYPE_INTEGER == obj_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { /* Value is a Number */ acpi_os_printf (" value is [%8.8X%8.8x]", @@ -167,7 +143,7 @@ acpi_ex_dump_operand ( acpi_os_printf ("Reference: Local%d", obj_desc->reference.offset); - if (ACPI_TYPE_INTEGER == obj_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { /* Value is a Number */ @@ -189,7 +165,7 @@ acpi_ex_dump_operand ( /* unknown opcode */ - acpi_os_printf ("Unknown opcode=%X\n", + acpi_os_printf ("Unknown Reference opcode=%X\n", obj_desc->reference.opcode); break; @@ -340,8 +316,7 @@ acpi_ex_dump_operand ( { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); } - else if (ACPI_TYPE_BUFFER != - obj_desc->buffer_field.buffer_obj->common.type) + else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) { acpi_os_printf ("*not a Buffer* \n"); } @@ -399,9 +374,9 @@ acpi_ex_dump_operand ( default: - /* Unknown Obj_desc->Common.Type value */ + /* Unknown Type */ - acpi_os_printf ("Unknown Type %X\n", obj_desc->common.type); + acpi_os_printf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (obj_desc)); break; } @@ -603,13 +578,13 @@ acpi_ex_dump_object_descriptor ( /* Common Fields */ - acpi_ex_out_string ("Type", acpi_ut_get_type_name (obj_desc->common.type)); + acpi_ex_out_string ("Type", acpi_ut_get_object_type_name (obj_desc)); acpi_ex_out_integer ("Reference Count", obj_desc->common.reference_count); acpi_ex_out_integer ("Flags", obj_desc->common.flags); /* Object-specific Fields */ - switch (obj_desc->common.type) + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_INTEGER: @@ -649,7 +624,7 @@ acpi_ex_dump_object_descriptor ( acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]); if (obj_desc->package.elements[i]) { - acpi_os_printf (" %s", acpi_ut_get_type_name ((obj_desc->package.elements[i])->common.type)); + acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i])); } acpi_os_printf ("\n"); } @@ -745,7 +720,7 @@ acpi_ex_dump_object_descriptor ( acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits); acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node); - switch (obj_desc->common.type) + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_BUFFER_FIELD: acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj); @@ -813,15 +788,10 @@ acpi_ex_dump_object_descriptor ( case INTERNAL_TYPE_DEF_ANY: case INTERNAL_TYPE_EXTRA: case INTERNAL_TYPE_DATA: - - acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %X\n", - obj_desc->common.type); - break; - - default: - acpi_os_printf ("Ex_dump_object_descriptor: Unknown object type %X\n", obj_desc->common.type); + acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %s\n", + acpi_ut_get_object_type_name (obj_desc)); break; } diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c index 1326c3371a02..a7615997d478 100644 --- a/drivers/acpi/executer/exfield.c +++ b/drivers/acpi/executer/exfield.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exfield - ACPI AML (p-code) execution - field manipulation - * $Revision: 110 $ + * $Revision: 112 $ * *****************************************************************************/ @@ -70,7 +70,7 @@ acpi_ex_read_data_from_field ( return_ACPI_STATUS (AE_AML_NO_OPERAND); } - if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) { /* * If the Buffer_field arguments have not been previously evaluated, * evaluate them now and save the results. @@ -110,6 +110,8 @@ acpi_ex_read_data_from_field ( return_ACPI_STATUS (AE_NO_MEMORY); } + /* Complete the buffer object initialization */ + buffer_desc->common.flags = AOPOBJ_DATA_VALID; buffer_desc->buffer.length = length; buffer = buffer_desc->buffer.pointer; @@ -129,7 +131,7 @@ acpi_ex_read_data_from_field ( ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Obj=%p Type=%X Buf=%p Len=%X\n", - obj_desc, obj_desc->common.type, buffer, length)); + obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, length)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n", obj_desc->common_field.bit_length, @@ -193,7 +195,7 @@ acpi_ex_write_data_to_field ( return_ACPI_STATUS (AE_AML_NO_OPERAND); } - if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) { /* * If the Buffer_field arguments have not been previously evaluated, * evaluate them now and save the results. @@ -209,7 +211,7 @@ acpi_ex_write_data_to_field ( /* * Get a pointer to the data to be written */ - switch (source_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (source_desc)) { case ACPI_TYPE_INTEGER: buffer = &source_desc->integer.value; length = sizeof (source_desc->integer.value); @@ -258,7 +260,7 @@ acpi_ex_write_data_to_field ( ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Obj=%p Type=%X Buf=%p Len=%X\n", - obj_desc, obj_desc->common.type, buffer, length)); + obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, length)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Field_read: Bit_len=%X Bit_off=%X Byte_off=%X\n", obj_desc->common_field.bit_length, diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c index d4ffd5e5b927..142352a5a600 100644 --- a/drivers/acpi/executer/exfldio.c +++ b/drivers/acpi/executer/exfldio.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exfldio - Aml Field I/O - * $Revision: 86 $ + * $Revision: 87 $ * *****************************************************************************/ @@ -64,9 +64,11 @@ acpi_ex_setup_region ( rgn_desc = obj_desc->common_field.region_obj; - if (ACPI_TYPE_REGION != rgn_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (rgn_desc) != ACPI_TYPE_REGION) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X (%s)\n", - rgn_desc->common.type, acpi_ut_get_type_name (rgn_desc->common.type))); + ACPI_GET_OBJECT_TYPE (rgn_desc), + acpi_ut_get_object_type_name (rgn_desc))); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -298,7 +300,7 @@ acpi_ex_field_datum_io ( * Bank_fields - Write to a Bank Register, then read/write from/to an Op_region * Index_fields - Write to an Index Register, then read/write from/to a Data Register */ - switch (obj_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_BUFFER_FIELD: /* * If the Buffer_field arguments have not been previously evaluated, @@ -416,7 +418,7 @@ acpi_ex_field_datum_io ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, Wrong object type - %s\n", - obj_desc, acpi_ut_get_type_name (obj_desc->common.type))); + obj_desc, acpi_ut_get_object_type_name (obj_desc))); status = AE_AML_INTERNAL; break; } diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c index becf07f496b4..4e0efea22b28 100644 --- a/drivers/acpi/executer/exmisc.c +++ b/drivers/acpi/executer/exmisc.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 104 $ + * $Revision: 106 $ * *****************************************************************************/ @@ -64,7 +64,7 @@ acpi_ex_get_object_reference ( switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) { case ACPI_DESC_TYPE_OPERAND: - if (obj_desc->common.type != INTERNAL_TYPE_REFERENCE) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) != INTERNAL_TYPE_REFERENCE) { *return_desc = NULL; status = AE_TYPE; goto cleanup; @@ -184,9 +184,9 @@ acpi_ex_concat_template ( ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, length1); ACPI_MEMCPY (new_buf + length1, obj_desc2->buffer.pointer, length2); - /* - * Point the return object to the new buffer - */ + /* Complete the buffer object initialization */ + + return_desc->common.flags = AOPOBJ_DATA_VALID; return_desc->buffer.pointer = (u8 *) new_buf; return_desc->buffer.length = (u32) (length1 + length2); @@ -243,21 +243,22 @@ acpi_ex_do_concatenate ( /* * There are three cases to handle: - * 1) Two Integers concatenated to produce a buffer - * 2) Two Strings concatenated to produce a string - * 3) Two Buffers concatenated to produce a buffer + * + * 1) Two Integers concatenated to produce a new Buffer + * 2) Two Strings concatenated to produce a new String + * 3) Two Buffers concatenated to produce a new Buffer */ - switch (obj_desc1->common.type) { + switch (ACPI_GET_OBJECT_TYPE (obj_desc1)) { case ACPI_TYPE_INTEGER: - /* Result of two integers is a buffer */ + /* Result of two Integers is a Buffer */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!return_desc) { return (AE_NO_MEMORY); } - /* Need enough space for two integers */ + /* Need enough buffer space for two integers */ return_desc->buffer.length = acpi_gbl_integer_byte_width * 2; new_buf = ACPI_MEM_CALLOCATE (return_desc->buffer.length); @@ -268,8 +269,6 @@ acpi_ex_do_concatenate ( goto cleanup; } - return_desc->buffer.pointer = (u8 *) new_buf; - /* Convert the first integer */ this_integer = obj_desc1->integer.value; @@ -286,11 +285,17 @@ acpi_ex_do_concatenate ( this_integer >>= 8; } + /* Complete the buffer object initialization */ + + return_desc->common.flags = AOPOBJ_DATA_VALID; + return_desc->buffer.pointer = (u8 *) new_buf; break; case ACPI_TYPE_STRING: + /* Result of two Strings is a String */ + return_desc = acpi_ut_create_internal_object (ACPI_TYPE_STRING); if (!return_desc) { return (AE_NO_MEMORY); @@ -307,11 +312,13 @@ acpi_ex_do_concatenate ( goto cleanup; } + /* Concatenate the strings */ + ACPI_STRCPY (new_buf, obj_desc1->string.pointer); ACPI_STRCPY (new_buf + obj_desc1->string.length, obj_desc2->string.pointer); - /* Point the return object to the new string */ + /* Complete the String object initialization */ return_desc->string.pointer = new_buf; return_desc->string.length = obj_desc1->string.length + @@ -321,7 +328,7 @@ acpi_ex_do_concatenate ( case ACPI_TYPE_BUFFER: - /* Operand0 is a buffer */ + /* Result of two Buffers is a Buffer */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!return_desc) { @@ -337,22 +344,26 @@ acpi_ex_do_concatenate ( goto cleanup; } + /* Concatenate the buffers */ + ACPI_MEMCPY (new_buf, obj_desc1->buffer.pointer, obj_desc1->buffer.length); ACPI_MEMCPY (new_buf + obj_desc1->buffer.length, obj_desc2->buffer.pointer, obj_desc2->buffer.length); - /* - * Point the return object to the new buffer - */ + /* Complete the buffer object initialization */ + return_desc->common.flags = AOPOBJ_DATA_VALID; return_desc->buffer.pointer = (u8 *) new_buf; return_desc->buffer.length = obj_desc1->buffer.length + - obj_desc2->buffer.length; + obj_desc2->buffer.length; break; default: + + /* Invalid object type, should not happen here */ + status = AE_AML_INTERNAL; return_desc = NULL; } diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c index c26186e48eab..497e7e18933e 100644 --- a/drivers/acpi/executer/exoparg1.c +++ b/drivers/acpi/executer/exoparg1.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument - * $Revision: 137 $ + * $Revision: 139 $ * *****************************************************************************/ @@ -560,23 +560,12 @@ acpi_ex_opcode_1A_0T_1R ( case AML_TYPE_OP: /* Object_type (Source_object) */ - if (INTERNAL_TYPE_REFERENCE == operand[0]->common.type) { + if (ACPI_GET_OBJECT_TYPE (operand[0]) == INTERNAL_TYPE_REFERENCE) { /* * Not a Name -- an indirect name pointer would have * been converted to a direct name pointer in Resolve_operands */ switch (operand[0]->reference.opcode) { - case AML_ZERO_OP: - case AML_ONE_OP: - case AML_ONES_OP: - case AML_REVISION_OP: - - /* Constants are of type Integer */ - - type = ACPI_TYPE_INTEGER; - break; - - case AML_DEBUG_OP: /* The Debug Object is of type "Debug_object" */ @@ -596,7 +585,7 @@ acpi_ex_opcode_1A_0T_1R ( * of the individual package element that is referenced by * the index. */ - type = (*(operand[0]->reference.where))->common.type; + type = ACPI_GET_OBJECT_TYPE (*(operand[0]->reference.where)); } break; @@ -611,7 +600,7 @@ acpi_ex_opcode_1A_0T_1R ( default: - ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Internal error - Unknown Reference subtype %X\n", + ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R/Type_op: Unknown Reference subtype %X\n", operand[0]->reference.opcode)); status = AE_AML_INTERNAL; goto cleanup; @@ -668,7 +657,7 @@ acpi_ex_opcode_1A_0T_1R ( * point (even if the original operand was an object reference, it * will be resolved and typechecked during operand resolution.) */ - switch (temp_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (temp_desc)) { case ACPI_TYPE_BUFFER: value = temp_desc->buffer.length; break; @@ -683,7 +672,7 @@ acpi_ex_opcode_1A_0T_1R ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Size_of, Not Buf/Str/Pkg - found type %s\n", - acpi_ut_get_type_name (temp_desc->common.type))); + acpi_ut_get_object_type_name (temp_desc))); status = AE_AML_OPERAND_TYPE; goto cleanup; } diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c index 265dc08860c6..02361f1fba0d 100644 --- a/drivers/acpi/executer/exoparg2.c +++ b/drivers/acpi/executer/exoparg2.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exoparg2 - AML execution - opcodes with 2 arguments - * $Revision: 106 $ + * $Revision: 108 $ * *****************************************************************************/ @@ -297,7 +297,7 @@ acpi_ex_opcode_2A_1T_1R ( * guaranteed to be either Integer/String/Buffer by the operand * resolution mechanism above. */ - switch (operand[0]->common.type) { + switch (ACPI_GET_OBJECT_TYPE (operand[0])) { case ACPI_TYPE_INTEGER: status = acpi_ex_convert_to_integer (operand[1], &operand[1], walk_state); break; @@ -355,7 +355,7 @@ acpi_ex_opcode_2A_1T_1R ( /* * At this point, the Source operand is either a Package or a Buffer */ - if (operand[0]->common.type == ACPI_TYPE_PACKAGE) { + if (ACPI_GET_OBJECT_TYPE (operand[0]) == ACPI_TYPE_PACKAGE) { /* Object to be indexed is a Package */ if (index >= operand[0]->package.count) { @@ -364,10 +364,10 @@ acpi_ex_opcode_2A_1T_1R ( goto cleanup; } - if ((operand[2]->common.type == INTERNAL_TYPE_REFERENCE) && - (operand[2]->reference.opcode == AML_ZERO_OP)) { + if ((ACPI_GET_OBJECT_TYPE (operand[2]) == ACPI_TYPE_INTEGER) && + (operand[2]->common.flags & AOPOBJ_AML_CONSTANT)) { /* - * There is no actual result descriptor (the Zero_op Result + * There is no actual result descriptor (the Zero_op/Constant Result * descriptor is a placeholder), so just delete the placeholder and * return a reference to the package element */ @@ -381,7 +381,7 @@ acpi_ex_opcode_2A_1T_1R ( */ temp_desc = operand[0]->package.elements [index]; return_desc->reference.opcode = AML_INDEX_OP; - return_desc->reference.target_type = temp_desc->common.type; + return_desc->reference.target_type = ACPI_GET_OBJECT_TYPE (temp_desc); return_desc->reference.object = temp_desc; status = acpi_ex_store (return_desc, operand[2], walk_state); diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c index 11f0858510de..8b829dcf24bb 100644 --- a/drivers/acpi/executer/exoparg3.c +++ b/drivers/acpi/executer/exoparg3.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg3 - AML execution - opcodes with 3 arguments - * $Revision: 13 $ + * $Revision: 14 $ * *****************************************************************************/ @@ -159,7 +159,7 @@ acpi_ex_opcode_3A_1T_1R ( * Create the return object. The Source operand is guaranteed to be * either a String or a Buffer, so just use its type. */ - return_desc = acpi_ut_create_internal_object (operand[0]->common.type); + return_desc = acpi_ut_create_internal_object (ACPI_GET_OBJECT_TYPE (operand[0])); if (!return_desc) { status = AE_NO_MEMORY; goto cleanup; diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c index 36cf10a5c8a3..251c4b435553 100644 --- a/drivers/acpi/executer/exoparg6.c +++ b/drivers/acpi/executer/exoparg6.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg6 - AML execution - opcodes with 6 arguments - * $Revision: 10 $ + * $Revision: 11 $ * *****************************************************************************/ @@ -212,7 +212,7 @@ acpi_ex_opcode_6A_0T_1R ( * Treat any NULL or non-numeric elements as non-matching. */ if (!this_element || - this_element->common.type != ACPI_TYPE_INTEGER) { + ACPI_GET_OBJECT_TYPE (this_element) != ACPI_TYPE_INTEGER) { continue; } diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c index a30fe7bb0099..40608e1d3967 100644 --- a/drivers/acpi/executer/exprep.c +++ b/drivers/acpi/executer/exprep.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities - * $Revision: 117 $ + * $Revision: 118 $ * *****************************************************************************/ @@ -140,7 +140,7 @@ acpi_ex_decode_field_access ( return (0); } - if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) { /* * Buffer_field access can be on any byte boundary, so the * Byte_alignment is always 1 byte -- regardless of any Byte_alignment diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c index 7548575a2545..d4917693b3f8 100644 --- a/drivers/acpi/executer/exresnte.c +++ b/drivers/acpi/executer/exresnte.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution - * $Revision: 53 $ + * $Revision: 56 $ * *****************************************************************************/ @@ -73,7 +73,6 @@ acpi_ex_resolve_node_to_value ( acpi_operand_object *obj_desc = NULL; acpi_namespace_node *node; acpi_object_type entry_type; - acpi_integer temp_val; ACPI_FUNCTION_TRACE ("Ex_resolve_node_to_value"); @@ -113,9 +112,9 @@ acpi_ex_resolve_node_to_value ( switch (entry_type) { case ACPI_TYPE_PACKAGE: - if (ACPI_TYPE_PACKAGE != source_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_PACKAGE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Package, type %s\n", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -131,9 +130,9 @@ acpi_ex_resolve_node_to_value ( case ACPI_TYPE_BUFFER: - if (ACPI_TYPE_BUFFER != source_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Buffer, type %s\n", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -149,9 +148,9 @@ acpi_ex_resolve_node_to_value ( case ACPI_TYPE_STRING: - if (ACPI_TYPE_STRING != source_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_STRING) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a String, type %s\n", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -164,9 +163,9 @@ acpi_ex_resolve_node_to_value ( case ACPI_TYPE_INTEGER: - if (ACPI_TYPE_INTEGER != source_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_INTEGER) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Integer, type %s\n", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -216,61 +215,14 @@ acpi_ex_resolve_node_to_value ( return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */ - /* - * The only named references allowed are named constants - * e.g. -- Name (\OSFL, Ones) - */ case INTERNAL_TYPE_REFERENCE: - switch (source_desc->reference.opcode) { - - case AML_ZERO_OP: - - temp_val = 0; - break; - - case AML_ONE_OP: - - temp_val = 1; - break; - - case AML_ONES_OP: - - temp_val = ACPI_INTEGER_MAX; - break; - - case AML_REVISION_OP: - - temp_val = ACPI_CA_SUPPORT_LEVEL; - break; + /* No named references are allowed here */ - default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported reference opcode %X\n", + source_desc->reference.opcode)); - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported reference opcode %X\n", - source_desc->reference.opcode)); - - return_ACPI_STATUS (AE_AML_BAD_OPCODE); - } - - /* Create object for result */ - - obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - obj_desc->integer.value = temp_val; - - /* - * Truncate value if we are executing from a 32-bit ACPI table - * AND actually executing AML code. If we are resolving - * an object in the namespace via an external call to the - * subsystem, we will have a null Walk_state - */ - if (walk_state) { - acpi_ex_truncate_for32bit_table (obj_desc, walk_state); - } - break; + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Default case is for unknown types */ diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c index 204b9be93abb..e3a7c6b25455 100644 --- a/drivers/acpi/executer/exresolv.c +++ b/drivers/acpi/executer/exresolv.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution - * $Revision: 111 $ + * $Revision: 114 $ * *****************************************************************************/ @@ -130,7 +130,7 @@ acpi_ex_resolve_object_to_value ( /* This is an acpi_operand_object */ - switch (stack_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (stack_desc)) { case INTERNAL_TYPE_REFERENCE: opcode = stack_desc->reference.opcode; @@ -178,56 +178,6 @@ acpi_ex_resolve_object_to_value ( stack_desc->reference.offset, obj_desc)); break; - /* - * For constants, we must change the reference/constant object - * to a real integer object - */ - case AML_ZERO_OP: - case AML_ONE_OP: - case AML_ONES_OP: - case AML_REVISION_OP: - - /* Create a new integer object */ - - obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); - if (!obj_desc) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - switch (opcode) { - case AML_ZERO_OP: - obj_desc->integer.value = 0; - break; - - case AML_ONE_OP: - obj_desc->integer.value = 1; - break; - - case AML_ONES_OP: - obj_desc->integer.value = ACPI_INTEGER_MAX; - - /* Truncate value if we are executing from a 32-bit ACPI table */ - - acpi_ex_truncate_for32bit_table (obj_desc, walk_state); - break; - - case AML_REVISION_OP: - obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL; - break; - - default: - /* No other opcodes can get here */ - break; - } - - /* - * Remove a reference from the original reference object - * and put the new object in its place - */ - acpi_ut_remove_reference (stack_desc); - *stack_ptr = obj_desc; - break; - case AML_INDEX_OP: @@ -239,6 +189,7 @@ acpi_ex_resolve_object_to_value ( case ACPI_TYPE_PACKAGE: + obj_desc = *stack_desc->reference.where; if (obj_desc) { /* @@ -262,7 +213,9 @@ acpi_ex_resolve_object_to_value ( } break; + default: + /* Invalid reference object */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -282,14 +235,12 @@ acpi_ex_resolve_object_to_value ( default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference object subtype %02X in %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference opcode %X in %p\n", opcode, stack_desc)); status = AE_AML_INTERNAL; break; - - } /* switch (Opcode) */ - - break; /* case INTERNAL_TYPE_REFERENCE */ + } + break; case ACPI_TYPE_BUFFER: @@ -313,7 +264,7 @@ acpi_ex_resolve_object_to_value ( case INTERNAL_TYPE_INDEX_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n", - stack_desc, stack_desc->common.type)); + stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc))); status = acpi_ex_read_data_from_field (walk_state, stack_desc, &obj_desc); *stack_ptr = (void *) obj_desc; diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c index 27edf13850ab..531b0d305e4f 100644 --- a/drivers/acpi/executer/exresop.c +++ b/drivers/acpi/executer/exresop.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution - * $Revision: 50 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -65,6 +65,18 @@ acpi_ex_check_object_type ( return (AE_OK); } + if (type_needed == INTERNAL_TYPE_REFERENCE) { + /* + * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference + * objects and thus allow them to be targets. (As per the ACPI + * specification, a store to a constant is a noop.) + */ + if ((this_type == ACPI_TYPE_INTEGER) && + (((acpi_operand_object *) object)->common.flags & AOPOBJ_AML_CONSTANT)) { + return (AE_OK); + } + } + if (type_needed != this_type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [%s], found [%s] %p\n", @@ -85,18 +97,17 @@ acpi_ex_check_object_type ( * PARAMETERS: Opcode - Opcode being interpreted * Stack_ptr - Pointer to the operand stack to be * resolved - * Walk_state - Current stateu + * Walk_state - Current state * * RETURN: Status * * DESCRIPTION: Convert multiple input operands to the types required by the * target operator. * - * Each nibble (actually 5 bits) in Arg_types represents one required - * operand and indicates the required Type: - * - * The corresponding operand will be converted to the required type if - * possible, otherwise we abort with an exception. + * Each 5-bit group in Arg_types represents one required + * operand and indicates the required Type. The corresponding operand + * will be converted to the required type if possible, otherwise we + * abort with an exception. * ******************************************************************************/ @@ -169,7 +180,7 @@ acpi_ex_resolve_operands ( /* ACPI internal object */ - object_type = obj_desc->common.type; + object_type = ACPI_GET_OBJECT_TYPE (obj_desc); /* Check for bad acpi_object_type */ @@ -190,15 +201,11 @@ acpi_ex_resolve_operands ( } switch (obj_desc->reference.opcode) { - case AML_ZERO_OP: - case AML_ONE_OP: - case AML_ONES_OP: case AML_DEBUG_OP: case AML_NAME_OP: case AML_INDEX_OP: case AML_ARG_OP: case AML_LOCAL_OP: - case AML_REVISION_OP: ACPI_DEBUG_ONLY_MEMBERS (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Reference Opcode: %s\n", op_info->name))); @@ -206,7 +213,7 @@ acpi_ex_resolve_operands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Reference Opcode: Unknown [%02x]\n", + "Unknown Reference Opcode %X\n", obj_desc->reference.opcode)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -293,7 +300,7 @@ acpi_ex_resolve_operands ( * -- All others must be resolved below. */ if ((opcode == AML_STORE_OP) && - ((*stack_ptr)->common.type == INTERNAL_TYPE_REFERENCE) && + (ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) && ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) { goto next_operand; } @@ -378,7 +385,7 @@ acpi_ex_resolve_operands ( if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -399,7 +406,7 @@ acpi_ex_resolve_operands ( if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -420,7 +427,7 @@ acpi_ex_resolve_operands ( if (status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -434,7 +441,7 @@ acpi_ex_resolve_operands ( /* Need an operand of type INTEGER, STRING or BUFFER */ - switch ((*stack_ptr)->common.type) { + switch (ACPI_GET_OBJECT_TYPE (*stack_ptr)) { case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: @@ -445,7 +452,7 @@ acpi_ex_resolve_operands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -460,7 +467,7 @@ acpi_ex_resolve_operands ( * The only reference allowed here is a direct reference to * a namespace node. */ - if ((*stack_ptr)->common.type == INTERNAL_TYPE_REFERENCE) { + if (ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) { if (!(*stack_ptr)->reference.node) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Node Reference], found [%p]\n", @@ -492,7 +499,7 @@ acpi_ex_resolve_operands ( /* Need a buffer, string, package */ - switch ((*stack_ptr)->common.type) { + switch (ACPI_GET_OBJECT_TYPE (*stack_ptr)) { case ACPI_TYPE_PACKAGE: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: @@ -503,7 +510,7 @@ acpi_ex_resolve_operands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Buf/Str/Pkg], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -514,7 +521,7 @@ acpi_ex_resolve_operands ( /* Need a buffer or package or (ACPI 2.0) String */ - switch ((*stack_ptr)->common.type) { + switch (ACPI_GET_OBJECT_TYPE (*stack_ptr)) { case ACPI_TYPE_PACKAGE: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: @@ -525,7 +532,7 @@ acpi_ex_resolve_operands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Buf/Str/Pkg], found [%s] %p\n", - acpi_ut_get_type_name ((*stack_ptr)->common.type), *stack_ptr)); + acpi_ut_get_object_type_name (*stack_ptr), *stack_ptr)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -548,7 +555,7 @@ acpi_ex_resolve_operands ( * required object type (Simple cases only). */ status = acpi_ex_check_object_type (type_needed, - (*stack_ptr)->common.type, *stack_ptr); + ACPI_GET_OBJECT_TYPE (*stack_ptr), *stack_ptr); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c index f15d3a625362..83cee00d5dfa 100644 --- a/drivers/acpi/executer/exstore.c +++ b/drivers/acpi/executer/exstore.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support - * $Revision: 164 $ + * $Revision: 167 $ * *****************************************************************************/ @@ -89,18 +89,33 @@ acpi_ex_store ( return_ACPI_STATUS (status); } - /* Destination object must be an object of type Reference */ + /* Destination object must be a Reference or a Constant object */ + + switch (ACPI_GET_OBJECT_TYPE (dest_desc)) { + case INTERNAL_TYPE_REFERENCE: + break; + + case ACPI_TYPE_INTEGER: + + /* Allow stores to Constants -- a Noop as per ACPI spec */ + + if (dest_desc->common.flags & AOPOBJ_AML_CONSTANT) { + return_ACPI_STATUS (AE_OK); + } + + /*lint: -fallthrough */ + + default: - if (dest_desc->common.type != INTERNAL_TYPE_REFERENCE) { /* Destination is not an Reference */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Destination is not a Reference_obj [%p]\n", dest_desc)); + "Destination is not a Reference or Constant object [%p]\n", dest_desc)); ACPI_DUMP_STACK_ENTRY (source_desc); ACPI_DUMP_STACK_ENTRY (dest_desc); ACPI_DUMP_OPERANDS (&dest_desc, ACPI_IMODE_EXECUTE, "Ex_store", - 2, "Target is not a Reference_obj"); + 2, "Target is not a Reference or Constant object"); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -112,7 +127,6 @@ acpi_ex_store ( * 2) Store to an indexed area of a Buffer or Package * 3) Store to a Method Local or Arg * 4) Store to the debug object - * 5) Store to a constant -- a noop */ switch (ref_desc->reference.opcode) { case AML_NAME_OP: @@ -151,9 +165,9 @@ acpi_ex_store ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Write to Debug Object: ****:\n\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); - switch (source_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (source_desc)) { case ACPI_TYPE_INTEGER: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n", @@ -185,7 +199,7 @@ acpi_ex_store ( default: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Type %s %p\n", - acpi_ut_get_type_name (source_desc->common.type), source_desc)); + acpi_ut_get_object_type_name (source_desc), source_desc)); break; } @@ -193,28 +207,15 @@ acpi_ex_store ( break; - case AML_ZERO_OP: - case AML_ONE_OP: - case AML_ONES_OP: - case AML_REVISION_OP: - - /* - * Storing to a constant is a no-op according to the ACPI - * Specification. (Delete the reference descriptor, however.) - */ - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference subtype %02x\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference opcode %X\n", ref_desc->reference.opcode)); ACPI_DUMP_ENTRY (ref_desc, ACPI_LV_ERROR); status = AE_AML_INTERNAL; break; - - } /* switch (Ref_desc->Reference.Opcode) */ + } return_ACPI_STATUS (status); } @@ -303,7 +304,7 @@ acpi_ex_store_object_to_index ( * Make sure the target is a Buffer */ obj_desc = index_desc->reference.object; - if (obj_desc->common.type != ACPI_TYPE_BUFFER) { + if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_BUFFER) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -311,7 +312,7 @@ acpi_ex_store_object_to_index ( * The assignment of the individual elements will be slightly * different for each source type. */ - switch (source_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (source_desc)) { case ACPI_TYPE_INTEGER: /* Use the least-significant byte of the integer */ @@ -335,7 +336,7 @@ acpi_ex_store_object_to_index ( ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Source must be Integer/Buffer/String type, not %s\n", - acpi_ut_get_type_name (source_desc->common.type))); + acpi_ut_get_object_type_name (source_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -403,7 +404,7 @@ acpi_ex_store_object_to_node ( target_desc = acpi_ns_get_attached_object (node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n", - source_desc, acpi_ut_get_type_name (source_desc->common.type), + source_desc, acpi_ut_get_object_type_name (source_desc), node, acpi_ut_get_type_name (target_type))); /* @@ -456,8 +457,8 @@ acpi_ex_store_object_to_node ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Store %s into %s via Convert/Attach\n", - acpi_ut_get_type_name (source_desc->common.type), - acpi_ut_get_type_name (new_desc->common.type))); + acpi_ut_get_object_type_name (source_desc), + acpi_ut_get_object_type_name (new_desc))); } break; @@ -466,11 +467,11 @@ acpi_ex_store_object_to_node ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %s (%p) directly into node (%p), no implicit conversion\n", - acpi_ut_get_type_name (source_desc->common.type), source_desc, node)); + acpi_ut_get_object_type_name (source_desc), source_desc, node)); /* No conversions for all other types. Just attach the source object */ - status = acpi_ns_attach_object (node, source_desc, source_desc->common.type); + status = acpi_ns_attach_object (node, source_desc, ACPI_GET_OBJECT_TYPE (source_desc)); break; } diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c index a50ed360e298..5b2da611287a 100644 --- a/drivers/acpi/executer/exstoren.c +++ b/drivers/acpi/executer/exstoren.c @@ -3,7 +3,7 @@ * * Module Name: exstoren - AML Interpreter object store support, * Store to Node (namespace object) - * $Revision: 48 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -84,7 +84,7 @@ acpi_ex_resolve_object ( * are all essentially the same. This case handles the * "interchangeable" types Integer, String, and Buffer. */ - if (source_desc->common.type == INTERNAL_TYPE_REFERENCE) { + if (ACPI_GET_OBJECT_TYPE (source_desc) == INTERNAL_TYPE_REFERENCE) { /* Resolve a reference object first */ status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state); @@ -96,15 +96,15 @@ acpi_ex_resolve_object ( /* * Must have a Integer, Buffer, or String */ - if ((source_desc->common.type != ACPI_TYPE_INTEGER) && - (source_desc->common.type != ACPI_TYPE_BUFFER) && - (source_desc->common.type != ACPI_TYPE_STRING)) { + if ((ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_INTEGER) && + (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER) && + (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_STRING)) { /* * Conversion successful but still not a valid type */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Cannot assign type %s to %s (must be type Int/Str/Buf)\n", - acpi_ut_get_type_name (source_desc->common.type), + acpi_ut_get_object_type_name (source_desc), acpi_ut_get_type_name (target_type))); status = AE_AML_OPERAND_TYPE; } @@ -195,7 +195,7 @@ acpi_ex_store_object_to_object ( return_ACPI_STATUS (status); } - if (source_desc->common.type != dest_desc->common.type) { + if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_GET_OBJECT_TYPE (dest_desc)) { /* * The source type does not match the type of the destination. * Perform the "implicit conversion" of the source to the current type @@ -205,7 +205,7 @@ acpi_ex_store_object_to_object ( * Otherwise, Actual_src_desc is a temporary object to hold the * converted object. */ - status = acpi_ex_convert_to_target_type (dest_desc->common.type, source_desc, + status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), source_desc, &actual_src_desc, walk_state); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); @@ -216,14 +216,14 @@ acpi_ex_store_object_to_object ( * We now have two objects of identical types, and we can perform a * copy of the *value* of the source object. */ - switch (dest_desc->common.type) { + switch (ACPI_GET_OBJECT_TYPE (dest_desc)) { case ACPI_TYPE_INTEGER: dest_desc->integer.value = actual_src_desc->integer.value; /* Truncate value if we are executing from a 32-bit ACPI table */ - acpi_ex_truncate_for32bit_table (dest_desc, walk_state); + acpi_ex_truncate_for32bit_table (dest_desc); break; case ACPI_TYPE_STRING: @@ -246,7 +246,7 @@ acpi_ex_store_object_to_object ( * All other types come here. */ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into type %s not implemented\n", - acpi_ut_get_type_name (dest_desc->common.type))); + acpi_ut_get_object_type_name (dest_desc))); status = AE_NOT_IMPLEMENTED; break; diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c index 2f937fb9b127..11005af6a7a2 100644 --- a/drivers/acpi/executer/exutils.c +++ b/drivers/acpi/executer/exutils.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities - * $Revision: 98 $ + * $Revision: 100 $ * *****************************************************************************/ @@ -148,8 +148,6 @@ acpi_ex_validate_object_type ( * FUNCTION: Acpi_ex_truncate_for32bit_table * * PARAMETERS: Obj_desc - Object to be truncated - * Walk_state - Current walk state - * (A method must be executing) * * RETURN: none * @@ -160,8 +158,7 @@ acpi_ex_validate_object_type ( void acpi_ex_truncate_for32bit_table ( - acpi_operand_object *obj_desc, - acpi_walk_state *walk_state) + acpi_operand_object *obj_desc) { ACPI_FUNCTION_ENTRY (); @@ -172,8 +169,7 @@ acpi_ex_truncate_for32bit_table ( * a control method */ if ((!obj_desc) || - (obj_desc->common.type != ACPI_TYPE_INTEGER) || - (!walk_state->method_node)) { + (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_INTEGER)) { return; } |
