Print this page
acpica-unix2-20130823
PANKOVs restructure
*** 3,13 ****
* Module Name: dbdisply - debug display commands
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
--- 3,13 ----
* Module Name: dbdisply - debug display commands
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2013, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*** 66,83 ****
--- 66,90 ----
static void *
AcpiDbGetPointer (
void *Target);
+ static ACPI_STATUS
+ AcpiDbDisplayNonRootHandlers (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
/*
* System handler information.
* Used for Handlers command, in AcpiDbDisplayHandlers.
*/
#define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
#define ACPI_HANDLER_NAME_STRING "%30s : "
#define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
+ #define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)"
#define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
/* All predefined Address Space IDs */
static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
*** 88,97 ****
--- 95,106 ----
ACPI_ADR_SPACE_EC,
ACPI_ADR_SPACE_SMBUS,
ACPI_ADR_SPACE_CMOS,
ACPI_ADR_SPACE_PCI_BAR_TARGET,
ACPI_ADR_SPACE_IPMI,
+ ACPI_ADR_SPACE_GPIO,
+ ACPI_ADR_SPACE_GSBUS,
ACPI_ADR_SPACE_DATA_TABLE,
ACPI_ADR_SPACE_FIXED_HARDWARE
};
/* Global handler information */
*** 103,114 ****
} ACPI_HANDLER_INFO;
static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
{
! {&AcpiGbl_SystemNotify.Handler, "System Notifications"},
! {&AcpiGbl_DeviceNotify.Handler, "Device Notifications"},
{&AcpiGbl_TableHandler, "ACPI Table Events"},
{&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
{&AcpiGbl_InterfaceHandler, "OSI Invocations"}
};
--- 112,123 ----
} ACPI_HANDLER_INFO;
static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
{
! {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
! {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
{&AcpiGbl_TableHandler, "ACPI Table Events"},
{&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
{&AcpiGbl_InterfaceHandler, "OSI Invocations"}
};
*** 128,140 ****
static void *
AcpiDbGetPointer (
void *Target)
{
void *ObjPtr;
! ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));
return (ObjPtr);
}
/*******************************************************************************
--- 137,151 ----
static void *
AcpiDbGetPointer (
void *Target)
{
void *ObjPtr;
+ ACPI_SIZE Address;
! Address = ACPI_STRTOUL (Target, NULL, 16);
! ObjPtr = ACPI_TO_POINTER (Address);
return (ObjPtr);
}
/*******************************************************************************
*** 254,264 ****
}
Node = ObjPtr;
goto DumpNode;
-
case ACPI_DESC_TYPE_OPERAND:
/* This is a ACPI OPERAND OBJECT */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
--- 265,274 ----
*** 266,281 ****
AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
ObjPtr);
return;
}
! AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjPtr, 1);
break;
-
case ACPI_DESC_TYPE_PARSER:
/* This is a Parser Op object */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
--- 276,290 ----
AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
ObjPtr);
return;
}
! AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjPtr, 1);
break;
case ACPI_DESC_TYPE_PARSER:
/* This is a Parser Op object */
if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
*** 283,298 ****
AcpiOsPrintf (
"Cannot read entire Parser object at address %p\n", ObjPtr);
return;
}
! AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
ACPI_UINT32_MAX);
AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
break;
-
default:
/* Is not a recognizeable object */
Size = 16;
--- 292,306 ----
AcpiOsPrintf (
"Cannot read entire Parser object at address %p\n", ObjPtr);
return;
}
! AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
ACPI_UINT32_MAX);
AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
break;
default:
/* Is not a recognizeable object */
Size = 16;
*** 301,311 ****
Size = 64;
}
/* Just dump some memory */
! AcpiUtDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
break;
}
return;
}
--- 309,319 ----
Size = 64;
}
/* Just dump some memory */
! AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
break;
}
return;
}
*** 338,348 ****
{
AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
return;
}
! AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
Display, ACPI_UINT32_MAX);
AcpiExDumpNamespaceNode (Node, 1);
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
--- 346,356 ----
{
AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
return;
}
! AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
Display, ACPI_UINT32_MAX);
AcpiExDumpNamespaceNode (Node, 1);
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
*** 353,363 ****
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
ObjDesc);
return;
}
! AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
Display, ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjDesc, 1);
}
}
--- 361,371 ----
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
ObjDesc);
return;
}
! AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
Display, ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjDesc, 1);
}
}
*** 435,458 ****
--- 443,469 ----
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
switch (OpInfo->Class)
{
case AML_CLASS_ARGUMENT:
+
if (CountRemaining)
{
NumRemainingOperands++;
}
NumOperands++;
break;
case AML_CLASS_UNKNOWN:
+
/* Bad opcode or ASCII character */
continue;
default:
+
if (CountRemaining)
{
NumRemainingOperators++;
}
*** 639,697 ****
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayObjectType
*
! * PARAMETERS: ObjectArg - User entered NS node handle
*
* RETURN: None
*
* DESCRIPTION: Display type of an arbitrary NS node
*
******************************************************************************/
void
AcpiDbDisplayObjectType (
! char *ObjectArg)
{
! ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *Info;
ACPI_STATUS Status;
UINT32 i;
! Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
! Status = AcpiGetObjectInfo (Handle, &Info);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get object info, %s\n",
AcpiFormatException (Status));
return;
}
AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
ACPI_FORMAT_UINT64 (Info->Address),
Info->CurrentStatus, Info->Flags);
!
AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
Info->HighestDstates[0], Info->HighestDstates[1],
Info->HighestDstates[2], Info->HighestDstates[3]);
!
AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
Info->LowestDstates[0], Info->LowestDstates[1],
Info->LowestDstates[2], Info->LowestDstates[3],
Info->LowestDstates[4]);
if (Info->Valid & ACPI_VALID_HID)
{
AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
}
if (Info->Valid & ACPI_VALID_UID)
{
AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
}
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
{
AcpiOsPrintf ("CID %u: %s\n", i,
--- 650,723 ----
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayObjectType
*
! * PARAMETERS: Name - User entered NS node handle or name
*
* RETURN: None
*
* DESCRIPTION: Display type of an arbitrary NS node
*
******************************************************************************/
void
AcpiDbDisplayObjectType (
! char *Name)
{
! ACPI_NAMESPACE_NODE *Node;
ACPI_DEVICE_INFO *Info;
ACPI_STATUS Status;
UINT32 i;
! Node = AcpiDbConvertToNode (Name);
! if (!Node)
! {
! return;
! }
! Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get object info, %s\n",
AcpiFormatException (Status));
return;
}
+ if (Info->Valid & ACPI_VALID_ADR)
+ {
AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
ACPI_FORMAT_UINT64 (Info->Address),
Info->CurrentStatus, Info->Flags);
! }
! if (Info->Valid & ACPI_VALID_SXDS)
! {
AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
Info->HighestDstates[0], Info->HighestDstates[1],
Info->HighestDstates[2], Info->HighestDstates[3]);
! }
! if (Info->Valid & ACPI_VALID_SXWS)
! {
AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
Info->LowestDstates[0], Info->LowestDstates[1],
Info->LowestDstates[2], Info->LowestDstates[3],
Info->LowestDstates[4]);
+ }
if (Info->Valid & ACPI_VALID_HID)
{
AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
}
if (Info->Valid & ACPI_VALID_UID)
{
AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
}
+ if (Info->Valid & ACPI_VALID_SUB)
+ {
+ AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
+ }
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
{
AcpiOsPrintf ("CID %u: %s\n", i,
*** 766,775 ****
--- 792,802 ----
AcpiOsPrintf ("ArgObj: ");
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
}
+ #if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayGpes
*
* PARAMETERS: None
*** 787,800 ****
--- 814,829 ----
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
char *GpeType;
+ ACPI_GPE_NOTIFY_INFO *Notify;
UINT32 GpeIndex;
UINT32 Block = 0;
UINT32 i;
UINT32 j;
+ UINT32 Count;
char Buffer[80];
ACPI_BUFFER RetBuf;
ACPI_STATUS Status;
*** 902,923 ****
}
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
{
case ACPI_GPE_DISPATCH_NONE:
AcpiOsPrintf ("NotUsed");
break;
case ACPI_GPE_DISPATCH_METHOD:
AcpiOsPrintf ("Method");
break;
case ACPI_GPE_DISPATCH_HANDLER:
AcpiOsPrintf ("Handler");
break;
case ACPI_GPE_DISPATCH_NOTIFY:
! AcpiOsPrintf ("Notify");
break;
default:
AcpiOsPrintf ("UNKNOWN: %X",
GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
break;
}
--- 931,967 ----
}
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
{
case ACPI_GPE_DISPATCH_NONE:
+
AcpiOsPrintf ("NotUsed");
break;
+
case ACPI_GPE_DISPATCH_METHOD:
+
AcpiOsPrintf ("Method");
break;
case ACPI_GPE_DISPATCH_HANDLER:
+
AcpiOsPrintf ("Handler");
break;
+
case ACPI_GPE_DISPATCH_NOTIFY:
!
! Count = 0;
! Notify = GpeEventInfo->Dispatch.NotifyList;
! while (Notify)
! {
! Count++;
! Notify = Notify->Next;
! }
! AcpiOsPrintf ("Implicit Notify on %u devices", Count);
break;
+
default:
+
AcpiOsPrintf ("UNKNOWN: %X",
GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
break;
}
*** 928,937 ****
--- 972,982 ----
GpeBlock = GpeBlock->Next;
}
GpeXruptInfo = GpeXruptInfo->Next;
}
}
+ #endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayHandlers
*** 954,964 ****
UINT32 i;
/* Operation region handlers */
! AcpiOsPrintf ("\nOperation Region Handlers:\n");
ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
if (ObjDesc)
{
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
--- 999,1009 ----
UINT32 i;
/* Operation region handlers */
! AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n");
ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
if (ObjDesc)
{
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
*** 969,979 ****
AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
while (HandlerObj)
{
! if (i == HandlerObj->AddressSpace.SpaceId)
{
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
(HandlerObj->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
HandlerObj->AddressSpace.Handler);
--- 1014,1024 ----
AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
while (HandlerObj)
{
! if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
{
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
(HandlerObj->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
HandlerObj->AddressSpace.Handler);
*** 987,998 ****
--- 1032,1063 ----
AcpiOsPrintf ("None\n");
FoundHandler:;
}
+
+ /* Find all handlers for user-defined SpaceIDs */
+
+ HandlerObj = ObjDesc->Device.Handler;
+ while (HandlerObj)
+ {
+ if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
+ {
+ AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
+ "User-defined ID", HandlerObj->AddressSpace.SpaceId);
+ AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
+ (HandlerObj->AddressSpace.HandlerFlags &
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
+ HandlerObj->AddressSpace.Handler);
}
+ HandlerObj = HandlerObj->AddressSpace.Next;
+ }
+ }
+
+ #if (!ACPI_REDUCED_HARDWARE)
+
/* Fixed event handlers */
AcpiOsPrintf ("\nFixed Event Handlers:\n");
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
*** 1007,1016 ****
--- 1072,1083 ----
{
AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
}
}
+ #endif /* !ACPI_REDUCED_HARDWARE */
+
/* Miscellaneous global handlers */
AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
*** 1024,1031 ****
--- 1091,1169 ----
else
{
AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
}
}
+
+
+ /* Other handlers that are installed throughout the namespace */
+
+ AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n");
+
+ (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers,
+ NULL, NULL, NULL);
}
+
+ /*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDisplayNonRootHandlers
+ *
+ * PARAMETERS: ACPI_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Display information about all handlers installed for a
+ * device object.
+ *
+ ******************************************************************************/
+
+ static ACPI_STATUS
+ AcpiDbDisplayNonRootHandlers (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+ {
+ ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *HandlerObj;
+ char *Pathname;
+
+
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ return (AE_OK);
+ }
+
+ Pathname = AcpiNsGetExternalPathname (Node);
+ if (!Pathname)
+ {
+ return (AE_OK);
+ }
+
+ /* Display all handlers associated with this device */
+
+ HandlerObj = ObjDesc->Device.Handler;
+ while (HandlerObj)
+ {
+ AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
+ AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId),
+ HandlerObj->AddressSpace.SpaceId);
+
+ AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2,
+ (HandlerObj->AddressSpace.HandlerFlags &
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
+ HandlerObj->AddressSpace.Handler);
+
+ AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node);
+
+ HandlerObj = HandlerObj->AddressSpace.Next;
+ }
+
+ ACPI_FREE (Pathname);
+ return (AE_OK);
+ }
+
#endif /* ACPI_DEBUGGER */