diff options
author | jkim <jkim@FreeBSD.org> | 2015-04-11 03:23:41 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2015-04-11 03:23:41 +0000 |
commit | 94f110f31347dc79883dc4c041bb750c9f07e7d2 (patch) | |
tree | 4624054659df9227c59dda7a6d689446bc231b4b /sys/contrib/dev/acpica/components/resources | |
parent | 4cd5f1d88e1d9580b0e7263cd8c3470067b43aa0 (diff) | |
download | FreeBSD-src-94f110f31347dc79883dc4c041bb750c9f07e7d2.zip FreeBSD-src-94f110f31347dc79883dc4c041bb750c9f07e7d2.tar.gz |
Merge ACPICA 20150410.
Diffstat (limited to 'sys/contrib/dev/acpica/components/resources')
4 files changed, 176 insertions, 166 deletions
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c index f05c4fc..decd9a6 100644 --- a/sys/contrib/dev/acpica/components/resources/rsaddr.c +++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c @@ -77,7 +77,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[5] = * Address Translation Offset * Address Length */ - {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Granularity), + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Address.Granularity), AML_OFFSET (Address16.Granularity), 5}, @@ -117,7 +117,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[5] = * Address Translation Offset * Address Length */ - {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Granularity), + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Address.Granularity), AML_OFFSET (Address32.Granularity), 5}, @@ -157,7 +157,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[5] = * Address Translation Offset * Address Length */ - {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Granularity), + {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Address.Granularity), AML_OFFSET (Address64.Granularity), 5}, @@ -203,7 +203,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[5] = * Address Length * Type-Specific Attribute */ - {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Granularity), + {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Address.Granularity), AML_OFFSET (ExtAddress64.Granularity), 6} }; diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c index ddae6e0..9c1a7ec 100644 --- a/sys/contrib/dev/acpica/components/resources/rsdump.c +++ b/sys/contrib/dev/acpica/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. * ******************************************************************************/ @@ -48,8 +48,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 */ @@ -89,8 +91,8 @@ AcpiRsDumpByteList ( static void AcpiRsDumpWordList ( - UINT16 Length, - UINT16 *Data); + UINT16 Length, + UINT16 *Data); static void AcpiRsDumpDwordList ( @@ -99,8 +101,8 @@ AcpiRsDumpDwordList ( static void AcpiRsDumpShortByteList ( - UINT8 Length, - UINT8 *Data); + UINT8 Length, + UINT8 *Data); static void AcpiRsDumpResourceSource ( @@ -113,7 +115,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); + } +} /******************************************************************************* @@ -288,14 +416,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: @@ -399,131 +529,6 @@ AcpiRsDumpAddressCommon ( /******************************************************************************* * - * 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); - } -} - - -/******************************************************************************* - * * FUNCTION: AcpiRsOut* * * PARAMETERS: Title - Name of the resource field @@ -620,8 +625,8 @@ AcpiRsDumpByteList ( static void AcpiRsDumpShortByteList ( - UINT8 Length, - UINT8 *Data) + UINT8 Length, + UINT8 *Data) { UINT8 i; diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c index aab597a..dfa1a84 100644 --- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c +++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c @@ -161,11 +161,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL}, {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.TranslationOffset), + "Translation Offset", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.AddressLength), "Address Length", NULL}, {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL} }; @@ -173,11 +174,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL}, {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.TranslationOffset), + "Translation Offset", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.AddressLength), "Address Length", NULL}, {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL} }; @@ -185,11 +187,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL}, {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.TranslationOffset), + "Translation Offset", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.AddressLength), "Address Length", NULL}, {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL} }; @@ -197,11 +200,13 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL}, {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.TranslationOffset), + "Translation Offset", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.AddressLength), + "Address Length", NULL}, {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL} }; diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c index 2fe3e6f..a477f20 100644 --- a/sys/contrib/dev/acpica/components/resources/rsxface.c +++ b/sys/contrib/dev/acpica/components/resources/rsxface.c @@ -61,11 +61,11 @@ ACPI_COPY_FIELD(Out, In, MinAddressFixed); \ ACPI_COPY_FIELD(Out, In, MaxAddressFixed); \ ACPI_COPY_FIELD(Out, In, Info); \ - ACPI_COPY_FIELD(Out, In, Granularity); \ - ACPI_COPY_FIELD(Out, In, Minimum); \ - ACPI_COPY_FIELD(Out, In, Maximum); \ - ACPI_COPY_FIELD(Out, In, TranslationOffset); \ - ACPI_COPY_FIELD(Out, In, AddressLength); \ + ACPI_COPY_FIELD(Out, In, Address.Granularity); \ + ACPI_COPY_FIELD(Out, In, Address.Minimum); \ + ACPI_COPY_FIELD(Out, In, Address.Maximum); \ + ACPI_COPY_FIELD(Out, In, Address.TranslationOffset); \ + ACPI_COPY_FIELD(Out, In, Address.AddressLength); \ ACPI_COPY_FIELD(Out, In, ResourceSource); |