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.
57 #define _COMPONENT ACPI_CA_DEBUGGER
58 ACPI_MODULE_NAME ("dbdisply")
60 /* Local prototypes */
63 AcpiDbDumpParserDescriptor (
64 ACPI_PARSE_OBJECT *Op);
71 AcpiDbDisplayNonRootHandlers (
72 ACPI_HANDLE ObjHandle,
78 * System handler information.
79 * Used for Handlers command, in AcpiDbDisplayHandlers.
81 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
82 #define ACPI_HANDLER_NAME_STRING "%30s : "
83 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
84 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
85 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
87 /* All predefined Address Space IDs */
89 static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
91 ACPI_ADR_SPACE_SYSTEM_MEMORY,
92 ACPI_ADR_SPACE_SYSTEM_IO,
93 ACPI_ADR_SPACE_PCI_CONFIG,
97 ACPI_ADR_SPACE_PCI_BAR_TARGET,
100 ACPI_ADR_SPACE_GSBUS,
101 ACPI_ADR_SPACE_DATA_TABLE,
102 ACPI_ADR_SPACE_FIXED_HARDWARE
105 /* Global handler information */
107 typedef struct acpi_handler_info
114 static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
116 {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
117 {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
118 {&AcpiGbl_TableHandler, "ACPI Table Events"},
119 {&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
120 {&AcpiGbl_InterfaceHandler, "OSI Invocations"}
124 /*******************************************************************************
126 * FUNCTION: AcpiDbGetPointer
128 * PARAMETERS: Target - Pointer to string to be converted
130 * RETURN: Converted pointer
132 * DESCRIPTION: Convert an ascii pointer value to a real value
134 ******************************************************************************/
144 Address = strtoul (Target, NULL, 16);
145 ObjPtr = ACPI_TO_POINTER (Address);
150 /*******************************************************************************
152 * FUNCTION: AcpiDbDumpParserDescriptor
154 * PARAMETERS: Op - A parser Op descriptor
158 * DESCRIPTION: Display a formatted parser object
160 ******************************************************************************/
163 AcpiDbDumpParserDescriptor (
164 ACPI_PARSE_OBJECT *Op)
166 const ACPI_OPCODE_INFO *Info;
169 Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
171 AcpiOsPrintf ("Parser Op Descriptor:\n");
172 AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
174 ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name",
177 AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
178 AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
179 AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
183 /*******************************************************************************
185 * FUNCTION: AcpiDbDecodeAndDisplayObject
187 * PARAMETERS: Target - String with object to be displayed. Names
188 * and hex pointers are supported.
189 * OutputType - Byte, Word, Dword, or Qword (B|W|D|Q)
193 * DESCRIPTION: Display a formatted ACPI object
195 ******************************************************************************/
198 AcpiDbDecodeAndDisplayObject (
203 ACPI_NAMESPACE_NODE *Node;
204 ACPI_OPERAND_OBJECT *ObjDesc;
205 UINT32 Display = DB_BYTE_DISPLAY;
217 /* Decode the output type */
221 AcpiUtStrupr (OutputType);
222 if (OutputType[0] == 'W')
224 Display = DB_WORD_DISPLAY;
226 else if (OutputType[0] == 'D')
228 Display = DB_DWORD_DISPLAY;
230 else if (OutputType[0] == 'Q')
232 Display = DB_QWORD_DISPLAY;
236 RetBuf.Length = sizeof (Buffer);
237 RetBuf.Pointer = Buffer;
239 /* Differentiate between a number and a name */
241 if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
243 ObjPtr = AcpiDbGetPointer (Target);
244 if (!AcpiOsReadable (ObjPtr, 16))
246 AcpiOsPrintf ("Address %p is invalid in this address space\n",
251 /* Decode the object type */
253 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
255 case ACPI_DESC_TYPE_NAMED:
257 /* This is a namespace Node */
259 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
262 "Cannot read entire Named object at address %p\n", ObjPtr);
269 case ACPI_DESC_TYPE_OPERAND:
271 /* This is a ACPI OPERAND OBJECT */
273 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
275 AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
280 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
282 AcpiExDumpObjectDescriptor (ObjPtr, 1);
285 case ACPI_DESC_TYPE_PARSER:
287 /* This is a Parser Op object */
289 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
292 "Cannot read entire Parser object at address %p\n", ObjPtr);
296 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
298 AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
303 /* Is not a recognizeable object */
306 "Not a known ACPI internal object, descriptor type %2.2X\n",
307 ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
310 if (AcpiOsReadable (ObjPtr, 64))
315 /* Just dump some memory */
317 AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
324 /* The parameter is a name string that must be resolved to a Named obj */
326 Node = AcpiDbLocalNsLookup (Target);
334 /* Now dump the NS node */
336 Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
337 if (ACPI_FAILURE (Status))
339 AcpiOsPrintf ("Could not convert name to pathname\n");
344 AcpiOsPrintf ("Object (%p) Pathname: %s\n",
345 Node, (char *) RetBuf.Pointer);
348 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
350 AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
354 AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
355 Display, ACPI_UINT32_MAX);
356 AcpiExDumpNamespaceNode (Node, 1);
358 ObjDesc = AcpiNsGetAttachedObject (Node);
361 AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
362 if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
364 AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
369 AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
370 Display, ACPI_UINT32_MAX);
371 AcpiExDumpObjectDescriptor (ObjDesc, 1);
376 /*******************************************************************************
378 * FUNCTION: AcpiDbDisplayMethodInfo
380 * PARAMETERS: StartOp - Root of the control method parse tree
384 * DESCRIPTION: Display information about the current method
386 ******************************************************************************/
389 AcpiDbDisplayMethodInfo (
390 ACPI_PARSE_OBJECT *StartOp)
392 ACPI_WALK_STATE *WalkState;
393 ACPI_OPERAND_OBJECT *ObjDesc;
394 ACPI_NAMESPACE_NODE *Node;
395 ACPI_PARSE_OBJECT *RootOp;
396 ACPI_PARSE_OBJECT *Op;
397 const ACPI_OPCODE_INFO *OpInfo;
399 UINT32 NumOperands = 0;
400 UINT32 NumOperators = 0;
401 UINT32 NumRemainingOps = 0;
402 UINT32 NumRemainingOperands = 0;
403 UINT32 NumRemainingOperators = 0;
404 BOOLEAN CountRemaining = FALSE;
407 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
410 AcpiOsPrintf ("There is no method currently executing\n");
414 ObjDesc = WalkState->MethodDesc;
415 Node = WalkState->MethodNode;
417 AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
418 AcpiUtGetNodeName (Node));
419 AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
420 (UINT32) ObjDesc->Method.ParamCount,
421 (UINT32) ObjDesc->Method.SyncLevel);
425 while (RootOp->Common.Parent)
427 RootOp = RootOp->Common.Parent;
436 CountRemaining = TRUE;
445 /* Decode the opcode */
447 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
448 switch (OpInfo->Class)
450 case AML_CLASS_ARGUMENT:
454 NumRemainingOperands++;
460 case AML_CLASS_UNKNOWN:
462 /* Bad opcode or ASCII character */
470 NumRemainingOperators++;
477 Op = AcpiPsGetDepthNext (StartOp, Op);
481 "Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
482 NumOps, NumOperators, NumOperands);
485 "Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
486 NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
490 /*******************************************************************************
492 * FUNCTION: AcpiDbDisplayLocals
498 * DESCRIPTION: Display all locals for the currently running control method
500 ******************************************************************************/
503 AcpiDbDisplayLocals (
506 ACPI_WALK_STATE *WalkState;
509 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
512 AcpiOsPrintf ("There is no method currently executing\n");
516 AcpiDmDisplayLocals (WalkState);
520 /*******************************************************************************
522 * FUNCTION: AcpiDbDisplayArguments
528 * DESCRIPTION: Display all arguments for the currently running control method
530 ******************************************************************************/
533 AcpiDbDisplayArguments (
536 ACPI_WALK_STATE *WalkState;
539 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
542 AcpiOsPrintf ("There is no method currently executing\n");
546 AcpiDmDisplayArguments (WalkState);
550 /*******************************************************************************
552 * FUNCTION: AcpiDbDisplayResults
558 * DESCRIPTION: Display current contents of a method result stack
560 ******************************************************************************/
563 AcpiDbDisplayResults (
567 ACPI_WALK_STATE *WalkState;
568 ACPI_OPERAND_OBJECT *ObjDesc;
569 UINT32 ResultCount = 0;
570 ACPI_NAMESPACE_NODE *Node;
571 ACPI_GENERIC_STATE *Frame;
572 UINT32 Index; /* Index onto current frame */
575 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
578 AcpiOsPrintf ("There is no method currently executing\n");
582 ObjDesc = WalkState->MethodDesc;
583 Node = WalkState->MethodNode;
585 if (WalkState->Results)
587 ResultCount = WalkState->ResultCount;
590 AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
591 AcpiUtGetNodeName (Node), ResultCount);
593 /* From the top element of result stack */
595 Frame = WalkState->Results;
596 Index = (ResultCount - 1) % ACPI_RESULTS_FRAME_OBJ_NUM;
598 for (i = 0; i < ResultCount; i++)
600 ObjDesc = Frame->Results.ObjDesc[Index];
601 AcpiOsPrintf ("Result%u: ", i);
602 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
605 Frame = Frame->Results.Next;
606 Index = ACPI_RESULTS_FRAME_OBJ_NUM;
613 /*******************************************************************************
615 * FUNCTION: AcpiDbDisplayCallingTree
621 * DESCRIPTION: Display current calling tree of nested control methods
623 ******************************************************************************/
626 AcpiDbDisplayCallingTree (
629 ACPI_WALK_STATE *WalkState;
630 ACPI_NAMESPACE_NODE *Node;
633 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
636 AcpiOsPrintf ("There is no method currently executing\n");
640 Node = WalkState->MethodNode;
641 AcpiOsPrintf ("Current Control Method Call Tree\n");
645 Node = WalkState->MethodNode;
647 AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node));
649 WalkState = WalkState->Next;
654 /*******************************************************************************
656 * FUNCTION: AcpiDbDisplayObjectType
658 * PARAMETERS: Name - User entered NS node handle or name
662 * DESCRIPTION: Display type of an arbitrary NS node
664 ******************************************************************************/
667 AcpiDbDisplayObjectType (
670 ACPI_NAMESPACE_NODE *Node;
671 ACPI_DEVICE_INFO *Info;
676 Node = AcpiDbConvertToNode (Name);
682 Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
683 if (ACPI_FAILURE (Status))
685 AcpiOsPrintf ("Could not get object info, %s\n",
686 AcpiFormatException (Status));
690 if (Info->Valid & ACPI_VALID_ADR)
692 AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
693 ACPI_FORMAT_UINT64 (Info->Address),
694 Info->CurrentStatus, Info->Flags);
696 if (Info->Valid & ACPI_VALID_SXDS)
698 AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
699 Info->HighestDstates[0], Info->HighestDstates[1],
700 Info->HighestDstates[2], Info->HighestDstates[3]);
702 if (Info->Valid & ACPI_VALID_SXWS)
704 AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
705 Info->LowestDstates[0], Info->LowestDstates[1],
706 Info->LowestDstates[2], Info->LowestDstates[3],
707 Info->LowestDstates[4]);
710 if (Info->Valid & ACPI_VALID_HID)
712 AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
714 if (Info->Valid & ACPI_VALID_UID)
716 AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
718 if (Info->Valid & ACPI_VALID_SUB)
720 AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
722 if (Info->Valid & ACPI_VALID_CID)
724 for (i = 0; i < Info->CompatibleIdList.Count; i++)
726 AcpiOsPrintf ("CID %u: %s\n", i,
727 Info->CompatibleIdList.Ids[i].String);
735 /*******************************************************************************
737 * FUNCTION: AcpiDbDisplayResultObject
739 * PARAMETERS: ObjDesc - Object to be displayed
740 * WalkState - Current walk state
744 * DESCRIPTION: Display the result of an AML opcode
746 * Note: Curently only displays the result object if we are single stepping.
747 * However, this output may be useful in other contexts and could be enabled
748 * to do so if needed.
750 ******************************************************************************/
753 AcpiDbDisplayResultObject (
754 ACPI_OPERAND_OBJECT *ObjDesc,
755 ACPI_WALK_STATE *WalkState)
758 /* Only display if single stepping */
760 if (!AcpiGbl_CmSingleStep)
765 AcpiOsPrintf ("ResultObj: ");
766 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
771 /*******************************************************************************
773 * FUNCTION: AcpiDbDisplayArgumentObject
775 * PARAMETERS: ObjDesc - Object to be displayed
776 * WalkState - Current walk state
780 * DESCRIPTION: Display the result of an AML opcode
782 ******************************************************************************/
785 AcpiDbDisplayArgumentObject (
786 ACPI_OPERAND_OBJECT *ObjDesc,
787 ACPI_WALK_STATE *WalkState)
790 if (!AcpiGbl_CmSingleStep)
795 AcpiOsPrintf ("ArgObj: ");
796 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
800 #if (!ACPI_REDUCED_HARDWARE)
801 /*******************************************************************************
803 * FUNCTION: AcpiDbDisplayGpes
809 * DESCRIPTION: Display the current GPE structures
811 ******************************************************************************/
817 ACPI_GPE_BLOCK_INFO *GpeBlock;
818 ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
819 ACPI_GPE_EVENT_INFO *GpeEventInfo;
820 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
822 ACPI_GPE_NOTIFY_INFO *Notify;
833 RetBuf.Length = sizeof (Buffer);
834 RetBuf.Pointer = Buffer;
838 /* Walk the GPE lists */
840 GpeXruptInfo = AcpiGbl_GpeXruptListHead;
843 GpeBlock = GpeXruptInfo->GpeBlockListHead;
846 Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);
847 if (ACPI_FAILURE (Status))
849 AcpiOsPrintf ("Could not convert name to pathname\n");
852 if (GpeBlock->Node == AcpiGbl_FadtGpeDevice)
854 GpeType = "FADT-defined GPE block";
858 GpeType = "GPE Block Device";
861 AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
862 Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
864 AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
865 GpeBlock->RegisterCount, GpeBlock->GpeCount);
867 AcpiOsPrintf (" GPE range: 0x%X to 0x%X on interrupt %u\n",
868 GpeBlock->BlockBaseNumber,
869 GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),
870 GpeXruptInfo->InterruptNumber);
873 " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
874 GpeBlock->RegisterInfo,
875 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address),
876 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address));
878 AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo);
880 /* Examine each GPE Register within the block */
882 for (i = 0; i < GpeBlock->RegisterCount; i++)
884 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
887 " Reg %u: (GPE %.2X-%.2X) RunEnable %2.2X WakeEnable %2.2X"
888 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
889 i, GpeRegisterInfo->BaseGpeNumber,
890 GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
891 GpeRegisterInfo->EnableForRun,
892 GpeRegisterInfo->EnableForWake,
893 ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address),
894 ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address));
896 /* Now look at the individual GPEs in this byte register */
898 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
900 GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
901 GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
903 if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
904 ACPI_GPE_DISPATCH_NONE)
906 /* This GPE is not used (no method or handler), ignore it */
912 " GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
913 GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
914 GpeEventInfo->RuntimeCount, GpeEventInfo->Flags);
916 /* Decode the flags byte */
918 if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED)
920 AcpiOsPrintf ("Level, ");
924 AcpiOsPrintf ("Edge, ");
927 if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
929 AcpiOsPrintf ("CanWake, ");
933 AcpiOsPrintf ("RunOnly, ");
936 switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
938 case ACPI_GPE_DISPATCH_NONE:
940 AcpiOsPrintf ("NotUsed");
943 case ACPI_GPE_DISPATCH_METHOD:
945 AcpiOsPrintf ("Method");
948 case ACPI_GPE_DISPATCH_HANDLER:
950 AcpiOsPrintf ("Handler");
953 case ACPI_GPE_DISPATCH_NOTIFY:
956 Notify = GpeEventInfo->Dispatch.NotifyList;
960 Notify = Notify->Next;
962 AcpiOsPrintf ("Implicit Notify on %u devices", Count);
965 case ACPI_GPE_DISPATCH_RAW_HANDLER:
967 AcpiOsPrintf ("RawHandler");
972 AcpiOsPrintf ("UNKNOWN: %X",
973 ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags));
977 AcpiOsPrintf (")\n");
981 GpeBlock = GpeBlock->Next;
983 GpeXruptInfo = GpeXruptInfo->Next;
986 #endif /* !ACPI_REDUCED_HARDWARE */
989 /*******************************************************************************
991 * FUNCTION: AcpiDbDisplayHandlers
997 * DESCRIPTION: Display the currently installed global handlers
999 ******************************************************************************/
1002 AcpiDbDisplayHandlers (
1005 ACPI_OPERAND_OBJECT *ObjDesc;
1006 ACPI_OPERAND_OBJECT *HandlerObj;
1007 ACPI_ADR_SPACE_TYPE SpaceId;
1011 /* Operation region handlers */
1013 AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n");
1015 ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
1018 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
1020 SpaceId = AcpiGbl_SpaceIdList[i];
1021 HandlerObj = ObjDesc->Device.Handler;
1023 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1024 AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
1028 if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
1030 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1031 (HandlerObj->AddressSpace.HandlerFlags &
1032 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1033 HandlerObj->AddressSpace.Handler);
1037 HandlerObj = HandlerObj->AddressSpace.Next;
1040 /* There is no handler for this SpaceId */
1042 AcpiOsPrintf ("None\n");
1047 /* Find all handlers for user-defined SpaceIDs */
1049 HandlerObj = ObjDesc->Device.Handler;
1052 if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
1054 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1055 "User-defined ID", HandlerObj->AddressSpace.SpaceId);
1056 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1057 (HandlerObj->AddressSpace.HandlerFlags &
1058 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1059 HandlerObj->AddressSpace.Handler);
1062 HandlerObj = HandlerObj->AddressSpace.Next;
1066 #if (!ACPI_REDUCED_HARDWARE)
1068 /* Fixed event handlers */
1070 AcpiOsPrintf ("\nFixed Event Handlers:\n");
1072 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
1074 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);
1075 if (AcpiGbl_FixedEventHandlers[i].Handler)
1077 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1078 AcpiGbl_FixedEventHandlers[i].Handler);
1082 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1086 #endif /* !ACPI_REDUCED_HARDWARE */
1088 /* Miscellaneous global handlers */
1090 AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
1092 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
1094 AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
1095 if (AcpiGbl_HandlerList[i].Handler)
1097 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1098 AcpiGbl_HandlerList[i].Handler);
1102 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1107 /* Other handlers that are installed throughout the namespace */
1109 AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
1111 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1112 ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
1117 /*******************************************************************************
1119 * FUNCTION: AcpiDbDisplayNonRootHandlers
1121 * PARAMETERS: ACPI_WALK_CALLBACK
1125 * DESCRIPTION: Display information about all handlers installed for a
1128 ******************************************************************************/
1131 AcpiDbDisplayNonRootHandlers (
1132 ACPI_HANDLE ObjHandle,
1133 UINT32 NestingLevel,
1137 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
1138 ACPI_OPERAND_OBJECT *ObjDesc;
1139 ACPI_OPERAND_OBJECT *HandlerObj;
1143 ObjDesc = AcpiNsGetAttachedObject (Node);
1149 Pathname = AcpiNsGetExternalPathname (Node);
1155 /* Display all handlers associated with this device */
1157 HandlerObj = ObjDesc->Device.Handler;
1160 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1161 AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId),
1162 HandlerObj->AddressSpace.SpaceId);
1164 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2,
1165 (HandlerObj->AddressSpace.HandlerFlags &
1166 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1167 HandlerObj->AddressSpace.Handler);
1169 AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node);
1171 HandlerObj = HandlerObj->AddressSpace.Next;
1174 ACPI_FREE (Pathname);
1178 #endif /* ACPI_DEBUGGER */