void acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags) { 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; } } if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) { acpi_ex_dump_namespace_node((struct acpi_namespace_node *) obj_desc, flags); acpi_os_printf("\nAttached Object (%p):\n", ((struct acpi_namespace_node *)obj_desc)-> object); acpi_ex_dump_object_descriptor(((struct acpi_namespace_node *) obj_desc)->object, flags); return_VOID; } if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) { acpi_os_printf ("ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n", obj_desc, acpi_ut_get_descriptor_name(obj_desc)); return_VOID; } if (obj_desc->common.type > ACPI_TYPE_NS_NODE_MAX) { return_VOID; } /* Common Fields */ acpi_ex_dump_object(obj_desc, acpi_ex_dump_common); /* Object-specific fields */ acpi_ex_dump_object(obj_desc, acpi_ex_dump_info[obj_desc->common.type]); return_VOID; }
void acpi_db_decode_and_display_object(char *target, char *output_type) { void *obj_ptr; struct acpi_namespace_node *node; union acpi_operand_object *obj_desc; u32 display = DB_BYTE_DISPLAY; char buffer[80]; struct acpi_buffer ret_buf; acpi_status status; u32 size; if (!target) { return; } /* Decode the output type */ if (output_type) { acpi_ut_strupr(output_type); if (output_type[0] == 'W') { display = DB_WORD_DISPLAY; } else if (output_type[0] == 'D') { display = DB_DWORD_DISPLAY; } else if (output_type[0] == 'Q') { display = DB_QWORD_DISPLAY; } } ret_buf.length = sizeof(buffer); ret_buf.pointer = buffer; /* Differentiate between a number and a name */ if ((target[0] >= 0x30) && (target[0] <= 0x39)) { obj_ptr = acpi_db_get_pointer(target); if (!acpi_os_readable(obj_ptr, 16)) { acpi_os_printf ("Address %p is invalid in this address space\n", obj_ptr); return; } /* Decode the object type */ switch (ACPI_GET_DESCRIPTOR_TYPE(obj_ptr)) { case ACPI_DESC_TYPE_NAMED: /* This is a namespace Node */ if (!acpi_os_readable (obj_ptr, sizeof(struct acpi_namespace_node))) { acpi_os_printf ("Cannot read entire Named object at address %p\n", obj_ptr); return; } node = obj_ptr; goto dump_node; case ACPI_DESC_TYPE_OPERAND: /* This is a ACPI OPERAND OBJECT */ if (!acpi_os_readable (obj_ptr, sizeof(union acpi_operand_object))) { acpi_os_printf ("Cannot read entire ACPI object at address %p\n", obj_ptr); return; } acpi_ut_debug_dump_buffer(obj_ptr, sizeof(union acpi_operand_object), display, ACPI_UINT32_MAX); acpi_ex_dump_object_descriptor(obj_ptr, 1); break; case ACPI_DESC_TYPE_PARSER: /* This is a Parser Op object */ if (!acpi_os_readable (obj_ptr, sizeof(union acpi_parse_object))) { acpi_os_printf ("Cannot read entire Parser object at address %p\n", obj_ptr); return; } acpi_ut_debug_dump_buffer(obj_ptr, sizeof(union acpi_parse_object), display, ACPI_UINT32_MAX); acpi_db_dump_parser_descriptor((union acpi_parse_object *)obj_ptr); break; default: /* Is not a recognizeable object */ acpi_os_printf ("Not a known ACPI internal object, descriptor type %2.2X\n", ACPI_GET_DESCRIPTOR_TYPE(obj_ptr)); size = 16; if (acpi_os_readable(obj_ptr, 64)) { size = 64; } /* Just dump some memory */ acpi_ut_debug_dump_buffer(obj_ptr, size, display, ACPI_UINT32_MAX); break; } return; } /* The parameter is a name string that must be resolved to a Named obj */ node = acpi_db_local_ns_lookup(target); if (!node) { return; } dump_node: /* Now dump the NS node */ status = acpi_get_name(node, ACPI_FULL_PATHNAME_NO_TRAILING, &ret_buf); if (ACPI_FAILURE(status)) { acpi_os_printf("Could not convert name to pathname\n"); } else { acpi_os_printf("Object (%p) Pathname: %s\n", node, (char *)ret_buf.pointer); } if (!acpi_os_readable(node, sizeof(struct acpi_namespace_node))) { acpi_os_printf("Invalid Named object at address %p\n", node); return; } acpi_ut_debug_dump_buffer((void *)node, sizeof(struct acpi_namespace_node), display, ACPI_UINT32_MAX); acpi_ex_dump_namespace_node(node, 1); obj_desc = acpi_ns_get_attached_object(node); if (obj_desc) { acpi_os_printf("\nAttached Object (%p):\n", obj_desc); if (!acpi_os_readable (obj_desc, sizeof(union acpi_operand_object))) { acpi_os_printf ("Invalid internal ACPI Object at address %p\n", obj_desc); return; } acpi_ut_debug_dump_buffer((void *)obj_desc, sizeof(union acpi_operand_object), display, ACPI_UINT32_MAX); acpi_ex_dump_object_descriptor(obj_desc, 1); } }