1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /*******************************************************************************
4 * Module Name: dbnames - Debugger commands for the acpi namespace
6 ******************************************************************************/
15 #define _COMPONENT ACPI_CA_DEBUGGER
16 ACPI_MODULE_NAME("dbnames")
18 /* Local prototypes */
20 acpi_db_walk_and_match_name(acpi_handle obj_handle
,
22 void *context
, void **return_value
);
25 acpi_db_walk_for_predefined_names(acpi_handle obj_handle
,
27 void *context
, void **return_value
);
30 acpi_db_walk_for_specific_objects(acpi_handle obj_handle
,
32 void *context
, void **return_value
);
35 acpi_db_walk_for_object_counts(acpi_handle obj_handle
,
37 void *context
, void **return_value
);
40 acpi_db_integrity_walk(acpi_handle obj_handle
,
41 u32 nesting_level
, void *context
, void **return_value
);
44 acpi_db_walk_for_references(acpi_handle obj_handle
,
46 void *context
, void **return_value
);
49 acpi_db_bus_walk(acpi_handle obj_handle
,
50 u32 nesting_level
, void *context
, void **return_value
);
53 * Arguments for the Objects command
54 * These object types map directly to the ACPI_TYPES
56 static struct acpi_db_argument_info acpi_db_object_types
[] = {
85 {NULL
} /* Must be null terminated */
88 /*******************************************************************************
90 * FUNCTION: acpi_db_set_scope
92 * PARAMETERS: name - New scope path
96 * DESCRIPTION: Set the "current scope" as maintained by this utility.
97 * The scope is used as a prefix to ACPI paths.
99 ******************************************************************************/
101 void acpi_db_set_scope(char *name
)
104 struct acpi_namespace_node
*node
;
106 if (!name
|| name
[0] == 0) {
107 acpi_os_printf("Current scope: %s\n", acpi_gbl_db_scope_buf
);
111 acpi_db_prep_namestring(name
);
113 if (ACPI_IS_ROOT_PREFIX(name
[0])) {
115 /* Validate new scope from the root */
117 status
= acpi_ns_get_node(acpi_gbl_root_node
, name
,
118 ACPI_NS_NO_UPSEARCH
, &node
);
119 if (ACPI_FAILURE(status
)) {
123 acpi_gbl_db_scope_buf
[0] = 0;
125 /* Validate new scope relative to old scope */
127 status
= acpi_ns_get_node(acpi_gbl_db_scope_node
, name
,
128 ACPI_NS_NO_UPSEARCH
, &node
);
129 if (ACPI_FAILURE(status
)) {
134 /* Build the final pathname */
136 if (acpi_ut_safe_strcat
137 (acpi_gbl_db_scope_buf
, sizeof(acpi_gbl_db_scope_buf
), name
)) {
138 status
= AE_BUFFER_OVERFLOW
;
142 if (acpi_ut_safe_strcat
143 (acpi_gbl_db_scope_buf
, sizeof(acpi_gbl_db_scope_buf
), "\\")) {
144 status
= AE_BUFFER_OVERFLOW
;
148 acpi_gbl_db_scope_node
= node
;
149 acpi_os_printf("New scope: %s\n", acpi_gbl_db_scope_buf
);
154 acpi_os_printf("Could not attach scope: %s, %s\n",
155 name
, acpi_format_exception(status
));
158 /*******************************************************************************
160 * FUNCTION: acpi_db_dump_namespace
162 * PARAMETERS: start_arg - Node to begin namespace dump
163 * depth_arg - Maximum tree depth to be dumped
167 * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
168 * with type and other information.
170 ******************************************************************************/
172 void acpi_db_dump_namespace(char *start_arg
, char *depth_arg
)
174 acpi_handle subtree_entry
= acpi_gbl_root_node
;
175 u32 max_depth
= ACPI_UINT32_MAX
;
177 /* No argument given, just start at the root and dump entire namespace */
180 subtree_entry
= acpi_db_convert_to_node(start_arg
);
181 if (!subtree_entry
) {
185 /* Now we can check for the depth argument */
188 max_depth
= strtoul(depth_arg
, NULL
, 0);
192 acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT
);
194 if (((struct acpi_namespace_node
*)subtree_entry
)->parent
) {
195 acpi_os_printf("ACPI Namespace (from %4.4s (%p) subtree):\n",
196 ((struct acpi_namespace_node
*)subtree_entry
)->
197 name
.ascii
, subtree_entry
);
199 acpi_os_printf("ACPI Namespace (from %s):\n",
200 ACPI_NAMESPACE_ROOT
);
203 /* Display the subtree */
205 acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT
);
206 acpi_ns_dump_objects(ACPI_TYPE_ANY
, ACPI_DISPLAY_SUMMARY
, max_depth
,
207 ACPI_OWNER_ID_MAX
, subtree_entry
);
208 acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT
);
211 /*******************************************************************************
213 * FUNCTION: acpi_db_dump_namespace_paths
219 * DESCRIPTION: Dump entire namespace with full object pathnames and object
220 * type information. Alternative to "namespace" command.
222 ******************************************************************************/
224 void acpi_db_dump_namespace_paths(void)
227 acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT
);
228 acpi_os_printf("ACPI Namespace (from root):\n");
230 /* Display the entire namespace */
232 acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT
);
233 acpi_ns_dump_object_paths(ACPI_TYPE_ANY
, ACPI_DISPLAY_SUMMARY
,
234 ACPI_UINT32_MAX
, ACPI_OWNER_ID_MAX
,
237 acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT
);
240 /*******************************************************************************
242 * FUNCTION: acpi_db_dump_namespace_by_owner
244 * PARAMETERS: owner_arg - Owner ID whose nodes will be displayed
245 * depth_arg - Maximum tree depth to be dumped
249 * DESCRIPTION: Dump elements of the namespace that are owned by the owner_id.
251 ******************************************************************************/
253 void acpi_db_dump_namespace_by_owner(char *owner_arg
, char *depth_arg
)
255 acpi_handle subtree_entry
= acpi_gbl_root_node
;
256 u32 max_depth
= ACPI_UINT32_MAX
;
257 acpi_owner_id owner_id
;
259 owner_id
= (acpi_owner_id
)strtoul(owner_arg
, NULL
, 0);
261 /* Now we can check for the depth argument */
264 max_depth
= strtoul(depth_arg
, NULL
, 0);
267 acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT
);
268 acpi_os_printf("ACPI Namespace by owner %X:\n", owner_id
);
270 /* Display the subtree */
272 acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT
);
273 acpi_ns_dump_objects(ACPI_TYPE_ANY
, ACPI_DISPLAY_SUMMARY
, max_depth
,
274 owner_id
, subtree_entry
);
275 acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT
);
278 /*******************************************************************************
280 * FUNCTION: acpi_db_walk_and_match_name
282 * PARAMETERS: Callback from walk_namespace
286 * DESCRIPTION: Find a particular name/names within the namespace. Wildcards
287 * are supported -- '?' matches any character.
289 ******************************************************************************/
292 acpi_db_walk_and_match_name(acpi_handle obj_handle
,
294 void *context
, void **return_value
)
297 char *requested_name
= (char *)context
;
299 struct acpi_buffer buffer
;
300 struct acpi_walk_info info
;
302 /* Check for a name match */
304 for (i
= 0; i
< 4; i
++) {
306 /* Wildcard support */
308 if ((requested_name
[i
] != '?') &&
309 (requested_name
[i
] != ((struct acpi_namespace_node
*)
310 obj_handle
)->name
.ascii
[i
])) {
312 /* No match, just exit */
318 /* Get the full pathname to this object */
320 buffer
.length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
321 status
= acpi_ns_handle_to_pathname(obj_handle
, &buffer
, TRUE
);
322 if (ACPI_FAILURE(status
)) {
323 acpi_os_printf("Could Not get pathname for object %p\n",
327 info
.owner_id
= ACPI_OWNER_ID_MAX
;
328 info
.debug_level
= ACPI_UINT32_MAX
;
329 info
.display_type
= ACPI_DISPLAY_SUMMARY
| ACPI_DISPLAY_SHORT
;
331 acpi_os_printf("%32s", (char *)buffer
.pointer
);
332 (void)acpi_ns_dump_one_object(obj_handle
, nesting_level
, &info
,
334 ACPI_FREE(buffer
.pointer
);
340 /*******************************************************************************
342 * FUNCTION: acpi_db_find_name_in_namespace
344 * PARAMETERS: name_arg - The 4-character ACPI name to find.
345 * wildcards are supported.
349 * DESCRIPTION: Search the namespace for a given name (with wildcards)
351 ******************************************************************************/
353 acpi_status
acpi_db_find_name_in_namespace(char *name_arg
)
355 char acpi_name
[5] = "____";
356 char *acpi_name_ptr
= acpi_name
;
358 if (strlen(name_arg
) > ACPI_NAMESEG_SIZE
) {
359 acpi_os_printf("Name must be no longer than 4 characters\n");
363 /* Pad out name with underscores as necessary to create a 4-char name */
365 acpi_ut_strupr(name_arg
);
367 *acpi_name_ptr
= *name_arg
;
372 /* Walk the namespace from the root */
374 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
375 ACPI_UINT32_MAX
, acpi_db_walk_and_match_name
,
376 NULL
, acpi_name
, NULL
);
378 acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT
);
382 /*******************************************************************************
384 * FUNCTION: acpi_db_walk_for_predefined_names
386 * PARAMETERS: Callback from walk_namespace
390 * DESCRIPTION: Detect and display predefined ACPI names (names that start with
393 ******************************************************************************/
396 acpi_db_walk_for_predefined_names(acpi_handle obj_handle
,
398 void *context
, void **return_value
)
400 struct acpi_namespace_node
*node
=
401 (struct acpi_namespace_node
*)obj_handle
;
402 u32
*count
= (u32
*)context
;
403 const union acpi_predefined_info
*predefined
;
404 const union acpi_predefined_info
*package
= NULL
;
406 char string_buffer
[48];
408 predefined
= acpi_ut_match_predefined_method(node
->name
.ascii
);
413 pathname
= acpi_ns_get_normalized_pathname(node
, TRUE
);
418 /* If method returns a package, the info is in the next table entry */
420 if (predefined
->info
.expected_btypes
& ACPI_RTYPE_PACKAGE
) {
421 package
= predefined
+ 1;
424 acpi_ut_get_expected_return_types(string_buffer
,
425 predefined
->info
.expected_btypes
);
427 acpi_os_printf("%-32s Arguments %X, Return Types: %s", pathname
,
428 METHOD_GET_ARG_COUNT(predefined
->info
.argument_list
),
432 acpi_os_printf(" (PkgType %2.2X, ObjType %2.2X, Count %2.2X)",
433 package
->ret_info
.type
,
434 package
->ret_info
.object_type1
,
435 package
->ret_info
.count1
);
438 acpi_os_printf("\n");
440 /* Check that the declared argument count matches the ACPI spec */
442 acpi_ns_check_acpi_compliance(pathname
, node
, predefined
);
449 /*******************************************************************************
451 * FUNCTION: acpi_db_check_predefined_names
457 * DESCRIPTION: Validate all predefined names in the namespace
459 ******************************************************************************/
461 void acpi_db_check_predefined_names(void)
465 /* Search all nodes in namespace */
467 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
469 acpi_db_walk_for_predefined_names
, NULL
,
470 (void *)&count
, NULL
);
472 acpi_os_printf("Found %u predefined names in the namespace\n", count
);
475 /*******************************************************************************
477 * FUNCTION: acpi_db_walk_for_object_counts
479 * PARAMETERS: Callback from walk_namespace
483 * DESCRIPTION: Display short info about objects in the namespace
485 ******************************************************************************/
488 acpi_db_walk_for_object_counts(acpi_handle obj_handle
,
490 void *context
, void **return_value
)
492 struct acpi_object_info
*info
= (struct acpi_object_info
*)context
;
493 struct acpi_namespace_node
*node
=
494 (struct acpi_namespace_node
*)obj_handle
;
496 if (node
->type
> ACPI_TYPE_NS_NODE_MAX
) {
497 acpi_os_printf("[%4.4s]: Unknown object type %X\n",
498 node
->name
.ascii
, node
->type
);
500 info
->types
[node
->type
]++;
506 /*******************************************************************************
508 * FUNCTION: acpi_db_walk_for_fields
510 * PARAMETERS: Callback from walk_namespace
514 * DESCRIPTION: Display short info about objects in the namespace
516 ******************************************************************************/
519 acpi_db_walk_for_fields(acpi_handle obj_handle
,
520 u32 nesting_level
, void *context
, void **return_value
)
522 union acpi_object
*ret_value
;
523 struct acpi_region_walk_info
*info
=
524 (struct acpi_region_walk_info
*)context
;
525 struct acpi_buffer buffer
;
527 struct acpi_namespace_node
*node
= acpi_ns_validate_handle(obj_handle
);
532 if (node
->object
->field
.region_obj
->region
.space_id
!=
533 info
->address_space_id
) {
539 /* Get and display the full pathname to this object */
541 buffer
.length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
542 status
= acpi_ns_handle_to_pathname(obj_handle
, &buffer
, TRUE
);
543 if (ACPI_FAILURE(status
)) {
544 acpi_os_printf("Could Not get pathname for object %p\n",
549 acpi_os_printf("%s ", (char *)buffer
.pointer
);
550 ACPI_FREE(buffer
.pointer
);
552 buffer
.length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
553 acpi_evaluate_object(obj_handle
, NULL
, NULL
, &buffer
);
556 * Since this is a field unit, surround the output in braces
560 ret_value
= (union acpi_object
*)buffer
.pointer
;
561 switch (ret_value
->type
) {
562 case ACPI_TYPE_INTEGER
:
564 acpi_os_printf("%8.8X%8.8X",
565 ACPI_FORMAT_UINT64(ret_value
->integer
.value
));
568 case ACPI_TYPE_BUFFER
:
570 acpi_ut_dump_buffer(ret_value
->buffer
.pointer
,
571 ret_value
->buffer
.length
,
572 DB_DISPLAY_DATA_ONLY
| DB_BYTE_DISPLAY
, 0);
579 acpi_os_printf("}\n");
581 ACPI_FREE(buffer
.pointer
);
586 /*******************************************************************************
588 * FUNCTION: acpi_db_walk_for_specific_objects
590 * PARAMETERS: Callback from walk_namespace
594 * DESCRIPTION: Display short info about objects in the namespace
596 ******************************************************************************/
599 acpi_db_walk_for_specific_objects(acpi_handle obj_handle
,
601 void *context
, void **return_value
)
603 struct acpi_walk_info
*info
= (struct acpi_walk_info
*)context
;
604 struct acpi_buffer buffer
;
609 /* Get and display the full pathname to this object */
611 buffer
.length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
612 status
= acpi_ns_handle_to_pathname(obj_handle
, &buffer
, TRUE
);
613 if (ACPI_FAILURE(status
)) {
614 acpi_os_printf("Could Not get pathname for object %p\n",
619 acpi_os_printf("%32s", (char *)buffer
.pointer
);
620 ACPI_FREE(buffer
.pointer
);
622 /* Dump short info about the object */
624 (void)acpi_ns_dump_one_object(obj_handle
, nesting_level
, info
, NULL
);
628 /*******************************************************************************
630 * FUNCTION: acpi_db_display_objects
632 * PARAMETERS: obj_type_arg - Type of object to display
633 * display_count_arg - Max depth to display
637 * DESCRIPTION: Display objects in the namespace of the requested type
639 ******************************************************************************/
641 acpi_status
acpi_db_display_objects(char *obj_type_arg
, char *display_count_arg
)
643 struct acpi_walk_info info
;
644 acpi_object_type type
;
645 struct acpi_object_info
*object_info
;
647 u32 total_objects
= 0;
649 /* No argument means display summary/count of all object types */
653 ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_object_info
));
655 /* Walk the namespace from the root */
657 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
659 acpi_db_walk_for_object_counts
, NULL
,
660 (void *)object_info
, NULL
);
662 acpi_os_printf("\nSummary of namespace objects:\n\n");
664 for (i
= 0; i
< ACPI_TOTAL_TYPES
; i
++) {
665 acpi_os_printf("%8u %s\n", object_info
->types
[i
],
666 acpi_ut_get_type_name(i
));
668 total_objects
+= object_info
->types
[i
];
671 acpi_os_printf("\n%8u Total namespace objects\n\n",
674 ACPI_FREE(object_info
);
678 /* Get the object type */
680 type
= acpi_db_match_argument(obj_type_arg
, acpi_db_object_types
);
681 if (type
== ACPI_TYPE_NOT_FOUND
) {
682 acpi_os_printf("Invalid or unsupported argument\n");
686 acpi_db_set_output_destination(ACPI_DB_DUPLICATE_OUTPUT
);
688 ("Objects of type [%s] defined in the current ACPI Namespace:\n",
689 acpi_ut_get_type_name(type
));
691 acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT
);
694 info
.owner_id
= ACPI_OWNER_ID_MAX
;
695 info
.debug_level
= ACPI_UINT32_MAX
;
696 info
.display_type
= ACPI_DISPLAY_SUMMARY
| ACPI_DISPLAY_SHORT
;
698 /* Walk the namespace from the root */
700 (void)acpi_walk_namespace(type
, ACPI_ROOT_OBJECT
, ACPI_UINT32_MAX
,
701 acpi_db_walk_for_specific_objects
, NULL
,
702 (void *)&info
, NULL
);
705 ("\nFound %u objects of type [%s] in the current ACPI Namespace\n",
706 info
.count
, acpi_ut_get_type_name(type
));
708 acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT
);
712 /*******************************************************************************
714 * FUNCTION: acpi_db_display_fields
716 * PARAMETERS: obj_type_arg - Type of object to display
717 * display_count_arg - Max depth to display
721 * DESCRIPTION: Display objects in the namespace of the requested type
723 ******************************************************************************/
725 acpi_status
acpi_db_display_fields(u32 address_space_id
)
727 struct acpi_region_walk_info info
;
730 info
.owner_id
= ACPI_OWNER_ID_MAX
;
731 info
.debug_level
= ACPI_UINT32_MAX
;
732 info
.display_type
= ACPI_DISPLAY_SUMMARY
| ACPI_DISPLAY_SHORT
;
733 info
.address_space_id
= address_space_id
;
735 /* Walk the namespace from the root */
737 (void)acpi_walk_namespace(ACPI_TYPE_LOCAL_REGION_FIELD
,
738 ACPI_ROOT_OBJECT
, ACPI_UINT32_MAX
,
739 acpi_db_walk_for_fields
, NULL
, (void *)&info
,
745 /*******************************************************************************
747 * FUNCTION: acpi_db_integrity_walk
749 * PARAMETERS: Callback from walk_namespace
753 * DESCRIPTION: Examine one NS node for valid values.
755 ******************************************************************************/
758 acpi_db_integrity_walk(acpi_handle obj_handle
,
759 u32 nesting_level
, void *context
, void **return_value
)
761 struct acpi_integrity_info
*info
=
762 (struct acpi_integrity_info
*)context
;
763 struct acpi_namespace_node
*node
=
764 (struct acpi_namespace_node
*)obj_handle
;
765 union acpi_operand_object
*object
;
770 /* Verify the NS node, and dereference aliases */
773 if (ACPI_GET_DESCRIPTOR_TYPE(node
) != ACPI_DESC_TYPE_NAMED
) {
775 ("Invalid Descriptor Type for Node %p [%s] - "
776 "is %2.2X should be %2.2X\n", node
,
777 acpi_ut_get_descriptor_name(node
),
778 ACPI_GET_DESCRIPTOR_TYPE(node
),
779 ACPI_DESC_TYPE_NAMED
);
783 if ((node
->type
== ACPI_TYPE_LOCAL_ALIAS
) ||
784 (node
->type
== ACPI_TYPE_LOCAL_METHOD_ALIAS
)) {
785 node
= (struct acpi_namespace_node
*)node
->object
;
791 if (node
->type
> ACPI_TYPE_LOCAL_MAX
) {
792 acpi_os_printf("Invalid Object Type for Node %p, Type = %X\n",
797 if (!acpi_ut_valid_nameseg(node
->name
.ascii
)) {
798 acpi_os_printf("Invalid AcpiName for Node %p\n", node
);
802 object
= acpi_ns_get_attached_object(node
);
805 if (ACPI_GET_DESCRIPTOR_TYPE(object
) != ACPI_DESC_TYPE_OPERAND
) {
807 ("Invalid Descriptor Type for Object %p [%s]\n",
808 object
, acpi_ut_get_descriptor_name(object
));
815 /*******************************************************************************
817 * FUNCTION: acpi_db_check_integrity
823 * DESCRIPTION: Check entire namespace for data structure integrity
825 ******************************************************************************/
827 void acpi_db_check_integrity(void)
829 struct acpi_integrity_info info
= { 0, 0 };
831 /* Search all nodes in namespace */
833 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
834 ACPI_UINT32_MAX
, acpi_db_integrity_walk
, NULL
,
835 (void *)&info
, NULL
);
837 acpi_os_printf("Verified %u namespace nodes with %u Objects\n",
838 info
.nodes
, info
.objects
);
841 /*******************************************************************************
843 * FUNCTION: acpi_db_walk_for_references
845 * PARAMETERS: Callback from walk_namespace
849 * DESCRIPTION: Check if this namespace object refers to the target object
850 * that is passed in as the context value.
852 * Note: Currently doesn't check subobjects within the Node's object
854 ******************************************************************************/
857 acpi_db_walk_for_references(acpi_handle obj_handle
,
859 void *context
, void **return_value
)
861 union acpi_operand_object
*obj_desc
=
862 (union acpi_operand_object
*)context
;
863 struct acpi_namespace_node
*node
=
864 (struct acpi_namespace_node
*)obj_handle
;
866 /* Check for match against the namespace node itself */
868 if (node
== (void *)obj_desc
) {
869 acpi_os_printf("Object is a Node [%4.4s]\n",
870 acpi_ut_get_node_name(node
));
873 /* Check for match against the object attached to the node */
875 if (acpi_ns_get_attached_object(node
) == obj_desc
) {
876 acpi_os_printf("Reference at Node->Object %p [%4.4s]\n",
877 node
, acpi_ut_get_node_name(node
));
883 /*******************************************************************************
885 * FUNCTION: acpi_db_find_references
887 * PARAMETERS: object_arg - String with hex value of the object
891 * DESCRIPTION: Search namespace for all references to the input object
893 ******************************************************************************/
895 void acpi_db_find_references(char *object_arg
)
897 union acpi_operand_object
*obj_desc
;
900 /* Convert string to object pointer */
902 address
= strtoul(object_arg
, NULL
, 16);
903 obj_desc
= ACPI_TO_POINTER(address
);
905 /* Search all nodes in namespace */
907 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
908 ACPI_UINT32_MAX
, acpi_db_walk_for_references
,
909 NULL
, (void *)obj_desc
, NULL
);
912 /*******************************************************************************
914 * FUNCTION: acpi_db_bus_walk
916 * PARAMETERS: Callback from walk_namespace
920 * DESCRIPTION: Display info about device objects that have a corresponding
923 ******************************************************************************/
926 acpi_db_bus_walk(acpi_handle obj_handle
,
927 u32 nesting_level
, void *context
, void **return_value
)
929 struct acpi_namespace_node
*node
=
930 (struct acpi_namespace_node
*)obj_handle
;
932 struct acpi_buffer buffer
;
933 struct acpi_namespace_node
*temp_node
;
934 struct acpi_device_info
*info
;
937 if ((node
->type
!= ACPI_TYPE_DEVICE
) &&
938 (node
->type
!= ACPI_TYPE_PROCESSOR
)) {
942 /* Exit if there is no _PRT under this device */
944 status
= acpi_get_handle(node
, METHOD_NAME__PRT
,
945 ACPI_CAST_PTR(acpi_handle
, &temp_node
));
946 if (ACPI_FAILURE(status
)) {
950 /* Get the full path to this device object */
952 buffer
.length
= ACPI_ALLOCATE_LOCAL_BUFFER
;
953 status
= acpi_ns_handle_to_pathname(obj_handle
, &buffer
, TRUE
);
954 if (ACPI_FAILURE(status
)) {
955 acpi_os_printf("Could Not get pathname for object %p\n",
960 status
= acpi_get_object_info(obj_handle
, &info
);
961 if (ACPI_FAILURE(status
)) {
965 /* Display the full path */
967 acpi_os_printf("%-32s Type %X", (char *)buffer
.pointer
, node
->type
);
968 ACPI_FREE(buffer
.pointer
);
970 if (info
->flags
& ACPI_PCI_ROOT_BRIDGE
) {
971 acpi_os_printf(" - Is PCI Root Bridge");
973 acpi_os_printf("\n");
977 acpi_os_printf("_PRT: %p\n", temp_node
);
979 /* Dump _ADR, _HID, _UID, _CID */
981 if (info
->valid
& ACPI_VALID_ADR
) {
982 acpi_os_printf("_ADR: %8.8X%8.8X\n",
983 ACPI_FORMAT_UINT64(info
->address
));
985 acpi_os_printf("_ADR: <Not Present>\n");
988 if (info
->valid
& ACPI_VALID_HID
) {
989 acpi_os_printf("_HID: %s\n", info
->hardware_id
.string
);
991 acpi_os_printf("_HID: <Not Present>\n");
994 if (info
->valid
& ACPI_VALID_UID
) {
995 acpi_os_printf("_UID: %s\n", info
->unique_id
.string
);
997 acpi_os_printf("_UID: <Not Present>\n");
1000 if (info
->valid
& ACPI_VALID_CID
) {
1001 for (i
= 0; i
< info
->compatible_id_list
.count
; i
++) {
1002 acpi_os_printf("_CID: %s\n",
1003 info
->compatible_id_list
.ids
[i
].string
);
1006 acpi_os_printf("_CID: <Not Present>\n");
1013 /*******************************************************************************
1015 * FUNCTION: acpi_db_get_bus_info
1021 * DESCRIPTION: Display info about system buses.
1023 ******************************************************************************/
1025 void acpi_db_get_bus_info(void)
1027 /* Search all nodes in namespace */
1029 (void)acpi_walk_namespace(ACPI_TYPE_ANY
, ACPI_ROOT_OBJECT
,
1030 ACPI_UINT32_MAX
, acpi_db_bus_walk
, NULL
, NULL
,