Subversion Repositories Kolibri OS

Rev

Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 6... Line 6...
6
 
6
 
7
/******************************************************************************
7
/******************************************************************************
8
 *
8
 *
9
 * 1. Copyright Notice
9
 * 1. Copyright Notice
10
 *
10
 *
11
 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
11
 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
12
 * All rights reserved.
12
 * All rights reserved.
13
 *
13
 *
14
 * 2. License
14
 * 2. License
15
 *
15
 *
Line 132... Line 132...
132
#define _COMPONENT          ACPI_TOOLS
132
#define _COMPONENT          ACPI_TOOLS
133
        ACPI_MODULE_NAME    ("adisasm")
133
        ACPI_MODULE_NAME    ("adisasm")
Line 134... Line 134...
134
 
134
 
135
 
-
 
Line 136... Line 135...
136
extern int                  AslCompilerdebug;
135
 
137
extern char                 *Gbl_ExternalFilename;
136
extern int                  AslCompilerdebug;
138
 
137
 
Line 146... Line 145...
146
    void                    *Handle);
145
    void                    *Handle);
Line 147... Line 146...
147
 
146
 
Line 148... Line 147...
148
 
147
 
149
/* Local prototypes */
148
/* Local prototypes */
150
 
149
 
151
void
150
static void
Line 152... Line -...
152
AdCreateTableHeader (
-
 
153
    char                    *Filename,
-
 
154
    ACPI_TABLE_HEADER       *Table);
-
 
155
 
-
 
156
void
151
AdCreateTableHeader (
157
AdDisassemblerHeader (
152
    char                    *Filename,
158
    char                    *Filename);
153
    ACPI_TABLE_HEADER       *Table);
159
 
154
 
160
ACPI_STATUS
155
static ACPI_STATUS
Line 161... Line 156...
161
AdDeferredParse (
156
AdDeferredParse (
162
    ACPI_PARSE_OBJECT       *Op,
157
    ACPI_PARSE_OBJECT       *Op,
163
    UINT8                   *Aml,
158
    UINT8                   *Aml,
Line 164... Line 159...
164
    UINT32                  AmlLength);
159
    UINT32                  AmlLength);
Line 315... Line 310...
315
    BOOLEAN                 GetAllTables)
310
    BOOLEAN                 GetAllTables)
316
{
311
{
317
    ACPI_STATUS             Status;
312
    ACPI_STATUS             Status;
318
    char                    *DisasmFilename = NULL;
313
    char                    *DisasmFilename = NULL;
319
    char                    *ExternalFilename;
314
    char                    *ExternalFilename;
-
 
315
    ACPI_EXTERNAL_FILE      *ExternalFileList = AcpiGbl_ExternalFileList;
320
    FILE                    *File = NULL;
316
    FILE                    *File = NULL;
321
    ACPI_TABLE_HEADER       *Table = NULL;
317
    ACPI_TABLE_HEADER       *Table = NULL;
322
    ACPI_TABLE_HEADER       *ExternalTable;
318
    ACPI_TABLE_HEADER       *ExternalTable;
323
    ACPI_OWNER_ID           OwnerId;
319
    ACPI_OWNER_ID           OwnerId;
Line 337... Line 333...
337
 
333
 
338
        /*
334
        /*
339
         * External filenames separated by commas
335
         * External filenames separated by commas
340
         * Example: iasl -e file1,file2,file3 -d xxx.aml
336
         * Example: iasl -e file1,file2,file3 -d xxx.aml
341
         */
337
         */
342
        if (Gbl_ExternalFilename)
338
        while (ExternalFileList)
343
        {
339
        {
344
            ExternalFilename = strtok (Gbl_ExternalFilename, ",");
-
 
345
 
340
            ExternalFilename = ExternalFileList->Path;
346
            while (ExternalFilename)
341
            if (!ACPI_STRCMP (ExternalFilename, Filename))
-
 
342
            {
-
 
343
                /* Next external file */
-
 
344
 
-
 
345
                ExternalFileList = ExternalFileList->Next;
-
 
346
 
-
 
347
                continue;
-
 
348
            }
347
            {
349
 
348
                Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
350
                Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
349
                if (ACPI_FAILURE (Status))
351
                if (ACPI_FAILURE (Status))
350
                {
352
                {
351
                    return Status;
353
                    return Status;
Line 370... Line 372...
370
                    AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
372
                    AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
371
                        AcpiGbl_RootNode, OwnerId);
373
                        AcpiGbl_RootNode, OwnerId);
372
                    AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
374
                    AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
373
                }
375
                }
Line 374... Line 376...
374
 
376
 
Line 375... Line 377...
375
                /* Next external file name */
377
            /* Next external file */
376
 
378
 
Line 377... Line 379...
377
                ExternalFilename = strtok (NULL, ",");
379
            ExternalFileList = ExternalFileList->Next;
Line -... Line 380...
-
 
380
            }
-
 
381
 
378
            }
382
            /* Clear external list generated by Scope in external tables */
379
 
383
 
380
            /* Clear external list generated by Scope in external tables */
384
        if (AcpiGbl_ExternalFileList)
381
 
385
        {
382
            AcpiDmClearExternalList ();
386
            AcpiDmClearExternalList ();
Line 606... Line 610...
606
 
610
 
Line 607... Line 611...
607
    time (&Timer);
611
    time (&Timer);
Line 608... Line 612...
608
 
612
 
609
    /* Header and input table info */
613
    /* Header and input table info */
Line 610... Line 614...
610
 
614
 
611
    AcpiOsPrintf ("/*\n * Intel ACPI Component Architecture\n");
615
    AcpiOsPrintf ("/*\n");
612
    AcpiOsPrintf (" * AML Disassembler version %8.8X\n", ACPI_CA_VERSION);
616
    AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
Line 613... Line 617...
613
 
617
 
Line 628... Line 632...
628
 * DESCRIPTION: Create the ASL table header, including ACPI CA signon with
632
 * DESCRIPTION: Create the ASL table header, including ACPI CA signon with
629
 *              current time and date.
633
 *              current time and date.
630
 *
634
 *
631
 *****************************************************************************/
635
 *****************************************************************************/
Line 632... Line 636...
632
 
636
 
633
void
637
static void
634
AdCreateTableHeader (
638
AdCreateTableHeader (
635
    char                    *Filename,
639
    char                    *Filename,
636
    ACPI_TABLE_HEADER       *Table)
640
    ACPI_TABLE_HEADER       *Table)
637
{
641
{
Line 642... Line 646...
642
    /*
646
    /*
643
     * Print file header and dump original table header
647
     * Print file header and dump original table header
644
     */
648
     */
645
    AdDisassemblerHeader (Filename);
649
    AdDisassemblerHeader (Filename);
Line 646... Line 650...
646
 
650
 
647
    AcpiOsPrintf (" *\n * Original Table Header:\n");
651
    AcpiOsPrintf (" * Original Table Header:\n");
648
    AcpiOsPrintf (" *     Signature        \"%4.4s\"\n",    Table->Signature);
652
    AcpiOsPrintf (" *     Signature        \"%4.4s\"\n",    Table->Signature);
Line 649... Line 653...
649
    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", Table->Length, Table->Length);
653
    AcpiOsPrintf (" *     Length           0x%8.8X (%u)\n", Table->Length, Table->Length);
Line 661... Line 665...
661
    case 1:
665
    case 1:
662
        /* Revision of DSDT controls the ACPI integer width */
666
        /* Revision of DSDT controls the ACPI integer width */
Line 663... Line 667...
663
 
667
 
664
        if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
668
        if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
665
        {
669
        {
666
            AcpiOsPrintf (" **** ACPI 1.0, no 64-bit math support");
670
            AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support");
667
        }
671
        }
Line 668... Line 672...
668
        break;
672
        break;
669
 
673
 
Line 687... Line 691...
687
    AcpiOsPrintf (" *     OEM ID           \"%.6s\"\n",     Table->OemId);
691
    AcpiOsPrintf (" *     OEM ID           \"%.6s\"\n",     Table->OemId);
688
    AcpiOsPrintf (" *     OEM Table ID     \"%.8s\"\n",     Table->OemTableId);
692
    AcpiOsPrintf (" *     OEM Table ID     \"%.8s\"\n",     Table->OemTableId);
689
    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
693
    AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
690
    AcpiOsPrintf (" *     Compiler ID      \"%.4s\"\n",     Table->AslCompilerId);
694
    AcpiOsPrintf (" *     Compiler ID      \"%.4s\"\n",     Table->AslCompilerId);
691
    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
695
    AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
692
    AcpiOsPrintf (" */\n");
696
    AcpiOsPrintf (" */\n\n");
Line 693... Line 697...
693
 
697
 
Line 694... Line 698...
694
    /* Create AML output filename based on input filename */
698
    /* Create AML output filename based on input filename */
695
 
699
 
Line 775... Line 779...
775
 * DESCRIPTION: Parse one deferred opcode
779
 * DESCRIPTION: Parse one deferred opcode
776
 *              (Methods, operation regions, etc.)
780
 *              (Methods, operation regions, etc.)
777
 *
781
 *
778
 *****************************************************************************/
782
 *****************************************************************************/
Line 779... Line 783...
779
 
783
 
780
ACPI_STATUS
784
static ACPI_STATUS
781
AdDeferredParse (
785
AdDeferredParse (
782
    ACPI_PARSE_OBJECT       *Op,
786
    ACPI_PARSE_OBJECT       *Op,
783
    UINT8                   *Aml,
787
    UINT8                   *Aml,
784
    UINT32                  AmlLength)
788
    UINT32                  AmlLength)
Line 898... Line 902...
898
 *
902
 *
899
 * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.)
903
 * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.)
900
 *
904
 *
901
 *****************************************************************************/
905
 *****************************************************************************/
Line 902... Line 906...
902
 
906
 
903
ACPI_STATUS
907
static ACPI_STATUS
904
AdParseDeferredOps (
908
AdParseDeferredOps (
905
    ACPI_PARSE_OBJECT       *Root)
909
    ACPI_PARSE_OBJECT       *Root)
906
{
910
{
907
    ACPI_PARSE_OBJECT       *Op = Root;
911
    ACPI_PARSE_OBJECT       *Op = Root;