diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index 321069d45..583a530ef 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -1,12 +1,11 @@ - -/****************************************************************************** +/******************************************************************************* * * Module Name: rscreate - AcpiRsCreateResourceList * AcpiRsCreatePciRoutingTable * AcpiRsCreateByteStream - * $Revision: 1.14 $ + * $Revision: 1.21 $ * - *****************************************************************************/ + ******************************************************************************/ /****************************************************************************** * @@ -124,7 +123,7 @@ #include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER - MODULE_NAME ("rscreate"); + MODULE_NAME ("rscreate") /******************************************************************************* @@ -149,7 +148,7 @@ ACPI_STATUS AcpiRsCreateResourceList ( - ACPI_OBJECT_INTERNAL *ByteStreamBuffer, + ACPI_OPERAND_OBJECT *ByteStreamBuffer, UINT8 *OutputBuffer, UINT32 *OutputBufferLength) { @@ -162,13 +161,14 @@ AcpiRsCreateResourceList ( FUNCTION_TRACE ("RsCreateResourceList"); + DEBUG_PRINT (VERBOSE_INFO, ("RsCreateResourceList: ByteStreamBuffer = %p\n", ByteStreamBuffer)); /* * Params already validated, so we don't re-validate here */ - + ByteStreamBufferLength = ByteStreamBuffer->Buffer.Length; ByteStreamStart = ByteStreamBuffer->Buffer.Pointer; @@ -237,7 +237,7 @@ AcpiRsCreateResourceList ( * FUNCTION: AcpiRsCreatePciRoutingTable * * PARAMETERS: - * PackageObject - Pointer to an ACPI_OBJECT_INTERNAL + * PackageObject - Pointer to an ACPI_OPERAND_OBJECT * package * OutputBuffer - Pointer to the user's buffer * OutputBufferLength - Size of OutputBuffer @@ -247,21 +247,21 @@ AcpiRsCreateResourceList ( * AE_BUFFER_OVERFLOW and OutputBufferLength will point * to the size buffer needed. * - * DESCRIPTION: Takes the ACPI_OBJECT_INTERNAL package and creates a + * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a * linked list of PCI interrupt descriptions * ******************************************************************************/ ACPI_STATUS AcpiRsCreatePciRoutingTable ( - ACPI_OBJECT_INTERNAL *PackageObject, + ACPI_OPERAND_OBJECT *PackageObject, UINT8 *OutputBuffer, UINT32 *OutputBufferLength) { UINT8 *Buffer = OutputBuffer; - ACPI_OBJECT_INTERNAL **TopObjectList = NULL; - ACPI_OBJECT_INTERNAL **SubObjectList = NULL; - ACPI_OBJECT_INTERNAL *PackageElement = NULL; + ACPI_OPERAND_OBJECT **TopObjectList = NULL; + ACPI_OPERAND_OBJECT **SubObjectList = NULL; + ACPI_OPERAND_OBJECT *PackageElement = NULL; UINT32 BufferSizeNeeded = 0; UINT32 NumberOfElements = 0; UINT32 Index = 0; @@ -271,6 +271,7 @@ AcpiRsCreatePciRoutingTable ( FUNCTION_TRACE ("RsCreatePciRoutingTable"); + /* * Params already validated, so we don't re-validate here */ @@ -298,11 +299,12 @@ AcpiRsCreatePciRoutingTable ( * contain a UINT32 Address, a UINT8 Pin, a Name and a UINT8 * SourceIndex. */ - TopObjectList = PackageObject->Package.Elements; + TopObjectList = PackageObject->Package.Elements; + NumberOfElements = PackageObject->Package.Count; + UserPrt = (PCI_ROUTING_TABLE *) Buffer; - NumberOfElements = PackageObject->Package.Count; - UserPrt = (PCI_ROUTING_TABLE *) Buffer; + Buffer = ROUND_PTR_UP_TO_8 (Buffer, UINT8); for (Index = 0; Index < NumberOfElements; Index++) { @@ -315,6 +317,7 @@ AcpiRsCreatePciRoutingTable ( Buffer += UserPrt->Length; UserPrt = (PCI_ROUTING_TABLE *) Buffer; + /* * Fill in the Length field with the information we * have at this point. @@ -357,7 +360,7 @@ AcpiRsCreatePciRoutingTable ( if (ACPI_TYPE_NUMBER == (*SubObjectList)->Common.Type) { UserPrt->Data.Pin = - (*SubObjectList)->Number.Value; + (UINT32) (*SubObjectList)->Number.Value; } else @@ -379,8 +382,6 @@ AcpiRsCreatePciRoutingTable ( * Add to the Length field the length of the string */ UserPrt->Length += (*SubObjectList)->String.Length; - UserPrt->Length = - ROUND_UP_TO_32BITS (UserPrt->Length); } else @@ -405,6 +406,10 @@ AcpiRsCreatePciRoutingTable ( } } + /* Now align the current length */ + + UserPrt->Length = ROUND_UP_TO_64BITS (UserPrt->Length); + /* * Dereference the Source Index */ @@ -413,7 +418,7 @@ AcpiRsCreatePciRoutingTable ( if (ACPI_TYPE_NUMBER == (*SubObjectList)->Common.Type) { UserPrt->Data.SourceIndex = - (*SubObjectList)->Number.Value; + (UINT32) (*SubObjectList)->Number.Value; } else @@ -422,7 +427,7 @@ AcpiRsCreatePciRoutingTable ( } /* - * Point to the next ACPI_OBJECT_INTERNAL + * Point to the next ACPI_OPERAND_OBJECT */ TopObjectList++; } @@ -445,7 +450,6 @@ AcpiRsCreatePciRoutingTable ( *OutputBufferLength = BufferSizeNeeded; return_ACPI_STATUS (AE_OK); - } @@ -481,6 +485,7 @@ AcpiRsCreateByteStream ( FUNCTION_TRACE ("RsCreateByteStream"); + DEBUG_PRINT (VERBOSE_INFO, ("RsCreateByteStream: LinkedListBuffer = %p\n", LinkedListBuffer)); @@ -542,6 +547,5 @@ AcpiRsCreateByteStream ( } return_ACPI_STATUS (AE_OK); - }