From 44f6c01242da4e162f28d8e1216a8c7a91174605 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Mon, 18 Apr 2005 22:49:35 -0400 Subject: ACPICA 20050408 from Bob Moore Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown --- drivers/acpi/executer/exdump.c | 105 ++++++++++++++++++++++++++++------------- 1 file changed, 73 insertions(+), 32 deletions(-) (limited to 'drivers/acpi/executer/exdump.c') diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c index e2f7c32f28d..40850064811 100644 --- a/drivers/acpi/executer/exdump.c +++ b/drivers/acpi/executer/exdump.c @@ -51,23 +51,48 @@ #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exdump") +/* Local prototypes */ + +#ifdef ACPI_FUTURE_USAGE +static void +acpi_ex_out_string ( + char *title, + char *value); + +static void +acpi_ex_out_pointer ( + char *title, + void *value); + +static void +acpi_ex_out_integer ( + char *title, + u32 value); + +static void +acpi_ex_out_address ( + char *title, + acpi_physical_address value); +#endif /* ACPI_FUTURE_USAGE */ + /* * The following routines are used for debug output only */ #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -/***************************************************************************** +/******************************************************************************* * * FUNCTION: acpi_ex_dump_operand * - * PARAMETERS: *obj_desc - Pointer to entry to be dumped + * PARAMETERS: *obj_desc - Pointer to entry to be dumped + * Depth - Current nesting depth * * RETURN: None * * DESCRIPTION: Dump an operand object * - ****************************************************************************/ + ******************************************************************************/ void acpi_ex_dump_operand ( @@ -86,9 +111,8 @@ acpi_ex_dump_operand ( } if (!obj_desc) { - /* - * This could be a null element of a package - */ + /* This could be a null element of a package */ + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); return; } @@ -117,6 +141,8 @@ acpi_ex_dump_operand ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); } + /* Decode object type */ + switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { case ACPI_TYPE_LOCAL_REFERENCE: @@ -274,7 +300,9 @@ acpi_ex_dump_operand ( case ACPI_TYPE_STRING: acpi_os_printf ("String length %X @ %p ", - obj_desc->string.length, obj_desc->string.pointer); + obj_desc->string.length, + obj_desc->string.pointer); + acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX); acpi_os_printf ("\n"); break; @@ -290,10 +318,13 @@ acpi_ex_dump_operand ( acpi_os_printf ( "region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", - obj_desc->field.bit_length, obj_desc->field.access_byte_width, + obj_desc->field.bit_length, + obj_desc->field.access_byte_width, obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, - obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset); + obj_desc->field.base_byte_offset, + obj_desc->field.start_field_bit_offset); + acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1); break; @@ -308,13 +339,15 @@ acpi_ex_dump_operand ( acpi_os_printf ( "buffer_field: %X bits at byte %X bit %X of \n", - obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset, + obj_desc->buffer_field.bit_length, + obj_desc->buffer_field.base_byte_offset, obj_desc->buffer_field.start_field_bit_offset); if (!obj_desc->buffer_field.buffer_obj) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); } - else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) { + else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != + ACPI_TYPE_BUFFER) { acpi_os_printf ("*not a Buffer* \n"); } else { @@ -331,10 +364,10 @@ acpi_ex_dump_operand ( case ACPI_TYPE_METHOD: - acpi_os_printf ( - "Method(%X) @ %p:%X\n", + acpi_os_printf ("Method(%X) @ %p:%X\n", obj_desc->method.param_count, - obj_desc->method.aml_start, obj_desc->method.aml_length); + obj_desc->method.aml_start, + obj_desc->method.aml_length); break; @@ -379,7 +412,7 @@ acpi_ex_dump_operand ( } -/***************************************************************************** +/******************************************************************************* * * FUNCTION: acpi_ex_dump_operands * @@ -393,7 +426,7 @@ acpi_ex_dump_operand ( * * DESCRIPTION: Dump the object stack * - ****************************************************************************/ + ******************************************************************************/ void acpi_ex_dump_operands ( @@ -441,10 +474,9 @@ acpi_ex_dump_operands ( #ifdef ACPI_FUTURE_USAGE - -/***************************************************************************** +/******************************************************************************* * - * FUNCTION: acpi_ex_out* + * FUNCTION: acpi_ex_out* functions * * PARAMETERS: Title - Descriptive text * Value - Value to be displayed @@ -453,9 +485,9 @@ acpi_ex_dump_operands ( * reduce the number of format strings required and keeps them * all in one place for easy modification. * - ****************************************************************************/ + ******************************************************************************/ -void +static void acpi_ex_out_string ( char *title, char *value) @@ -463,7 +495,7 @@ acpi_ex_out_string ( acpi_os_printf ("%20s : %s\n", title, value); } -void +static void acpi_ex_out_pointer ( char *title, void *value) @@ -471,7 +503,7 @@ acpi_ex_out_pointer ( acpi_os_printf ("%20s : %p\n", title, value); } -void +static void acpi_ex_out_integer ( char *title, u32 value) @@ -479,7 +511,7 @@ acpi_ex_out_integer ( acpi_os_printf ("%20s : %X\n", title, value); } -void +static void acpi_ex_out_address ( char *title, acpi_physical_address value) @@ -493,16 +525,16 @@ acpi_ex_out_address ( } -/***************************************************************************** +/******************************************************************************* * * FUNCTION: acpi_ex_dump_node * * PARAMETERS: *Node - Descriptor to dump - * Flags - Force display + * Flags - Force display if TRUE * * DESCRIPTION: Dumps the members of the given.Node * - ****************************************************************************/ + ******************************************************************************/ void acpi_ex_dump_node ( @@ -531,16 +563,16 @@ acpi_ex_dump_node ( } -/***************************************************************************** +/******************************************************************************* * * FUNCTION: acpi_ex_dump_object_descriptor * * PARAMETERS: *Object - Descriptor to dump - * Flags - Force display + * Flags - Force display if TRUE * * DESCRIPTION: Dumps the members of the object descriptor given. * - ****************************************************************************/ + ******************************************************************************/ void acpi_ex_dump_object_descriptor ( @@ -553,6 +585,10 @@ acpi_ex_dump_object_descriptor ( ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor"); + if (!obj_desc) { + return_VOID; + } + if (!flags) { if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) { return_VOID; @@ -747,11 +783,17 @@ acpi_ex_dump_object_descriptor ( case ACPI_TYPE_LOCAL_REFERENCE: acpi_ex_out_integer ("target_type", obj_desc->reference.target_type); - acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name); + acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info ( + obj_desc->reference.opcode))->name); acpi_ex_out_integer ("Offset", obj_desc->reference.offset); acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object); acpi_ex_out_pointer ("Node", obj_desc->reference.node); acpi_ex_out_pointer ("Where", obj_desc->reference.where); + + if (obj_desc->reference.object) { + acpi_os_printf ("\nReferenced Object:\n"); + acpi_ex_dump_object_descriptor (obj_desc->reference.object, flags); + } break; @@ -788,6 +830,5 @@ acpi_ex_dump_object_descriptor ( } #endif /* ACPI_FUTURE_USAGE */ - #endif -- cgit v1.2.3