FreeBSD/sys/contrib/dev/acpica/compiler/aslmapenter.c
/*******************************************************************************
 *
 * 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.
 *
 ******************************************************************************/
MpSaveSerialInfo
PARAMETERS:  Resource                - A Serial resource descriptor
DeviceName              - The "ResourceSource" name.

None

External Interface.
Save serial resource descriptor information.
Creates a new serial info block.
MpSaveSerialInfo PARAMETERS : Resource - A Serial resource descriptor DeviceName - The " ResourceSource " name . None External Interface . Save serial resource descriptor information . Creates a new serial info block .
void
MpSaveSerialInfo (
    ACPI_PARSE_OBJECT       *Op,
    AML_RESOURCE            *Resource,
    char                    *DeviceName)
{
    ACPI_SERIAL_INFO        *Info;
    UINT16                  Address;
    UINT32                  Speed;
    if (!Gbl_MapfileFlag)
    {
        return;
    }
    if (Resource->DescriptorType != ACPI_RESOURCE_NAME_SERIAL_BUS)
    {
        return;
    }
    switch (Resource->CommonSerialBus.Type)
    {
    case AML_RESOURCE_I2C_SERIALBUSTYPE:
        Address = Resource->I2cSerialBus.SlaveAddress;
        Speed = Resource->I2cSerialBus.ConnectionSpeed;
        break;
    case AML_RESOURCE_SPI_SERIALBUSTYPE:
        Address = Resource->SpiSerialBus.DeviceSelection;
        Speed = Resource->SpiSerialBus.ConnectionSpeed;
        break;
    case AML_RESOURCE_UART_SERIALBUSTYPE:
        Address = 0;
        Speed = Resource->UartSerialBus.DefaultBaudRate;
        break;
    default:    
        return;
    }
    Info = MpCreateSerialInfo (DeviceName, Address);
    Info->Op = Op;
    Info->DeviceName = DeviceName;
    Info->Resource = Resource;
    Info->Address = Address;
    Info->Speed = Speed;
}
void MpSaveSerialInfo ( ACPI_PARSE_OBJECT * Op , AML_RESOURCE * Resource , char * DeviceName ) { ACPI_SERIAL_INFO * Info ; UINT16 Address ; UINT32 Speed ; if ( ! Gbl_MapfileFlag ) { return ; } if ( Resource -> DescriptorType != ACPI_RESOURCE_NAME_SERIAL_BUS ) { return ; } switch ( Resource -> CommonSerialBus . Type ) { case AML_RESOURCE_I2C_SERIALBUSTYPE : Address = Resource -> I2cSerialBus . SlaveAddress ; Speed = Resource -> I2cSerialBus . ConnectionSpeed ; break ; case AML_RESOURCE_SPI_SERIALBUSTYPE : Address = Resource -> SpiSerialBus . DeviceSelection ; Speed = Resource -> SpiSerialBus . ConnectionSpeed ; break ; case AML_RESOURCE_UART_SERIALBUSTYPE : Address = 0 ; Speed = Resource -> UartSerialBus . DefaultBaudRate ; break ; default : return ; } Info = MpCreateSerialInfo ( DeviceName , Address ) ; Info -> Op = Op ; Info -> DeviceName = DeviceName ; Info -> Resource = Resource ; Info -> Address = Address ; Info -> Speed = Speed ; }
FUNCTION:    MpSaveSerialInfo
 PARAMETERS:  Resource                - A Serial resource descriptor
              DeviceName              - The "ResourceSource" name.
FUNCTION : MpSaveSerialInfo PARAMETERS : Resource - A Serial resource descriptor DeviceName - The " ResourceSource " name .
/* Mapfile option enabled? */ /* Extract address and speed from the resource descriptor */ /* Invalid bus subtype */