summaryrefslogtreecommitdiff
path: root/source/components/resources
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2015-02-27 09:04:18 -0800
committerRobert Moore <Robert.Moore@intel.com>2015-02-27 09:04:18 -0800
commit184f3cc4d162a6b6b2005eacd8be2fe55f19a245 (patch)
tree013b59e90920bdc5ed505b1f6fd020658fc31fad /source/components/resources
parent5cc42916ba82e5fea115693f37afcfce506e4aa4 (diff)
downloadacpica-184f3cc4d162a6b6b2005eacd8be2fe55f19a245.tar.gz
Update Resource descriptor dump module.
- Change global #ifdef to check for ACPI_DEBUGGER only. - Cleanup some long lines and misaligned code.
Diffstat (limited to 'source/components/resources')
-rw-r--r--source/components/resources/rsdump.c281
1 files changed, 142 insertions, 139 deletions
diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c
index 1152984d9..623711859 100644
--- a/source/components/resources/rsdump.c
+++ b/source/components/resources/rsdump.c
@@ -1,6 +1,6 @@
/*******************************************************************************
*
- * Module Name: rsdump - Functions to display the resource structures.
+ * Module Name: rsdump - AML debugger support for resource structures.
*
******************************************************************************/
@@ -120,8 +120,10 @@
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME ("rsdump")
-
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
+/*
+ * All functions in this module are used by the AML Debugger only
+ */
+#if defined(ACPI_DEBUGGER)
/* Local prototypes */
@@ -161,8 +163,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpWordList (
- UINT16 Length,
- UINT16 *Data);
+ UINT16 Length,
+ UINT16 *Data);
static void
AcpiRsDumpDwordList (
@@ -171,8 +173,8 @@ AcpiRsDumpDwordList (
static void
AcpiRsDumpShortByteList (
- UINT8 Length,
- UINT8 *Data);
+ UINT8 Length,
+ UINT8 *Data);
static void
AcpiRsDumpResourceSource (
@@ -185,7 +187,133 @@ AcpiRsDumpAddressCommon (
static void
AcpiRsDumpDescriptor (
void *Resource,
- ACPI_RSDUMP_INFO *Table);
+ ACPI_RSDUMP_INFO *Table);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpResourceList
+ *
+ * PARAMETERS: ResourceList - Pointer to a resource descriptor list
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dispatches the structure to the correct dump routine.
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpResourceList (
+ ACPI_RESOURCE *ResourceList)
+{
+ UINT32 Count = 0;
+ UINT32 Type;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
+ {
+ return;
+ }
+
+ /* Walk list and dump all resource descriptors (END_TAG terminates) */
+
+ do
+ {
+ AcpiOsPrintf ("\n[%02X] ", Count);
+ Count++;
+
+ /* Validate Type before dispatch */
+
+ Type = ResourceList->Type;
+ if (Type > ACPI_RESOURCE_TYPE_MAX)
+ {
+ AcpiOsPrintf (
+ "Invalid descriptor type (%X) in resource list\n",
+ ResourceList->Type);
+ return;
+ }
+
+ /* Sanity check the length. It must not be zero, or we loop forever */
+
+ if (!ResourceList->Length)
+ {
+ AcpiOsPrintf (
+ "Invalid zero length descriptor in resource list\n");
+ return;
+ }
+
+ /* Dump the resource descriptor */
+
+ if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpSerialBusDispatch[
+ ResourceList->Data.CommonSerialBus.Type]);
+ }
+ else
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpResourceDispatch[Type]);
+ }
+
+ /* Point to the next resource structure */
+
+ ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
+
+ /* Exit when END_TAG descriptor is reached */
+
+ } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpIrqList
+ *
+ * PARAMETERS: RouteTable - Pointer to the routing table to dump.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print IRQ routing table
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpIrqList (
+ UINT8 *RouteTable)
+{
+ ACPI_PCI_ROUTING_TABLE *PrtElement;
+ UINT8 Count;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
+ {
+ return;
+ }
+
+ PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
+
+ /* Dump all table elements, Exit on zero length element */
+
+ for (Count = 0; PrtElement->Length; Count++)
+ {
+ AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
+ AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
+
+ PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
+ PrtElement, PrtElement->Length);
+ }
+}
/*******************************************************************************
@@ -360,14 +488,16 @@ AcpiRsDumpDescriptor (
/*
* Common flags for all Address resources
*/
- AcpiRsDumpAddressCommon (ACPI_CAST_PTR (ACPI_RESOURCE_DATA, Target));
+ AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
+ ACPI_RESOURCE_DATA, Target));
break;
case ACPI_RSD_SOURCE:
/*
* Optional ResourceSource for Address resources
*/
- AcpiRsDumpResourceSource (ACPI_CAST_PTR (ACPI_RESOURCE_SOURCE, Target));
+ AcpiRsDumpResourceSource (ACPI_CAST_PTR (
+ ACPI_RESOURCE_SOURCE, Target));
break;
default:
@@ -469,133 +599,6 @@ AcpiRsDumpAddressCommon (
}
-#ifdef ACPI_EXEC_APP
-/*******************************************************************************
- *
- * FUNCTION: AcpiRsDumpResourceList
- *
- * PARAMETERS: ResourceList - Pointer to a resource descriptor list
- *
- * RETURN: None
- *
- * DESCRIPTION: Dispatches the structure to the correct dump routine.
- *
- ******************************************************************************/
-
-void
-AcpiRsDumpResourceList (
- ACPI_RESOURCE *ResourceList)
-{
- UINT32 Count = 0;
- UINT32 Type;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* Check if debug output enabled */
-
- if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
- {
- return;
- }
-
- /* Walk list and dump all resource descriptors (END_TAG terminates) */
-
- do
- {
- AcpiOsPrintf ("\n[%02X] ", Count);
- Count++;
-
- /* Validate Type before dispatch */
-
- Type = ResourceList->Type;
- if (Type > ACPI_RESOURCE_TYPE_MAX)
- {
- AcpiOsPrintf (
- "Invalid descriptor type (%X) in resource list\n",
- ResourceList->Type);
- return;
- }
-
- /* Sanity check the length. It must not be zero, or we loop forever */
-
- if (!ResourceList->Length)
- {
- AcpiOsPrintf (
- "Invalid zero length descriptor in resource list\n");
- return;
- }
-
- /* Dump the resource descriptor */
-
- if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
- {
- AcpiRsDumpDescriptor (&ResourceList->Data,
- AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]);
- }
- else
- {
- AcpiRsDumpDescriptor (&ResourceList->Data,
- AcpiGbl_DumpResourceDispatch[Type]);
- }
-
- /* Point to the next resource structure */
-
- ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
-
- /* Exit when END_TAG descriptor is reached */
-
- } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiRsDumpIrqList
- *
- * PARAMETERS: RouteTable - Pointer to the routing table to dump.
- *
- * RETURN: None
- *
- * DESCRIPTION: Print IRQ routing table
- *
- ******************************************************************************/
-
-void
-AcpiRsDumpIrqList (
- UINT8 *RouteTable)
-{
- ACPI_PCI_ROUTING_TABLE *PrtElement;
- UINT8 Count;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* Check if debug output enabled */
-
- if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
- {
- return;
- }
-
- PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
-
- /* Dump all table elements, Exit on zero length element */
-
- for (Count = 0; PrtElement->Length; Count++)
- {
- AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
- AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
-
- PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
- PrtElement, PrtElement->Length);
- }
-}
-#endif
-
-
/*******************************************************************************
*
* FUNCTION: AcpiRsOut*
@@ -694,8 +697,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpShortByteList (
- UINT8 Length,
- UINT8 *Data)
+ UINT8 Length,
+ UINT8 *Data)
{
UINT8 i;