FreeBSD/sys/contrib/dev/acpica/compiler/dttemplate.c
/*******************************************************************************
 *
 * FUNCTION:    DtCreateOneTemplateFile
 *
 * PARAMETERS:  Signature           - ACPI table signature
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Create one template file of the requested signature.
 *
 ******************************************************************************/
DtCreateOneTemplateFile
PARAMETERS:  Signature           - ACPI table signature

Status

Create one template file of the requested signature.
DtCreateOneTemplateFile PARAMETERS : Signature - ACPI table signature Status Create one template file of the requested signature .
static ACPI_STATUS
DtCreateOneTemplateFile (
    char                    *Signature,
    UINT32                  TableCount)
{
    const ACPI_DMTABLE_DATA *TableData;
    ACPI_STATUS             Status;
    if (strlen (Signature) != ACPI_NAME_SIZE)
    {
        fprintf (stderr,
            "%s: Invalid ACPI table signature "
            "(length must be 4 characters)\n", Signature);
        return (AE_ERROR);
    }
    if (!strcmp (Signature, "MADT"))
    {
        Signature = "APIC";
    }
    else if (!strcmp (Signature, "FADT"))
    {
        Signature = "FACP";
    }
    TableData = AcpiDmGetTableData (Signature);
    if (TableData)
    {
        if (!TableData->Template)
        {
            fprintf (stderr, "%4.4s: No template available\n", Signature);
            return (AE_ERROR);
        }
    }
    else if (!AcpiUtIsSpecialTable (Signature))
    {
        fprintf (stderr,
            "%4.4s: Unrecognized ACPI table signature\n", Signature);
        return (AE_ERROR);
    }
    Status = DtCreateOneTemplate (Signature, TableCount, TableData);
    return (Status);
}
static ACPI_STATUS DtCreateOneTemplateFile ( char * Signature , UINT32 TableCount ) { const ACPI_DMTABLE_DATA * TableData ; ACPI_STATUS Status ; if ( strlen ( Signature ) != ACPI_NAME_SIZE ) { fprintf ( stderr , " " " \n " , Signature ) ; return ( AE_ERROR ) ; } if ( ! strcmp ( Signature , " " ) ) { Signature = " " ; } else if ( ! strcmp ( Signature , " " ) ) { Signature = " " ; } TableData = AcpiDmGetTableData ( Signature ) ; if ( TableData ) { if ( ! TableData -> Template ) { fprintf ( stderr , " \n " , Signature ) ; return ( AE_ERROR ) ; } } else if ( ! AcpiUtIsSpecialTable ( Signature ) ) { fprintf ( stderr , " \n " , Signature ) ; return ( AE_ERROR ) ; } Status = DtCreateOneTemplate ( Signature , TableCount , TableData ) ; return ( Status ) ; }
FUNCTION:    DtCreateOneTemplateFile
 PARAMETERS:  Signature           - ACPI table signature
FUNCTION : DtCreateOneTemplateFile PARAMETERS : Signature - ACPI table signature
/*
     * Validate signature and get the template data:
     *  1) Signature must be 4 characters
     *  2) Signature must be a recognized ACPI table
     *  3) There must be a template associated with the signature
     */ /*
     * Some slack for the two strange tables whose name is different than
     * their signatures: MADT->APIC and FADT->FACP.
     */ /* TableData will point to the template */