1 /*******************************************************************************
3 * Module Name: dbdisply - debug display commands
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2018, 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>
54 #define _COMPONENT ACPI_CA_DEBUGGER
55 ACPI_MODULE_NAME("dbdisply")
57 /* Local prototypes */
58 static void acpi_db_dump_parser_descriptor(union acpi_parse_object
*op
);
60 static void *acpi_db_get_pointer(void *target
);
63 acpi_db_display_non_root_handlers(acpi_handle obj_handle
,
65 void *context
, void **return_value
);
68 * System handler information.
69 * Used for Handlers command, in acpi_db_display_handlers.
71 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
72 #define ACPI_HANDLER_NAME_STRING "%30s : "
73 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
74 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
75 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
77 /* All predefined Address Space IDs */
79 static acpi_adr_space_type acpi_gbl_space_id_list
[] = {
80 ACPI_ADR_SPACE_SYSTEM_MEMORY
,
81 ACPI_ADR_SPACE_SYSTEM_IO
,
82 ACPI_ADR_SPACE_PCI_CONFIG
,
86 ACPI_ADR_SPACE_PCI_BAR_TARGET
,
90 ACPI_ADR_SPACE_DATA_TABLE
,
91 ACPI_ADR_SPACE_FIXED_HARDWARE
94 /* Global handler information */
96 typedef struct acpi_handler_info
{
102 static struct acpi_handler_info acpi_gbl_handler_list
[] = {
103 {&acpi_gbl_global_notify
[0].handler
, "System Notifications"},
104 {&acpi_gbl_global_notify
[1].handler
, "Device Notifications"},
105 {&acpi_gbl_table_handler
, "ACPI Table Events"},
106 {&acpi_gbl_exception_handler
, "Control Method Exceptions"},
107 {&acpi_gbl_interface_handler
, "OSI Invocations"}
110 /*******************************************************************************
112 * FUNCTION: acpi_db_get_pointer
114 * PARAMETERS: target - Pointer to string to be converted
116 * RETURN: Converted pointer
118 * DESCRIPTION: Convert an ascii pointer value to a real value
120 ******************************************************************************/
122 static void *acpi_db_get_pointer(void *target
)
127 address
= strtoul(target
, NULL
, 16);
128 obj_ptr
= ACPI_TO_POINTER(address
);
132 /*******************************************************************************
134 * FUNCTION: acpi_db_dump_parser_descriptor
136 * PARAMETERS: op - A parser Op descriptor
140 * DESCRIPTION: Display a formatted parser object
142 ******************************************************************************/
144 static void acpi_db_dump_parser_descriptor(union acpi_parse_object
*op
)
146 const struct acpi_opcode_info
*info
;
148 info
= acpi_ps_get_opcode_info(op
->common
.aml_opcode
);
150 acpi_os_printf("Parser Op Descriptor:\n");
151 acpi_os_printf("%20.20s : %4.4X\n", "Opcode", op
->common
.aml_opcode
);
153 ACPI_DEBUG_ONLY_MEMBERS(acpi_os_printf("%20.20s : %s\n", "Opcode Name",
156 acpi_os_printf("%20.20s : %p\n", "Value/ArgList", op
->common
.value
.arg
);
157 acpi_os_printf("%20.20s : %p\n", "Parent", op
->common
.parent
);
158 acpi_os_printf("%20.20s : %p\n", "NextOp", op
->common
.next
);
161 /*******************************************************************************
163 * FUNCTION: acpi_db_decode_and_display_object
165 * PARAMETERS: target - String with object to be displayed. Names
166 * and hex pointers are supported.
167 * output_type - Byte, Word, Dword, or Qword (B|W|D|Q)
171 * DESCRIPTION: Display a formatted ACPI object
173 ******************************************************************************/
175 void acpi_db_decode_and_display_object(char *target
, char *output_type
)
178 struct acpi_namespace_node
*node
;
179 union acpi_operand_object
*obj_desc
;
180 u32 display
= DB_BYTE_DISPLAY
;
182 struct acpi_buffer ret_buf
;
190 /* Decode the output type */
193 acpi_ut_strupr(output_type
);
194 if (output_type
[0] == 'W') {
195 display
= DB_WORD_DISPLAY
;
196 } else if (output_type
[0] == 'D') {
197 display
= DB_DWORD_DISPLAY
;
198 } else if (output_type
[0] == 'Q') {
199 display
= DB_QWORD_DISPLAY
;
203 ret_buf
.length
= sizeof(buffer
);
204 ret_buf
.pointer
= buffer
;
206 /* Differentiate between a number and a name */
208 if ((target
[0] >= 0x30) && (target
[0] <= 0x39)) {
209 obj_ptr
= acpi_db_get_pointer(target
);
210 if (!acpi_os_readable(obj_ptr
, 16)) {
212 ("Address %p is invalid in this address space\n",
217 /* Decode the object type */
219 switch (ACPI_GET_DESCRIPTOR_TYPE(obj_ptr
)) {
220 case ACPI_DESC_TYPE_NAMED
:
222 /* This is a namespace Node */
224 if (!acpi_os_readable
225 (obj_ptr
, sizeof(struct acpi_namespace_node
))) {
227 ("Cannot read entire Named object at address %p\n",
235 case ACPI_DESC_TYPE_OPERAND
:
237 /* This is a ACPI OPERAND OBJECT */
239 if (!acpi_os_readable
240 (obj_ptr
, sizeof(union acpi_operand_object
))) {
242 ("Cannot read entire ACPI object at address %p\n",
247 acpi_ut_debug_dump_buffer(obj_ptr
,
249 acpi_operand_object
),
250 display
, ACPI_UINT32_MAX
);
251 acpi_ex_dump_object_descriptor(obj_ptr
, 1);
254 case ACPI_DESC_TYPE_PARSER
:
256 /* This is a Parser Op object */
258 if (!acpi_os_readable
259 (obj_ptr
, sizeof(union acpi_parse_object
))) {
261 ("Cannot read entire Parser object at address %p\n",
266 acpi_ut_debug_dump_buffer(obj_ptr
,
269 display
, ACPI_UINT32_MAX
);
270 acpi_db_dump_parser_descriptor((union acpi_parse_object
276 /* Is not a recognizeable object */
279 ("Not a known ACPI internal object, descriptor type %2.2X\n",
280 ACPI_GET_DESCRIPTOR_TYPE(obj_ptr
));
283 if (acpi_os_readable(obj_ptr
, 64)) {
287 /* Just dump some memory */
289 acpi_ut_debug_dump_buffer(obj_ptr
, size
, display
,
297 /* The parameter is a name string that must be resolved to a Named obj */
299 node
= acpi_db_local_ns_lookup(target
);
305 /* Now dump the NS node */
307 status
= acpi_get_name(node
, ACPI_FULL_PATHNAME_NO_TRAILING
, &ret_buf
);
308 if (ACPI_FAILURE(status
)) {
309 acpi_os_printf("Could not convert name to pathname\n");
313 acpi_os_printf("Object %p: Namespace Node - Pathname: %s\n",
314 node
, (char *)ret_buf
.pointer
);
317 if (!acpi_os_readable(node
, sizeof(struct acpi_namespace_node
))) {
318 acpi_os_printf("Invalid Named object at address %p\n", node
);
322 acpi_ut_debug_dump_buffer((void *)node
,
323 sizeof(struct acpi_namespace_node
), display
,
325 acpi_ex_dump_namespace_node(node
, 1);
327 obj_desc
= acpi_ns_get_attached_object(node
);
329 acpi_os_printf("\nAttached Object %p:", obj_desc
);
330 if (!acpi_os_readable
331 (obj_desc
, sizeof(union acpi_operand_object
))) {
333 ("Invalid internal ACPI Object at address %p\n",
338 if (ACPI_GET_DESCRIPTOR_TYPE(((struct acpi_namespace_node
*)
340 ACPI_DESC_TYPE_NAMED
) {
341 acpi_os_printf(" Namespace Node - ");
343 acpi_get_name((struct acpi_namespace_node
*)
345 ACPI_FULL_PATHNAME_NO_TRAILING
,
347 if (ACPI_FAILURE(status
)) {
349 ("Could not convert name to pathname\n");
351 acpi_os_printf("Pathname: %s",
352 (char *)ret_buf
.pointer
);
355 acpi_os_printf("\n");
356 acpi_ut_debug_dump_buffer((void *)obj_desc
,
358 acpi_namespace_node
),
359 display
, ACPI_UINT32_MAX
);
361 acpi_os_printf("\n");
362 acpi_ut_debug_dump_buffer((void *)obj_desc
,
364 acpi_operand_object
),
365 display
, ACPI_UINT32_MAX
);
368 acpi_ex_dump_object_descriptor(obj_desc
, 1);
372 /*******************************************************************************
374 * FUNCTION: acpi_db_display_method_info
376 * PARAMETERS: start_op - Root of the control method parse tree
380 * DESCRIPTION: Display information about the current method
382 ******************************************************************************/
384 void acpi_db_display_method_info(union acpi_parse_object
*start_op
)
386 struct acpi_walk_state
*walk_state
;
387 union acpi_operand_object
*obj_desc
;
388 struct acpi_namespace_node
*node
;
389 union acpi_parse_object
*root_op
;
390 union acpi_parse_object
*op
;
391 const struct acpi_opcode_info
*op_info
;
393 u32 num_operands
= 0;
394 u32 num_operators
= 0;
395 u32 num_remaining_ops
= 0;
396 u32 num_remaining_operands
= 0;
397 u32 num_remaining_operators
= 0;
398 u8 count_remaining
= FALSE
;
400 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
402 acpi_os_printf("There is no method currently executing\n");
406 obj_desc
= walk_state
->method_desc
;
407 node
= walk_state
->method_node
;
409 acpi_os_printf("Currently executing control method is [%4.4s]\n",
410 acpi_ut_get_node_name(node
));
411 acpi_os_printf("%X Arguments, SyncLevel = %X\n",
412 (u32
)obj_desc
->method
.param_count
,
413 (u32
)obj_desc
->method
.sync_level
);
416 while (root_op
->common
.parent
) {
417 root_op
= root_op
->common
.parent
;
423 if (op
== start_op
) {
424 count_remaining
= TRUE
;
428 if (count_remaining
) {
432 /* Decode the opcode */
434 op_info
= acpi_ps_get_opcode_info(op
->common
.aml_opcode
);
435 switch (op_info
->class) {
436 case AML_CLASS_ARGUMENT
:
438 if (count_remaining
) {
439 num_remaining_operands
++;
445 case AML_CLASS_UNKNOWN
:
447 /* Bad opcode or ASCII character */
453 if (count_remaining
) {
454 num_remaining_operators
++;
461 op
= acpi_ps_get_depth_next(start_op
, op
);
465 ("Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
466 num_ops
, num_operators
, num_operands
);
469 ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
470 num_remaining_ops
, num_remaining_operators
,
471 num_remaining_operands
);
474 /*******************************************************************************
476 * FUNCTION: acpi_db_display_locals
482 * DESCRIPTION: Display all locals for the currently running control method
484 ******************************************************************************/
486 void acpi_db_display_locals(void)
488 struct acpi_walk_state
*walk_state
;
490 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
492 acpi_os_printf("There is no method currently executing\n");
496 acpi_db_decode_locals(walk_state
);
499 /*******************************************************************************
501 * FUNCTION: acpi_db_display_arguments
507 * DESCRIPTION: Display all arguments for the currently running control method
509 ******************************************************************************/
511 void acpi_db_display_arguments(void)
513 struct acpi_walk_state
*walk_state
;
515 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
517 acpi_os_printf("There is no method currently executing\n");
521 acpi_db_decode_arguments(walk_state
);
524 /*******************************************************************************
526 * FUNCTION: acpi_db_display_results
532 * DESCRIPTION: Display current contents of a method result stack
534 ******************************************************************************/
536 void acpi_db_display_results(void)
539 struct acpi_walk_state
*walk_state
;
540 union acpi_operand_object
*obj_desc
;
541 u32 result_count
= 0;
542 struct acpi_namespace_node
*node
;
543 union acpi_generic_state
*frame
;
544 u32 index
; /* Index onto current frame */
546 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
548 acpi_os_printf("There is no method currently executing\n");
552 obj_desc
= walk_state
->method_desc
;
553 node
= walk_state
->method_node
;
555 if (walk_state
->results
) {
556 result_count
= walk_state
->result_count
;
559 acpi_os_printf("Method [%4.4s] has %X stacked result objects\n",
560 acpi_ut_get_node_name(node
), result_count
);
562 /* From the top element of result stack */
564 frame
= walk_state
->results
;
565 index
= (result_count
- 1) % ACPI_RESULTS_FRAME_OBJ_NUM
;
567 for (i
= 0; i
< result_count
; i
++) {
568 obj_desc
= frame
->results
.obj_desc
[index
];
569 acpi_os_printf("Result%u: ", i
);
570 acpi_db_display_internal_object(obj_desc
, walk_state
);
573 frame
= frame
->results
.next
;
574 index
= ACPI_RESULTS_FRAME_OBJ_NUM
;
581 /*******************************************************************************
583 * FUNCTION: acpi_db_display_calling_tree
589 * DESCRIPTION: Display current calling tree of nested control methods
591 ******************************************************************************/
593 void acpi_db_display_calling_tree(void)
595 struct acpi_walk_state
*walk_state
;
596 struct acpi_namespace_node
*node
;
598 walk_state
= acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list
);
600 acpi_os_printf("There is no method currently executing\n");
604 node
= walk_state
->method_node
;
605 acpi_os_printf("Current Control Method Call Tree\n");
608 node
= walk_state
->method_node
;
609 acpi_os_printf(" [%4.4s]\n", acpi_ut_get_node_name(node
));
611 walk_state
= walk_state
->next
;
615 /*******************************************************************************
617 * FUNCTION: acpi_db_display_object_type
619 * PARAMETERS: object_arg - User entered NS node handle
623 * DESCRIPTION: Display type of an arbitrary NS node
625 ******************************************************************************/
627 void acpi_db_display_object_type(char *object_arg
)
631 struct acpi_device_info
*info
;
635 arg
= strtoul(object_arg
, NULL
, 16);
636 handle
= ACPI_TO_POINTER(arg
);
638 status
= acpi_get_object_info(handle
, &info
);
639 if (ACPI_FAILURE(status
)) {
640 acpi_os_printf("Could not get object info, %s\n",
641 acpi_format_exception(status
));
645 acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
646 ACPI_FORMAT_UINT64(info
->address
),
647 info
->current_status
, info
->flags
);
649 acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
650 info
->highest_dstates
[0], info
->highest_dstates
[1],
651 info
->highest_dstates
[2], info
->highest_dstates
[3]);
653 acpi_os_printf("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
654 info
->lowest_dstates
[0], info
->lowest_dstates
[1],
655 info
->lowest_dstates
[2], info
->lowest_dstates
[3],
656 info
->lowest_dstates
[4]);
658 if (info
->valid
& ACPI_VALID_HID
) {
659 acpi_os_printf("HID: %s\n", info
->hardware_id
.string
);
662 if (info
->valid
& ACPI_VALID_UID
) {
663 acpi_os_printf("UID: %s\n", info
->unique_id
.string
);
666 if (info
->valid
& ACPI_VALID_CID
) {
667 for (i
= 0; i
< info
->compatible_id_list
.count
; i
++) {
668 acpi_os_printf("CID %u: %s\n", i
,
669 info
->compatible_id_list
.ids
[i
].string
);
676 /*******************************************************************************
678 * FUNCTION: acpi_db_display_result_object
680 * PARAMETERS: obj_desc - Object to be displayed
681 * walk_state - Current walk state
685 * DESCRIPTION: Display the result of an AML opcode
687 * Note: Curently only displays the result object if we are single stepping.
688 * However, this output may be useful in other contexts and could be enabled
689 * to do so if needed.
691 ******************************************************************************/
694 acpi_db_display_result_object(union acpi_operand_object
*obj_desc
,
695 struct acpi_walk_state
*walk_state
)
698 #ifndef ACPI_APPLICATION
699 if (acpi_gbl_db_thread_id
!= acpi_os_get_thread_id()) {
704 /* Only display if single stepping */
706 if (!acpi_gbl_cm_single_step
) {
710 acpi_os_printf("ResultObj: ");
711 acpi_db_display_internal_object(obj_desc
, walk_state
);
712 acpi_os_printf("\n");
715 /*******************************************************************************
717 * FUNCTION: acpi_db_display_argument_object
719 * PARAMETERS: obj_desc - Object to be displayed
720 * walk_state - Current walk state
724 * DESCRIPTION: Display the result of an AML opcode
726 ******************************************************************************/
729 acpi_db_display_argument_object(union acpi_operand_object
*obj_desc
,
730 struct acpi_walk_state
*walk_state
)
733 #ifndef ACPI_APPLICATION
734 if (acpi_gbl_db_thread_id
!= acpi_os_get_thread_id()) {
739 if (!acpi_gbl_cm_single_step
) {
743 acpi_os_printf("ArgObj: ");
744 acpi_db_display_internal_object(obj_desc
, walk_state
);
747 #if (!ACPI_REDUCED_HARDWARE)
748 /*******************************************************************************
750 * FUNCTION: acpi_db_display_gpes
756 * DESCRIPTION: Display the current GPE structures
758 ******************************************************************************/
760 void acpi_db_display_gpes(void)
762 struct acpi_gpe_block_info
*gpe_block
;
763 struct acpi_gpe_xrupt_info
*gpe_xrupt_info
;
764 struct acpi_gpe_event_info
*gpe_event_info
;
765 struct acpi_gpe_register_info
*gpe_register_info
;
767 struct acpi_gpe_notify_info
*notify
;
774 struct acpi_buffer ret_buf
;
777 ret_buf
.length
= sizeof(buffer
);
778 ret_buf
.pointer
= buffer
;
782 /* Walk the GPE lists */
784 gpe_xrupt_info
= acpi_gbl_gpe_xrupt_list_head
;
785 while (gpe_xrupt_info
) {
786 gpe_block
= gpe_xrupt_info
->gpe_block_list_head
;
788 status
= acpi_get_name(gpe_block
->node
,
789 ACPI_FULL_PATHNAME_NO_TRAILING
,
791 if (ACPI_FAILURE(status
)) {
793 ("Could not convert name to pathname\n");
796 if (gpe_block
->node
== acpi_gbl_fadt_gpe_device
) {
797 gpe_type
= "FADT-defined GPE block";
799 gpe_type
= "GPE Block Device";
803 ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
804 block
, gpe_block
, gpe_block
->node
, buffer
,
807 acpi_os_printf(" Registers: %u (%u GPEs)\n",
808 gpe_block
->register_count
,
809 gpe_block
->gpe_count
);
812 (" GPE range: 0x%X to 0x%X on interrupt %u\n",
813 gpe_block
->block_base_number
,
814 gpe_block
->block_base_number
+
815 (gpe_block
->gpe_count
- 1),
816 gpe_xrupt_info
->interrupt_number
);
819 (" RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
820 gpe_block
->register_info
,
821 ACPI_FORMAT_UINT64(gpe_block
->register_info
->
822 status_address
.address
),
823 ACPI_FORMAT_UINT64(gpe_block
->register_info
->
824 enable_address
.address
));
826 acpi_os_printf(" EventInfo: %p\n",
827 gpe_block
->event_info
);
829 /* Examine each GPE Register within the block */
831 for (i
= 0; i
< gpe_block
->register_count
; i
++) {
833 &gpe_block
->register_info
[i
];
835 acpi_os_printf(" Reg %u: (GPE %.2X-%.2X) "
836 "RunEnable %2.2X WakeEnable %2.2X"
837 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
843 (ACPI_GPE_REGISTER_WIDTH
- 1),
850 status_address
.address
),
853 enable_address
.address
));
855 /* Now look at the individual GPEs in this byte register */
857 for (j
= 0; j
< ACPI_GPE_REGISTER_WIDTH
; j
++) {
859 (i
* ACPI_GPE_REGISTER_WIDTH
) + j
;
861 &gpe_block
->event_info
[gpe_index
];
863 if (ACPI_GPE_DISPATCH_TYPE
864 (gpe_event_info
->flags
) ==
865 ACPI_GPE_DISPATCH_NONE
) {
867 /* This GPE is not used (no method or handler), ignore it */
873 (" GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
874 gpe_block
->block_base_number
+
875 gpe_index
, gpe_event_info
,
876 gpe_event_info
->runtime_count
,
877 gpe_event_info
->flags
);
879 /* Decode the flags byte */
882 flags
& ACPI_GPE_LEVEL_TRIGGERED
) {
883 acpi_os_printf("Level, ");
885 acpi_os_printf("Edge, ");
889 flags
& ACPI_GPE_CAN_WAKE
) {
890 acpi_os_printf("CanWake, ");
892 acpi_os_printf("RunOnly, ");
895 switch (ACPI_GPE_DISPATCH_TYPE
896 (gpe_event_info
->flags
)) {
897 case ACPI_GPE_DISPATCH_NONE
:
899 acpi_os_printf("NotUsed");
902 case ACPI_GPE_DISPATCH_METHOD
:
904 acpi_os_printf("Method");
907 case ACPI_GPE_DISPATCH_HANDLER
:
909 acpi_os_printf("Handler");
912 case ACPI_GPE_DISPATCH_NOTIFY
:
916 gpe_event_info
->dispatch
.
920 notify
= notify
->next
;
924 ("Implicit Notify on %u devices",
928 case ACPI_GPE_DISPATCH_RAW_HANDLER
:
930 acpi_os_printf("RawHandler");
935 acpi_os_printf("UNKNOWN: %X",
936 ACPI_GPE_DISPATCH_TYPE
942 acpi_os_printf(")\n");
947 gpe_block
= gpe_block
->next
;
950 gpe_xrupt_info
= gpe_xrupt_info
->next
;
953 #endif /* !ACPI_REDUCED_HARDWARE */
955 /*******************************************************************************
957 * FUNCTION: acpi_db_display_handlers
963 * DESCRIPTION: Display the currently installed global handlers
965 ******************************************************************************/
967 void acpi_db_display_handlers(void)
969 union acpi_operand_object
*obj_desc
;
970 union acpi_operand_object
*handler_obj
;
971 acpi_adr_space_type space_id
;
974 /* Operation region handlers */
976 acpi_os_printf("\nOperation Region Handlers at the namespace root:\n");
978 obj_desc
= acpi_ns_get_attached_object(acpi_gbl_root_node
);
980 for (i
= 0; i
< ACPI_ARRAY_LENGTH(acpi_gbl_space_id_list
); i
++) {
981 space_id
= acpi_gbl_space_id_list
[i
];
983 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
984 acpi_ut_get_region_name((u8
)space_id
),
988 acpi_ev_find_region_handler(space_id
,
989 obj_desc
->common_notify
.
992 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
,
993 (handler_obj
->address_space
.
995 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
)
996 ? "Default" : "User",
997 handler_obj
->address_space
.
1003 /* There is no handler for this space_id */
1005 acpi_os_printf("None\n");
1010 /* Find all handlers for user-defined space_IDs */
1012 handler_obj
= obj_desc
->common_notify
.handler
;
1013 while (handler_obj
) {
1014 if (handler_obj
->address_space
.space_id
>=
1015 ACPI_USER_REGION_BEGIN
) {
1016 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
1018 handler_obj
->address_space
.
1020 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
,
1021 (handler_obj
->address_space
.
1023 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
)
1024 ? "Default" : "User",
1025 handler_obj
->address_space
.
1029 handler_obj
= handler_obj
->address_space
.next
;
1032 #if (!ACPI_REDUCED_HARDWARE)
1034 /* Fixed event handlers */
1036 acpi_os_printf("\nFixed Event Handlers:\n");
1038 for (i
= 0; i
< ACPI_NUM_FIXED_EVENTS
; i
++) {
1039 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
1040 acpi_ut_get_event_name(i
), i
);
1041 if (acpi_gbl_fixed_event_handlers
[i
].handler
) {
1042 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
, "User",
1043 acpi_gbl_fixed_event_handlers
[i
].
1046 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING
, "None");
1050 #endif /* !ACPI_REDUCED_HARDWARE */
1052 /* Miscellaneous global handlers */
1054 acpi_os_printf("\nMiscellaneous Global Handlers:\n");
1056 for (i
= 0; i
< ACPI_ARRAY_LENGTH(acpi_gbl_handler_list
); i
++) {
1057 acpi_os_printf(ACPI_HANDLER_NAME_STRING
,
1058 acpi_gbl_handler_list
[i
].name
);
1060 if (acpi_gbl_handler_list
[i
].handler
) {
1061 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING
, "User",
1062 acpi_gbl_handler_list
[i
].handler
);
1064 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING
, "None");
1068 /* Other handlers that are installed throughout the namespace */
1070 acpi_os_printf("\nOperation Region Handlers for specific devices:\n");
1072 (void)acpi_walk_namespace(ACPI_TYPE_DEVICE
, ACPI_ROOT_OBJECT
,
1074 acpi_db_display_non_root_handlers
, NULL
, NULL
,
1078 /*******************************************************************************
1080 * FUNCTION: acpi_db_display_non_root_handlers
1082 * PARAMETERS: acpi_walk_callback
1086 * DESCRIPTION: Display information about all handlers installed for a
1089 ******************************************************************************/
1092 acpi_db_display_non_root_handlers(acpi_handle obj_handle
,
1094 void *context
, void **return_value
)
1096 struct acpi_namespace_node
*node
=
1097 ACPI_CAST_PTR(struct acpi_namespace_node
, obj_handle
);
1098 union acpi_operand_object
*obj_desc
;
1099 union acpi_operand_object
*handler_obj
;
1102 obj_desc
= acpi_ns_get_attached_object(node
);
1107 pathname
= acpi_ns_get_normalized_pathname(node
, TRUE
);
1112 /* Display all handlers associated with this device */
1114 handler_obj
= obj_desc
->common_notify
.handler
;
1115 while (handler_obj
) {
1116 acpi_os_printf(ACPI_PREDEFINED_PREFIX
,
1117 acpi_ut_get_region_name((u8
)handler_obj
->
1118 address_space
.space_id
),
1119 handler_obj
->address_space
.space_id
);
1121 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING2
,
1122 (handler_obj
->address_space
.handler_flags
&
1123 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED
) ? "Default"
1124 : "User", handler_obj
->address_space
.handler
);
1126 acpi_os_printf(" Device Name: %s (%p)\n", pathname
, node
);
1128 handler_obj
= handler_obj
->address_space
.next
;
1131 ACPI_FREE(pathname
);