/* * Arguments for the Objects command * These object types map directly to the ACPI_TYPES
*/ staticstruct acpi_db_argument_info acpi_db_object_types[] = {
{"ANY"},
{"INTEGERS"},
{"STRINGS"},
{"BUFFERS"},
{"PACKAGES"},
{"FIELDS"},
{"DEVICES"},
{"EVENTS"},
{"METHODS"},
{"MUTEXES"},
{"REGIONS"},
{"POWERRESOURCES"},
{"PROCESSORS"},
{"THERMALZONES"},
{"BUFFERFIELDS"},
{"DDBHANDLES"},
{"DEBUG"},
{"REGIONFIELDS"},
{"BANKFIELDS"},
{"INDEXFIELDS"},
{"REFERENCES"},
{"ALIASES"},
{"METHODALIASES"},
{"NOTIFY"},
{"ADDRESSHANDLER"},
{"RESOURCE"},
{"RESOURCEFIELD"},
{"SCOPES"},
{NULL} /* Must be null terminated */
};
/******************************************************************************* * * FUNCTION: acpi_db_set_scope * * PARAMETERS: name - New scope path * * RETURN: Status * * DESCRIPTION: Set the "current scope" as maintained by this utility. * The scope is used as a prefix to ACPI paths. *
******************************************************************************/
acpi_os_printf("Could not attach scope: %s, %s\n",
name, acpi_format_exception(status));
}
/******************************************************************************* * * FUNCTION: acpi_db_dump_namespace * * PARAMETERS: start_arg - Node to begin namespace dump * depth_arg - Maximum tree depth to be dumped * * RETURN: None * * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed * with type and other information. *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_db_dump_namespace_by_owner * * PARAMETERS: owner_arg - Owner ID whose nodes will be displayed * depth_arg - Maximum tree depth to be dumped * * RETURN: None * * DESCRIPTION: Dump elements of the namespace that are owned by the owner_id. *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_db_find_name_in_namespace * * PARAMETERS: name_arg - The 4-character ACPI name to find. * wildcards are supported. * * RETURN: None * * DESCRIPTION: Search the namespace for a given name (with wildcards) *
******************************************************************************/
acpi_os_printf("Found %u predefined names in the namespace\n", count);
}
/******************************************************************************* * * FUNCTION: acpi_db_walk_for_object_counts * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace *
******************************************************************************/
if (node->type > ACPI_TYPE_NS_NODE_MAX) {
acpi_os_printf("[%4.4s]: Unknown object type %X\n",
node->name.ascii, node->type);
} else {
info->types[node->type]++;
}
return (AE_OK);
}
/******************************************************************************* * * FUNCTION: acpi_db_walk_for_fields * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace *
******************************************************************************/
if (!node) { return (AE_OK);
} if (node->object->field.region_obj->region.space_id !=
info->address_space_id) { return (AE_OK);
}
info->count++;
/* Get and display the full pathname to this object */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could Not get pathname for object %p\n",
obj_handle); return (AE_OK);
}
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_evaluate_object(obj_handle, NULL, NULL, &buffer); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could Not evaluate object %p\n",
obj_handle); return (AE_OK);
} /* * Since this is a field unit, surround the output in braces
*/
acpi_os_printf("{");
ret_value = (union acpi_object *)buffer.pointer; switch (ret_value->type) { case ACPI_TYPE_INTEGER:
/******************************************************************************* * * FUNCTION: acpi_db_walk_for_specific_objects * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display short info about objects in the namespace *
******************************************************************************/
/* Get and display the full pathname to this object */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could Not get pathname for object %p\n",
obj_handle); return (AE_OK);
}
/******************************************************************************* * * FUNCTION: acpi_db_display_objects * * PARAMETERS: obj_type_arg - Type of object to display * display_count_arg - Max depth to display * * RETURN: None * * DESCRIPTION: Display objects in the namespace of the requested type *
******************************************************************************/
acpi_os_printf("\nSummary of namespace objects:\n\n");
for (i = 0; i < ACPI_TOTAL_TYPES; i++) {
acpi_os_printf("%8u %s\n", object_info->types[i],
acpi_ut_get_type_name(i));
total_objects += object_info->types[i];
}
acpi_os_printf("\n%8u Total namespace objects\n\n",
total_objects);
ACPI_FREE(object_info); return (AE_OK);
}
/* Get the object type */
type = acpi_db_match_argument(obj_type_arg, acpi_db_object_types); if (type == ACPI_TYPE_NOT_FOUND) {
acpi_os_printf("Invalid or unsupported argument\n"); return (AE_OK);
}
acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT);
acpi_os_printf
("Objects of type [%s] defined in the current ACPI Namespace:\n",
acpi_ut_get_type_name(type));
/******************************************************************************* * * FUNCTION: acpi_db_display_fields * * PARAMETERS: obj_type_arg - Type of object to display * display_count_arg - Max depth to display * * RETURN: None * * DESCRIPTION: Display objects in the namespace of the requested type *
******************************************************************************/
while (alias) { if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
acpi_os_printf
("Invalid Descriptor Type for Node %p [%s] - " "is %2.2X should be %2.2X\n", node,
acpi_ut_get_descriptor_name(node),
ACPI_GET_DESCRIPTOR_TYPE(node),
ACPI_DESC_TYPE_NAMED); return (AE_OK);
}
acpi_os_printf("Verified %u namespace nodes with %u Objects\n",
info.nodes, info.objects);
}
/******************************************************************************* * * FUNCTION: acpi_db_walk_for_references * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Check if this namespace object refers to the target object * that is passed in as the context value. * * Note: Currently doesn't check subobjects within the Node's object *
******************************************************************************/
/* Check for match against the namespace node itself */
if (node == (void *)obj_desc) {
acpi_os_printf("Object is a Node [%4.4s]\n",
acpi_ut_get_node_name(node));
}
/* Check for match against the object attached to the node */
if (acpi_ns_get_attached_object(node) == obj_desc) {
acpi_os_printf("Reference at Node->Object %p [%4.4s]\n",
node, acpi_ut_get_node_name(node));
}
return (AE_OK);
}
/******************************************************************************* * * FUNCTION: acpi_db_find_references * * PARAMETERS: object_arg - String with hex value of the object * * RETURN: None * * DESCRIPTION: Search namespace for all references to the input object *
******************************************************************************/
void acpi_db_find_references(char *object_arg)
{ union acpi_operand_object *obj_desc;
acpi_size address;
/******************************************************************************* * * FUNCTION: acpi_db_bus_walk * * PARAMETERS: Callback from walk_namespace * * RETURN: Status * * DESCRIPTION: Display info about device objects that have a corresponding * _PRT method. *
******************************************************************************/
status = acpi_get_handle(node, METHOD_NAME__PRT,
ACPI_CAST_PTR(acpi_handle, &temp_node)); if (ACPI_FAILURE(status)) { return (AE_OK);
}
/* Get the full path to this device object */
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could Not get pathname for object %p\n",
obj_handle); return (AE_OK);
}
status = acpi_get_object_info(obj_handle, &info); if (ACPI_FAILURE(status)) { return (AE_OK);
}
/* Display the full path */
acpi_os_printf("%-32s Type %X", (char *)buffer.pointer, node->type);
ACPI_FREE(buffer.pointer);
if (info->flags & ACPI_PCI_ROOT_BRIDGE) {
acpi_os_printf(" - Is PCI Root Bridge");
}
acpi_os_printf("\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.