1 /*******************************************************************************
3 * Module Name: dbdisply - debug display commands
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2013, 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.
45 #include <contrib/dev/acpica/include/acpi.h>
46 #include <contrib/dev/acpica/include/accommon.h>
47 #include <contrib/dev/acpica/include/amlcode.h>
48 #include <contrib/dev/acpica/include/acdispat.h>
49 #include <contrib/dev/acpica/include/acnamesp.h>
50 #include <contrib/dev/acpica/include/acparser.h>
51 #include <contrib/dev/acpica/include/acinterp.h>
52 #include <contrib/dev/acpica/include/acdebug.h>
53 #include <contrib/dev/acpica/include/acdisasm.h>
58 #define _COMPONENT ACPI_CA_DEBUGGER
59 ACPI_MODULE_NAME ("dbdisply")
61 /* Local prototypes */
64 AcpiDbDumpParserDescriptor (
65 ACPI_PARSE_OBJECT *Op);
72 AcpiDbDisplayNonRootHandlers (
73 ACPI_HANDLE ObjHandle,
79 * System handler information.
80 * Used for Handlers command, in AcpiDbDisplayHandlers.
82 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
83 #define ACPI_HANDLER_NAME_STRING "%30s : "
84 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
85 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
86 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
88 /* All predefined Address Space IDs */
90 static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
92 ACPI_ADR_SPACE_SYSTEM_MEMORY,
93 ACPI_ADR_SPACE_SYSTEM_IO,
94 ACPI_ADR_SPACE_PCI_CONFIG,
98 ACPI_ADR_SPACE_PCI_BAR_TARGET,
101 ACPI_ADR_SPACE_GSBUS,
102 ACPI_ADR_SPACE_DATA_TABLE,
103 ACPI_ADR_SPACE_FIXED_HARDWARE
106 /* Global handler information */
108 typedef struct acpi_handler_info
115 static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
117 {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
118 {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
119 {&AcpiGbl_TableHandler, "ACPI Table Events"},
120 {&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
121 {&AcpiGbl_InterfaceHandler, "OSI Invocations"}
125 /*******************************************************************************
127 * FUNCTION: AcpiDbGetPointer
129 * PARAMETERS: Target - Pointer to string to be converted
131 * RETURN: Converted pointer
133 * DESCRIPTION: Convert an ascii pointer value to a real value
135 ******************************************************************************/
145 Address = ACPI_STRTOUL (Target, NULL, 16);
146 ObjPtr = ACPI_TO_POINTER (Address);
151 /*******************************************************************************
153 * FUNCTION: AcpiDbDumpParserDescriptor
155 * PARAMETERS: Op - A parser Op descriptor
159 * DESCRIPTION: Display a formatted parser object
161 ******************************************************************************/
164 AcpiDbDumpParserDescriptor (
165 ACPI_PARSE_OBJECT *Op)
167 const ACPI_OPCODE_INFO *Info;
170 Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
172 AcpiOsPrintf ("Parser Op Descriptor:\n");
173 AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
175 ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name",
178 AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
179 AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
180 AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
184 /*******************************************************************************
186 * FUNCTION: AcpiDbDecodeAndDisplayObject
188 * PARAMETERS: Target - String with object to be displayed. Names
189 * and hex pointers are supported.
190 * OutputType - Byte, Word, Dword, or Qword (B|W|D|Q)
194 * DESCRIPTION: Display a formatted ACPI object
196 ******************************************************************************/
199 AcpiDbDecodeAndDisplayObject (
204 ACPI_NAMESPACE_NODE *Node;
205 ACPI_OPERAND_OBJECT *ObjDesc;
206 UINT32 Display = DB_BYTE_DISPLAY;
218 /* Decode the output type */
222 AcpiUtStrupr (OutputType);
223 if (OutputType[0] == 'W')
225 Display = DB_WORD_DISPLAY;
227 else if (OutputType[0] == 'D')
229 Display = DB_DWORD_DISPLAY;
231 else if (OutputType[0] == 'Q')
233 Display = DB_QWORD_DISPLAY;
237 RetBuf.Length = sizeof (Buffer);
238 RetBuf.Pointer = Buffer;
240 /* Differentiate between a number and a name */
242 if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
244 ObjPtr = AcpiDbGetPointer (Target);
245 if (!AcpiOsReadable (ObjPtr, 16))
247 AcpiOsPrintf ("Address %p is invalid in this address space\n",
252 /* Decode the object type */
254 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
256 case ACPI_DESC_TYPE_NAMED:
258 /* This is a namespace Node */
260 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
263 "Cannot read entire Named object at address %p\n", ObjPtr);
270 case ACPI_DESC_TYPE_OPERAND:
272 /* This is a ACPI OPERAND OBJECT */
274 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
276 AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
281 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
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", ObjPtr);
297 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
299 AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
304 /* Is not a recognizeable object */
307 if (AcpiOsReadable (ObjPtr, 64))
312 /* Just dump some memory */
314 AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
321 /* The parameter is a name string that must be resolved to a Named obj */
323 Node = AcpiDbLocalNsLookup (Target);
331 /* Now dump the NS node */
333 Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
334 if (ACPI_FAILURE (Status))
336 AcpiOsPrintf ("Could not convert name to pathname\n");
341 AcpiOsPrintf ("Object (%p) Pathname: %s\n",
342 Node, (char *) RetBuf.Pointer);
345 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
347 AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
351 AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
352 Display, ACPI_UINT32_MAX);
353 AcpiExDumpNamespaceNode (Node, 1);
355 ObjDesc = AcpiNsGetAttachedObject (Node);
358 AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
359 if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
361 AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
366 AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
367 Display, ACPI_UINT32_MAX);
368 AcpiExDumpObjectDescriptor (ObjDesc, 1);
373 /*******************************************************************************
375 * FUNCTION: AcpiDbDisplayMethodInfo
377 * PARAMETERS: StartOp - Root of the control method parse tree
381 * DESCRIPTION: Display information about the current method
383 ******************************************************************************/
386 AcpiDbDisplayMethodInfo (
387 ACPI_PARSE_OBJECT *StartOp)
389 ACPI_WALK_STATE *WalkState;
390 ACPI_OPERAND_OBJECT *ObjDesc;
391 ACPI_NAMESPACE_NODE *Node;
392 ACPI_PARSE_OBJECT *RootOp;
393 ACPI_PARSE_OBJECT *Op;
394 const ACPI_OPCODE_INFO *OpInfo;
396 UINT32 NumOperands = 0;
397 UINT32 NumOperators = 0;
398 UINT32 NumRemainingOps = 0;
399 UINT32 NumRemainingOperands = 0;
400 UINT32 NumRemainingOperators = 0;
401 BOOLEAN CountRemaining = FALSE;
404 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
407 AcpiOsPrintf ("There is no method currently executing\n");
411 ObjDesc = WalkState->MethodDesc;
412 Node = WalkState->MethodNode;
414 AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
415 AcpiUtGetNodeName (Node));
416 AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
417 (UINT32) ObjDesc->Method.ParamCount,
418 (UINT32) ObjDesc->Method.SyncLevel);
422 while (RootOp->Common.Parent)
424 RootOp = RootOp->Common.Parent;
433 CountRemaining = TRUE;
442 /* Decode the opcode */
444 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
445 switch (OpInfo->Class)
447 case AML_CLASS_ARGUMENT:
451 NumRemainingOperands++;
457 case AML_CLASS_UNKNOWN:
459 /* Bad opcode or ASCII character */
467 NumRemainingOperators++;
474 Op = AcpiPsGetDepthNext (StartOp, Op);
478 "Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
479 NumOps, NumOperators, NumOperands);
482 "Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
483 NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
487 /*******************************************************************************
489 * FUNCTION: AcpiDbDisplayLocals
495 * DESCRIPTION: Display all locals for the currently running control method
497 ******************************************************************************/
500 AcpiDbDisplayLocals (
503 ACPI_WALK_STATE *WalkState;
506 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
509 AcpiOsPrintf ("There is no method currently executing\n");
513 AcpiDmDisplayLocals (WalkState);
517 /*******************************************************************************
519 * FUNCTION: AcpiDbDisplayArguments
525 * DESCRIPTION: Display all arguments for the currently running control method
527 ******************************************************************************/
530 AcpiDbDisplayArguments (
533 ACPI_WALK_STATE *WalkState;
536 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
539 AcpiOsPrintf ("There is no method currently executing\n");
543 AcpiDmDisplayArguments (WalkState);
547 /*******************************************************************************
549 * FUNCTION: AcpiDbDisplayResults
555 * DESCRIPTION: Display current contents of a method result stack
557 ******************************************************************************/
560 AcpiDbDisplayResults (
564 ACPI_WALK_STATE *WalkState;
565 ACPI_OPERAND_OBJECT *ObjDesc;
566 UINT32 ResultCount = 0;
567 ACPI_NAMESPACE_NODE *Node;
568 ACPI_GENERIC_STATE *Frame;
569 UINT32 Index; /* Index onto current frame */
572 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
575 AcpiOsPrintf ("There is no method currently executing\n");
579 ObjDesc = WalkState->MethodDesc;
580 Node = WalkState->MethodNode;
582 if (WalkState->Results)
584 ResultCount = WalkState->ResultCount;
587 AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
588 AcpiUtGetNodeName (Node), ResultCount);
590 /* From the top element of result stack */
592 Frame = WalkState->Results;
593 Index = (ResultCount - 1) % ACPI_RESULTS_FRAME_OBJ_NUM;
595 for (i = 0; i < ResultCount; i++)
597 ObjDesc = Frame->Results.ObjDesc[Index];
598 AcpiOsPrintf ("Result%u: ", i);
599 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
602 Frame = Frame->Results.Next;
603 Index = ACPI_RESULTS_FRAME_OBJ_NUM;
610 /*******************************************************************************
612 * FUNCTION: AcpiDbDisplayCallingTree
618 * DESCRIPTION: Display current calling tree of nested control methods
620 ******************************************************************************/
623 AcpiDbDisplayCallingTree (
626 ACPI_WALK_STATE *WalkState;
627 ACPI_NAMESPACE_NODE *Node;
630 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
633 AcpiOsPrintf ("There is no method currently executing\n");
637 Node = WalkState->MethodNode;
638 AcpiOsPrintf ("Current Control Method Call Tree\n");
642 Node = WalkState->MethodNode;
644 AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node));
646 WalkState = WalkState->Next;
651 /*******************************************************************************
653 * FUNCTION: AcpiDbDisplayObjectType
655 * PARAMETERS: Name - User entered NS node handle or name
659 * DESCRIPTION: Display type of an arbitrary NS node
661 ******************************************************************************/
664 AcpiDbDisplayObjectType (
667 ACPI_NAMESPACE_NODE *Node;
668 ACPI_DEVICE_INFO *Info;
673 Node = AcpiDbConvertToNode (Name);
679 Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
680 if (ACPI_FAILURE (Status))
682 AcpiOsPrintf ("Could not get object info, %s\n",
683 AcpiFormatException (Status));
687 if (Info->Valid & ACPI_VALID_ADR)
689 AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
690 ACPI_FORMAT_UINT64 (Info->Address),
691 Info->CurrentStatus, Info->Flags);
693 if (Info->Valid & ACPI_VALID_SXDS)
695 AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
696 Info->HighestDstates[0], Info->HighestDstates[1],
697 Info->HighestDstates[2], Info->HighestDstates[3]);
699 if (Info->Valid & ACPI_VALID_SXWS)
701 AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
702 Info->LowestDstates[0], Info->LowestDstates[1],
703 Info->LowestDstates[2], Info->LowestDstates[3],
704 Info->LowestDstates[4]);
707 if (Info->Valid & ACPI_VALID_HID)
709 AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
711 if (Info->Valid & ACPI_VALID_UID)
713 AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
715 if (Info->Valid & ACPI_VALID_SUB)
717 AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
719 if (Info->Valid & ACPI_VALID_CID)
721 for (i = 0; i < Info->CompatibleIdList.Count; i++)
723 AcpiOsPrintf ("CID %u: %s\n", i,
724 Info->CompatibleIdList.Ids[i].String);
732 /*******************************************************************************
734 * FUNCTION: AcpiDbDisplayResultObject
736 * PARAMETERS: ObjDesc - Object to be displayed
737 * WalkState - Current walk state
741 * DESCRIPTION: Display the result of an AML opcode
743 * Note: Curently only displays the result object if we are single stepping.
744 * However, this output may be useful in other contexts and could be enabled
745 * to do so if needed.
747 ******************************************************************************/
750 AcpiDbDisplayResultObject (
751 ACPI_OPERAND_OBJECT *ObjDesc,
752 ACPI_WALK_STATE *WalkState)
755 /* Only display if single stepping */
757 if (!AcpiGbl_CmSingleStep)
762 AcpiOsPrintf ("ResultObj: ");
763 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
768 /*******************************************************************************
770 * FUNCTION: AcpiDbDisplayArgumentObject
772 * PARAMETERS: ObjDesc - Object to be displayed
773 * WalkState - Current walk state
777 * DESCRIPTION: Display the result of an AML opcode
779 ******************************************************************************/
782 AcpiDbDisplayArgumentObject (
783 ACPI_OPERAND_OBJECT *ObjDesc,
784 ACPI_WALK_STATE *WalkState)
787 if (!AcpiGbl_CmSingleStep)
792 AcpiOsPrintf ("ArgObj: ");
793 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
797 #if (!ACPI_REDUCED_HARDWARE)
798 /*******************************************************************************
800 * FUNCTION: AcpiDbDisplayGpes
806 * DESCRIPTION: Display the current GPE structures
808 ******************************************************************************/
814 ACPI_GPE_BLOCK_INFO *GpeBlock;
815 ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
816 ACPI_GPE_EVENT_INFO *GpeEventInfo;
817 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
819 ACPI_GPE_NOTIFY_INFO *Notify;
830 RetBuf.Length = sizeof (Buffer);
831 RetBuf.Pointer = Buffer;
835 /* Walk the GPE lists */
837 GpeXruptInfo = AcpiGbl_GpeXruptListHead;
840 GpeBlock = GpeXruptInfo->GpeBlockListHead;
843 Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);
844 if (ACPI_FAILURE (Status))
846 AcpiOsPrintf ("Could not convert name to pathname\n");
849 if (GpeBlock->Node == AcpiGbl_FadtGpeDevice)
851 GpeType = "FADT-defined GPE block";
855 GpeType = "GPE Block Device";
858 AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
859 Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
861 AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
862 GpeBlock->RegisterCount, GpeBlock->GpeCount);
864 AcpiOsPrintf (" GPE range: 0x%X to 0x%X on interrupt %u\n",
865 GpeBlock->BlockBaseNumber,
866 GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),
867 GpeXruptInfo->InterruptNumber);
870 " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
871 GpeBlock->RegisterInfo,
872 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address),
873 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address));
875 AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo);
877 /* Examine each GPE Register within the block */
879 for (i = 0; i < GpeBlock->RegisterCount; i++)
881 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
884 " Reg %u: (GPE %.2X-%.2X) RunEnable %2.2X WakeEnable %2.2X"
885 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
886 i, GpeRegisterInfo->BaseGpeNumber,
887 GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
888 GpeRegisterInfo->EnableForRun,
889 GpeRegisterInfo->EnableForWake,
890 ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address),
891 ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address));
893 /* Now look at the individual GPEs in this byte register */
895 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
897 GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
898 GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
900 if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
901 ACPI_GPE_DISPATCH_NONE)
903 /* This GPE is not used (no method or handler), ignore it */
909 " GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
910 GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
911 GpeEventInfo->RuntimeCount, GpeEventInfo->Flags);
913 /* Decode the flags byte */
915 if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED)
917 AcpiOsPrintf ("Level, ");
921 AcpiOsPrintf ("Edge, ");
924 if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
926 AcpiOsPrintf ("CanWake, ");
930 AcpiOsPrintf ("RunOnly, ");
933 switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
935 case ACPI_GPE_DISPATCH_NONE:
937 AcpiOsPrintf ("NotUsed");
940 case ACPI_GPE_DISPATCH_METHOD:
942 AcpiOsPrintf ("Method");
944 case ACPI_GPE_DISPATCH_HANDLER:
946 AcpiOsPrintf ("Handler");
949 case ACPI_GPE_DISPATCH_NOTIFY:
952 Notify = GpeEventInfo->Dispatch.NotifyList;
956 Notify = Notify->Next;
958 AcpiOsPrintf ("Implicit Notify on %u devices", Count);
963 AcpiOsPrintf ("UNKNOWN: %X",
964 GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
968 AcpiOsPrintf (")\n");
972 GpeBlock = GpeBlock->Next;
974 GpeXruptInfo = GpeXruptInfo->Next;
977 #endif /* !ACPI_REDUCED_HARDWARE */
980 /*******************************************************************************
982 * FUNCTION: AcpiDbDisplayHandlers
988 * DESCRIPTION: Display the currently installed global handlers
990 ******************************************************************************/
993 AcpiDbDisplayHandlers (
996 ACPI_OPERAND_OBJECT *ObjDesc;
997 ACPI_OPERAND_OBJECT *HandlerObj;
998 ACPI_ADR_SPACE_TYPE SpaceId;
1002 /* Operation region handlers */
1004 AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n");
1006 ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
1009 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
1011 SpaceId = AcpiGbl_SpaceIdList[i];
1012 HandlerObj = ObjDesc->Device.Handler;
1014 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1015 AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
1019 if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
1021 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1022 (HandlerObj->AddressSpace.HandlerFlags &
1023 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1024 HandlerObj->AddressSpace.Handler);
1028 HandlerObj = HandlerObj->AddressSpace.Next;
1031 /* There is no handler for this SpaceId */
1033 AcpiOsPrintf ("None\n");
1038 /* Find all handlers for user-defined SpaceIDs */
1040 HandlerObj = ObjDesc->Device.Handler;
1043 if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
1045 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1046 "User-defined ID", HandlerObj->AddressSpace.SpaceId);
1047 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1048 (HandlerObj->AddressSpace.HandlerFlags &
1049 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1050 HandlerObj->AddressSpace.Handler);
1053 HandlerObj = HandlerObj->AddressSpace.Next;
1057 #if (!ACPI_REDUCED_HARDWARE)
1059 /* Fixed event handlers */
1061 AcpiOsPrintf ("\nFixed Event Handlers:\n");
1063 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
1065 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);
1066 if (AcpiGbl_FixedEventHandlers[i].Handler)
1068 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1069 AcpiGbl_FixedEventHandlers[i].Handler);
1073 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1077 #endif /* !ACPI_REDUCED_HARDWARE */
1079 /* Miscellaneous global handlers */
1081 AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
1083 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
1085 AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
1086 if (AcpiGbl_HandlerList[i].Handler)
1088 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1089 AcpiGbl_HandlerList[i].Handler);
1093 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1098 /* Other handlers that are installed throughout the namespace */
1100 AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
1102 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1103 ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
1108 /*******************************************************************************
1110 * FUNCTION: AcpiDbDisplayNonRootHandlers
1112 * PARAMETERS: ACPI_WALK_CALLBACK
1116 * DESCRIPTION: Display information about all handlers installed for a
1119 ******************************************************************************/
1122 AcpiDbDisplayNonRootHandlers (
1123 ACPI_HANDLE ObjHandle,
1124 UINT32 NestingLevel,
1128 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
1129 ACPI_OPERAND_OBJECT *ObjDesc;
1130 ACPI_OPERAND_OBJECT *HandlerObj;
1134 ObjDesc = AcpiNsGetAttachedObject (Node);
1140 Pathname = AcpiNsGetExternalPathname (Node);
1146 /* Display all handlers associated with this device */
1148 HandlerObj = ObjDesc->Device.Handler;
1151 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1152 AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId),
1153 HandlerObj->AddressSpace.SpaceId);
1155 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2,
1156 (HandlerObj->AddressSpace.HandlerFlags &
1157 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1158 HandlerObj->AddressSpace.Handler);
1160 AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node);
1162 HandlerObj = HandlerObj->AddressSpace.Next;
1165 ACPI_FREE (Pathname);
1169 #endif /* ACPI_DEBUGGER */