FreeBSD/sys/contrib/dev/acpica/compiler/aslmapoutput.c
/*******************************************************************************
 *
 * FUNCTION:    MpEmitSerialInfo
 *
 * PARAMETERS:  None
 *
 * RETURN:      None
 *
 * DESCRIPTION: Emit the info about all Serial devices found during the
 *              compile or disassembly.
 *
 ******************************************************************************/


None

Emit the info about all Serial devices found during the
compile or disassembly.
None Emit the info about all Serial devices found during the compile or disassembly .
static void
MpEmitSerialInfo (
    void)
{
    ACPI_SERIAL_INFO        *Info;
    char                    *Type;
    char                    *ParentPathname;
    char                    *PrevDeviceName = NULL;
    char                    *HidString;
    const AH_DEVICE_ID      *HidInfo;
    const char              *Description;
    AML_RESOURCE            *Resource;
    Info = Gbl_SerialList;
    while (Info)
    {
        Resource = Info->Resource;
        switch (Resource->CommonSerialBus.Type)
        {
        case AML_RESOURCE_I2C_SERIALBUSTYPE:
            Type = "I2C ";
            break;
        case AML_RESOURCE_SPI_SERIALBUSTYPE:
            Type = "SPI ";
            break;
        case AML_RESOURCE_UART_SERIALBUSTYPE:
            Type = "UART";
            break;
        default:
            Type = "UNKN";
            break;
        }
        HidString = MpGetHidViaNamestring (Info->DeviceName);
        if (!PrevDeviceName ||
            strcmp (PrevDeviceName, Info->DeviceName))
        {
            FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller:  ",
                Type);
            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-8s  %-28s",
                HidString, Info->DeviceName);
            HidInfo = AcpiAhMatchHardwareId (HidString);
            if (HidInfo)
            {
                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
                    HidInfo->Description);
            }
            FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n");
            FlPrintFile (ASL_FILE_MAP_OUTPUT,
                "Type  Address   Speed      Dest _HID  Destination\n");
        }
        PrevDeviceName = Info->DeviceName;
        FlPrintFile (ASL_FILE_MAP_OUTPUT, "%s   %4.4X    %8.8X    ",
            Type, Info->Address, Info->Speed);
        ParentPathname = NULL;
        HidString = MpGetConnectionInfo (Info->Op, 0, &Info->TargetNode,
            &ParentPathname);
        if (HidString)
        {
            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
                HidString, ParentPathname);
        }
        else
        {
            HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
                &ParentPathname);
            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
                HidString, ParentPathname);
            HidInfo = AcpiAhMatchHardwareId (HidString);
            if (HidInfo)
            {
                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
                    HidInfo->Description);
            }
            else if ((Description = MpGetDdnValue (ParentPathname)))
            {
                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s (_DDN)",
                    Description);
            }
        }
        FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
        ACPI_FREE (ParentPathname);
        Info = Info->Next;
    }
}
static void MpEmitSerialInfo ( void ) { ACPI_SERIAL_INFO * Info ; char * Type ; char * ParentPathname ; char * PrevDeviceName = NULL ; char * HidString ; const AH_DEVICE_ID * HidInfo ; const char * Description ; AML_RESOURCE * Resource ; Info = Gbl_SerialList ; while ( Info ) { Resource = Info -> Resource ; switch ( Resource -> CommonSerialBus . Type ) { case AML_RESOURCE_I2C_SERIALBUSTYPE : Type = " " ; break ; case AML_RESOURCE_SPI_SERIALBUSTYPE : Type = " " ; break ; case AML_RESOURCE_UART_SERIALBUSTYPE : Type = " " ; break ; default : Type = " " ; break ; } HidString = MpGetHidViaNamestring ( Info -> DeviceName ) ; if ( ! PrevDeviceName || strcmp ( PrevDeviceName , Info -> DeviceName ) ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " \n \n " , Type ) ; FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidString , Info -> DeviceName ) ; HidInfo = AcpiAhMatchHardwareId ( HidString ) ; if ( HidInfo ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidInfo -> Description ) ; } FlPrintFile ( ASL_FILE_MAP_OUTPUT , " \n \n " ) ; FlPrintFile ( ASL_FILE_MAP_OUTPUT , " \n " ) ; } PrevDeviceName = Info -> DeviceName ; FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , Type , Info -> Address , Info -> Speed ) ; ParentPathname = NULL ; HidString = MpGetConnectionInfo ( Info -> Op , 0 , & Info -> TargetNode , & ParentPathname ) ; if ( HidString ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidString , ParentPathname ) ; } else { HidString = MpGetParentDeviceHid ( Info -> Op , & Info -> TargetNode , & ParentPathname ) ; FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidString , ParentPathname ) ; HidInfo = AcpiAhMatchHardwareId ( HidString ) ; if ( HidInfo ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidInfo -> Description ) ; } else if ( ( Description = MpGetDdnValue ( ParentPathname ) ) ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , Description ) ; } } FlPrintFile ( ASL_FILE_MAP_OUTPUT , " \n " ) ; ACPI_FREE ( ParentPathname ) ; Info = Info -> Next ; } }
FUNCTION:    MpEmitSerialInfo
 PARAMETERS:  None
FUNCTION : MpEmitSerialInfo PARAMETERS : None
/* Walk the constructed serial descriptor list */ /* Print header info for the controller itself */ /*
             * This is a Connection() field
             * Attempt to find all references to the field.
             */ /* Normal resource template */ /* Get the _HID description or _DDN string */