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 <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/acdebug.h>
56 #define _COMPONENT ACPI_CA_DEBUGGER
57 ACPI_MODULE_NAME ("dbdisply")
59 /* Local prototypes */
62 AcpiDbDumpParserDescriptor (
63 ACPI_PARSE_OBJECT *Op);
70 AcpiDbDisplayNonRootHandlers (
71 ACPI_HANDLE ObjHandle,
77 * System handler information.
78 * Used for Handlers command, in AcpiDbDisplayHandlers.
80 #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
81 #define ACPI_HANDLER_NAME_STRING "%30s : "
82 #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
83 #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
84 #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
86 /* All predefined Address Space IDs */
88 static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
90 ACPI_ADR_SPACE_SYSTEM_MEMORY,
91 ACPI_ADR_SPACE_SYSTEM_IO,
92 ACPI_ADR_SPACE_PCI_CONFIG,
96 ACPI_ADR_SPACE_PCI_BAR_TARGET,
100 ACPI_ADR_SPACE_DATA_TABLE,
101 ACPI_ADR_SPACE_FIXED_HARDWARE
104 /* Global handler information */
106 typedef struct acpi_handler_info
113 static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
115 {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
116 {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
117 {&AcpiGbl_TableHandler, "ACPI Table Events"},
118 {&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
119 {&AcpiGbl_InterfaceHandler, "OSI Invocations"}
123 /*******************************************************************************
125 * FUNCTION: AcpiDbGetPointer
127 * PARAMETERS: Target - Pointer to string to be converted
129 * RETURN: Converted pointer
131 * DESCRIPTION: Convert an ascii pointer value to a real value
133 ******************************************************************************/
143 Address = strtoul (Target, NULL, 16);
144 ObjPtr = ACPI_TO_POINTER (Address);
149 /*******************************************************************************
151 * FUNCTION: AcpiDbDumpParserDescriptor
153 * PARAMETERS: Op - A parser Op descriptor
157 * DESCRIPTION: Display a formatted parser object
159 ******************************************************************************/
162 AcpiDbDumpParserDescriptor (
163 ACPI_PARSE_OBJECT *Op)
165 const ACPI_OPCODE_INFO *Info;
168 Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
170 AcpiOsPrintf ("Parser Op Descriptor:\n");
171 AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
173 ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name",
176 AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
177 AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
178 AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
182 /*******************************************************************************
184 * FUNCTION: AcpiDbDecodeAndDisplayObject
186 * PARAMETERS: Target - String with object to be displayed. Names
187 * and hex pointers are supported.
188 * OutputType - Byte, Word, Dword, or Qword (B|W|D|Q)
192 * DESCRIPTION: Display a formatted ACPI object
194 ******************************************************************************/
197 AcpiDbDecodeAndDisplayObject (
202 ACPI_NAMESPACE_NODE *Node;
203 ACPI_OPERAND_OBJECT *ObjDesc;
204 UINT32 Display = DB_BYTE_DISPLAY;
216 /* Decode the output type */
220 AcpiUtStrupr (OutputType);
221 if (OutputType[0] == 'W')
223 Display = DB_WORD_DISPLAY;
225 else if (OutputType[0] == 'D')
227 Display = DB_DWORD_DISPLAY;
229 else if (OutputType[0] == 'Q')
231 Display = DB_QWORD_DISPLAY;
235 RetBuf.Length = sizeof (Buffer);
236 RetBuf.Pointer = Buffer;
238 /* Differentiate between a number and a name */
240 if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
242 ObjPtr = AcpiDbGetPointer (Target);
243 if (!AcpiOsReadable (ObjPtr, 16))
245 AcpiOsPrintf ("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", ObjPtr);
268 case ACPI_DESC_TYPE_OPERAND:
270 /* This is a ACPI OPERAND OBJECT */
272 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
274 AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
279 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
281 AcpiExDumpObjectDescriptor (ObjPtr, 1);
284 case ACPI_DESC_TYPE_PARSER:
286 /* This is a Parser Op object */
288 if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
291 "Cannot read entire Parser object at address %p\n", ObjPtr);
295 AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
297 AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
302 /* Is not a recognizeable object */
305 "Not a known ACPI internal object, descriptor type %2.2X\n",
306 ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
309 if (AcpiOsReadable (ObjPtr, 64))
314 /* Just dump some memory */
316 AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
323 /* The parameter is a name string that must be resolved to a Named obj */
325 Node = AcpiDbLocalNsLookup (Target);
333 /* Now dump the NS node */
335 Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
336 if (ACPI_FAILURE (Status))
338 AcpiOsPrintf ("Could not convert name to pathname\n");
343 AcpiOsPrintf ("Object (%p) Pathname: %s\n",
344 Node, (char *) RetBuf.Pointer);
347 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
349 AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
353 AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
354 Display, ACPI_UINT32_MAX);
355 AcpiExDumpNamespaceNode (Node, 1);
357 ObjDesc = AcpiNsGetAttachedObject (Node);
360 AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
361 if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
363 AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
368 AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
369 Display, ACPI_UINT32_MAX);
370 AcpiExDumpObjectDescriptor (ObjDesc, 1);
375 /*******************************************************************************
377 * FUNCTION: AcpiDbDisplayMethodInfo
379 * PARAMETERS: StartOp - Root of the control method parse tree
383 * DESCRIPTION: Display information about the current method
385 ******************************************************************************/
388 AcpiDbDisplayMethodInfo (
389 ACPI_PARSE_OBJECT *StartOp)
391 ACPI_WALK_STATE *WalkState;
392 ACPI_OPERAND_OBJECT *ObjDesc;
393 ACPI_NAMESPACE_NODE *Node;
394 ACPI_PARSE_OBJECT *RootOp;
395 ACPI_PARSE_OBJECT *Op;
396 const ACPI_OPCODE_INFO *OpInfo;
398 UINT32 NumOperands = 0;
399 UINT32 NumOperators = 0;
400 UINT32 NumRemainingOps = 0;
401 UINT32 NumRemainingOperands = 0;
402 UINT32 NumRemainingOperators = 0;
403 BOOLEAN CountRemaining = FALSE;
406 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
409 AcpiOsPrintf ("There is no method currently executing\n");
413 ObjDesc = WalkState->MethodDesc;
414 Node = WalkState->MethodNode;
416 AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
417 AcpiUtGetNodeName (Node));
418 AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
419 (UINT32) ObjDesc->Method.ParamCount,
420 (UINT32) ObjDesc->Method.SyncLevel);
424 while (RootOp->Common.Parent)
426 RootOp = RootOp->Common.Parent;
435 CountRemaining = TRUE;
444 /* Decode the opcode */
446 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
447 switch (OpInfo->Class)
449 case AML_CLASS_ARGUMENT:
453 NumRemainingOperands++;
459 case AML_CLASS_UNKNOWN:
461 /* Bad opcode or ASCII character */
469 NumRemainingOperators++;
476 Op = AcpiPsGetDepthNext (StartOp, Op);
480 "Method contains: %X AML Opcodes - %X Operators, %X Operands\n",
481 NumOps, NumOperators, NumOperands);
484 "Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
485 NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
489 /*******************************************************************************
491 * FUNCTION: AcpiDbDisplayLocals
497 * DESCRIPTION: Display all locals for the currently running control method
499 ******************************************************************************/
502 AcpiDbDisplayLocals (
505 ACPI_WALK_STATE *WalkState;
508 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
511 AcpiOsPrintf ("There is no method currently executing\n");
515 AcpiDbDecodeLocals (WalkState);
519 /*******************************************************************************
521 * FUNCTION: AcpiDbDisplayArguments
527 * DESCRIPTION: Display all arguments for the currently running control method
529 ******************************************************************************/
532 AcpiDbDisplayArguments (
535 ACPI_WALK_STATE *WalkState;
538 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
541 AcpiOsPrintf ("There is no method currently executing\n");
545 AcpiDbDecodeArguments (WalkState);
549 /*******************************************************************************
551 * FUNCTION: AcpiDbDisplayResults
557 * DESCRIPTION: Display current contents of a method result stack
559 ******************************************************************************/
562 AcpiDbDisplayResults (
566 ACPI_WALK_STATE *WalkState;
567 ACPI_OPERAND_OBJECT *ObjDesc;
568 UINT32 ResultCount = 0;
569 ACPI_NAMESPACE_NODE *Node;
570 ACPI_GENERIC_STATE *Frame;
571 UINT32 Index; /* Index onto current frame */
574 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
577 AcpiOsPrintf ("There is no method currently executing\n");
581 ObjDesc = WalkState->MethodDesc;
582 Node = WalkState->MethodNode;
584 if (WalkState->Results)
586 ResultCount = WalkState->ResultCount;
589 AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
590 AcpiUtGetNodeName (Node), ResultCount);
592 /* From the top element of result stack */
594 Frame = WalkState->Results;
595 Index = (ResultCount - 1) % ACPI_RESULTS_FRAME_OBJ_NUM;
597 for (i = 0; i < ResultCount; i++)
599 ObjDesc = Frame->Results.ObjDesc[Index];
600 AcpiOsPrintf ("Result%u: ", i);
601 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
604 Frame = Frame->Results.Next;
605 Index = ACPI_RESULTS_FRAME_OBJ_NUM;
612 /*******************************************************************************
614 * FUNCTION: AcpiDbDisplayCallingTree
620 * DESCRIPTION: Display current calling tree of nested control methods
622 ******************************************************************************/
625 AcpiDbDisplayCallingTree (
628 ACPI_WALK_STATE *WalkState;
629 ACPI_NAMESPACE_NODE *Node;
632 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
635 AcpiOsPrintf ("There is no method currently executing\n");
639 Node = WalkState->MethodNode;
640 AcpiOsPrintf ("Current Control Method Call Tree\n");
644 Node = WalkState->MethodNode;
646 AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node));
648 WalkState = WalkState->Next;
653 /*******************************************************************************
655 * FUNCTION: AcpiDbDisplayObjectType
657 * PARAMETERS: Name - User entered NS node handle or name
661 * DESCRIPTION: Display type of an arbitrary NS node
663 ******************************************************************************/
666 AcpiDbDisplayObjectType (
669 ACPI_NAMESPACE_NODE *Node;
670 ACPI_DEVICE_INFO *Info;
675 Node = AcpiDbConvertToNode (Name);
681 Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
682 if (ACPI_FAILURE (Status))
684 AcpiOsPrintf ("Could not get object info, %s\n",
685 AcpiFormatException (Status));
689 if (Info->Valid & ACPI_VALID_ADR)
691 AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
692 ACPI_FORMAT_UINT64 (Info->Address),
693 Info->CurrentStatus, Info->Flags);
695 if (Info->Valid & ACPI_VALID_SXDS)
697 AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
698 Info->HighestDstates[0], Info->HighestDstates[1],
699 Info->HighestDstates[2], Info->HighestDstates[3]);
701 if (Info->Valid & ACPI_VALID_SXWS)
703 AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
704 Info->LowestDstates[0], Info->LowestDstates[1],
705 Info->LowestDstates[2], Info->LowestDstates[3],
706 Info->LowestDstates[4]);
709 if (Info->Valid & ACPI_VALID_HID)
711 AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
713 if (Info->Valid & ACPI_VALID_UID)
715 AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
717 if (Info->Valid & ACPI_VALID_SUB)
719 AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
721 if (Info->Valid & ACPI_VALID_CID)
723 for (i = 0; i < Info->CompatibleIdList.Count; i++)
725 AcpiOsPrintf ("CID %u: %s\n", i,
726 Info->CompatibleIdList.Ids[i].String);
734 /*******************************************************************************
736 * FUNCTION: AcpiDbDisplayResultObject
738 * PARAMETERS: ObjDesc - Object to be displayed
739 * WalkState - Current walk state
743 * DESCRIPTION: Display the result of an AML opcode
745 * Note: Curently only displays the result object if we are single stepping.
746 * However, this output may be useful in other contexts and could be enabled
747 * to do so if needed.
749 ******************************************************************************/
752 AcpiDbDisplayResultObject (
753 ACPI_OPERAND_OBJECT *ObjDesc,
754 ACPI_WALK_STATE *WalkState)
757 /* Only display if single stepping */
759 if (!AcpiGbl_CmSingleStep)
764 AcpiOsPrintf ("ResultObj: ");
765 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
770 /*******************************************************************************
772 * FUNCTION: AcpiDbDisplayArgumentObject
774 * PARAMETERS: ObjDesc - Object to be displayed
775 * WalkState - Current walk state
779 * DESCRIPTION: Display the result of an AML opcode
781 ******************************************************************************/
784 AcpiDbDisplayArgumentObject (
785 ACPI_OPERAND_OBJECT *ObjDesc,
786 ACPI_WALK_STATE *WalkState)
789 if (!AcpiGbl_CmSingleStep)
794 AcpiOsPrintf ("ArgObj: ");
795 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
799 #if (!ACPI_REDUCED_HARDWARE)
800 /*******************************************************************************
802 * FUNCTION: AcpiDbDisplayGpes
808 * DESCRIPTION: Display the current GPE structures
810 ******************************************************************************/
816 ACPI_GPE_BLOCK_INFO *GpeBlock;
817 ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
818 ACPI_GPE_EVENT_INFO *GpeEventInfo;
819 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
821 ACPI_GPE_NOTIFY_INFO *Notify;
832 RetBuf.Length = sizeof (Buffer);
833 RetBuf.Pointer = Buffer;
837 /* Walk the GPE lists */
839 GpeXruptInfo = AcpiGbl_GpeXruptListHead;
842 GpeBlock = GpeXruptInfo->GpeBlockListHead;
845 Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);
846 if (ACPI_FAILURE (Status))
848 AcpiOsPrintf ("Could not convert name to pathname\n");
851 if (GpeBlock->Node == AcpiGbl_FadtGpeDevice)
853 GpeType = "FADT-defined GPE block";
857 GpeType = "GPE Block Device";
860 AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
861 Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
863 AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
864 GpeBlock->RegisterCount, GpeBlock->GpeCount);
866 AcpiOsPrintf (" GPE range: 0x%X to 0x%X on interrupt %u\n",
867 GpeBlock->BlockBaseNumber,
868 GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1),
869 GpeXruptInfo->InterruptNumber);
872 " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n",
873 GpeBlock->RegisterInfo,
874 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address),
875 ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address));
877 AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo);
879 /* Examine each GPE Register within the block */
881 for (i = 0; i < GpeBlock->RegisterCount; i++)
883 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
886 " Reg %u: (GPE %.2X-%.2X) RunEnable %2.2X WakeEnable %2.2X"
887 " Status %8.8X%8.8X Enable %8.8X%8.8X\n",
888 i, GpeRegisterInfo->BaseGpeNumber,
889 GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
890 GpeRegisterInfo->EnableForRun,
891 GpeRegisterInfo->EnableForWake,
892 ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address),
893 ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address));
895 /* Now look at the individual GPEs in this byte register */
897 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
899 GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
900 GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
902 if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
903 ACPI_GPE_DISPATCH_NONE)
905 /* This GPE is not used (no method or handler), ignore it */
911 " GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
912 GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
913 GpeEventInfo->RuntimeCount, GpeEventInfo->Flags);
915 /* Decode the flags byte */
917 if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED)
919 AcpiOsPrintf ("Level, ");
923 AcpiOsPrintf ("Edge, ");
926 if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
928 AcpiOsPrintf ("CanWake, ");
932 AcpiOsPrintf ("RunOnly, ");
935 switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
937 case ACPI_GPE_DISPATCH_NONE:
939 AcpiOsPrintf ("NotUsed");
942 case ACPI_GPE_DISPATCH_METHOD:
944 AcpiOsPrintf ("Method");
947 case ACPI_GPE_DISPATCH_HANDLER:
949 AcpiOsPrintf ("Handler");
952 case ACPI_GPE_DISPATCH_NOTIFY:
955 Notify = GpeEventInfo->Dispatch.NotifyList;
959 Notify = Notify->Next;
961 AcpiOsPrintf ("Implicit Notify on %u devices", Count);
964 case ACPI_GPE_DISPATCH_RAW_HANDLER:
966 AcpiOsPrintf ("RawHandler");
971 AcpiOsPrintf ("UNKNOWN: %X",
972 ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags));
976 AcpiOsPrintf (")\n");
980 GpeBlock = GpeBlock->Next;
982 GpeXruptInfo = GpeXruptInfo->Next;
985 #endif /* !ACPI_REDUCED_HARDWARE */
988 /*******************************************************************************
990 * FUNCTION: AcpiDbDisplayHandlers
996 * DESCRIPTION: Display the currently installed global handlers
998 ******************************************************************************/
1001 AcpiDbDisplayHandlers (
1004 ACPI_OPERAND_OBJECT *ObjDesc;
1005 ACPI_OPERAND_OBJECT *HandlerObj;
1006 ACPI_ADR_SPACE_TYPE SpaceId;
1010 /* Operation region handlers */
1012 AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n");
1014 ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
1017 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
1019 SpaceId = AcpiGbl_SpaceIdList[i];
1020 HandlerObj = ObjDesc->Device.Handler;
1022 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1023 AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
1027 if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
1029 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1030 (HandlerObj->AddressSpace.HandlerFlags &
1031 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1032 HandlerObj->AddressSpace.Handler);
1036 HandlerObj = HandlerObj->AddressSpace.Next;
1039 /* There is no handler for this SpaceId */
1041 AcpiOsPrintf ("None\n");
1046 /* Find all handlers for user-defined SpaceIDs */
1048 HandlerObj = ObjDesc->Device.Handler;
1051 if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
1053 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1054 "User-defined ID", HandlerObj->AddressSpace.SpaceId);
1055 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
1056 (HandlerObj->AddressSpace.HandlerFlags &
1057 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1058 HandlerObj->AddressSpace.Handler);
1061 HandlerObj = HandlerObj->AddressSpace.Next;
1065 #if (!ACPI_REDUCED_HARDWARE)
1067 /* Fixed event handlers */
1069 AcpiOsPrintf ("\nFixed Event Handlers:\n");
1071 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
1073 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);
1074 if (AcpiGbl_FixedEventHandlers[i].Handler)
1076 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1077 AcpiGbl_FixedEventHandlers[i].Handler);
1081 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1085 #endif /* !ACPI_REDUCED_HARDWARE */
1087 /* Miscellaneous global handlers */
1089 AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
1091 for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
1093 AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
1094 if (AcpiGbl_HandlerList[i].Handler)
1096 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
1097 AcpiGbl_HandlerList[i].Handler);
1101 AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
1106 /* Other handlers that are installed throughout the namespace */
1108 AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
1110 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1111 ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
1116 /*******************************************************************************
1118 * FUNCTION: AcpiDbDisplayNonRootHandlers
1120 * PARAMETERS: ACPI_WALK_CALLBACK
1124 * DESCRIPTION: Display information about all handlers installed for a
1127 ******************************************************************************/
1130 AcpiDbDisplayNonRootHandlers (
1131 ACPI_HANDLE ObjHandle,
1132 UINT32 NestingLevel,
1136 ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
1137 ACPI_OPERAND_OBJECT *ObjDesc;
1138 ACPI_OPERAND_OBJECT *HandlerObj;
1142 ObjDesc = AcpiNsGetAttachedObject (Node);
1148 Pathname = AcpiNsGetExternalPathname (Node);
1154 /* Display all handlers associated with this device */
1156 HandlerObj = ObjDesc->Device.Handler;
1159 AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
1160 AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId),
1161 HandlerObj->AddressSpace.SpaceId);
1163 AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2,
1164 (HandlerObj->AddressSpace.HandlerFlags &
1165 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
1166 HandlerObj->AddressSpace.Handler);
1168 AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node);
1170 HandlerObj = HandlerObj->AddressSpace.Next;
1173 ACPI_FREE (Pathname);
1177 #endif /* ACPI_DEBUGGER */