/*******************************************************************************
*
* Module Name: rsaddr - Address resource descriptors (16/32/64)
*
******************************************************************************/
/*
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
ACPI_MODULE_NAME ("rsaddr")
/*******************************************************************************
*
* AcpiRsConvertAddress16 - All WORD (16-bit) address resources
*
******************************************************************************/
{
sizeof (AML_RESOURCE_ADDRESS16),
0},
/* Resource Type, General Flags, and Type-Specific Flags */
{ACPI_RSC_ADDRESS, 0, 0, 0},
/*
* These fields are contiguous in both the source and destination:
* Address Granularity
* Address Range Minimum
* Address Range Maximum
* Address Translation Offset
* Address Length
*/
5},
/* Optional ResourceSource (Index and String) */
0,
sizeof (AML_RESOURCE_ADDRESS16)}
};
/*******************************************************************************
*
* AcpiRsConvertAddress32 - All DWORD (32-bit) address resources
*
******************************************************************************/
{
sizeof (AML_RESOURCE_ADDRESS32),
0},
/* Resource Type, General Flags, and Type-Specific Flags */
{ACPI_RSC_ADDRESS, 0, 0, 0},
/*
* These fields are contiguous in both the source and destination:
* Address Granularity
* Address Range Minimum
* Address Range Maximum
* Address Translation Offset
* Address Length
*/
5},
/* Optional ResourceSource (Index and String) */
0,
sizeof (AML_RESOURCE_ADDRESS32)}
};
/*******************************************************************************
*
* AcpiRsConvertAddress64 - All QWORD (64-bit) address resources
*
******************************************************************************/
{
sizeof (AML_RESOURCE_ADDRESS64),
0},
/* Resource Type, General Flags, and Type-Specific Flags */
{ACPI_RSC_ADDRESS, 0, 0, 0},
/*
* These fields are contiguous in both the source and destination:
* Address Granularity
* Address Range Minimum
* Address Range Maximum
* Address Translation Offset
* Address Length
*/
5},
/* Optional ResourceSource (Index and String) */
0,
sizeof (AML_RESOURCE_ADDRESS64)}
};
/*******************************************************************************
*
* AcpiRsConvertExtAddress64 - All Extended (64-bit) address resources
*
******************************************************************************/
{
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),
0},
/* Resource Type, General Flags, and Type-Specific Flags */
{ACPI_RSC_ADDRESS, 0, 0, 0},
/* Revision ID */
1},
/*
* These fields are contiguous in both the source and destination:
* Address Granularity
* Address Range Minimum
* Address Range Maximum
* Address Translation Offset
* Address Length
* Type-Specific Attribute
*/
6}
};
/*******************************************************************************
*
* AcpiRsConvertGeneralFlags - Flags common to all address descriptors
*
******************************************************************************/
{
/* Resource Type (Memory, Io, BusNumber, etc.) */
1},
/* General Flags - Consume, Decode, MinFixed, MaxFixed */
0},
1},
2},
3}
};
/*******************************************************************************
*
* AcpiRsConvertMemFlags - Flags common to Memory address descriptors
*
******************************************************************************/
{
/* Memory-specific flags */
0},
1},
3},
5}
};
/*******************************************************************************
*
* AcpiRsConvertIoFlags - Flags common to I/O address descriptors
*
******************************************************************************/
{
/* I/O-specific flags */
0},
4},
5}
};
/*******************************************************************************
*
* FUNCTION: AcpiRsGetAddressCommon
*
* PARAMETERS: Resource - Pointer to the internal resource struct
* Aml - Pointer to the AML resource descriptor
*
* RETURN: TRUE if the ResourceType field is OK, FALSE otherwise
*
* DESCRIPTION: Convert common flag fields from a raw AML resource descriptor
* to an internal resource descriptor
*
******************************************************************************/
{
/* Validate the Resource Type */
{
return (FALSE);
}
/* Get the Resource Type and General Flags */
(void) AcpiRsConvertAmlToResource (
/* Get the Type-Specific Flags (Memory and I/O descriptors only) */
{
(void) AcpiRsConvertAmlToResource (
}
{
(void) AcpiRsConvertAmlToResource (
}
else
{
/* Generic resource type, just grab the TypeSpecific byte */
}
return (TRUE);
}
/*******************************************************************************
*
* FUNCTION: AcpiRsSetAddressCommon
*
* PARAMETERS: Aml - Pointer to the AML resource descriptor
* Resource - Pointer to the internal resource struct
*
* RETURN: None
*
* DESCRIPTION: Convert common flag fields from a resource descriptor to an
* AML descriptor
*
******************************************************************************/
void
{
/* Set the Resource Type and General Flags */
(void) AcpiRsConvertResourceToAml (
/* Set the Type-Specific Flags (Memory and I/O descriptors only) */
{
(void) AcpiRsConvertResourceToAml (
}
{
(void) AcpiRsConvertResourceToAml (
}
else
{
/* Generic resource type, just copy the TypeSpecific byte */
}
}