aslrestype1i.c revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
*
*****************************************************************************/
/*
* 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 ("aslrestype1i")
/*
*
* DMA
* FixedDMA
* FixedIO
* IO
* IRQ
* IRQNoFlags
*/
/*******************************************************************************
*
* FUNCTION: RsDoDmaDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "DMA" descriptor
*
******************************************************************************/
{
UINT32 i;
UINT8 DmaChannelMask = 0;
UINT8 DmaChannels = 0;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* DMA type */
break;
case 1: /* Bus Master */
break;
case 2: /* Xfer Type (transfer width) */
break;
case 3: /* Name */
break;
default:
/* All DMA channel bytes are handled here, after flags and name */
{
/* Up to 8 channels can be specified in the list */
DmaChannels++;
if (DmaChannels > 8)
{
return (Rnode);
}
/* Only DMA channels 0-7 are allowed (mask is 8 bits) */
{
}
/* Build the mask */
}
if (i == 4) /* case 4: First DMA byte */
{
/* Check now for duplicates in list */
/* Create a named field at the start of the list */
}
break;
}
}
/* Now we can set the channel mask */
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoFixedDmaDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "FixedDMA" descriptor
*
******************************************************************************/
{
UINT32 i;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* DMA Request Lines [WORD] (_DMA) */
break;
case 1: /* DMA Channel [WORD] (_TYP) */
break;
case 2: /* Transfer Width [BYTE] (_SIZ) */
break;
case 3: /* Descriptor Name (optional) */
break;
default: /* Ignore any extra nodes */
break;
}
}
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoFixedIoDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "FixedIO" descriptor
*
******************************************************************************/
{
UINT32 i;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* Base Address */
break;
case 1: /* Length */
break;
case 2: /* Name */
break;
default:
break;
}
}
/* Error checks */
{
}
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoIoDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "IO" descriptor
*
******************************************************************************/
{
UINT32 i;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* Decode size */
break;
case 1: /* Min Address */
break;
case 2: /* Max Address */
break;
case 3: /* Alignment */
break;
case 4: /* Length */
break;
case 5: /* Name */
break;
default:
break;
}
}
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoIrqDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "IRQ" descriptor
*
******************************************************************************/
{
UINT32 Interrupts = 0;
UINT32 i;
/* Length = 3 (with flag byte) */
(ASL_RDESC_IRQ_SIZE + 0x01);
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
break;
break;
case 2: /* Share Type - Default: exclusive (0) */
break;
case 3: /* Name */
break;
default:
/* All IRQ bytes are handled here, after the flags and name */
{
/* Up to 16 interrupts can be specified in the list */
Interrupts++;
if (Interrupts > 16)
{
return (Rnode);
}
/* Only interrupts 0-15 are allowed (mask is 16 bits) */
{
}
else
{
}
}
/* Case 4: First IRQ value in list */
if (i == 4)
{
/* Check now for duplicates in list */
/* Create a named field at the start of the list */
}
break;
}
}
/* Now we can set the channel mask */
return (Rnode);
}
/*******************************************************************************
*
* FUNCTION: RsDoIrqNoFlagsDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
* DESCRIPTION: Construct a short "IRQNoFlags" descriptor
*
******************************************************************************/
{
UINT32 Interrupts = 0;
UINT32 i;
/* Process all child initialization nodes */
for (i = 0; InitializerOp; i++)
{
switch (i)
{
case 0: /* Name */
break;
default:
/* IRQ bytes are handled here, after the flags and name */
{
/* Up to 16 interrupts can be specified in the list */
Interrupts++;
if (Interrupts > 16)
{
return (Rnode);
}
/* Only interrupts 0-15 are allowed (mask is 16 bits) */
{
}
else
{
}
}
/* Case 1: First IRQ value in list */
if (i == 1)
{
/* Check now for duplicates in list */
/* Create a named field at the start of the list */
}
break;
}
}
/* Now we can set the interrupt mask */
return (Rnode);
}