1 /*******************************************************************************
3 * Module Name: dbcmds - Miscellaneous debug commands and output routines
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2012, 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/acevents.h>
48 #include <contrib/dev/acpica/include/acdebug.h>
49 #include <contrib/dev/acpica/include/acnamesp.h>
50 #include <contrib/dev/acpica/include/acresrc.h>
51 #include <contrib/dev/acpica/include/actables.h>
55 #define _COMPONENT ACPI_CA_DEBUGGER
56 ACPI_MODULE_NAME ("dbcmds")
59 /* Local prototypes */
62 AcpiDmCompareAmlResources (
64 ACPI_RSDESC_SIZE Aml1BufferLength,
66 ACPI_RSDESC_SIZE Aml2BufferLength);
69 AcpiDmTestResourceConversion (
70 ACPI_NAMESPACE_NODE *Node,
74 AcpiDbResourceCallback (
75 ACPI_RESOURCE *Resource,
79 AcpiDbDeviceResources (
80 ACPI_HANDLE ObjHandle,
86 /*******************************************************************************
88 * FUNCTION: AcpiDbConvertToNode
90 * PARAMETERS: InString - String to convert
92 * RETURN: Pointer to a NS node
94 * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or
97 ******************************************************************************/
100 AcpiDbConvertToNode (
103 ACPI_NAMESPACE_NODE *Node;
106 if ((*InString >= 0x30) && (*InString <= 0x39))
108 /* Numeric argument, convert */
110 Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
111 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
113 AcpiOsPrintf ("Address %p is invalid in this address space\n",
118 /* Make sure pointer is valid NS node */
120 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
122 AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
123 Node, AcpiUtGetDescriptorName (Node));
130 /* The parameter is a name string that must be resolved to a
133 Node = AcpiDbLocalNsLookup (InString);
136 Node = AcpiGbl_RootNode;
144 /*******************************************************************************
146 * FUNCTION: AcpiDbSleep
148 * PARAMETERS: ObjectArg - Desired sleep state (0-5)
152 * DESCRIPTION: Simulate a sleep/wake sequence
154 ******************************************************************************/
164 ACPI_FUNCTION_TRACE (AcpiDbSleep);
167 SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
169 AcpiOsPrintf ("**** Prepare to sleep ****\n");
170 Status = AcpiEnterSleepStatePrep (SleepState);
171 if (ACPI_FAILURE (Status))
176 AcpiOsPrintf ("**** Going to sleep ****\n");
177 Status = AcpiEnterSleepState (SleepState);
178 if (ACPI_FAILURE (Status))
183 AcpiOsPrintf ("**** Prepare to return from sleep ****\n");
184 Status = AcpiLeaveSleepStatePrep (SleepState);
185 if (ACPI_FAILURE (Status))
190 AcpiOsPrintf ("**** Returning from sleep ****\n");
191 Status = AcpiLeaveSleepState (SleepState);
192 if (ACPI_FAILURE (Status))
202 ACPI_EXCEPTION ((AE_INFO, Status, "During sleep test"));
207 /*******************************************************************************
209 * FUNCTION: AcpiDbDisplayLocks
215 * DESCRIPTION: Display information about internal mutexes.
217 ******************************************************************************/
226 for (i = 0; i < ACPI_MAX_MUTEX; i++)
228 AcpiOsPrintf ("%26s : %s\n", AcpiUtGetMutexName (i),
229 AcpiGbl_MutexInfo[i].ThreadId == ACPI_MUTEX_NOT_ACQUIRED
230 ? "Locked" : "Unlocked");
235 /*******************************************************************************
237 * FUNCTION: AcpiDbDisplayTableInfo
239 * PARAMETERS: TableArg - String with name of table to be displayed
243 * DESCRIPTION: Display information about loaded tables. Current
244 * implementation displays all loaded tables.
246 ******************************************************************************/
249 AcpiDbDisplayTableInfo (
253 ACPI_TABLE_DESC *TableDesc;
259 AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
261 /* Walk the entire root table list */
263 for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
265 TableDesc = &AcpiGbl_RootTableList.Tables[i];
267 /* Index and Table ID */
269 AcpiOsPrintf ("%3u %.2u ", i, TableDesc->OwnerId);
271 /* Decode the table flags */
273 if (!(TableDesc->Flags & ACPI_TABLE_IS_LOADED))
275 AcpiOsPrintf ("NotLoaded ");
279 AcpiOsPrintf (" Loaded ");
282 switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
284 case ACPI_TABLE_ORIGIN_UNKNOWN:
285 AcpiOsPrintf ("Unknown ");
288 case ACPI_TABLE_ORIGIN_MAPPED:
289 AcpiOsPrintf ("Mapped ");
292 case ACPI_TABLE_ORIGIN_ALLOCATED:
293 AcpiOsPrintf ("Allocated ");
296 case ACPI_TABLE_ORIGIN_OVERRIDE:
297 AcpiOsPrintf ("Override ");
301 AcpiOsPrintf ("INVALID ");
305 /* Make sure that the table is mapped */
307 Status = AcpiTbVerifyTable (TableDesc);
308 if (ACPI_FAILURE (Status))
313 /* Dump the table header */
315 if (TableDesc->Pointer)
317 AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
321 /* If the pointer is null, the table has been unloaded */
323 ACPI_INFO ((AE_INFO, "%4.4s - Table has been unloaded",
324 TableDesc->Signature.Ascii));
330 /*******************************************************************************
332 * FUNCTION: AcpiDbUnloadAcpiTable
334 * PARAMETERS: ObjectName - Namespace pathname for an object that
335 * is owned by the table to be unloaded
339 * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned
342 ******************************************************************************/
345 AcpiDbUnloadAcpiTable (
348 ACPI_NAMESPACE_NODE *Node;
352 /* Translate name to an Named object */
354 Node = AcpiDbConvertToNode (ObjectName);
357 AcpiOsPrintf ("Could not find [%s] in namespace\n",
362 Status = AcpiUnloadParentTable (ACPI_CAST_PTR (ACPI_HANDLE, Node));
363 if (ACPI_SUCCESS (Status))
365 AcpiOsPrintf ("Parent of [%s] (%p) unloaded and uninstalled\n",
370 AcpiOsPrintf ("%s, while unloading parent table of [%s]\n",
371 AcpiFormatException (Status), ObjectName);
376 /*******************************************************************************
378 * FUNCTION: AcpiDbSendNotify
380 * PARAMETERS: Name - Name of ACPI object to send the notify to
381 * Value - Value of the notify to send.
385 * DESCRIPTION: Send an ACPI notification. The value specified is sent to the
386 * named object as an ACPI notify.
388 ******************************************************************************/
395 ACPI_NAMESPACE_NODE *Node;
399 /* Translate name to an Named object */
401 Node = AcpiDbConvertToNode (Name);
407 /* Dispatch the notify if legal */
409 if (AcpiEvIsNotifyObject (Node))
411 Status = AcpiEvQueueNotifyRequest (Node, Value);
412 if (ACPI_FAILURE (Status))
414 AcpiOsPrintf ("Could not queue notify\n");
419 AcpiOsPrintf ("Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n",
420 AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type));
425 /*******************************************************************************
427 * FUNCTION: AcpiDbDisplayInterfaces
429 * PARAMETERS: ActionArg - Null, "install", or "remove"
430 * InterfaceNameArg - Name for install/remove options
434 * DESCRIPTION: Display or modify the global _OSI interface list
436 ******************************************************************************/
439 AcpiDbDisplayInterfaces (
441 char *InterfaceNameArg)
443 ACPI_INTERFACE_INFO *NextInterface;
448 /* If no arguments, just display current interface list */
452 (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex,
455 NextInterface = AcpiGbl_SupportedInterfaces;
457 while (NextInterface)
459 if (!(NextInterface->Flags & ACPI_OSI_INVALID))
461 AcpiOsPrintf ("%s\n", NextInterface->Name);
463 NextInterface = NextInterface->Next;
466 AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
470 /* If ActionArg exists, so must InterfaceNameArg */
472 if (!InterfaceNameArg)
474 AcpiOsPrintf ("Missing Interface Name argument\n");
478 /* Uppercase the action for match below */
480 AcpiUtStrupr (ActionArg);
482 /* Install - install an interface */
484 SubString = ACPI_STRSTR ("INSTALL", ActionArg);
487 Status = AcpiInstallInterface (InterfaceNameArg);
488 if (ACPI_FAILURE (Status))
490 AcpiOsPrintf ("%s, while installing \"%s\"\n",
491 AcpiFormatException (Status), InterfaceNameArg);
496 /* Remove - remove an interface */
498 SubString = ACPI_STRSTR ("REMOVE", ActionArg);
501 Status = AcpiRemoveInterface (InterfaceNameArg);
502 if (ACPI_FAILURE (Status))
504 AcpiOsPrintf ("%s, while removing \"%s\"\n",
505 AcpiFormatException (Status), InterfaceNameArg);
510 /* Invalid ActionArg */
512 AcpiOsPrintf ("Invalid action argument: %s\n", ActionArg);
517 /*******************************************************************************
519 * FUNCTION: AcpiDbDisplayTemplate
521 * PARAMETERS: BufferArg - Buffer name or addrss
525 * DESCRIPTION: Dump a buffer that contains a resource template
527 ******************************************************************************/
530 AcpiDbDisplayTemplate (
533 ACPI_NAMESPACE_NODE *Node;
535 ACPI_BUFFER ReturnObj;
538 /* Translate BufferArg to an Named object */
540 Node = AcpiDbConvertToNode (BufferArg);
541 if (!Node || (Node == AcpiGbl_RootNode))
543 AcpiOsPrintf ("Invalid argument: %s\n", BufferArg);
547 /* We must have a buffer object */
549 if (Node->Type != ACPI_TYPE_BUFFER)
551 AcpiOsPrintf ("Not a Buffer object, cannot be a template: %s\n",
556 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
557 ReturnObj.Pointer = AcpiGbl_DbBuffer;
559 /* Attempt to convert the raw buffer to a resource list */
561 Status = AcpiRsCreateResourceList (Node->Object, &ReturnObj);
563 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
564 AcpiDbgLevel |= ACPI_LV_RESOURCES;
566 if (ACPI_FAILURE (Status))
568 AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n",
569 BufferArg, AcpiFormatException (Status));
573 /* Now we can dump the resource list */
575 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
579 AcpiOsPrintf ("\nRaw data buffer:\n");
580 AcpiUtDumpBuffer ((UINT8 *) Node->Object->Buffer.Pointer,
581 Node->Object->Buffer.Length,
582 DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
584 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
589 /*******************************************************************************
591 * FUNCTION: AcpiDmCompareAmlResources
593 * PARAMETERS: Aml1Buffer - Contains first resource list
594 * Aml1BufferLength - Length of first resource list
595 * Aml2Buffer - Contains second resource list
596 * Aml2BufferLength - Length of second resource list
600 * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in
601 * order to isolate a miscompare to an individual resource)
603 ******************************************************************************/
606 AcpiDmCompareAmlResources (
608 ACPI_RSDESC_SIZE Aml1BufferLength,
610 ACPI_RSDESC_SIZE Aml2BufferLength)
616 ACPI_RSDESC_SIZE Aml1Length;
617 ACPI_RSDESC_SIZE Aml2Length;
618 ACPI_RSDESC_SIZE Offset = 0;
624 /* Compare overall buffer sizes (may be different due to size rounding) */
626 if (Aml1BufferLength != Aml2BufferLength)
629 "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n",
630 Aml1BufferLength, Aml2BufferLength);
635 Aml1End = Aml1Buffer + Aml1BufferLength;
636 Aml2End = Aml2Buffer + Aml2BufferLength;
638 /* Walk the descriptor lists, comparing each descriptor */
640 while ((Aml1 < Aml1End) && (Aml2 < Aml2End))
642 /* Get the lengths of each descriptor */
644 Aml1Length = AcpiUtGetDescriptorLength (Aml1);
645 Aml2Length = AcpiUtGetDescriptorLength (Aml2);
646 ResourceType = AcpiUtGetResourceType (Aml1);
648 /* Check for descriptor length match */
650 if (Aml1Length != Aml2Length)
653 "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n",
654 Count, ResourceType, Offset, Aml1Length, Aml2Length);
657 /* Check for descriptor byte match */
659 else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length))
662 "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
663 Count, ResourceType, Offset);
665 for (i = 0; i < Aml1Length; i++)
667 if (Aml1[i] != Aml2[i])
669 AcpiOsPrintf ("Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n",
670 i, Aml2[i], Aml1[i]);
675 /* Exit on EndTag descriptor */
677 if (ResourceType == ACPI_RESOURCE_NAME_END_TAG)
682 /* Point to next descriptor in each buffer */
685 Offset += Aml1Length;
692 /*******************************************************************************
694 * FUNCTION: AcpiDmTestResourceConversion
696 * PARAMETERS: Node - Parent device node
697 * Name - resource method name (_CRS)
701 * DESCRIPTION: Compare the original AML with a conversion of the AML to
702 * internal resource list, then back to AML.
704 ******************************************************************************/
707 AcpiDmTestResourceConversion (
708 ACPI_NAMESPACE_NODE *Node,
712 ACPI_BUFFER ReturnObj;
713 ACPI_BUFFER ResourceObj;
715 ACPI_OBJECT *OriginalAml;
718 AcpiOsPrintf ("Resource Conversion Comparison:\n");
720 NewAml.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
721 ReturnObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
722 ResourceObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
724 /* Get the original _CRS AML resource template */
726 Status = AcpiEvaluateObject (Node, Name, NULL, &ReturnObj);
727 if (ACPI_FAILURE (Status))
729 AcpiOsPrintf ("Could not obtain %s: %s\n",
730 Name, AcpiFormatException (Status));
734 /* Get the AML resource template, converted to internal resource structs */
736 Status = AcpiGetCurrentResources (Node, &ResourceObj);
737 if (ACPI_FAILURE (Status))
739 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
740 AcpiFormatException (Status));
744 /* Convert internal resource list to external AML resource template */
746 Status = AcpiRsCreateAmlResources (ResourceObj.Pointer, &NewAml);
747 if (ACPI_FAILURE (Status))
749 AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
750 AcpiFormatException (Status));
754 /* Compare original AML to the newly created AML resource list */
756 OriginalAml = ReturnObj.Pointer;
758 AcpiDmCompareAmlResources (
759 OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
760 NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
762 /* Cleanup and exit */
764 ACPI_FREE (NewAml.Pointer);
766 ACPI_FREE (ResourceObj.Pointer);
768 ACPI_FREE (ReturnObj.Pointer);
773 /*******************************************************************************
775 * FUNCTION: AcpiDbResourceCallback
777 * PARAMETERS: ACPI_WALK_RESOURCE_CALLBACK
781 * DESCRIPTION: Simple callback to exercise AcpiWalkResources
783 ******************************************************************************/
786 AcpiDbResourceCallback (
787 ACPI_RESOURCE *Resource,
795 /*******************************************************************************
797 * FUNCTION: AcpiDbDeviceResources
799 * PARAMETERS: ACPI_WALK_CALLBACK
803 * DESCRIPTION: Display the _PRT/_CRS/_PRS resources for a device object.
805 ******************************************************************************/
808 AcpiDbDeviceResources (
809 ACPI_HANDLE ObjHandle,
814 ACPI_NAMESPACE_NODE *Node;
815 ACPI_NAMESPACE_NODE *PrtNode = NULL;
816 ACPI_NAMESPACE_NODE *CrsNode = NULL;
817 ACPI_NAMESPACE_NODE *PrsNode = NULL;
818 ACPI_NAMESPACE_NODE *AeiNode = NULL;
820 ACPI_BUFFER ReturnObj;
824 Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
825 ParentPath = AcpiNsGetExternalPathname (Node);
828 return (AE_NO_MEMORY);
831 /* Get handles to the resource methods for this device */
833 (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode));
834 (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode));
835 (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode));
836 (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode));
837 if (!PrtNode && !CrsNode && !PrsNode && !AeiNode)
839 goto Cleanup; /* Nothing to do */
842 AcpiOsPrintf ("\nDevice: %s\n", ParentPath);
844 /* Prepare for a return object of arbitrary size */
846 ReturnObj.Pointer = AcpiGbl_DbBuffer;
847 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
854 AcpiOsPrintf ("Evaluating _PRT\n");
856 Status = AcpiEvaluateObject (PrtNode, NULL, NULL, &ReturnObj);
857 if (ACPI_FAILURE (Status))
859 AcpiOsPrintf ("Could not evaluate _PRT: %s\n",
860 AcpiFormatException (Status));
864 ReturnObj.Pointer = AcpiGbl_DbBuffer;
865 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
867 Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
868 if (ACPI_FAILURE (Status))
870 AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
871 AcpiFormatException (Status));
875 AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
884 AcpiOsPrintf ("Evaluating _CRS\n");
886 ReturnObj.Pointer = AcpiGbl_DbBuffer;
887 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
889 Status = AcpiEvaluateObject (CrsNode, NULL, NULL, &ReturnObj);
890 if (ACPI_FAILURE (Status))
892 AcpiOsPrintf ("Could not evaluate _CRS: %s\n",
893 AcpiFormatException (Status));
897 /* This code is here to exercise the AcpiWalkResources interface */
899 Status = AcpiWalkResources (Node, METHOD_NAME__CRS,
900 AcpiDbResourceCallback, NULL);
901 if (ACPI_FAILURE (Status))
903 AcpiOsPrintf ("AcpiWalkResources failed: %s\n",
904 AcpiFormatException (Status));
908 /* Get the _CRS resource list */
910 ReturnObj.Pointer = AcpiGbl_DbBuffer;
911 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
913 Status = AcpiGetCurrentResources (Node, &ReturnObj);
914 if (ACPI_FAILURE (Status))
916 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
917 AcpiFormatException (Status));
921 /* Dump the _CRS resource list */
923 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
927 * Perform comparison of original AML to newly created AML. This tests both
928 * the AML->Resource conversion and the Resource->Aml conversion.
930 Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
932 /* Execute _SRS with the resource list */
934 Status = AcpiSetCurrentResources (Node, &ReturnObj);
935 if (ACPI_FAILURE (Status))
937 AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
938 AcpiFormatException (Status));
949 AcpiOsPrintf ("Evaluating _PRS\n");
951 ReturnObj.Pointer = AcpiGbl_DbBuffer;
952 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
954 Status = AcpiEvaluateObject (PrsNode, NULL, NULL, &ReturnObj);
955 if (ACPI_FAILURE (Status))
957 AcpiOsPrintf ("Could not evaluate _PRS: %s\n",
958 AcpiFormatException (Status));
962 ReturnObj.Pointer = AcpiGbl_DbBuffer;
963 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
965 Status = AcpiGetPossibleResources (Node, &ReturnObj);
966 if (ACPI_FAILURE (Status))
968 AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
969 AcpiFormatException (Status));
973 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
982 AcpiOsPrintf ("Evaluating _AEI\n");
984 ReturnObj.Pointer = AcpiGbl_DbBuffer;
985 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
987 Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnObj);
988 if (ACPI_FAILURE (Status))
990 AcpiOsPrintf ("Could not evaluate _AEI: %s\n",
991 AcpiFormatException (Status));
995 ReturnObj.Pointer = AcpiGbl_DbBuffer;
996 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
998 Status = AcpiGetEventResources (Node, &ReturnObj);
999 if (ACPI_FAILURE (Status))
1001 AcpiOsPrintf ("AcpiGetEventResources failed: %s\n",
1002 AcpiFormatException (Status));
1006 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
1011 ACPI_FREE (ParentPath);
1016 /*******************************************************************************
1018 * FUNCTION: AcpiDbDisplayResources
1020 * PARAMETERS: ObjectArg - String object name or object pointer.
1021 * "*" means "display resources for all devices"
1025 * DESCRIPTION: Display the resource objects associated with a device.
1027 ******************************************************************************/
1030 AcpiDbDisplayResources (
1033 ACPI_NAMESPACE_NODE *Node;
1036 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1037 AcpiDbgLevel |= ACPI_LV_RESOURCES;
1039 /* Asterisk means "display resources for all devices" */
1041 if (!ACPI_STRCMP (ObjectArg, "*"))
1043 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
1044 ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
1048 /* Convert string to object pointer */
1050 Node = AcpiDbConvertToNode (ObjectArg);
1053 if (Node->Type != ACPI_TYPE_DEVICE)
1055 AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n",
1056 Node->Name.Ascii, AcpiUtGetTypeName (Node->Type));
1060 (void) AcpiDbDeviceResources (Node, 0, NULL, NULL);
1065 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1069 #if (!ACPI_REDUCED_HARDWARE)
1070 /*******************************************************************************
1072 * FUNCTION: AcpiDbGenerateGpe
1074 * PARAMETERS: GpeArg - Raw GPE number, ascii string
1075 * BlockArg - GPE block number, ascii string
1076 * 0 or 1 for FADT GPE blocks
1080 * DESCRIPTION: Generate a GPE
1082 ******************************************************************************/
1091 ACPI_GPE_EVENT_INFO *GpeEventInfo;
1094 GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
1095 BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
1098 GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
1102 AcpiOsPrintf ("Invalid GPE\n");
1106 (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
1108 #endif /* !ACPI_REDUCED_HARDWARE */
1110 #endif /* ACPI_DEBUGGER */