aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-06-01 00:01:19 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-06-01 00:01:19 +0000
commitaf051161437e44a6ceabf9e196f0eb8f33d92b86 (patch)
treed4411998414d0b3c9958f926b75c18ee1c445421 /sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
parentbbeb726b93c0bed9eccdbf401f810140809bb989 (diff)
parentc457a42be4fca72c51fdca569271b62213d01a37 (diff)
Merge ACPICA 20170531.
Notes
Notes: svn path=/head/; revision=319365
Diffstat (limited to 'sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c')
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c466
1 files changed, 466 insertions, 0 deletions
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index ad1a49361f88..e2cbdaed8797 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -517,6 +517,112 @@ AcpiDmGpioDescriptor (
}
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
+
+ if (Resource->PinFunction.PinConfig <= 3)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
+ }
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
+
+ if (Resource->PinFunction.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ /* Always ResourceConsumer */
+ AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
+ Resource->PinFunction.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinFunction.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
/*******************************************************************************
*
@@ -856,3 +962,363 @@ AcpiDmSerialBusDescriptor (
SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
Info, Resource, Length, Level);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfig
+ *
+ * PARAMETERS: PinConfigType - Pin configuration type
+ * PinConfigValue - Pin configuration value
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Pretty prints PinConfig type and value.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmPinConfig(
+ UINT8 PinConfigType,
+ UINT32 PinConfigValue)
+{
+ if (PinConfigType <= 13)
+ {
+ AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
+ AcpiGbl_PtypDecode[PinConfigType]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
+ }
+
+ /* PinConfigValue */
+
+ AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
+
+ AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
+ Resource->PinConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ if (Resource->PinConfig.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
+ Resource->PinConfig.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinConfig.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroup descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ char *Label;
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ /* Always producer */
+ AcpiOsPrintf ("PinGroup (");
+
+ Label = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroup.LabelOffset),
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroup.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroup.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroup.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = (Resource->PinGroup.LabelOffset -
+ Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroup.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupFunction.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
+
+ AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
+ Resource->PinGroupConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupConfig.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}