summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/rsmemory.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/rsmemory.c')
-rw-r--r--sys/contrib/dev/acpica/rsmemory.c154
1 files changed, 74 insertions, 80 deletions
diff --git a/sys/contrib/dev/acpica/rsmemory.c b/sys/contrib/dev/acpica/rsmemory.c
index 368f765..2da4523 100644
--- a/sys/contrib/dev/acpica/rsmemory.c
+++ b/sys/contrib/dev/acpica/rsmemory.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsmem24 - Memory resource descriptors
- * $Revision: 14 $
+ * $Revision: 17 $
*
******************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -120,7 +120,7 @@
#include "acresrc.h"
#define _COMPONENT ACPI_RESOURCES
- MODULE_NAME ("rsmemory")
+ ACPI_MODULE_NAME ("rsmemory")
/*******************************************************************************
@@ -129,13 +129,12 @@
*
* PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
* stream
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes consumed from
- * the ByteStreamBuffer
- * OutputBuffer - Pointer to the user's return buffer
- * StructureSize - UINT32 pointer that is filled with
- * the number of bytes in the filled
- * in structure
+ * BytesConsumed - Pointer to where the number of bytes
+ * consumed the ByteStreamBuffer is
+ * returned
+ * OutputBuffer - Pointer to the return data buffer
+ * StructureSize - Pointer to where the number of bytes
+ * in the return data struct is returned
*
* RETURN: Status
*
@@ -148,18 +147,18 @@
ACPI_STATUS
AcpiRsMemory24Resource (
UINT8 *ByteStreamBuffer,
- UINT32 *BytesConsumed,
+ ACPI_SIZE *BytesConsumed,
UINT8 **OutputBuffer,
- UINT32 *StructureSize)
+ ACPI_SIZE *StructureSize)
{
UINT8 *Buffer = ByteStreamBuffer;
ACPI_RESOURCE *OutputStruct = (ACPI_RESOURCE *) *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- UINT32 StructSize = SIZEOF_RESOURCE (ACPI_RESOURCE_MEM24);
+ ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM24);
- FUNCTION_TRACE ("RsMemory24Resource");
+ ACPI_FUNCTION_TRACE ("RsMemory24Resource");
/*
@@ -167,7 +166,7 @@ AcpiRsMemory24Resource (
*/
Buffer += 1;
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
*BytesConsumed = Temp16 + 3;
OutputStruct->Id = ACPI_RSTYPE_MEM24;
@@ -182,28 +181,28 @@ AcpiRsMemory24Resource (
/*
* Get MinBaseAddress (Bytes 4-5)
*/
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
OutputStruct->Data.Memory24.MinBaseAddress = Temp16;
/*
* Get MaxBaseAddress (Bytes 6-7)
*/
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
OutputStruct->Data.Memory24.MaxBaseAddress = Temp16;
/*
* Get Alignment (Bytes 8-9)
*/
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
OutputStruct->Data.Memory24.Alignment = Temp16;
/*
* Get RangeLength (Bytes 10-11)
*/
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
OutputStruct->Data.Memory24.RangeLength = Temp16;
/*
@@ -225,9 +224,8 @@ AcpiRsMemory24Resource (
*
* PARAMETERS: LinkedList - Pointer to the resource linked list
* OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes of the
- * OutputBuffer used
+ * BytesConsumed - Pointer to where the number of bytes
+ * used in the OutputBuffer is returned
*
* RETURN: Status
*
@@ -240,14 +238,14 @@ ACPI_STATUS
AcpiRsMemory24Stream (
ACPI_RESOURCE *LinkedList,
UINT8 **OutputBuffer,
- UINT32 *BytesConsumed)
+ ACPI_SIZE *BytesConsumed)
{
UINT8 *Buffer = *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- FUNCTION_TRACE ("RsMemory24Stream");
+ ACPI_FUNCTION_TRACE ("RsMemory24Stream");
/*
@@ -260,7 +258,7 @@ AcpiRsMemory24Stream (
* The length field is static
*/
Temp16 = 0x09;
- MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
Buffer += 2;
/*
@@ -273,31 +271,31 @@ AcpiRsMemory24Stream (
/*
* Set the Range minimum base address
*/
- MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MinBaseAddress);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MinBaseAddress);
Buffer += 2;
/*
* Set the Range maximum base address
*/
- MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MaxBaseAddress);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.MaxBaseAddress);
Buffer += 2;
/*
* Set the base alignment
*/
- MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.Alignment);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.Alignment);
Buffer += 2;
/*
* Set the range length
*/
- MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.RangeLength);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &LinkedList->Data.Memory24.RangeLength);
Buffer += 2;
/*
* Return the number of bytes consumed in this operation
*/
- *BytesConsumed = POINTER_DIFF (Buffer, *OutputBuffer);
+ *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
return_ACPI_STATUS (AE_OK);
}
@@ -308,13 +306,12 @@ AcpiRsMemory24Stream (
*
* PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
* stream
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes consumed from
- * the ByteStreamBuffer
- * OutputBuffer - Pointer to the user's return buffer
- * StructureSize - UINT32 pointer that is filled with
- * the number of bytes in the filled
- * in structure
+ * BytesConsumed - Pointer to where the number of bytes
+ * consumed the ByteStreamBuffer is
+ * returned
+ * OutputBuffer - Pointer to the return data buffer
+ * StructureSize - Pointer to where the number of bytes
+ * in the return data struct is returned
*
* RETURN: Status
*
@@ -327,18 +324,18 @@ AcpiRsMemory24Stream (
ACPI_STATUS
AcpiRsMemory32RangeResource (
UINT8 *ByteStreamBuffer,
- UINT32 *BytesConsumed,
+ ACPI_SIZE *BytesConsumed,
UINT8 **OutputBuffer,
- UINT32 *StructureSize)
+ ACPI_SIZE *StructureSize)
{
UINT8 *Buffer = ByteStreamBuffer;
ACPI_RESOURCE *OutputStruct = (ACPI_RESOURCE *) *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- UINT32 StructSize = SIZEOF_RESOURCE (ACPI_RESOURCE_MEM32);
+ ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_MEM32);
- FUNCTION_TRACE ("RsMemory32RangeResource");
+ ACPI_FUNCTION_TRACE ("RsMemory32RangeResource");
/*
@@ -346,7 +343,7 @@ AcpiRsMemory32RangeResource (
*/
Buffer += 1;
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
*BytesConsumed = Temp16 + 3;
@@ -373,27 +370,27 @@ AcpiRsMemory32RangeResource (
/*
* Get MinBaseAddress (Bytes 4-7)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MinBaseAddress,
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MinBaseAddress,
Buffer);
Buffer += 4;
/*
* Get MaxBaseAddress (Bytes 8-11)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MaxBaseAddress,
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.MaxBaseAddress,
Buffer);
Buffer += 4;
/*
* Get Alignment (Bytes 12-15)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.Alignment, Buffer);
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.Alignment, Buffer);
Buffer += 4;
/*
* Get RangeLength (Bytes 16-19)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.RangeLength, Buffer);
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.Memory32.RangeLength, Buffer);
/*
* Set the Length parameter
@@ -414,13 +411,12 @@ AcpiRsMemory32RangeResource (
*
* PARAMETERS: ByteStreamBuffer - Pointer to the resource input byte
* stream
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes consumed from
- * the ByteStreamBuffer
- * OutputBuffer - Pointer to the user's return buffer
- * StructureSize - UINT32 pointer that is filled with
- * the number of bytes in the filled
- * in structure
+ * BytesConsumed - Pointer to where the number of bytes
+ * consumed the ByteStreamBuffer is
+ * returned
+ * OutputBuffer - Pointer to the return data buffer
+ * StructureSize - Pointer to where the number of bytes
+ * in the return data struct is returned
*
* RETURN: Status
*
@@ -433,25 +429,25 @@ AcpiRsMemory32RangeResource (
ACPI_STATUS
AcpiRsFixedMemory32Resource (
UINT8 *ByteStreamBuffer,
- UINT32 *BytesConsumed,
+ ACPI_SIZE *BytesConsumed,
UINT8 **OutputBuffer,
- UINT32 *StructureSize)
+ ACPI_SIZE *StructureSize)
{
UINT8 *Buffer = ByteStreamBuffer;
ACPI_RESOURCE *OutputStruct = (ACPI_RESOURCE *) *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- UINT32 StructSize = SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEM32);
+ ACPI_SIZE StructSize = ACPI_SIZEOF_RESOURCE (ACPI_RESOURCE_FIXED_MEM32);
- FUNCTION_TRACE ("RsFixedMemory32Resource");
+ ACPI_FUNCTION_TRACE ("RsFixedMemory32Resource");
/*
* Point past the Descriptor to get the number of bytes consumed
*/
Buffer += 1;
- MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
+ ACPI_MOVE_UNALIGNED16_TO_16 (&Temp16, Buffer);
Buffer += 2;
*BytesConsumed = Temp16 + 3;
@@ -468,14 +464,14 @@ AcpiRsFixedMemory32Resource (
/*
* Get RangeBaseAddress (Bytes 4-7)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeBaseAddress,
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeBaseAddress,
Buffer);
Buffer += 4;
/*
* Get RangeLength (Bytes 8-11)
*/
- MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeLength,
+ ACPI_MOVE_UNALIGNED32_TO_32 (&OutputStruct->Data.FixedMemory32.RangeLength,
Buffer);
/*
@@ -497,9 +493,8 @@ AcpiRsFixedMemory32Resource (
*
* PARAMETERS: LinkedList - Pointer to the resource linked list
* OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes of the
- * OutputBuffer used
+ * BytesConsumed - Pointer to where the number of bytes
+ * used in the OutputBuffer is returned
*
* RETURN: Status
*
@@ -512,14 +507,14 @@ ACPI_STATUS
AcpiRsMemory32RangeStream (
ACPI_RESOURCE *LinkedList,
UINT8 **OutputBuffer,
- UINT32 *BytesConsumed)
+ ACPI_SIZE *BytesConsumed)
{
UINT8 *Buffer = *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- FUNCTION_TRACE ("RsMemory32RangeStream");
+ ACPI_FUNCTION_TRACE ("RsMemory32RangeStream");
/*
@@ -533,7 +528,7 @@ AcpiRsMemory32RangeStream (
*/
Temp16 = 0x11;
- MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
Buffer += 2;
/*
@@ -546,31 +541,31 @@ AcpiRsMemory32RangeStream (
/*
* Set the Range minimum base address
*/
- MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MinBaseAddress);
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MinBaseAddress);
Buffer += 4;
/*
* Set the Range maximum base address
*/
- MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MaxBaseAddress);
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.MaxBaseAddress);
Buffer += 4;
/*
* Set the base alignment
*/
- MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.Alignment);
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.Alignment);
Buffer += 4;
/*
* Set the range length
*/
- MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.RangeLength);
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer, &LinkedList->Data.Memory32.RangeLength);
Buffer += 4;
/*
* Return the number of bytes consumed in this operation
*/
- *BytesConsumed = POINTER_DIFF (Buffer, *OutputBuffer);
+ *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
return_ACPI_STATUS (AE_OK);
}
@@ -581,9 +576,8 @@ AcpiRsMemory32RangeStream (
*
* PARAMETERS: LinkedList - Pointer to the resource linked list
* OutputBuffer - Pointer to the user's return buffer
- * BytesConsumed - UINT32 pointer that is filled with
- * the number of bytes of the
- * OutputBuffer used
+ * BytesConsumed - Pointer to where the number of bytes
+ * used in the OutputBuffer is returned
*
* RETURN: Status
*
@@ -596,14 +590,14 @@ ACPI_STATUS
AcpiRsFixedMemory32Stream (
ACPI_RESOURCE *LinkedList,
UINT8 **OutputBuffer,
- UINT32 *BytesConsumed)
+ ACPI_SIZE *BytesConsumed)
{
UINT8 *Buffer = *OutputBuffer;
UINT16 Temp16 = 0;
UINT8 Temp8 = 0;
- FUNCTION_TRACE ("RsFixedMemory32Stream");
+ ACPI_FUNCTION_TRACE ("RsFixedMemory32Stream");
/*
@@ -617,7 +611,7 @@ AcpiRsFixedMemory32Stream (
*/
Temp16 = 0x09;
- MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
+ ACPI_MOVE_UNALIGNED16_TO_16 (Buffer, &Temp16);
Buffer += 2;
/*
@@ -630,21 +624,21 @@ AcpiRsFixedMemory32Stream (
/*
* Set the Range base address
*/
- MOVE_UNALIGNED32_TO_32 (Buffer,
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer,
&LinkedList->Data.FixedMemory32.RangeBaseAddress);
Buffer += 4;
/*
* Set the range length
*/
- MOVE_UNALIGNED32_TO_32 (Buffer,
+ ACPI_MOVE_UNALIGNED32_TO_32 (Buffer,
&LinkedList->Data.FixedMemory32.RangeLength);
Buffer += 4;
/*
* Return the number of bytes consumed in this operation
*/
- *BytesConsumed = POINTER_DIFF (Buffer, *OutputBuffer);
+ *BytesConsumed = ACPI_PTR_DIFF (Buffer, *OutputBuffer);
return_ACPI_STATUS (AE_OK);
}
OpenPOWER on IntegriCloud