summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/rsxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/rsxface.c')
-rw-r--r--sys/contrib/dev/acpica/rsxface.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/sys/contrib/dev/acpica/rsxface.c b/sys/contrib/dev/acpica/rsxface.c
index 5d0b3bb..109179e 100644
--- a/sys/contrib/dev/acpica/rsxface.c
+++ b/sys/contrib/dev/acpica/rsxface.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsxface - Public interfaces to the resource manager
- * $Revision: 31 $
+ * $Revision: 1.37 $
*
******************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -123,6 +123,23 @@
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME ("rsxface")
+/* Local macros for 16,32-bit to 64-bit conversion */
+
+#define ACPI_COPY_FIELD(Out, In, Field) ((Out)->Field = (In)->Field)
+#define ACPI_COPY_ADDRESS(Out, In) \
+ ACPI_COPY_FIELD(Out, In, ResourceType); \
+ ACPI_COPY_FIELD(Out, In, ProducerConsumer); \
+ ACPI_COPY_FIELD(Out, In, Decode); \
+ 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, ResourceSource);
+
/*******************************************************************************
*
@@ -312,10 +329,10 @@ AcpiGetPossibleResources (
ACPI_STATUS
AcpiWalkResources (
- ACPI_HANDLE DeviceHandle,
- char *Path,
- ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context)
+ ACPI_HANDLE DeviceHandle,
+ char *Path,
+ ACPI_WALK_RESOURCE_CALLBACK UserFunction,
+ void *Context)
{
ACPI_STATUS Status;
ACPI_BUFFER Buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -349,7 +366,7 @@ AcpiWalkResources (
for (;;)
{
- if (!Resource || Resource->Id == ACPI_RSTYPE_END_TAG)
+ if (!Resource || Resource->Type == ACPI_RESOURCE_TYPE_END_TAG)
{
break;
}
@@ -428,9 +445,8 @@ AcpiSetCurrentResources (
ACPI_FUNCTION_TRACE ("AcpiSetCurrentResources");
- /*
- * Must have a valid handle and buffer
- */
+ /* Must have a valid handle and buffer */
+
if ((!DeviceHandle) ||
(!InBuffer) ||
(!InBuffer->Pointer) ||
@@ -444,27 +460,12 @@ AcpiSetCurrentResources (
}
-#define ACPI_COPY_FIELD(Out, In, Field) ((Out)->Field = (In)->Field)
-#define ACPI_COPY_ADDRESS(Out, In) \
- ACPI_COPY_FIELD(Out, In, ResourceType); \
- ACPI_COPY_FIELD(Out, In, ProducerConsumer); \
- ACPI_COPY_FIELD(Out, In, Decode); \
- ACPI_COPY_FIELD(Out, In, MinAddressFixed); \
- ACPI_COPY_FIELD(Out, In, MaxAddressFixed); \
- ACPI_COPY_FIELD(Out, In, Attribute); \
- ACPI_COPY_FIELD(Out, In, Granularity); \
- ACPI_COPY_FIELD(Out, In, MinAddressRange); \
- ACPI_COPY_FIELD(Out, In, MaxAddressRange); \
- ACPI_COPY_FIELD(Out, In, AddressTranslationOffset); \
- ACPI_COPY_FIELD(Out, In, AddressLength); \
- ACPI_COPY_FIELD(Out, In, ResourceSource);
-
/******************************************************************************
*
* FUNCTION: AcpiResourceToAddress64
*
- * PARAMETERS: resource - Pointer to a resource
- * out - Pointer to the users's return
+ * PARAMETERS: Resource - Pointer to a resource
+ * Out - Pointer to the users's return
* buffer (a struct
* acpi_resource_address64)
*
@@ -486,29 +487,27 @@ AcpiResourceToAddress64 (
ACPI_RESOURCE_ADDRESS32 *Address32;
- switch (Resource->Id) {
- case ACPI_RSTYPE_ADDRESS16:
+ switch (Resource->Type)
+ {
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
Address16 = (ACPI_RESOURCE_ADDRESS16 *) &Resource->Data;
- ACPI_COPY_ADDRESS(Out, Address16);
+ ACPI_COPY_ADDRESS (Out, Address16);
break;
-
- case ACPI_RSTYPE_ADDRESS32:
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
Address32 = (ACPI_RESOURCE_ADDRESS32 *) &Resource->Data;
- ACPI_COPY_ADDRESS(Out, Address32);
+ ACPI_COPY_ADDRESS (Out, Address32);
break;
-
- case ACPI_RSTYPE_ADDRESS64:
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
/* Simple copy for 64 bit source */
ACPI_MEMCPY (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64));
break;
-
default:
return (AE_BAD_PARAMETER);
}
OpenPOWER on IntegriCloud