Index: sys/contrib/dev/acpica/rscalc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/rscalc.c,v retrieving revision 1.1.1.19 diff -u -r1.1.1.19 rscalc.c --- sys/contrib/dev/acpica/rscalc.c 1 Nov 2005 22:11:06 -0000 1.1.1.19 +++ sys/contrib/dev/acpica/rscalc.c 4 Nov 2005 16:58:04 -0000 @@ -487,8 +487,7 @@ * Get the number of bits set in the IRQ word */ ACPI_MOVE_16_TO_16 (&Temp16, Buffer); - ExtraStructBytes = (AcpiRsCountSetBits (Temp16) * - sizeof (UINT32)); + ExtraStructBytes = AcpiRsCountSetBits (Temp16); break; @@ -497,9 +496,7 @@ * DMA Resource: * Get the number of bits set in the DMA channels byte */ - ACPI_MOVE_16_TO_16 (&Temp16, Buffer); - ExtraStructBytes = (AcpiRsCountSetBits (Temp16) * - sizeof (UINT32)); + ExtraStructBytes = AcpiRsCountSetBits (*Buffer); break; @@ -515,10 +512,10 @@ case ACPI_RESOURCE_NAME_END_TAG: /* * End Tag: - * Terminate the loop now + * This is the normal exit, add size of EndTag */ - AmlBufferLength = BytesParsed; - break; + *SizeNeeded = BufferSize + ACPI_RS_SIZE_MIN; + return_ACPI_STATUS (AE_OK); default: @@ -598,7 +595,7 @@ /* Update the required buffer size for the internal descriptor structs */ Temp16 = (UINT16) (ResourceInfo->MinimumInternalStructLength + ExtraStructBytes); - BufferSize += (UINT32) ACPI_ALIGN_RESOURCE_SIZE (Temp16); + BufferSize += (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (Temp16); /* * Update byte count and point to the next resource within the stream