1 /*******************************************************************************
3 * Module Name: dbdisply - debug display commands
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2015, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #include <acpi/acpi.h>
53 #define _COMPONENT ACPI_CA_DEBUGGER
54 ACPI_MODULE_NAME("dbdisply")
56 /* Local prototypes */
57 static void acpi_db_dump_parser_descriptor(union acpi_parse_object
*op
);
59 static void *acpi_db_get_pointer(void *target
);
62 acpi_db_display_non_root_handlers(acpi_handle obj_handle
,
64 void *context
, void **return_value
);
67 * System handler information.
68 * Used for Handlers command, in acpi_db_display_handlers.
70 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
71 #define ACPI_HANDLER_NAME_STRING "%30s : "
72 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
73 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
74 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
76 /* All predefined Address Space IDs */
78 static acpi_adr_space_type acpi_gbl_space_id_list
[] = {
79 ACPI_ADR_SPACE_SYSTEM_MEMORY
,
80 ACPI_ADR_SPACE_SYSTEM_IO
,
81 ACPI_ADR_SPACE_PCI_CONFIG
,
85 ACPI_ADR_SPACE_PCI_BAR_TARGET
,
89 ACPI_ADR_SPACE_DATA_TABLE
,
90 ACPI_ADR_SPACE_FIXED_HARDWARE
93 /* Global handler information */
95 typedef struct acpi_handler_info
{
101 static struct acpi_handler_info acpi_gbl_handler_list
[] = {
102 {&acpi_gbl_global_notify
[0].handler
, "System Notifications"},
103 {&acpi_gbl_global_notify
[1].handler
, "Device Notifications"},
104 {&acpi_gbl_table_handler
, "ACPI Table Events"},
105 {&acpi_gbl_exception_handler
, "Control Method Exceptions"},
106 {&acpi_gbl_interface_handler
, "OSI Invocations"}
109 /*******************************************************************************
111 * FUNCTION: acpi_db_get_pointer
113 * PARAMETERS: target - Pointer to string to be converted
115 * RETURN: Converted pointer
117 * DESCRIPTION: Convert an ascii pointer value to a real value
119 ******************************************************************************/
121 static void *acpi_db_get_pointer(void *target
)
126 address
= strtoul(target
, NULL
, 16);
127 obj_ptr
= ACPI_TO_POINTER(address
);
131 /*******************************************************************************
133 * FUNCTION: acpi_db_dump_parser_descriptor
135 * PARAMETERS: op - A parser Op descriptor
139 * DESCRIPTION: Display a formatted parser object
141 ******************************************************************************/
143 static void acpi_db_dump_parser_descriptor(union acpi_parse_object
*op
)
145 const struct acpi_opcode_info
*info
;
147 info
= acpi_ps_get_opcode_info(op
->common
.aml_opcode
);
149 acpi_os_printf("Parser Op Descriptor:\n");
150 acpi_os_printf("%20.20s : %4.4X\n", "Opcode", op
->common
.aml_opcode
);
152 ACPI_DEBUG_ONLY_MEMBERS(acpi_os_printf("%20.20s : %s\n", "Opcode Name",
155 acpi_os_printf("%20.20s : %p\n", "Value/ArgList", op
->common
.value
.arg
);
156 acpi_os_printf("%20.20s : %p\n", "Parent", op
->common
.parent
);
157 acpi_os_printf("%20.20s : %p\n", "NextOp", op
->common
.next
);
160 /*******************************************************************************
162 * FUNCTION: acpi_db_decode_and_display_object
164 * PARAMETERS: target - String with object to be displayed. Names
165 * and hex pointers are supported.
166 * output_type - Byte, Word, Dword, or Qword (B|W|D|Q)
170 * DESCRIPTION: Display a formatted ACPI object
172 ******************************************************************************/
174 void acpi_db_decode_and_display_object(char *target
, char *output_type
)
177 struct acpi_namespace_node
*node
;
178 union acpi_operand_object
*obj_desc
;
179 u32 display
= DB_BYTE_DISPLAY
;
181 struct acpi_buffer ret_buf
;
189 /* Decode the output type */
192 acpi_ut_strupr(output_type
);
193 if (output_type
[0] == 'W') {
194 display
= DB_WORD_DISPLAY
;
195 } else if (output_type
[0] == 'D') {
196 display
= DB_DWORD_DISPLAY
;
197 } else if (output_type
[0] == 'Q') {
198 display
= DB_QWORD_DISPLAY
;
202 ret_buf
.length
= sizeof(buffer
);
203 ret_buf
.pointer
= buffer
;
205 /* Differentiate between a number and a name */
207 if ((target
[0] >= 0x30) && (target
[0] <= 0x39)) {
208 obj_ptr
= acpi_db_get_pointer(target
);
209 if (!acpi_os_readable(obj_ptr
, 16)) {
211 ("Address %p is invalid in this address space\n",
216 /* Decode the object type */
218 switch (ACPI_GET_DESCRIPTOR_TYPE(obj_ptr
)) {
219 case ACPI_DESC_TYPE_NAMED
:
221 /* This is a namespace Node */
223 if (!acpi_os_readable
224 (obj_ptr
, sizeof(struct acpi_namespace_node
))) {
226 ("Cannot read entire Named object at address %p\n",
234 case ACPI_DESC_TYPE_OPERAND
:
236 /* This is a ACPI OPERAND OBJECT */
238 if (!acpi_os_readable
239 (obj_ptr
, sizeof(union acpi_operand_object
))) {
241 ("Cannot read entire ACPI object at address %p\n",
246 acpi_ut_debug_dump_buffer(obj_ptr
,
248 acpi_operand_object
),
249 display
, ACPI_UINT32_MAX
);
250 acpi_ex_dump_object_descriptor(obj_ptr
, 1);
253 case ACPI_DESC_TYPE_PARSER
:
255 /* This is a Parser Op object */
257 if (!acpi_os_readable
258 (obj_ptr
, sizeof(union acpi_parse_object
))) {
260 ("Cannot read entire Parser object at address %p\n",
265 acpi_ut_debug_dump_buffer(obj_ptr
,
268 display
, ACPI_UINT32_MAX
);
269 acpi_db_dump_parser_descriptor((union acpi_parse_object
275 /* Is not a recognizeable object */
278 ("Not a known ACPI internal object, descriptor type %2.2X\n",
279 ACPI_GET_DESCRIPTOR_TYPE(obj_ptr
));
282 if (acpi_os_readable(obj_ptr
, 64)) {
286 /* Just dump some memory */
288 acpi_ut_debug_dump_buffer(obj_ptr
, size
, display
,
296 /* The parameter is a name string that must be resolved to a Named obj */
298 node
= acpi_db_local_ns_lookup(target
);
304 /* Now dump the NS node */
306 status
= acpi_get_name(node
, ACPI_FULL_PATHNAME_NO_TRAILING
, &ret_buf
);
307 if (ACPI_FAILURE(status
)) {
308 acpi_os_printf("Could not convert name to pathname\n");
312 acpi_os_printf("Object (%p) Pathname: %s\n",
313 node
, (char *)ret_buf
.pointer
);
316 if (!acpi_os_readable(node
, sizeof(struct acpi_namespace_node
))) {
317 acpi_os_printf("Invalid Named object at address %p\n", node
);
321 acpi_ut_debug_dump_buffer((void *)node
,
322 sizeof(struct acpi_namespace_node
), display
,
324 acpi_ex_dump_namespace_node(node
, 1);
326 obj_desc
= acpi_ns_get_attached_object(node
);
328 acpi_os_printf("\nAttached Object (%p):\n", obj_desc
);
329 if (!acpi_os_readable
330 (obj_desc
, sizeof(union acpi_operand_object
))) {
332 ("Invalid internal ACPI Object at address %p\n",
337 acpi_ut_debug_dump_buffer((void *)obj_desc
,
338 sizeof(union acpi_operand_object
),
339 display
, ACPI_UINT32_MAX
);
340 acpi_ex_dump_object_descriptor(obj_desc
, 1);
344 /*******************************************************************************
346 * FUNCTION: acpi_db_display_method_info
348 * PARAMETERS: start_op - Root of the control method parse tree
352 * DESCRIPTION: Display information about the current method
354 ******************************************************************************/
356 void acpi_db_display_method_info(union acpi_parse_object
*start_op
)
358 struct acpi_walk_state
*walk_state
;
359 union acpi_operand_object
*obj_desc
;
360 struct acpi_namespace_node
*node
;
361 union acpi_parse_object
*root_op
;
362 union acpi_parse_object
*op
;
363 const struct acpi_opcode_info
*op_info
;
365 u32 num_operands
= 0;
366 u32 num_operators
= 0;
367 u32 num_remaining_ops
= 0;
368 u32 num_remaining_operands
= 0;
369 u32 num_remaining_operators
= 0;
370 u8 count_remaining
= FALSE
;
372 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
374 acpi_os_printf("There is no method currently executing\n");
378 obj_desc
= walk_state
->method_desc
;
379 node
= walk_state
->method_node
;
381 acpi_os_printf("Currently executing control method is [%4.4s]\n",
382 acpi_ut_get_node_name(node
));
383 acpi_os_printf("%X Arguments, SyncLevel = %X\n",
384 (u32
)obj_desc
->method
.param_count
,
385 (u32
)obj_desc
->method
.sync_level
);
388 while (root_op
->common
.parent
) {
389 root_op
= root_op
->common
.parent
;
395 if (op
== start_op
) {
396 count_remaining
= TRUE
;
400 if (count_remaining
) {
404 /* Decode the opcode */
406 op_info
= acpi_ps_get_opcode_info(op
->common
.aml_opcode
);
407 switch (op_info
->class) {
408 case AML_CLASS_ARGUMENT
:
410 if (count_remaining
) {
411 num_remaining_operands
++;
417 case AML_CLASS_UNKNOWN
:
419 /* Bad opcode or ASCII character */
425 if (count_remaining
) {
426 num_remaining_operators
++;
433 op
= acpi_ps_get_depth_next(start_op
, op
);
437 ("Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
438 num_ops
, num_operators
, num_operands
);
441 ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
442 num_remaining_ops
, num_remaining_operators
,
443 num_remaining_operands
);
446 /*******************************************************************************
448 * FUNCTION: acpi_db_display_locals
454 * DESCRIPTION: Display all locals for the currently running control method
456 ******************************************************************************/
458 void acpi_db_display_locals(void)
460 struct acpi_walk_state
*walk_state
;
462 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
464 acpi_os_printf("There is no method currently executing\n");
468 acpi_db_decode_locals(walk_state
);
471 /*******************************************************************************
473 * FUNCTION: acpi_db_display_arguments
479 * DESCRIPTION: Display all arguments for the currently running control method
481 ******************************************************************************/
483 void acpi_db_display_arguments(void)
485 struct acpi_walk_state
*walk_state
;
487 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
489 acpi_os_printf("There is no method currently executing\n");
493 acpi_db_decode_arguments(walk_state
);
496 /*******************************************************************************
498 * FUNCTION: acpi_db_display_results
504 * DESCRIPTION: Display current contents of a method result stack
506 ******************************************************************************/
508 void acpi_db_display_results(void)
511 struct acpi_walk_state
*walk_state
;
512 union acpi_operand_object
*obj_desc
;
513 u32 result_count
= 0;
514 struct acpi_namespace_node
*node
;
515 union acpi_generic_state
*frame
;
516 u32 index
; /* Index onto current frame */
518 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
520 acpi_os_printf("There is no method currently executing\n");
524 obj_desc
= walk_state
->method_desc
;
525 node
= walk_state
->method_node
;
527 if (walk_state
->results
) {
528 result_count
= walk_state
->result_count
;
531 acpi_os_printf("Method [%4.4s] has %X stacked result objects\n",
532 acpi_ut_get_node_name(node
), result_count
);
534 /* From the top element of result stack */
536 frame
= walk_state
->results
;
537 index
= (result_count
- 1) % ACPI_RESULTS_FRAME_OBJ_NUM
;
539 for (i
= 0; i
< result_count
; i
++) {
540 obj_desc
= frame
->results
.obj_desc
[index
];
541 acpi_os_printf("Result%u: ", i
);
542 acpi_db_display_internal_object(obj_desc
, walk_state
);
545 frame
= frame
->results
.next
;
546 index
= ACPI_RESULTS_FRAME_OBJ_NUM
;
553 /*******************************************************************************
555 * FUNCTION: acpi_db_display_calling_tree
561 * DESCRIPTION: Display current calling tree of nested control methods
563 ******************************************************************************/
565 void acpi_db_display_calling_tree(void)
567 struct acpi_walk_state
*walk_state
;
568 struct acpi_namespace_node
*node
;
570 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
572 acpi_os_printf("There is no method currently executing\n");
576 node
= walk_state
->method_node
;
577 acpi_os_printf("Current Control Method Call Tree\n");
580 node
= walk_state
->method_node
;
581 acpi_os_printf(" [%4.4s]\n", acpi_ut_get_node_name(node
));
583 walk_state
= walk_state
->next
;
587 /*******************************************************************************
589 * FUNCTION: acpi_db_display_object_type
591 * PARAMETERS: name - User entered NS node handle or name
595 * DESCRIPTION: Display type of an arbitrary NS node
597 ******************************************************************************/
599 void acpi_db_display_object_type(char *name
)
601 struct acpi_namespace_node
*node
;
602 struct acpi_device_info
*info
;
606 node
= acpi_db_convert_to_node(name
);
611 status
= acpi_get_object_info(ACPI_CAST_PTR(acpi_handle
, node
), &info
);
612 if (ACPI_FAILURE(status
)) {
613 acpi_os_printf("Could not get object info, %s\n",
614 acpi_format_exception(status
));
618 if (info
->valid
& ACPI_VALID_ADR
) {
619 acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
620 ACPI_FORMAT_UINT64(info
->address
),
621 info
->current_status
, info
->flags
);
623 if (info
->valid
& ACPI_VALID_SXDS
) {
624 acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
625 info
->highest_dstates
[0],
626 info
->highest_dstates
[1],
627 info
->highest_dstates
[2],
628 info
->highest_dstates
[3]);
630 if (info
->valid
& ACPI_VALID_SXWS
) {
632 ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
633 info
->lowest_dstates
[0], info
->lowest_dstates
[1],
634 info
->lowest_dstates
[2], info
->lowest_dstates
[3],
635 info
->lowest_dstates
[4]);
638 if (info
->valid
& ACPI_VALID_HID
) {
639 acpi_os_printf("HID: %s\n", info
->hardware_id
.string
);
642 if (info
->valid
& ACPI_VALID_UID
) {
643 acpi_os_printf("UID: %s\n", info
->unique_id
.string
);
646 if (info
->valid
& ACPI_VALID_SUB
) {
647 acpi_os_printf("SUB: %s\n", info
->subsystem_id
.string
);
650 if (info
->valid
& ACPI_VALID_CID
) {
651 for (i
= 0; i
< info
->compatible_id_list
.count
; i
++) {
652 acpi_os_printf("CID %u: %s\n", i
,
653 info
->compatible_id_list
.ids
[i
].string
);
660 /*******************************************************************************
662 * FUNCTION: acpi_db_display_result_object
664 * PARAMETERS: obj_desc - Object to be displayed
665 * walk_state - Current walk state
669 * DESCRIPTION: Display the result of an AML opcode
671 * Note: Curently only displays the result object if we are single stepping.
672 * However, this output may be useful in other contexts and could be enabled
673 * to do so if needed.
675 ******************************************************************************/
678 acpi_db_display_result_object(union acpi_operand_object
*obj_desc
,
679 struct acpi_walk_state
*walk_state
)
682 /* Only display if single stepping */
684 if (!acpi_gbl_cm_single_step
) {
688 acpi_os_printf("ResultObj: ");
689 acpi_db_display_internal_object(obj_desc
, walk_state
);
690 acpi_os_printf("\n");
693 /*******************************************************************************
695 * FUNCTION: acpi_db_display_argument_object
697 * PARAMETERS: obj_desc - Object to be displayed
698 * walk_state - Current walk state
702 * DESCRIPTION: Display the result of an AML opcode
704 ******************************************************************************/
707 acpi_db_display_argument_object(union acpi_operand_object
*obj_desc
,
708 struct acpi_walk_state
*walk_state
)
711 if (!acpi_gbl_cm_single_step
) {
715 acpi_os_printf("ArgObj: ");
716 acpi_db_display_internal_object(obj_desc
, walk_state
);
719 #if (!ACPI_REDUCED_HARDWARE)
720 /*******************************************************************************
722 * FUNCTION: acpi_db_display_gpes
728 * DESCRIPTION: Display the current GPE structures
730 ******************************************************************************/
732 void acpi_db_display_gpes(void)
734 struct acpi_gpe_block_info
*gpe_block
;
735 struct acpi_gpe_xrupt_info
*gpe_xrupt_info
;
736 struct acpi_gpe_event_info
*gpe_event_info
;
737 struct acpi_gpe_register_info
*gpe_register_info
;
739 struct acpi_gpe_notify_info
*notify
;
746 struct acpi_buffer ret_buf
;
749 ret_buf
.length
= sizeof(buffer
);
750 ret_buf
.pointer
= buffer
;
754 /* Walk the GPE lists */
756 gpe_xrupt_info
= acpi_gbl_gpe_xrupt_list_head
;
757 while (gpe_xrupt_info
) {
758 gpe_block
= gpe_xrupt_info
->gpe_block_list_head
;
760 status
= acpi_get_name(gpe_block
->node
,
761 ACPI_FULL_PATHNAME_NO_TRAILING
,
763 if (ACPI_FAILURE(status
)) {
765 ("Could not convert name to pathname\n");
768 if (gpe_block
->node
== acpi_gbl_fadt_gpe_device
) {
769 gpe_type
= "FADT-defined GPE block";
771 gpe_type
= "GPE Block Device";
775 ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
776 block
, gpe_block
, gpe_block
->node
, buffer
,
779 acpi_os_printf(" Registers: %u (%u GPEs)\n",
780 gpe_block
->register_count
,
781 gpe_block
->gpe_count
);
784 (" GPE range: 0x%X to 0x%X on interrupt %u\n",
785 gpe_block
->block_base_number
,
786 gpe_block
->block_base_number
+
787 (gpe_block
->gpe_count
- 1),
788 gpe_xrupt_info
->interrupt_number
);
791 (" RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
792 gpe_block
->register_info
,
793 ACPI_FORMAT_UINT64(gpe_block
->register_info
->
794 status_address
.address
),
795 ACPI_FORMAT_UINT64(gpe_block
->register_info
->
796 enable_address
.address
));
798 acpi_os_printf(" EventInfo: %p\n",
799 gpe_block
->event_info
);
801 /* Examine each GPE Register within the block */
803 for (i
= 0; i
< gpe_block
->register_count
; i
++) {
805 &gpe_block
->register_info
[i
];
807 acpi_os_printf(" Reg %u: (GPE %.2X-%.2X) "
808 "RunEnable %2.2X WakeEnable %2.2X"
809 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
815 (ACPI_GPE_REGISTER_WIDTH
- 1),
822 status_address
.address
),
825 enable_address
.address
));
827 /* Now look at the individual GPEs in this byte register */
829 for (j
= 0; j
< ACPI_GPE_REGISTER_WIDTH
; j
++) {
831 (i
* ACPI_GPE_REGISTER_WIDTH
) + j
;
833 &gpe_block
->event_info
[gpe_index
];
835 if (ACPI_GPE_DISPATCH_TYPE
836 (gpe_event_info
->flags
) ==
837 ACPI_GPE_DISPATCH_NONE
) {
839 /* This GPE is not used (no method or handler), ignore it */
845 (" GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
846 gpe_block
->block_base_number
+
847 gpe_index
, gpe_event_info
,
848 gpe_event_info
->runtime_count
,
849 gpe_event_info
->flags
);
851 /* Decode the flags byte */
854 flags
& ACPI_GPE_LEVEL_TRIGGERED
) {
855 acpi_os_printf("Level, ");
857 acpi_os_printf("Edge, ");
861 flags
& ACPI_GPE_CAN_WAKE
) {
862 acpi_os_printf("CanWake, ");
864 acpi_os_printf("RunOnly, ");
867 switch (ACPI_GPE_DISPATCH_TYPE
868 (gpe_event_info
->flags
)) {
869 case ACPI_GPE_DISPATCH_NONE
:
871 acpi_os_printf("NotUsed");
874 case ACPI_GPE_DISPATCH_METHOD
:
876 acpi_os_printf("Method");
879 case ACPI_GPE_DISPATCH_HANDLER
:
881 acpi_os_printf("Handler");
884 case ACPI_GPE_DISPATCH_NOTIFY
:
888 gpe_event_info
->dispatch
.
892 notify
= notify
->next
;
896 ("Implicit Notify on %u devices",
900 case ACPI_GPE_DISPATCH_RAW_HANDLER
:
902 acpi_os_printf("RawHandler");
907 acpi_os_printf("UNKNOWN: %X",
908 ACPI_GPE_DISPATCH_TYPE
914 acpi_os_printf(")\n");
919 gpe_block
= gpe_block
->next
;
922 gpe_xrupt_info
= gpe_xrupt_info
->next
;
925 #endif /* !ACPI_REDUCED_HARDWARE */
927 /*******************************************************************************
929 * FUNCTION: acpi_db_display_handlers
935 * DESCRIPTION: Display the currently installed global handlers
937 ******************************************************************************/
939 void acpi_db_display_handlers(void)
941 union acpi_operand_object
*obj_desc
;
942 union acpi_operand_object
*handler_obj
;
943 acpi_adr_space_type space_id
;
946 /* Operation region handlers */
948 acpi_os_printf("\nOperation Region Handlers at the namespace root:\n");
950 obj_desc
= acpi_ns_get_attached_object(acpi_gbl_root_node
);
952 for (i
= 0; i
< ACPI_ARRAY_LENGTH(acpi_gbl_space_id_list
); i
++) {
953 space_id
= acpi_gbl_space_id_list
[i
];
954 handler_obj
= obj_desc
->device
.handler
;
956 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
957 acpi_ut_get_region_name((u8
)space_id
),
960 while (handler_obj
) {
961 if (acpi_gbl_space_id_list
[i
] ==
962 handler_obj
->address_space
.space_id
) {
964 (ACPI_HANDLER_PRESENT_STRING
,
965 (handler_obj
->address_space
.
967 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
)
968 ? "Default" : "User",
969 handler_obj
->address_space
.
975 handler_obj
= handler_obj
->address_space
.next
;
978 /* There is no handler for this space_id */
980 acpi_os_printf("None\n");
985 /* Find all handlers for user-defined space_IDs */
987 handler_obj
= obj_desc
->device
.handler
;
988 while (handler_obj
) {
989 if (handler_obj
->address_space
.space_id
>=
990 ACPI_USER_REGION_BEGIN
) {
991 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
993 handler_obj
->address_space
.
995 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
,
996 (handler_obj
->address_space
.
998 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
)
999 ? "Default" : "User",
1000 handler_obj
->address_space
.
1004 handler_obj
= handler_obj
->address_space
.next
;
1007 #if (!ACPI_REDUCED_HARDWARE)
1009 /* Fixed event handlers */
1011 acpi_os_printf("\nFixed Event Handlers:\n");
1013 for (i
= 0; i
< ACPI_NUM_FIXED_EVENTS
; i
++) {
1014 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
1015 acpi_ut_get_event_name(i
), i
);
1016 if (acpi_gbl_fixed_event_handlers
[i
].handler
) {
1017 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
, "User",
1018 acpi_gbl_fixed_event_handlers
[i
].
1021 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING
, "None");
1025 #endif /* !ACPI_REDUCED_HARDWARE */
1027 /* Miscellaneous global handlers */
1029 acpi_os_printf("\nMiscellaneous Global Handlers:\n");
1031 for (i
= 0; i
< ACPI_ARRAY_LENGTH(acpi_gbl_handler_list
); i
++) {
1032 acpi_os_printf(ACPI_HANDLER_NAME_STRING
,
1033 acpi_gbl_handler_list
[i
].name
);
1035 if (acpi_gbl_handler_list
[i
].handler
) {
1036 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
, "User",
1037 acpi_gbl_handler_list
[i
].handler
);
1039 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING
, "None");
1043 /* Other handlers that are installed throughout the namespace */
1045 acpi_os_printf("\nOperation Region Handlers for specific devices:\n");
1047 (void)acpi_walk_namespace(ACPI_TYPE_DEVICE
, ACPI_ROOT_OBJECT
,
1049 acpi_db_display_non_root_handlers
, NULL
, NULL
,
1053 /*******************************************************************************
1055 * FUNCTION: acpi_db_display_non_root_handlers
1057 * PARAMETERS: acpi_walk_callback
1061 * DESCRIPTION: Display information about all handlers installed for a
1064 ******************************************************************************/
1067 acpi_db_display_non_root_handlers(acpi_handle obj_handle
,
1069 void *context
, void **return_value
)
1071 struct acpi_namespace_node
*node
=
1072 ACPI_CAST_PTR(struct acpi_namespace_node
, obj_handle
);
1073 union acpi_operand_object
*obj_desc
;
1074 union acpi_operand_object
*handler_obj
;
1077 obj_desc
= acpi_ns_get_attached_object(node
);
1082 pathname
= acpi_ns_get_external_pathname(node
);
1087 /* Display all handlers associated with this device */
1089 handler_obj
= obj_desc
->device
.handler
;
1090 while (handler_obj
) {
1091 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
1092 acpi_ut_get_region_name((u8
)handler_obj
->
1093 address_space
.space_id
),
1094 handler_obj
->address_space
.space_id
);
1096 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING2
,
1097 (handler_obj
->address_space
.handler_flags
&
1098 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
) ? "Default"
1099 : "User", handler_obj
->address_space
.handler
);
1101 acpi_os_printf(" Device Name: %s (%p)\n", pathname
, node
);
1103 handler_obj
= handler_obj
->address_space
.next
;
1106 ACPI_FREE(pathname
);