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>
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) 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):\n", 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 acpi_ut_debug_dump_buffer((void *)obj_desc,
339 sizeof(union acpi_operand_object),
340 display, ACPI_UINT32_MAX);
341 acpi_ex_dump_object_descriptor(obj_desc, 1);
345 /*******************************************************************************
347 * FUNCTION: acpi_db_display_method_info
349 * PARAMETERS: start_op - Root of the control method parse tree
353 * DESCRIPTION: Display information about the current method
355 ******************************************************************************/
357 void acpi_db_display_method_info(union acpi_parse_object *start_op)
359 struct acpi_walk_state *walk_state;
360 union acpi_operand_object *obj_desc;
361 struct acpi_namespace_node *node;
362 union acpi_parse_object *root_op;
363 union acpi_parse_object *op;
364 const struct acpi_opcode_info *op_info;
366 u32 num_operands = 0;
367 u32 num_operators = 0;
368 u32 num_remaining_ops = 0;
369 u32 num_remaining_operands = 0;
370 u32 num_remaining_operators = 0;
371 u8 count_remaining = FALSE;
373 walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
375 acpi_os_printf("There is no method currently executing\n");
379 obj_desc = walk_state->method_desc;
380 node = walk_state->method_node;
382 acpi_os_printf("Currently executing control method is [%4.4s]\n",
383 acpi_ut_get_node_name(node));
384 acpi_os_printf("%X Arguments, SyncLevel = %X\n",
385 (u32)obj_desc->method.param_count,
386 (u32)obj_desc->method.sync_level);
389 while (root_op->common.parent) {
390 root_op = root_op->common.parent;
396 if (op == start_op) {
397 count_remaining = TRUE;
401 if (count_remaining) {
405 /* Decode the opcode */
407 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
408 switch (op_info->class) {
409 case AML_CLASS_ARGUMENT:
411 if (count_remaining) {
412 num_remaining_operands++;
418 case AML_CLASS_UNKNOWN:
420 /* Bad opcode or ASCII character */
426 if (count_remaining) {
427 num_remaining_operators++;
434 op = acpi_ps_get_depth_next(start_op, op);
438 ("Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
439 num_ops, num_operators, num_operands);
442 ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
443 num_remaining_ops, num_remaining_operators,
444 num_remaining_operands);
447 /*******************************************************************************
449 * FUNCTION: acpi_db_display_locals
455 * DESCRIPTION: Display all locals for the currently running control method
457 ******************************************************************************/
459 void acpi_db_display_locals(void)
461 struct acpi_walk_state *walk_state;
463 walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
465 acpi_os_printf("There is no method currently executing\n");
469 acpi_db_decode_locals(walk_state);
472 /*******************************************************************************
474 * FUNCTION: acpi_db_display_arguments
480 * DESCRIPTION: Display all arguments for the currently running control method
482 ******************************************************************************/
484 void acpi_db_display_arguments(void)
486 struct acpi_walk_state *walk_state;
488 walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
490 acpi_os_printf("There is no method currently executing\n");
494 acpi_db_decode_arguments(walk_state);
497 /*******************************************************************************
499 * FUNCTION: acpi_db_display_results
505 * DESCRIPTION: Display current contents of a method result stack
507 ******************************************************************************/
509 void acpi_db_display_results(void)
512 struct acpi_walk_state *walk_state;
513 union acpi_operand_object *obj_desc;
514 u32 result_count = 0;
515 struct acpi_namespace_node *node;
516 union acpi_generic_state *frame;
517 u32 index; /* Index onto current frame */
519 walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
521 acpi_os_printf("There is no method currently executing\n");
525 obj_desc = walk_state->method_desc;
526 node = walk_state->method_node;
528 if (walk_state->results) {
529 result_count = walk_state->result_count;
532 acpi_os_printf("Method [%4.4s] has %X stacked result objects\n",
533 acpi_ut_get_node_name(node), result_count);
535 /* From the top element of result stack */
537 frame = walk_state->results;
538 index = (result_count - 1) % ACPI_RESULTS_FRAME_OBJ_NUM;
540 for (i = 0; i < result_count; i++) {
541 obj_desc = frame->results.obj_desc[index];
542 acpi_os_printf("Result%u: ", i);
543 acpi_db_display_internal_object(obj_desc, walk_state);
546 frame = frame->results.next;
547 index = ACPI_RESULTS_FRAME_OBJ_NUM;
554 /*******************************************************************************
556 * FUNCTION: acpi_db_display_calling_tree
562 * DESCRIPTION: Display current calling tree of nested control methods
564 ******************************************************************************/
566 void acpi_db_display_calling_tree(void)
568 struct acpi_walk_state *walk_state;
569 struct acpi_namespace_node *node;
571 walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
573 acpi_os_printf("There is no method currently executing\n");
577 node = walk_state->method_node;
578 acpi_os_printf("Current Control Method Call Tree\n");
581 node = walk_state->method_node;
582 acpi_os_printf(" [%4.4s]\n", acpi_ut_get_node_name(node));
584 walk_state = walk_state->next;
588 /*******************************************************************************
590 * FUNCTION: acpi_db_display_object_type
592 * PARAMETERS: object_arg - User entered NS node handle
596 * DESCRIPTION: Display type of an arbitrary NS node
598 ******************************************************************************/
600 void acpi_db_display_object_type(char *object_arg)
603 struct acpi_device_info *info;
607 handle = ACPI_TO_POINTER(strtoul(object_arg, NULL, 16));
609 status = acpi_get_object_info(handle, &info);
610 if (ACPI_FAILURE(status)) {
611 acpi_os_printf("Could not get object info, %s\n",
612 acpi_format_exception(status));
616 acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
617 ACPI_FORMAT_UINT64(info->address),
618 info->current_status, info->flags);
620 acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
621 info->highest_dstates[0], info->highest_dstates[1],
622 info->highest_dstates[2], info->highest_dstates[3]);
624 acpi_os_printf("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
625 info->lowest_dstates[0], info->lowest_dstates[1],
626 info->lowest_dstates[2], info->lowest_dstates[3],
627 info->lowest_dstates[4]);
629 if (info->valid & ACPI_VALID_HID) {
630 acpi_os_printf("HID: %s\n", info->hardware_id.string);
633 if (info->valid & ACPI_VALID_UID) {
634 acpi_os_printf("UID: %s\n", info->unique_id.string);
637 if (info->valid & ACPI_VALID_CID) {
638 for (i = 0; i < info->compatible_id_list.count; i++) {
639 acpi_os_printf("CID %u: %s\n", i,
640 info->compatible_id_list.ids[i].string);
647 /*******************************************************************************
649 * FUNCTION: acpi_db_display_result_object
651 * PARAMETERS: obj_desc - Object to be displayed
652 * walk_state - Current walk state
656 * DESCRIPTION: Display the result of an AML opcode
658 * Note: Curently only displays the result object if we are single stepping.
659 * However, this output may be useful in other contexts and could be enabled
660 * to do so if needed.
662 ******************************************************************************/
665 acpi_db_display_result_object(union acpi_operand_object *obj_desc,
666 struct acpi_walk_state *walk_state)
669 #ifndef ACPI_APPLICATION
670 if (acpi_gbl_db_thread_id != acpi_os_get_thread_id()) {
675 /* Only display if single stepping */
677 if (!acpi_gbl_cm_single_step) {
681 acpi_os_printf("ResultObj: ");
682 acpi_db_display_internal_object(obj_desc, walk_state);
683 acpi_os_printf("\n");
686 /*******************************************************************************
688 * FUNCTION: acpi_db_display_argument_object
690 * PARAMETERS: obj_desc - Object to be displayed
691 * walk_state - Current walk state
695 * DESCRIPTION: Display the result of an AML opcode
697 ******************************************************************************/
700 acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
701 struct acpi_walk_state *walk_state)
704 #ifndef ACPI_APPLICATION
705 if (acpi_gbl_db_thread_id != acpi_os_get_thread_id()) {
710 if (!acpi_gbl_cm_single_step) {
714 acpi_os_printf("ArgObj: ");
715 acpi_db_display_internal_object(obj_desc, walk_state);
718 #if (!ACPI_REDUCED_HARDWARE)
719 /*******************************************************************************
721 * FUNCTION: acpi_db_display_gpes
727 * DESCRIPTION: Display the current GPE structures
729 ******************************************************************************/
731 void acpi_db_display_gpes(void)
733 struct acpi_gpe_block_info *gpe_block;
734 struct acpi_gpe_xrupt_info *gpe_xrupt_info;
735 struct acpi_gpe_event_info *gpe_event_info;
736 struct acpi_gpe_register_info *gpe_register_info;
738 struct acpi_gpe_notify_info *notify;
745 struct acpi_buffer ret_buf;
748 ret_buf.length = sizeof(buffer);
749 ret_buf.pointer = buffer;
753 /* Walk the GPE lists */
755 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
756 while (gpe_xrupt_info) {
757 gpe_block = gpe_xrupt_info->gpe_block_list_head;
759 status = acpi_get_name(gpe_block->node,
760 ACPI_FULL_PATHNAME_NO_TRAILING,
762 if (ACPI_FAILURE(status)) {
764 ("Could not convert name to pathname\n");
767 if (gpe_block->node == acpi_gbl_fadt_gpe_device) {
768 gpe_type = "FADT-defined GPE block";
770 gpe_type = "GPE Block Device";
774 ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
775 block, gpe_block, gpe_block->node, buffer,
778 acpi_os_printf(" Registers: %u (%u GPEs)\n",
779 gpe_block->register_count,
780 gpe_block->gpe_count);
783 (" GPE range: 0x%X to 0x%X on interrupt %u\n",
784 gpe_block->block_base_number,
785 gpe_block->block_base_number +
786 (gpe_block->gpe_count - 1),
787 gpe_xrupt_info->interrupt_number);
790 (" RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
791 gpe_block->register_info,
792 ACPI_FORMAT_UINT64(gpe_block->register_info->
793 status_address.address),
794 ACPI_FORMAT_UINT64(gpe_block->register_info->
795 enable_address.address));
797 acpi_os_printf(" EventInfo: %p\n",
798 gpe_block->event_info);
800 /* Examine each GPE Register within the block */
802 for (i = 0; i < gpe_block->register_count; i++) {
804 &gpe_block->register_info[i];
806 acpi_os_printf(" Reg %u: (GPE %.2X-%.2X) "
807 "RunEnable %2.2X WakeEnable %2.2X"
808 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
814 (ACPI_GPE_REGISTER_WIDTH - 1),
821 status_address.address),
824 enable_address.address));
826 /* Now look at the individual GPEs in this byte register */
828 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
830 (i * ACPI_GPE_REGISTER_WIDTH) + j;
832 &gpe_block->event_info[gpe_index];
834 if (ACPI_GPE_DISPATCH_TYPE
835 (gpe_event_info->flags) ==
836 ACPI_GPE_DISPATCH_NONE) {
838 /* This GPE is not used (no method or handler), ignore it */
844 (" GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
845 gpe_block->block_base_number +
846 gpe_index, gpe_event_info,
847 gpe_event_info->runtime_count,
848 gpe_event_info->flags);
850 /* Decode the flags byte */
853 flags & ACPI_GPE_LEVEL_TRIGGERED) {
854 acpi_os_printf("Level, ");
856 acpi_os_printf("Edge, ");
860 flags & ACPI_GPE_CAN_WAKE) {
861 acpi_os_printf("CanWake, ");
863 acpi_os_printf("RunOnly, ");
866 switch (ACPI_GPE_DISPATCH_TYPE
867 (gpe_event_info->flags)) {
868 case ACPI_GPE_DISPATCH_NONE:
870 acpi_os_printf("NotUsed");
873 case ACPI_GPE_DISPATCH_METHOD:
875 acpi_os_printf("Method");
878 case ACPI_GPE_DISPATCH_HANDLER:
880 acpi_os_printf("Handler");
883 case ACPI_GPE_DISPATCH_NOTIFY:
887 gpe_event_info->dispatch.
891 notify = notify->next;
895 ("Implicit Notify on %u devices",
899 case ACPI_GPE_DISPATCH_RAW_HANDLER:
901 acpi_os_printf("RawHandler");
906 acpi_os_printf("UNKNOWN: %X",
907 ACPI_GPE_DISPATCH_TYPE
913 acpi_os_printf(")\n");
918 gpe_block = gpe_block->next;
921 gpe_xrupt_info = gpe_xrupt_info->next;
924 #endif /* !ACPI_REDUCED_HARDWARE */
926 /*******************************************************************************
928 * FUNCTION: acpi_db_display_handlers
934 * DESCRIPTION: Display the currently installed global handlers
936 ******************************************************************************/
938 void acpi_db_display_handlers(void)
940 union acpi_operand_object *obj_desc;
941 union acpi_operand_object *handler_obj;
942 acpi_adr_space_type space_id;
945 /* Operation region handlers */
947 acpi_os_printf("\nOperation Region Handlers at the namespace root:\n");
949 obj_desc = acpi_ns_get_attached_object(acpi_gbl_root_node);
951 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_gbl_space_id_list); i++) {
952 space_id = acpi_gbl_space_id_list[i];
954 acpi_os_printf(ACPI_PREDEFINED_PREFIX,
955 acpi_ut_get_region_name((u8)space_id),
959 acpi_ev_find_region_handler(space_id,
960 obj_desc->common_notify.
963 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING,
964 (handler_obj->address_space.
966 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
967 ? "Default" : "User",
968 handler_obj->address_space.
974 /* There is no handler for this space_id */
976 acpi_os_printf("None\n");
981 /* Find all handlers for user-defined space_IDs */
983 handler_obj = obj_desc->common_notify.handler;
984 while (handler_obj) {
985 if (handler_obj->address_space.space_id >=
986 ACPI_USER_REGION_BEGIN) {
987 acpi_os_printf(ACPI_PREDEFINED_PREFIX,
989 handler_obj->address_space.
991 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING,
992 (handler_obj->address_space.
994 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
995 ? "Default" : "User",
996 handler_obj->address_space.
1000 handler_obj = handler_obj->address_space.next;
1003 #if (!ACPI_REDUCED_HARDWARE)
1005 /* Fixed event handlers */
1007 acpi_os_printf("\nFixed Event Handlers:\n");
1009 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
1010 acpi_os_printf(ACPI_PREDEFINED_PREFIX,
1011 acpi_ut_get_event_name(i), i);
1012 if (acpi_gbl_fixed_event_handlers[i].handler) {
1013 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING, "User",
1014 acpi_gbl_fixed_event_handlers[i].
1017 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1021 #endif /* !ACPI_REDUCED_HARDWARE */
1023 /* Miscellaneous global handlers */
1025 acpi_os_printf("\nMiscellaneous Global Handlers:\n");
1027 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_gbl_handler_list); i++) {
1028 acpi_os_printf(ACPI_HANDLER_NAME_STRING,
1029 acpi_gbl_handler_list[i].name);
1031 if (acpi_gbl_handler_list[i].handler) {
1032 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING, "User",
1033 acpi_gbl_handler_list[i].handler);
1035 acpi_os_printf(ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1039 /* Other handlers that are installed throughout the namespace */
1041 acpi_os_printf("\nOperation Region Handlers for specific devices:\n");
1043 (void)acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1045 acpi_db_display_non_root_handlers, NULL, NULL,
1049 /*******************************************************************************
1051 * FUNCTION: acpi_db_display_non_root_handlers
1053 * PARAMETERS: acpi_walk_callback
1057 * DESCRIPTION: Display information about all handlers installed for a
1060 ******************************************************************************/
1063 acpi_db_display_non_root_handlers(acpi_handle obj_handle,
1065 void *context, void **return_value)
1067 struct acpi_namespace_node *node =
1068 ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
1069 union acpi_operand_object *obj_desc;
1070 union acpi_operand_object *handler_obj;
1073 obj_desc = acpi_ns_get_attached_object(node);
1078 pathname = acpi_ns_get_normalized_pathname(node, TRUE);
1083 /* Display all handlers associated with this device */
1085 handler_obj = obj_desc->common_notify.handler;
1086 while (handler_obj) {
1087 acpi_os_printf(ACPI_PREDEFINED_PREFIX,
1088 acpi_ut_get_region_name((u8)handler_obj->
1089 address_space.space_id),
1090 handler_obj->address_space.space_id);
1092 acpi_os_printf(ACPI_HANDLER_PRESENT_STRING2,
1093 (handler_obj->address_space.handler_flags &
1094 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default"
1095 : "User", handler_obj->address_space.handler);
1097 acpi_os_printf(" Device Name: %s (%p)\n", pathname, node);
1099 handler_obj = handler_obj->address_space.next;
1102 ACPI_FREE(pathname);