aslmapenter.c revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Module Name: aslmapenter - Build resource descriptor/device maps
*
*****************************************************************************/
/*
* 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.
*/
/* This module used for application-level code only */
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmapenter")
/* Local prototypes */
static ACPI_GPIO_INFO *
char *DeviceName);
static ACPI_SERIAL_INFO *
char *DeviceName,
/*******************************************************************************
*
* FUNCTION: MpSaveGpioInfo
*
* PARAMETERS: Resource - GPIO resource descriptor
* PinCount - From GPIO descriptor
* PinList - From GPIO descriptor
* DeviceName - The "ResourceSource" name
*
* RETURN: None
*
* DESCRIPTION: External Interface.
* Save GPIO resource descriptor information.
* Creates new GPIO info blocks, one for each pin defined by the
* GPIO descriptor.
*
******************************************************************************/
void
char *DeviceName)
{
UINT32 i;
/* Mapfile option enabled? */
if (!Gbl_MapfileFlag)
{
return;
}
/* Create an info block for each pin defined in the descriptor */
for (i = 0; i < PinCount; i++)
{
}
}
/*******************************************************************************
*
* FUNCTION: MpSaveSerialInfo
*
* PARAMETERS: Resource - A Serial resource descriptor
* DeviceName - The "ResourceSource" name.
*
* RETURN: None
*
* DESCRIPTION: External Interface.
* Save serial resource descriptor information.
* Creates a new serial info block.
*
******************************************************************************/
void
char *DeviceName)
{
/* Mapfile option enabled? */
if (!Gbl_MapfileFlag)
{
return;
}
{
return;
}
/* Extract address and speed from the resource descriptor */
{
break;
break;
Address = 0;
break;
default: /* Invalid bus subtype */
return;
}
}
/*******************************************************************************
*
* FUNCTION: MpCreateGpioInfo
*
* PARAMETERS: PinNumber - GPIO pin number
* DeviceName - The "ResourceSource" name
*
* RETURN: New GPIO info block.
*
* DESCRIPTION: Create a new GPIO info block and place it on the global list.
* The list is sorted by GPIO device names first, and pin numbers
* secondarily.
*
******************************************************************************/
static ACPI_GPIO_INFO *
char *DeviceName)
{
char *Buffer;
/*
* Allocate a new info block and insert it into the global GPIO list
* sorted by both source device name and then the pin number. There is
* one block per pin.
*/
if (!Gbl_GpioList)
{
Gbl_GpioList = Info;
return (Info);
}
/* Sort on source DeviceName first */
while (NextGpio &&
{
}
/* Now sort on the PinNumber */
while (NextGpio &&
{
}
/* Finish the list insertion */
if (PrevGpio)
{
}
else
{
Gbl_GpioList = Info;
}
return (Info);
}
/*******************************************************************************
*
* FUNCTION: MpCreateSerialInfo
*
* PARAMETERS: DeviceName - The "ResourceSource" name.
* Address - Physical address for the device
*
* RETURN: New Serial info block.
*
* DESCRIPTION: Create a new Serial info block and place it on the global list.
* The list is sorted by Serial device names first, and addresses
* secondarily.
*
******************************************************************************/
static ACPI_SERIAL_INFO *
char *DeviceName,
{
char *Buffer;
/*
* Allocate a new info block and insert it into the global Serial list
* sorted by both source device name and then the address.
*/
PrevSerial = NULL;
if (!Gbl_SerialList)
{
return (Info);
}
/* Sort on source DeviceName */
while (NextSerial &&
{
}
/* Now sort on the Address */
while (NextSerial &&
{
}
/* Finish the list insertion */
if (PrevSerial)
{
}
else
{
}
return (Info);
}