Home | History | Annotate | Line # | Download | only in compiler
aslmain.c revision 1.1.1.3.16.1
      1           1.1  jruoho /******************************************************************************
      2           1.1  jruoho  *
      3           1.1  jruoho  * Module Name: aslmain - compiler main and utilities
      4           1.1  jruoho  *
      5           1.1  jruoho  *****************************************************************************/
      6           1.1  jruoho 
      7       1.1.1.2  jruoho /*
      8  1.1.1.3.16.1   rmind  * Copyright (C) 2000 - 2013, Intel Corp.
      9           1.1  jruoho  * All rights reserved.
     10           1.1  jruoho  *
     11       1.1.1.2  jruoho  * Redistribution and use in source and binary forms, with or without
     12       1.1.1.2  jruoho  * modification, are permitted provided that the following conditions
     13       1.1.1.2  jruoho  * are met:
     14       1.1.1.2  jruoho  * 1. Redistributions of source code must retain the above copyright
     15       1.1.1.2  jruoho  *    notice, this list of conditions, and the following disclaimer,
     16       1.1.1.2  jruoho  *    without modification.
     17       1.1.1.2  jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18       1.1.1.2  jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19       1.1.1.2  jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20       1.1.1.2  jruoho  *    including a substantially similar Disclaimer requirement for further
     21       1.1.1.2  jruoho  *    binary redistribution.
     22       1.1.1.2  jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23       1.1.1.2  jruoho  *    of any contributors may be used to endorse or promote products derived
     24       1.1.1.2  jruoho  *    from this software without specific prior written permission.
     25       1.1.1.2  jruoho  *
     26       1.1.1.2  jruoho  * Alternatively, this software may be distributed under the terms of the
     27       1.1.1.2  jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28       1.1.1.2  jruoho  * Software Foundation.
     29       1.1.1.2  jruoho  *
     30       1.1.1.2  jruoho  * NO WARRANTY
     31       1.1.1.2  jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32       1.1.1.2  jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33       1.1.1.2  jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34       1.1.1.2  jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35       1.1.1.2  jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36       1.1.1.2  jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37       1.1.1.2  jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38       1.1.1.2  jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39       1.1.1.2  jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40       1.1.1.2  jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41       1.1.1.2  jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42       1.1.1.2  jruoho  */
     43           1.1  jruoho 
     44           1.1  jruoho #define _DECLARE_GLOBALS
     45           1.1  jruoho 
     46           1.1  jruoho #include "aslcompiler.h"
     47           1.1  jruoho #include "acapps.h"
     48       1.1.1.2  jruoho #include "acdisasm.h"
     49  1.1.1.3.16.1   rmind #include <signal.h>
     50           1.1  jruoho 
     51           1.1  jruoho #define _COMPONENT          ACPI_COMPILER
     52           1.1  jruoho         ACPI_MODULE_NAME    ("aslmain")
     53           1.1  jruoho 
     54  1.1.1.3.16.1   rmind /*
     55  1.1.1.3.16.1   rmind  * Main routine for the iASL compiler.
     56  1.1.1.3.16.1   rmind  *
     57  1.1.1.3.16.1   rmind  * Portability note: The compiler depends upon the host for command-line
     58  1.1.1.3.16.1   rmind  * wildcard support - it is not implemented locally. For example:
     59  1.1.1.3.16.1   rmind  *
     60  1.1.1.3.16.1   rmind  * Linux/Unix systems: Shell expands wildcards automatically.
     61  1.1.1.3.16.1   rmind  *
     62  1.1.1.3.16.1   rmind  * Windows: The setargv.obj module must be linked in to automatically
     63  1.1.1.3.16.1   rmind  * expand wildcards.
     64  1.1.1.3.16.1   rmind  */
     65           1.1  jruoho 
     66  1.1.1.3.16.1   rmind /* Local prototypes */
     67           1.1  jruoho 
     68  1.1.1.3.16.1   rmind static void ACPI_SYSTEM_XFACE
     69  1.1.1.3.16.1   rmind AslSignalHandler (
     70  1.1.1.3.16.1   rmind     int                     Sig);
     71           1.1  jruoho 
     72           1.1  jruoho static void
     73           1.1  jruoho AslInitialize (
     74           1.1  jruoho     void);
     75           1.1  jruoho 
     76           1.1  jruoho 
     77           1.1  jruoho /*******************************************************************************
     78           1.1  jruoho  *
     79  1.1.1.3.16.1   rmind  * FUNCTION:    Usage
     80           1.1  jruoho  *
     81           1.1  jruoho  * PARAMETERS:  None
     82           1.1  jruoho  *
     83           1.1  jruoho  * RETURN:      None
     84           1.1  jruoho  *
     85  1.1.1.3.16.1   rmind  * DESCRIPTION: Display option help message.
     86  1.1.1.3.16.1   rmind  *              Optional items in square brackets.
     87           1.1  jruoho  *
     88           1.1  jruoho  ******************************************************************************/
     89           1.1  jruoho 
     90  1.1.1.3.16.1   rmind void
     91  1.1.1.3.16.1   rmind Usage (
     92           1.1  jruoho     void)
     93           1.1  jruoho {
     94  1.1.1.3.16.1   rmind     printf ("%s\n\n", ASL_COMPLIANCE);
     95  1.1.1.3.16.1   rmind     ACPI_USAGE_HEADER ("iasl [Options] [Files]");
     96           1.1  jruoho 
     97  1.1.1.3.16.1   rmind     printf ("\nGeneral:\n");
     98  1.1.1.3.16.1   rmind     ACPI_OPTION ("-@ <file>",       "Specify command file");
     99  1.1.1.3.16.1   rmind     ACPI_OPTION ("-I <dir>",        "Specify additional include directory");
    100  1.1.1.3.16.1   rmind     ACPI_OPTION ("-T <sig>|ALL|*",  "Create table template file for ACPI <Sig>");
    101  1.1.1.3.16.1   rmind     ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
    102  1.1.1.3.16.1   rmind     ACPI_OPTION ("-v",              "Display compiler version");
    103  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vo",             "Enable optimization comments");
    104  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vs",             "Disable signon");
    105           1.1  jruoho 
    106           1.1  jruoho     printf ("\nHelp:\n");
    107  1.1.1.3.16.1   rmind     ACPI_OPTION ("-h",              "This message");
    108  1.1.1.3.16.1   rmind     ACPI_OPTION ("-hc",             "Display operators allowed in constant expressions");
    109  1.1.1.3.16.1   rmind     ACPI_OPTION ("-hf",             "Display help for output filename generation");
    110  1.1.1.3.16.1   rmind     ACPI_OPTION ("-hr",             "Display ACPI reserved method names");
    111  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ht",             "Display currently supported ACPI table names");
    112  1.1.1.3.16.1   rmind 
    113  1.1.1.3.16.1   rmind     printf ("\nPreprocessor:\n");
    114  1.1.1.3.16.1   rmind     ACPI_OPTION ("-D <symbol>",     "Define symbol for preprocessor use");
    115  1.1.1.3.16.1   rmind     ACPI_OPTION ("-li",             "Create preprocessed output file (*.i)");
    116  1.1.1.3.16.1   rmind     ACPI_OPTION ("-P",              "Preprocess only and create preprocessor output file (*.i)");
    117  1.1.1.3.16.1   rmind     ACPI_OPTION ("-Pn",             "Disable preprocessor");
    118  1.1.1.3.16.1   rmind 
    119  1.1.1.3.16.1   rmind     printf ("\nErrors, Warnings, and Remarks:\n");
    120  1.1.1.3.16.1   rmind     ACPI_OPTION ("-va",             "Disable all errors/warnings/remarks");
    121  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ve",             "Report only errors (ignore warnings and remarks)");
    122  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vi",             "Less verbose errors and warnings for use with IDEs");
    123  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vr",             "Disable remarks");
    124  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
    125  1.1.1.3.16.1   rmind     ACPI_OPTION ("-w1 -w2 -w3",     "Set warning reporting level");
    126  1.1.1.3.16.1   rmind     ACPI_OPTION ("-we",             "Report warnings as errors");
    127  1.1.1.3.16.1   rmind 
    128  1.1.1.3.16.1   rmind     printf ("\nAML Code Generation (*.aml):\n");
    129  1.1.1.3.16.1   rmind     ACPI_OPTION ("-oa",             "Disable all optimizations (compatibility mode)");
    130  1.1.1.3.16.1   rmind     ACPI_OPTION ("-of",             "Disable constant folding");
    131  1.1.1.3.16.1   rmind     ACPI_OPTION ("-oi",             "Disable integer optimization to Zero/One/Ones");
    132  1.1.1.3.16.1   rmind     ACPI_OPTION ("-on",             "Disable named reference string optimization");
    133  1.1.1.3.16.1   rmind     ACPI_OPTION ("-cr",             "Disable Resource Descriptor error checking");
    134  1.1.1.3.16.1   rmind     ACPI_OPTION ("-in",             "Ignore NoOp operators");
    135  1.1.1.3.16.1   rmind     ACPI_OPTION ("-r <revision>",   "Override table header Revision (1-255)");
    136  1.1.1.3.16.1   rmind 
    137  1.1.1.3.16.1   rmind     printf ("\nOptional Source Code Output Files:\n");
    138  1.1.1.3.16.1   rmind     ACPI_OPTION ("-sc -sa",         "Create source file in C or assembler (*.c or *.asm)");
    139  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ic -ia",         "Create include file in C or assembler (*.h or *.inc)");
    140  1.1.1.3.16.1   rmind     ACPI_OPTION ("-tc -ta -ts",     "Create hex AML table in C, assembler, or ASL (*.hex)");
    141  1.1.1.3.16.1   rmind     ACPI_OPTION ("-so",             "Create offset table in C (*.offset.h)");
    142  1.1.1.3.16.1   rmind 
    143  1.1.1.3.16.1   rmind     printf ("\nOptional Listing Files:\n");
    144  1.1.1.3.16.1   rmind     ACPI_OPTION ("-l",              "Create mixed listing file (ASL source and AML) (*.lst)");
    145  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
    146  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
    147  1.1.1.3.16.1   rmind 
    148  1.1.1.3.16.1   rmind     printf ("\nData Table Compiler:\n");
    149  1.1.1.3.16.1   rmind     ACPI_OPTION ("-G",              "Compile custom table that contains generic operators");
    150  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vt",             "Create verbose template files (full disassembly)");
    151  1.1.1.3.16.1   rmind 
    152  1.1.1.3.16.1   rmind     printf ("\nAML Disassembler:\n");
    153  1.1.1.3.16.1   rmind     ACPI_OPTION ("-d  <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
    154  1.1.1.3.16.1   rmind     ACPI_OPTION ("",                "  (Optional, file type is automatically detected)");
    155  1.1.1.3.16.1   rmind     ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
    156  1.1.1.3.16.1   rmind     ACPI_OPTION ("-db",             "Do not translate Buffers to Resource Templates");
    157  1.1.1.3.16.1   rmind     ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
    158  1.1.1.3.16.1   rmind     ACPI_OPTION ("",                "  (Obtain DSDT from current system if no input file)");
    159  1.1.1.3.16.1   rmind     ACPI_OPTION ("-e  <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
    160  1.1.1.3.16.1   rmind     ACPI_OPTION ("-fe <file>",      "Specify external symbol declaration file");
    161  1.1.1.3.16.1   rmind     ACPI_OPTION ("-g",              "Get ACPI tables and write to files (*.dat)");
    162  1.1.1.3.16.1   rmind     ACPI_OPTION ("-in",             "Ignore NoOp opcodes");
    163  1.1.1.3.16.1   rmind     ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
    164  1.1.1.3.16.1   rmind 
    165  1.1.1.3.16.1   rmind     printf ("\nDebug Options:\n");
    166  1.1.1.3.16.1   rmind     ACPI_OPTION ("-bf -bt",         "Create debug file (full or parse tree only) (*.txt)");
    167  1.1.1.3.16.1   rmind     ACPI_OPTION ("-f",              "Ignore errors, force creation of AML output file(s)");
    168  1.1.1.3.16.1   rmind     ACPI_OPTION ("-m <size>",       "Set internal line buffer size (in Kbytes)");
    169  1.1.1.3.16.1   rmind     ACPI_OPTION ("-n",              "Parse only, no output generation");
    170  1.1.1.3.16.1   rmind     ACPI_OPTION ("-ot",             "Display compile times and statistics");
    171  1.1.1.3.16.1   rmind     ACPI_OPTION ("-x <level>",      "Set debug level for trace output");
    172  1.1.1.3.16.1   rmind     ACPI_OPTION ("-z",              "Do not insert new compiler ID for DataTables");
    173           1.1  jruoho }
    174           1.1  jruoho 
    175           1.1  jruoho 
    176           1.1  jruoho /*******************************************************************************
    177           1.1  jruoho  *
    178  1.1.1.3.16.1   rmind  * FUNCTION:    FilenameHelp
    179           1.1  jruoho  *
    180           1.1  jruoho  * PARAMETERS:  None
    181           1.1  jruoho  *
    182           1.1  jruoho  * RETURN:      None
    183           1.1  jruoho  *
    184  1.1.1.3.16.1   rmind  * DESCRIPTION: Display help message for output filename generation
    185           1.1  jruoho  *
    186           1.1  jruoho  ******************************************************************************/
    187           1.1  jruoho 
    188  1.1.1.3.16.1   rmind void
    189  1.1.1.3.16.1   rmind AslFilenameHelp (
    190           1.1  jruoho     void)
    191           1.1  jruoho {
    192           1.1  jruoho 
    193  1.1.1.3.16.1   rmind     printf ("\nAML output filename generation:\n");
    194           1.1  jruoho     printf ("  Output filenames are generated by appending an extension to a common\n");
    195  1.1.1.3.16.1   rmind     printf ("  filename prefix. The filename prefix is obtained via one of the\n");
    196           1.1  jruoho     printf ("  following methods (in priority order):\n");
    197           1.1  jruoho     printf ("    1) The -p option specifies the prefix\n");
    198           1.1  jruoho     printf ("    2) The prefix of the AMLFileName in the ASL Definition Block\n");
    199           1.1  jruoho     printf ("    3) The prefix of the input filename\n");
    200           1.1  jruoho     printf ("\n");
    201           1.1  jruoho }
    202           1.1  jruoho 
    203           1.1  jruoho 
    204  1.1.1.3.16.1   rmind /******************************************************************************
    205           1.1  jruoho  *
    206  1.1.1.3.16.1   rmind  * FUNCTION:    AslSignalHandler
    207           1.1  jruoho  *
    208  1.1.1.3.16.1   rmind  * PARAMETERS:  Sig                 - Signal that invoked this handler
    209           1.1  jruoho  *
    210           1.1  jruoho  * RETURN:      None
    211           1.1  jruoho  *
    212  1.1.1.3.16.1   rmind  * DESCRIPTION: Control-C handler. Delete any intermediate files and any
    213  1.1.1.3.16.1   rmind  *              output files that may be left in an indeterminate state.
    214           1.1  jruoho  *
    215  1.1.1.3.16.1   rmind  *****************************************************************************/
    216           1.1  jruoho 
    217  1.1.1.3.16.1   rmind static void ACPI_SYSTEM_XFACE
    218  1.1.1.3.16.1   rmind AslSignalHandler (
    219  1.1.1.3.16.1   rmind     int                     Sig)
    220           1.1  jruoho {
    221  1.1.1.3.16.1   rmind     UINT32                  i;
    222  1.1.1.3.16.1   rmind 
    223  1.1.1.3.16.1   rmind 
    224  1.1.1.3.16.1   rmind     signal (Sig, SIG_IGN);
    225  1.1.1.3.16.1   rmind     printf ("Aborting\n\n");
    226  1.1.1.3.16.1   rmind 
    227  1.1.1.3.16.1   rmind     /* Close all open files */
    228  1.1.1.3.16.1   rmind 
    229  1.1.1.3.16.1   rmind     Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
    230  1.1.1.3.16.1   rmind 
    231  1.1.1.3.16.1   rmind     for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
    232  1.1.1.3.16.1   rmind     {
    233  1.1.1.3.16.1   rmind         FlCloseFile (i);
    234  1.1.1.3.16.1   rmind     }
    235  1.1.1.3.16.1   rmind 
    236  1.1.1.3.16.1   rmind     /* Delete any output files */
    237           1.1  jruoho 
    238  1.1.1.3.16.1   rmind     for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++)
    239  1.1.1.3.16.1   rmind     {
    240  1.1.1.3.16.1   rmind         FlDeleteFile (i);
    241  1.1.1.3.16.1   rmind     }
    242  1.1.1.3.16.1   rmind 
    243  1.1.1.3.16.1   rmind     exit (0);
    244           1.1  jruoho }
    245           1.1  jruoho 
    246           1.1  jruoho 
    247           1.1  jruoho /*******************************************************************************
    248           1.1  jruoho  *
    249           1.1  jruoho  * FUNCTION:    AslInitialize
    250           1.1  jruoho  *
    251           1.1  jruoho  * PARAMETERS:  None
    252           1.1  jruoho  *
    253           1.1  jruoho  * RETURN:      None
    254           1.1  jruoho  *
    255           1.1  jruoho  * DESCRIPTION: Initialize compiler globals
    256           1.1  jruoho  *
    257           1.1  jruoho  ******************************************************************************/
    258           1.1  jruoho 
    259           1.1  jruoho static void
    260           1.1  jruoho AslInitialize (
    261           1.1  jruoho     void)
    262           1.1  jruoho {
    263           1.1  jruoho     UINT32                  i;
    264           1.1  jruoho 
    265           1.1  jruoho 
    266           1.1  jruoho     for (i = 0; i < ASL_NUM_FILES; i++)
    267           1.1  jruoho     {
    268           1.1  jruoho         Gbl_Files[i].Handle = NULL;
    269           1.1  jruoho         Gbl_Files[i].Filename = NULL;
    270           1.1  jruoho     }
    271           1.1  jruoho 
    272           1.1  jruoho     Gbl_Files[ASL_FILE_STDOUT].Handle   = stdout;
    273           1.1  jruoho     Gbl_Files[ASL_FILE_STDOUT].Filename = "STDOUT";
    274           1.1  jruoho 
    275           1.1  jruoho     Gbl_Files[ASL_FILE_STDERR].Handle   = stderr;
    276           1.1  jruoho     Gbl_Files[ASL_FILE_STDERR].Filename = "STDERR";
    277           1.1  jruoho }
    278           1.1  jruoho 
    279           1.1  jruoho 
    280           1.1  jruoho /*******************************************************************************
    281           1.1  jruoho  *
    282           1.1  jruoho  * FUNCTION:    main
    283           1.1  jruoho  *
    284           1.1  jruoho  * PARAMETERS:  Standard argc/argv
    285           1.1  jruoho  *
    286           1.1  jruoho  * RETURN:      Program termination code
    287           1.1  jruoho  *
    288           1.1  jruoho  * DESCRIPTION: C main routine for the Asl Compiler. Handle command line
    289           1.1  jruoho  *              options and begin the compile for each file on the command line
    290           1.1  jruoho  *
    291           1.1  jruoho  ******************************************************************************/
    292           1.1  jruoho 
    293           1.1  jruoho int ACPI_SYSTEM_XFACE
    294           1.1  jruoho main (
    295           1.1  jruoho     int                     argc,
    296           1.1  jruoho     char                    **argv)
    297           1.1  jruoho {
    298           1.1  jruoho     ACPI_STATUS             Status;
    299       1.1.1.2  jruoho     int                     Index1;
    300       1.1.1.2  jruoho     int                     Index2;
    301       1.1.1.2  jruoho 
    302           1.1  jruoho 
    303  1.1.1.3.16.1   rmind     ACPI_DEBUG_INITIALIZE (); /* For debug version only */
    304           1.1  jruoho 
    305  1.1.1.3.16.1   rmind     /* Initialize preprocessor and compiler before command line processing */
    306           1.1  jruoho 
    307  1.1.1.3.16.1   rmind     signal (SIGINT, AslSignalHandler);
    308  1.1.1.3.16.1   rmind     AcpiGbl_ExternalFileList = NULL;
    309  1.1.1.3.16.1   rmind     AcpiDbgLevel = 0;
    310  1.1.1.3.16.1   rmind     PrInitializePreprocessor ();
    311           1.1  jruoho     AslInitialize ();
    312  1.1.1.3.16.1   rmind 
    313       1.1.1.2  jruoho     Index1 = Index2 = AslCommandLine (argc, argv);
    314           1.1  jruoho 
    315  1.1.1.3.16.1   rmind     /* Allocate the line buffer(s), must be after command line */
    316  1.1.1.3.16.1   rmind 
    317  1.1.1.3.16.1   rmind     Gbl_LineBufferSize /= 2;
    318  1.1.1.3.16.1   rmind     UtExpandLineBuffers ();
    319  1.1.1.3.16.1   rmind 
    320  1.1.1.3.16.1   rmind     /* Perform global actions first/only */
    321           1.1  jruoho 
    322           1.1  jruoho     if (Gbl_GetAllTables)
    323           1.1  jruoho     {
    324           1.1  jruoho         Status = AslDoOneFile (NULL);
    325           1.1  jruoho         if (ACPI_FAILURE (Status))
    326           1.1  jruoho         {
    327           1.1  jruoho             return (-1);
    328           1.1  jruoho         }
    329           1.1  jruoho         return (0);
    330           1.1  jruoho     }
    331           1.1  jruoho 
    332       1.1.1.2  jruoho     if (Gbl_DisassembleAll)
    333       1.1.1.2  jruoho     {
    334       1.1.1.2  jruoho         while (argv[Index1])
    335       1.1.1.2  jruoho         {
    336  1.1.1.3.16.1   rmind             Status = AcpiDmAddToExternalFileList (argv[Index1]);
    337       1.1.1.2  jruoho             if (ACPI_FAILURE (Status))
    338       1.1.1.2  jruoho             {
    339       1.1.1.2  jruoho                 return (-1);
    340       1.1.1.2  jruoho             }
    341       1.1.1.2  jruoho 
    342       1.1.1.2  jruoho             Index1++;
    343       1.1.1.2  jruoho         }
    344       1.1.1.2  jruoho     }
    345       1.1.1.2  jruoho 
    346           1.1  jruoho     /* Process each pathname/filename in the list, with possible wildcards */
    347           1.1  jruoho 
    348       1.1.1.2  jruoho     while (argv[Index2])
    349           1.1  jruoho     {
    350  1.1.1.3.16.1   rmind         /*
    351  1.1.1.3.16.1   rmind          * If -p not specified, we will use the input filename as the
    352  1.1.1.3.16.1   rmind          * output filename prefix
    353  1.1.1.3.16.1   rmind          */
    354  1.1.1.3.16.1   rmind         if (Gbl_UseDefaultAmlFilename)
    355  1.1.1.3.16.1   rmind         {
    356  1.1.1.3.16.1   rmind             Gbl_OutputFilenamePrefix = argv[Index2];
    357  1.1.1.3.16.1   rmind             UtConvertBackslashes (Gbl_OutputFilenamePrefix);
    358  1.1.1.3.16.1   rmind         }
    359  1.1.1.3.16.1   rmind 
    360  1.1.1.3.16.1   rmind         Status = AslDoOneFile (argv[Index2]);
    361           1.1  jruoho         if (ACPI_FAILURE (Status))
    362           1.1  jruoho         {
    363           1.1  jruoho             return (-1);
    364           1.1  jruoho         }
    365           1.1  jruoho 
    366       1.1.1.2  jruoho         Index2++;
    367       1.1.1.2  jruoho     }
    368       1.1.1.2  jruoho 
    369       1.1.1.2  jruoho     if (AcpiGbl_ExternalFileList)
    370       1.1.1.2  jruoho     {
    371       1.1.1.2  jruoho         AcpiDmClearExternalFileList();
    372           1.1  jruoho     }
    373           1.1  jruoho 
    374           1.1  jruoho     return (0);
    375           1.1  jruoho }
    376