1 /*******************************************************************************
3 * Module Name: dbdisply - debug display commands
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2017, 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 <contrib/dev/acpica/include/acpi.h>
45 #include <contrib/dev/acpica/include/accommon.h>
46 #include <contrib/dev/acpica/include/amlcode.h>
47 #include <contrib/dev/acpica/include/acdispat.h>
48 #include <contrib/dev/acpica/include/acnamesp.h>
49 #include <contrib/dev/acpica/include/acparser.h>
50 #include <contrib/dev/acpica/include/acinterp.h>
51 #include <contrib/dev/acpica/include/acevents.h>
52 #include <contrib/dev/acpica/include/acdebug.h>
55 #define _COMPONENT ACPI_CA_DEBUGGER
56 ACPI_MODULE_NAME ("dbdisply")
58 /* Local prototypes */
61 AcpiDbDumpParserDescriptor (
62 ACPI_PARSE_OBJECT *Op);
69 AcpiDbDisplayNonRootHandlers (
70 ACPI_HANDLE ObjHandle,
76 * System handler information.
77 * Used for Handlers command, in AcpiDbDisplayHandlers.
79 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
80 #define ACPI_HANDLER_NAME_STRING "%30s : "
81 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
82 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
83 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
85 /* All predefined Address Space IDs */
87 static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
89 ACPI_ADR_SPACE_SYSTEM_MEMORY,
90 ACPI_ADR_SPACE_SYSTEM_IO,
91 ACPI_ADR_SPACE_PCI_CONFIG,
95 ACPI_ADR_SPACE_PCI_BAR_TARGET,
99 ACPI_ADR_SPACE_DATA_TABLE,
100 ACPI_ADR_SPACE_FIXED_HARDWARE
103 /* Global handler information */
105 typedef struct acpi_handler_info
112 static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
114 {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
115 {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
116 {&AcpiGbl_TableHandler, "ACPI Table Events"},
117 {&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
118 {&AcpiGbl_InterfaceHandler, "OSI Invocations"}
122 /*******************************************************************************
124 * FUNCTION: AcpiDbGetPointer
126 * PARAMETERS: Target - Pointer to string to be converted
128 * RETURN: Converted pointer
130 * DESCRIPTION: Convert an ascii pointer value to a real value
132 ******************************************************************************/
142 Address = strtoul (Target, NULL, 16);
143 ObjPtr = ACPI_TO_POINTER (Address);
148 /*******************************************************************************
150 * FUNCTION: AcpiDbDumpParserDescriptor
152 * PARAMETERS: Op - A parser Op descriptor
156 * DESCRIPTION: Display a formatted parser object
158 ******************************************************************************/
161 AcpiDbDumpParserDescriptor (
162 ACPI_PARSE_OBJECT *Op)
164 const ACPI_OPCODE_INFO *Info;
167 Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
169 AcpiOsPrintf ("Parser Op Descriptor:\n");
170 AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
172 ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name",
175 AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
176 AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
177 AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
181 /*******************************************************************************
183 * FUNCTION: AcpiDbDecodeAndDisplayObject
185 * PARAMETERS: Target - String with object to be displayed. Names
186 * and hex pointers are supported.
187 * OutputType - Byte, Word, Dword, or Qword (B|W|D|Q)
191 * DESCRIPTION: Display a formatted ACPI object
193 ******************************************************************************/
196 AcpiDbDecodeAndDisplayObject (
201 ACPI_NAMESPACE_NODE *Node;
202 ACPI_OPERAND_OBJECT *ObjDesc;
203 UINT32 Display = DB_BYTE_DISPLAY;
215 /* Decode the output type */
219 AcpiUtStrupr (OutputType);
220 if (OutputType[0] == 'W')
222 Display = DB_WORD_DISPLAY;
224 else if (OutputType[0] == 'D')
226 Display = DB_DWORD_DISPLAY;
228 else if (OutputType[0] == 'Q')
230 Display = DB_QWORD_DISPLAY;
234 RetBuf.Length = sizeof (Buffer);
235 RetBuf.Pointer = Buffer;
237 /* Differentiate between a number and a name */
239 if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
241 ObjPtr = AcpiDbGetPointer (Target);
242 if (!AcpiOsReadable (ObjPtr, 16))
245 "Address %p is invalid in this address space\n",
250 /* Decode the object type */
252 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
254 case ACPI_DESC_TYPE_NAMED:
256 /* This is a namespace Node */
258 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
261 "Cannot read entire Named object at address %p\n",
269 case ACPI_DESC_TYPE_OPERAND:
271 /* This is a ACPI OPERAND OBJECT */
273 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
276 "Cannot read entire ACPI object at address %p\n",
281 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT),
282 Display, ACPI_UINT32_MAX);
283 AcpiExDumpObjectDescriptor (ObjPtr, 1);
286 case ACPI_DESC_TYPE_PARSER:
288 /* This is a Parser Op object */
290 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
293 "Cannot read entire Parser object at address %p\n",
298 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT),
299 Display, ACPI_UINT32_MAX);
300 AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
305 /* Is not a recognizeable object */
308 "Not a known ACPI internal object, descriptor type %2.2X\n",
309 ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
312 if (AcpiOsReadable (ObjPtr, 64))
317 /* Just dump some memory */
319 AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
326 /* The parameter is a name string that must be resolved to a Named obj */
328 Node = AcpiDbLocalNsLookup (Target);
336 /* Now dump the NS node */
338 Status = AcpiGetName (Node, ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
339 if (ACPI_FAILURE (Status))
341 AcpiOsPrintf ("Could not convert name to pathname\n");
346 AcpiOsPrintf ("Object (%p) Pathname: %s\n",
347 Node, (char *) RetBuf.Pointer);
350 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
352 AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
356 AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
357 Display, ACPI_UINT32_MAX);
358 AcpiExDumpNamespaceNode (Node, 1);
360 ObjDesc = AcpiNsGetAttachedObject (Node);
363 AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
364 if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
366 AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
371 AcpiUtDebugDumpBuffer ((void *) ObjDesc,
372 sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
373 AcpiExDumpObjectDescriptor (ObjDesc, 1);
378 /*******************************************************************************
380 * FUNCTION: AcpiDbDisplayMethodInfo
382 * PARAMETERS: StartOp - Root of the control method parse tree
386 * DESCRIPTION: Display information about the current method
388 ******************************************************************************/
391 AcpiDbDisplayMethodInfo (
392 ACPI_PARSE_OBJECT *StartOp)
394 ACPI_WALK_STATE *WalkState;
395 ACPI_OPERAND_OBJECT *ObjDesc;
396 ACPI_NAMESPACE_NODE *Node;
397 ACPI_PARSE_OBJECT *RootOp;
398 ACPI_PARSE_OBJECT *Op;
399 const ACPI_OPCODE_INFO *OpInfo;
401 UINT32 NumOperands = 0;
402 UINT32 NumOperators = 0;
403 UINT32 NumRemainingOps = 0;
404 UINT32 NumRemainingOperands = 0;
405 UINT32 NumRemainingOperators = 0;
406 BOOLEAN CountRemaining = FALSE;
409 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
412 AcpiOsPrintf ("There is no method currently executing\n");
416 ObjDesc = WalkState->MethodDesc;
417 Node = WalkState->MethodNode;
419 AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
420 AcpiUtGetNodeName (Node));
421 AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
422 (UINT32) ObjDesc->Method.ParamCount,
423 (UINT32) ObjDesc->Method.SyncLevel);
426 while (RootOp->Common.Parent)
428 RootOp = RootOp->Common.Parent;
437 CountRemaining = TRUE;
446 /* Decode the opcode */
448 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
449 switch (OpInfo->Class)
451 case AML_CLASS_ARGUMENT:
455 NumRemainingOperands++;
461 case AML_CLASS_UNKNOWN:
463 /* Bad opcode or ASCII character */
471 NumRemainingOperators++;
478 Op = AcpiPsGetDepthNext (StartOp, Op);
482 "Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
483 NumOps, NumOperators, NumOperands);
486 "Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
487 NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
491 /*******************************************************************************
493 * FUNCTION: AcpiDbDisplayLocals
499 * DESCRIPTION: Display all locals for the currently running control method
501 ******************************************************************************/
504 AcpiDbDisplayLocals (
507 ACPI_WALK_STATE *WalkState;
510 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
513 AcpiOsPrintf ("There is no method currently executing\n");
517 AcpiDbDecodeLocals (WalkState);
521 /*******************************************************************************
523 * FUNCTION: AcpiDbDisplayArguments
529 * DESCRIPTION: Display all arguments for the currently running control method
531 ******************************************************************************/
534 AcpiDbDisplayArguments (
537 ACPI_WALK_STATE *WalkState;
540 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
543 AcpiOsPrintf ("There is no method currently executing\n");
547 AcpiDbDecodeArguments (WalkState);
551 /*******************************************************************************
553 * FUNCTION: AcpiDbDisplayResults
559 * DESCRIPTION: Display current contents of a method result stack
561 ******************************************************************************/
564 AcpiDbDisplayResults (
568 ACPI_WALK_STATE *WalkState;
569 ACPI_OPERAND_OBJECT *ObjDesc;
570 UINT32 ResultCount = 0;
571 ACPI_NAMESPACE_NODE *Node;
572 ACPI_GENERIC_STATE *Frame;
573 UINT32 Index; /* Index onto current frame */
576 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
579 AcpiOsPrintf ("There is no method currently executing\n");
583 ObjDesc = WalkState->MethodDesc;
584 Node = WalkState->MethodNode;
586 if (WalkState->Results)
588 ResultCount = WalkState->ResultCount;
591 AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
592 AcpiUtGetNodeName (Node), ResultCount);
594 /* From the top element of result stack */
596 Frame = WalkState->Results;
597 Index = (ResultCount - 1) % ACPI_RESULTS_FRAME_OBJ_NUM;
599 for (i = 0; i < ResultCount; i++)
601 ObjDesc = Frame->Results.ObjDesc[Index];
602 AcpiOsPrintf ("Result%u: ", i);
603 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
607 Frame = Frame->Results.Next;
608 Index = ACPI_RESULTS_FRAME_OBJ_NUM;
616 /*******************************************************************************
618 * FUNCTION: AcpiDbDisplayCallingTree
624 * DESCRIPTION: Display current calling tree of nested control methods
626 ******************************************************************************/
629 AcpiDbDisplayCallingTree (
632 ACPI_WALK_STATE *WalkState;
633 ACPI_NAMESPACE_NODE *Node;
636 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
639 AcpiOsPrintf ("There is no method currently executing\n");
643 Node = WalkState->MethodNode;
644 AcpiOsPrintf ("Current Control Method Call Tree\n");
648 Node = WalkState->MethodNode;
649 AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node));
651 WalkState = WalkState->Next;
656 /*******************************************************************************
658 * FUNCTION: AcpiDbDisplayObjectType
660 * PARAMETERS: ObjectArg - User entered NS node handle
664 * DESCRIPTION: Display type of an arbitrary NS node
666 ******************************************************************************/
669 AcpiDbDisplayObjectType (
674 ACPI_DEVICE_INFO *Info;
679 Arg = strtoul (ObjectArg, NULL, 16);
680 Handle = ACPI_TO_POINTER (Arg);
682 Status = AcpiGetObjectInfo (Handle, &Info);
683 if (ACPI_FAILURE (Status))
685 AcpiOsPrintf ("Could not get object info, %s\n",
686 AcpiFormatException (Status));
690 AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
691 ACPI_FORMAT_UINT64 (Info->Address),
692 Info->CurrentStatus, Info->Flags);
694 AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
695 Info->HighestDstates[0], Info->HighestDstates[1],
696 Info->HighestDstates[2], Info->HighestDstates[3]);
698 AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
699 Info->LowestDstates[0], Info->LowestDstates[1],
700 Info->LowestDstates[2], Info->LowestDstates[3],
701 Info->LowestDstates[4]);
703 if (Info->Valid & ACPI_VALID_HID)
705 AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
708 if (Info->Valid & ACPI_VALID_UID)
710 AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
713 if (Info->Valid & ACPI_VALID_CID)
715 for (i = 0; i < Info->CompatibleIdList.Count; i++)
717 AcpiOsPrintf ("CID %u: %s\n", i,
718 Info->CompatibleIdList.Ids[i].String);
726 /*******************************************************************************
728 * FUNCTION: AcpiDbDisplayResultObject
730 * PARAMETERS: ObjDesc - Object to be displayed
731 * WalkState - Current walk state
735 * DESCRIPTION: Display the result of an AML opcode
737 * Note: Curently only displays the result object if we are single stepping.
738 * However, this output may be useful in other contexts and could be enabled
739 * to do so if needed.
741 ******************************************************************************/
744 AcpiDbDisplayResultObject (
745 ACPI_OPERAND_OBJECT *ObjDesc,
746 ACPI_WALK_STATE *WalkState)
749 #ifndef ACPI_APPLICATION
750 if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
756 /* Only display if single stepping */
758 if (!AcpiGbl_CmSingleStep)
763 AcpiOsPrintf ("ResultObj: ");
764 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
769 /*******************************************************************************
771 * FUNCTION: AcpiDbDisplayArgumentObject
773 * PARAMETERS: ObjDesc - Object to be displayed
774 * WalkState - Current walk state
778 * DESCRIPTION: Display the result of an AML opcode
780 ******************************************************************************/
783 AcpiDbDisplayArgumentObject (
784 ACPI_OPERAND_OBJECT *ObjDesc,
785 ACPI_WALK_STATE *WalkState)
788 #ifndef ACPI_APPLICATION
789 if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
795 if (!AcpiGbl_CmSingleStep)
800 AcpiOsPrintf ("ArgObj: ");
801 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
805 #if (!ACPI_REDUCED_HARDWARE)
806 /*******************************************************************************
808 * FUNCTION: AcpiDbDisplayGpes
814 * DESCRIPTION: Display the current GPE structures
816 ******************************************************************************/
822 ACPI_GPE_BLOCK_INFO *GpeBlock;
823 ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
824 ACPI_GPE_EVENT_INFO *GpeEventInfo;
825 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
827 ACPI_GPE_NOTIFY_INFO *Notify;
838 RetBuf.Length = sizeof (Buffer);
839 RetBuf.Pointer = Buffer;
843 /* Walk the GPE lists */
845 GpeXruptInfo = AcpiGbl_GpeXruptListHead;
848 GpeBlock = GpeXruptInfo->GpeBlockListHead;
851 Status = AcpiGetName (GpeBlock->Node,
852 ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
853 if (ACPI_FAILURE (Status))
855 AcpiOsPrintf ("Could not convert name to pathname\n");
858 if (GpeBlock->Node == AcpiGbl_FadtGpeDevice)
860 GpeType = "FADT-defined GPE block";
864 GpeType = "GPE Block Device";
868 "\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
869 Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
872 " Registers: %u (%u GPEs)\n",
873 GpeBlock->RegisterCount, GpeBlock->GpeCount);
876 " GPE range: 0x%X to 0x%X on interrupt %u\n",
877 GpeBlock->BlockBaseNumber,
878 GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),
879 GpeXruptInfo->InterruptNumber);
882 " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
883 GpeBlock->RegisterInfo,
885 GpeBlock->RegisterInfo->StatusAddress.Address),
887 GpeBlock->RegisterInfo->EnableAddress.Address));
889 AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo);
891 /* Examine each GPE Register within the block */
893 for (i = 0; i < GpeBlock->RegisterCount; i++)
895 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
898 " Reg %u: (GPE %.2X-%.2X) "
899 "RunEnable %2.2X WakeEnable %2.2X"
900 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
901 i, GpeRegisterInfo->BaseGpeNumber,
902 GpeRegisterInfo->BaseGpeNumber +
903 (ACPI_GPE_REGISTER_WIDTH - 1),
904 GpeRegisterInfo->EnableForRun,
905 GpeRegisterInfo->EnableForWake,
907 GpeRegisterInfo->StatusAddress.Address),
909 GpeRegisterInfo->EnableAddress.Address));
911 /* Now look at the individual GPEs in this byte register */
913 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
915 GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
916 GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
918 if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
919 ACPI_GPE_DISPATCH_NONE)
921 /* This GPE is not used (no method or handler), ignore it */
927 " GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
928 GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
929 GpeEventInfo->RuntimeCount, GpeEventInfo->Flags);
931 /* Decode the flags byte */
933 if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED)
935 AcpiOsPrintf ("Level, ");
939 AcpiOsPrintf ("Edge, ");
942 if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
944 AcpiOsPrintf ("CanWake, ");
948 AcpiOsPrintf ("RunOnly, ");
951 switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
953 case ACPI_GPE_DISPATCH_NONE:
955 AcpiOsPrintf ("NotUsed");
958 case ACPI_GPE_DISPATCH_METHOD:
960 AcpiOsPrintf ("Method");
963 case ACPI_GPE_DISPATCH_HANDLER:
965 AcpiOsPrintf ("Handler");
968 case ACPI_GPE_DISPATCH_NOTIFY:
971 Notify = GpeEventInfo->Dispatch.NotifyList;
975 Notify = Notify->Next;
978 AcpiOsPrintf ("Implicit Notify on %u devices",
982 case ACPI_GPE_DISPATCH_RAW_HANDLER:
984 AcpiOsPrintf ("RawHandler");
989 AcpiOsPrintf ("UNKNOWN: %X",
990 ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags));
994 AcpiOsPrintf (")\n");
999 GpeBlock = GpeBlock->Next;
1002 GpeXruptInfo = GpeXruptInfo->Next;
1005 #endif /* !ACPI_REDUCED_HARDWARE */
1008 /*******************************************************************************
1010 * FUNCTION: AcpiDbDisplayHandlers
1016 * DESCRIPTION: Display the currently installed global handlers
1018 ******************************************************************************/
1021 AcpiDbDisplayHandlers (
1024 ACPI_OPERAND_OBJECT *ObjDesc;
1025 ACPI_OPERAND_OBJECT *HandlerObj;
1026 ACPI_ADR_SPACE_TYPE SpaceId;
1030 /* Operation region handlers */
1032 AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n");
1034 ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
1037 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
1039 SpaceId = AcpiGbl_SpaceIdList[i];
1041 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1042 AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
1044 HandlerObj = AcpiEvFindRegionHandler (
1045 SpaceId, ObjDesc->CommonNotify.Handler);
1048 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1049 (HandlerObj->AddressSpace.HandlerFlags &
1050 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ?
1052 HandlerObj->AddressSpace.Handler);
1057 /* There is no handler for this SpaceId */
1059 AcpiOsPrintf ("None\n");
1064 /* Find all handlers for user-defined SpaceIDs */
1066 HandlerObj = ObjDesc->CommonNotify.Handler;
1069 if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
1071 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1072 "User-defined ID", HandlerObj->AddressSpace.SpaceId);
1073 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1074 (HandlerObj->AddressSpace.HandlerFlags &
1075 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ?
1077 HandlerObj->AddressSpace.Handler);
1080 HandlerObj = HandlerObj->AddressSpace.Next;
1084 #if (!ACPI_REDUCED_HARDWARE)
1086 /* Fixed event handlers */
1088 AcpiOsPrintf ("\nFixed Event Handlers:\n");
1090 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
1092 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);
1093 if (AcpiGbl_FixedEventHandlers[i].Handler)
1095 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1096 AcpiGbl_FixedEventHandlers[i].Handler);
1100 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1104 #endif /* !ACPI_REDUCED_HARDWARE */
1106 /* Miscellaneous global handlers */
1108 AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
1110 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
1112 AcpiOsPrintf (ACPI_HANDLER_NAME_STRING,
1113 AcpiGbl_HandlerList[i].Name);
1115 if (AcpiGbl_HandlerList[i].Handler)
1117 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1118 AcpiGbl_HandlerList[i].Handler);
1122 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1127 /* Other handlers that are installed throughout the namespace */
1129 AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
1131 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1132 ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
1137 /*******************************************************************************
1139 * FUNCTION: AcpiDbDisplayNonRootHandlers
1141 * PARAMETERS: ACPI_WALK_CALLBACK
1145 * DESCRIPTION: Display information about all handlers installed for a
1148 ******************************************************************************/
1151 AcpiDbDisplayNonRootHandlers (
1152 ACPI_HANDLE ObjHandle,
1153 UINT32 NestingLevel,
1157 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
1158 ACPI_OPERAND_OBJECT *ObjDesc;
1159 ACPI_OPERAND_OBJECT *HandlerObj;
1163 ObjDesc = AcpiNsGetAttachedObject (Node);
1169 Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
1175 /* Display all handlers associated with this device */
1177 HandlerObj = ObjDesc->CommonNotify.Handler;
1180 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1181 AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId),
1182 HandlerObj->AddressSpace.SpaceId);
1184 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2,
1185 (HandlerObj->AddressSpace.HandlerFlags &
1186 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1187 HandlerObj->AddressSpace.Handler);
1189 AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node);
1191 HandlerObj = HandlerObj->AddressSpace.Next;
1194 ACPI_FREE (Pathname);