aslrestype2.c revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Module Name: aslrestype2 - Miscellaneous Large resource descriptors
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, 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 "aslcompiler.y.h"
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslrestype2")
/*
* This module contains miscellaneous large resource descriptors:
*
* Register
* Interrupt
* VendorLong
*/
/*******************************************************************************
*
* FUNCTION: RsDoGeneralRegisterDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a long "Register" descriptor
*
******************************************************************************/
{
UINT32 i;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* Address space */
break;
case 1: /* Register Bit Width */
break;
case 2: /* Register Bit Offset */
break;
case 3: /* Register Address */
break;
case 4: /* Access Size (ACPI 3.0) */
{
}
break;
case 5: /* ResourceTag (ACPI 3.0b) */
break;
default:
break;
}
}
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoInterruptDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a long "Interrupt" descriptor
*
******************************************************************************/
{
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 i;
UINT8 ResSourceIndex = 0;
/* Count the interrupt numbers */
for (i = 0; InitializerOp; i++)
{
if (i <= 6)
{
if (i == 3 &&
{
/*
* ResourceSourceIndex was specified, always make room for
* it, even if the ResourceSource was omitted.
*/
OptionIndex++;
}
continue;
}
OptionIndex += 4;
}
/*
* Initial descriptor length -- may be enlarged if there are
* optional fields present
*/
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* Resource Usage (Default: consumer (1) */
break;
break;
break;
case 3: /* Share Type - Default: exclusive (0) */
break;
case 4: /* ResSourceIndex [Optional Field - BYTE] */
{
}
break;
case 5: /* ResSource [Optional Field - STRING] */
{
if (StringLength)
{
}
/* ResourceSourceIndex must also be valid */
if (!HasResSourceIndex)
{
}
}
#if 0
/*
* Not a valid ResourceSource, ResourceSourceIndex must also
* be invalid
*/
else if (HasResSourceIndex)
{
}
#endif
break;
case 6: /* ResourceTag */
break;
default:
/*
* Interrupt Numbers come through here, repeatedly
*/
/* Maximum 255 interrupts allowed for this descriptor */
{
return (Rnode);
}
/* Each interrupt number must be a 32-bit value */
{
}
/* Save the integer and move pointer to the next one */
/* Case 7: First interrupt number in list */
if (i == 7)
{
{
/* Must be at least one interrupt */
}
/* Check now for duplicates in list */
/* Create a named field at the start of the list */
}
}
}
/* Add optional ResSourceIndex if present */
if (HasResSourceIndex)
{
}
/* Add optional ResSource string if present */
if (StringLength && ResSourceString)
{
Rover = ACPI_ADD_PTR (
}
+ OptionIndex + StringLength;
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoVendorLargeDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a long "VendorLong" descriptor
*
******************************************************************************/
{
UINT32 i;
/* Count the number of data bytes */
for (i = 0; InitializerOp; i++)
{
{
break;
}
}
/* Point to end-of-descriptor for vendor data */
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
{
break;
}
}
return (Rnode);
}