FreeBSD/sys/contrib/dev/acpica/compiler/dttemplate.c
/*******************************************************************************
 *
 * FUNCTION:    DtCreateTemplates
 *
 * PARAMETERS:  argv                - Standard command line arguments
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Create one or more template files.
 *
 ******************************************************************************/
DtCreateTemplates
PARAMETERS:  argv                - Standard command line arguments

Status

Create one or more template files.
DtCreateTemplates PARAMETERS : argv - Standard command line arguments Status Create one or more template files .
ACPI_STATUS
DtCreateTemplates (
    char                    **argv)
{
    char                    *Signature;
    char                    *End;
    unsigned long           TableCount;
    ACPI_STATUS             Status = AE_OK;
    AslInitializeGlobals ();
    Status = AdInitialize ();
    if (ACPI_FAILURE (Status))
    {
        return (Status);
    }
    if (AcpiGbl_Optind < 3)
    {
        Status = DtCreateOneTemplateFile (ACPI_SIG_DSDT, 0);
        goto Exit;
    }
    AcpiGbl_Optind--;
    Signature = argv[AcpiGbl_Optind];
    AcpiUtStrupr (Signature);
    TableCount = strtoul (Signature, &End, 0);
    if (Signature != End)
    {
        if (TableCount > 254)
        {
            fprintf (stderr, "%u SSDTs requested, maximum is 254\n",
                (unsigned int) TableCount);
            Status = AE_LIMIT;
            goto Exit;
        }
        Status = DtCreateOneTemplateFile (ACPI_SIG_DSDT, TableCount);
        goto Exit;
    }
    if (!strcmp (Signature, "ALL"))
    {
        Status = DtCreateAllTemplates ();
        goto Exit;
    }
    while (argv[AcpiGbl_Optind])
    {
        Signature = argv[AcpiGbl_Optind];
        AcpiUtStrupr (Signature);
        Status = DtCreateOneTemplateFile (Signature, 0);
        if (ACPI_FAILURE (Status))
        {
            goto Exit;
        }
        AcpiGbl_Optind++;
    }
Exit:
    (void) AcpiTerminate ();
    CmDeleteCaches ();
    return (Status);
}
ACPI_STATUS DtCreateTemplates ( char * * argv ) { char * Signature ; char * End ; unsigned long TableCount ; ACPI_STATUS Status = AE_OK ; AslInitializeGlobals ( ) ; Status = AdInitialize ( ) ; if ( ACPI_FAILURE ( Status ) ) { return ( Status ) ; } if ( AcpiGbl_Optind < 3 ) { Status = DtCreateOneTemplateFile ( ACPI_SIG_DSDT , 0 ) ; goto Exit ; } AcpiGbl_Optind -- ; Signature = argv [ AcpiGbl_Optind ] ; AcpiUtStrupr ( Signature ) ; TableCount = strtoul ( Signature , & End , 0 ) ; if ( Signature != End ) { if ( TableCount > 254 ) { fprintf ( stderr , " \n " , ( unsigned int ) TableCount ) ; Status = AE_LIMIT ; goto Exit ; } Status = DtCreateOneTemplateFile ( ACPI_SIG_DSDT , TableCount ) ; goto Exit ; } if ( ! strcmp ( Signature , " " ) ) { Status = DtCreateAllTemplates ( ) ; goto Exit ; } while ( argv [ AcpiGbl_Optind ] ) { Signature = argv [ AcpiGbl_Optind ] ; AcpiUtStrupr ( Signature ) ; Status = DtCreateOneTemplateFile ( Signature , 0 ) ; if ( ACPI_FAILURE ( Status ) ) { goto Exit ; } AcpiGbl_Optind ++ ; } Exit : ( void ) AcpiTerminate ( ) ; CmDeleteCaches ( ) ; return ( Status ) ; }
FUNCTION:    DtCreateTemplates
 PARAMETERS:  argv                - Standard command line arguments
FUNCTION : DtCreateTemplates PARAMETERS : argv - Standard command line arguments
/*
     * Special cases for DSDT, ALL, and '*'
     */ /* Default (no signature option) is DSDT */ /*
     * Multiple SSDT support (-T <ssdt count>)
     */ /* The count is used for table ID and method name - max is 254(+1) */ /* Create all available/known templates */ /*
     * Normal case: Create template for each signature
     */ /* Shutdown ACPICA subsystem */