Home | History | Annotate | Line # | Download | only in acpidump
apdump.c revision 1.1.1.10.2.1
      1           1.1  christos /******************************************************************************
      2           1.1  christos  *
      3           1.1  christos  * Module Name: apdump - Dump routines for ACPI tables (acpidump)
      4           1.1  christos  *
      5           1.1  christos  *****************************************************************************/
      6           1.1  christos 
      7           1.1  christos /*
      8  1.1.1.10.2.1  christos  * Copyright (C) 2000 - 2019, Intel Corp.
      9           1.1  christos  * All rights reserved.
     10           1.1  christos  *
     11           1.1  christos  * Redistribution and use in source and binary forms, with or without
     12           1.1  christos  * modification, are permitted provided that the following conditions
     13           1.1  christos  * are met:
     14           1.1  christos  * 1. Redistributions of source code must retain the above copyright
     15           1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     16           1.1  christos  *    without modification.
     17           1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18           1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19           1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20           1.1  christos  *    including a substantially similar Disclaimer requirement for further
     21           1.1  christos  *    binary redistribution.
     22           1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23           1.1  christos  *    of any contributors may be used to endorse or promote products derived
     24           1.1  christos  *    from this software without specific prior written permission.
     25           1.1  christos  *
     26           1.1  christos  * Alternatively, this software may be distributed under the terms of the
     27           1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28           1.1  christos  * Software Foundation.
     29           1.1  christos  *
     30           1.1  christos  * NO WARRANTY
     31           1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32           1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33           1.1  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34           1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35           1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36           1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37           1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38           1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39           1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40           1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41           1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     42           1.1  christos  */
     43           1.1  christos 
     44           1.1  christos #include "acpidump.h"
     45           1.1  christos 
     46           1.1  christos 
     47           1.1  christos /* Local prototypes */
     48           1.1  christos 
     49           1.1  christos static int
     50           1.1  christos ApDumpTableBuffer (
     51           1.1  christos     ACPI_TABLE_HEADER       *Table,
     52           1.1  christos     UINT32                  Instance,
     53           1.1  christos     ACPI_PHYSICAL_ADDRESS   Address);
     54           1.1  christos 
     55           1.1  christos 
     56           1.1  christos /******************************************************************************
     57           1.1  christos  *
     58           1.1  christos  * FUNCTION:    ApIsValidHeader
     59           1.1  christos  *
     60           1.1  christos  * PARAMETERS:  Table               - Pointer to table to be validated
     61           1.1  christos  *
     62           1.1  christos  * RETURN:      TRUE if the header appears to be valid. FALSE otherwise
     63           1.1  christos  *
     64           1.1  christos  * DESCRIPTION: Check for a valid ACPI table header
     65           1.1  christos  *
     66           1.1  christos  ******************************************************************************/
     67           1.1  christos 
     68           1.1  christos BOOLEAN
     69           1.1  christos ApIsValidHeader (
     70           1.1  christos     ACPI_TABLE_HEADER       *Table)
     71           1.1  christos {
     72       1.1.1.2  christos 
     73           1.1  christos     if (!ACPI_VALIDATE_RSDP_SIG (Table->Signature))
     74           1.1  christos     {
     75           1.1  christos         /* Make sure signature is all ASCII and a valid ACPI name */
     76           1.1  christos 
     77       1.1.1.6  christos         if (!AcpiUtValidNameseg (Table->Signature))
     78           1.1  christos         {
     79       1.1.1.7  christos             fprintf (stderr, "Table signature (0x%8.8X) is invalid\n",
     80           1.1  christos                 *(UINT32 *) Table->Signature);
     81           1.1  christos             return (FALSE);
     82           1.1  christos         }
     83           1.1  christos 
     84           1.1  christos         /* Check for minimum table length */
     85           1.1  christos 
     86           1.1  christos         if (Table->Length < sizeof (ACPI_TABLE_HEADER))
     87           1.1  christos         {
     88       1.1.1.7  christos             fprintf (stderr, "Table length (0x%8.8X) is invalid\n",
     89           1.1  christos                 Table->Length);
     90           1.1  christos             return (FALSE);
     91           1.1  christos         }
     92           1.1  christos     }
     93           1.1  christos 
     94           1.1  christos     return (TRUE);
     95           1.1  christos }
     96           1.1  christos 
     97           1.1  christos 
     98           1.1  christos /******************************************************************************
     99           1.1  christos  *
    100           1.1  christos  * FUNCTION:    ApIsValidChecksum
    101           1.1  christos  *
    102           1.1  christos  * PARAMETERS:  Table               - Pointer to table to be validated
    103           1.1  christos  *
    104       1.1.1.2  christos  * RETURN:      TRUE if the checksum appears to be valid. FALSE otherwise.
    105           1.1  christos  *
    106       1.1.1.2  christos  * DESCRIPTION: Check for a valid ACPI table checksum.
    107           1.1  christos  *
    108           1.1  christos  ******************************************************************************/
    109           1.1  christos 
    110           1.1  christos BOOLEAN
    111           1.1  christos ApIsValidChecksum (
    112           1.1  christos     ACPI_TABLE_HEADER       *Table)
    113           1.1  christos {
    114           1.1  christos     ACPI_STATUS             Status;
    115           1.1  christos     ACPI_TABLE_RSDP         *Rsdp;
    116           1.1  christos 
    117           1.1  christos 
    118           1.1  christos     if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
    119           1.1  christos     {
    120           1.1  christos         /*
    121           1.1  christos          * Checksum for RSDP.
    122           1.1  christos          * Note: Other checksums are computed during the table dump.
    123           1.1  christos          */
    124           1.1  christos         Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
    125           1.1  christos         Status = AcpiTbValidateRsdp (Rsdp);
    126           1.1  christos     }
    127           1.1  christos     else
    128           1.1  christos     {
    129           1.1  christos         Status = AcpiTbVerifyChecksum (Table, Table->Length);
    130           1.1  christos     }
    131           1.1  christos 
    132           1.1  christos     if (ACPI_FAILURE (Status))
    133           1.1  christos     {
    134       1.1.1.7  christos         fprintf (stderr, "%4.4s: Warning: wrong checksum in table\n",
    135           1.1  christos             Table->Signature);
    136           1.1  christos     }
    137           1.1  christos 
    138           1.1  christos     return (AE_OK);
    139           1.1  christos }
    140           1.1  christos 
    141           1.1  christos 
    142           1.1  christos /******************************************************************************
    143           1.1  christos  *
    144           1.1  christos  * FUNCTION:    ApGetTableLength
    145           1.1  christos  *
    146           1.1  christos  * PARAMETERS:  Table               - Pointer to the table
    147           1.1  christos  *
    148           1.1  christos  * RETURN:      Table length
    149           1.1  christos  *
    150       1.1.1.2  christos  * DESCRIPTION: Obtain table length according to table signature.
    151           1.1  christos  *
    152           1.1  christos  ******************************************************************************/
    153           1.1  christos 
    154           1.1  christos UINT32
    155           1.1  christos ApGetTableLength (
    156           1.1  christos     ACPI_TABLE_HEADER       *Table)
    157           1.1  christos {
    158           1.1  christos     ACPI_TABLE_RSDP         *Rsdp;
    159           1.1  christos 
    160           1.1  christos 
    161           1.1  christos     /* Check if table is valid */
    162           1.1  christos 
    163           1.1  christos     if (!ApIsValidHeader (Table))
    164           1.1  christos     {
    165           1.1  christos         return (0);
    166           1.1  christos     }
    167           1.1  christos 
    168           1.1  christos     if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
    169           1.1  christos     {
    170           1.1  christos         Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
    171       1.1.1.2  christos         return (AcpiTbGetRsdpLength (Rsdp));
    172           1.1  christos     }
    173       1.1.1.2  christos 
    174       1.1.1.2  christos     /* Normal ACPI table */
    175       1.1.1.2  christos 
    176       1.1.1.2  christos     return (Table->Length);
    177           1.1  christos }
    178           1.1  christos 
    179           1.1  christos 
    180           1.1  christos /******************************************************************************
    181           1.1  christos  *
    182           1.1  christos  * FUNCTION:    ApDumpTableBuffer
    183           1.1  christos  *
    184           1.1  christos  * PARAMETERS:  Table               - ACPI table to be dumped
    185           1.1  christos  *              Instance            - ACPI table instance no. to be dumped
    186           1.1  christos  *              Address             - Physical address of the table
    187           1.1  christos  *
    188           1.1  christos  * RETURN:      None
    189           1.1  christos  *
    190           1.1  christos  * DESCRIPTION: Dump an ACPI table in standard ASCII hex format, with a
    191           1.1  christos  *              header that is compatible with the AcpiXtract utility.
    192           1.1  christos  *
    193           1.1  christos  ******************************************************************************/
    194           1.1  christos 
    195           1.1  christos static int
    196           1.1  christos ApDumpTableBuffer (
    197           1.1  christos     ACPI_TABLE_HEADER       *Table,
    198           1.1  christos     UINT32                  Instance,
    199           1.1  christos     ACPI_PHYSICAL_ADDRESS   Address)
    200           1.1  christos {
    201           1.1  christos     UINT32                  TableLength;
    202           1.1  christos 
    203           1.1  christos 
    204           1.1  christos     TableLength = ApGetTableLength (Table);
    205           1.1  christos 
    206           1.1  christos     /* Print only the header if requested */
    207           1.1  christos 
    208           1.1  christos     if (Gbl_SummaryMode)
    209           1.1  christos     {
    210           1.1  christos         AcpiTbPrintTableHeader (Address, Table);
    211           1.1  christos         return (0);
    212           1.1  christos     }
    213           1.1  christos 
    214           1.1  christos     /* Dump to binary file if requested */
    215           1.1  christos 
    216           1.1  christos     if (Gbl_BinaryMode)
    217           1.1  christos     {
    218           1.1  christos         return (ApWriteToBinaryFile (Table, Instance));
    219           1.1  christos     }
    220           1.1  christos 
    221           1.1  christos     /*
    222       1.1.1.2  christos      * Dump the table with header for use with acpixtract utility.
    223           1.1  christos      * Note: simplest to just always emit a 64-bit address. AcpiXtract
    224           1.1  christos      * utility can handle this.
    225           1.1  christos      */
    226       1.1.1.7  christos     fprintf (Gbl_OutputFile, "%4.4s @ 0x%8.8X%8.8X\n",
    227       1.1.1.2  christos         Table->Signature, ACPI_FORMAT_UINT64 (Address));
    228           1.1  christos 
    229       1.1.1.2  christos     AcpiUtDumpBufferToFile (Gbl_OutputFile,
    230       1.1.1.2  christos         ACPI_CAST_PTR (UINT8, Table), TableLength,
    231           1.1  christos         DB_BYTE_DISPLAY, 0);
    232       1.1.1.7  christos     fprintf (Gbl_OutputFile, "\n");
    233           1.1  christos     return (0);
    234           1.1  christos }
    235           1.1  christos 
    236           1.1  christos 
    237           1.1  christos /******************************************************************************
    238           1.1  christos  *
    239           1.1  christos  * FUNCTION:    ApDumpAllTables
    240           1.1  christos  *
    241           1.1  christos  * PARAMETERS:  None
    242           1.1  christos  *
    243           1.1  christos  * RETURN:      Status
    244           1.1  christos  *
    245           1.1  christos  * DESCRIPTION: Get all tables from the RSDT/XSDT (or at least all of the
    246           1.1  christos  *              tables that we can possibly get).
    247           1.1  christos  *
    248           1.1  christos  ******************************************************************************/
    249           1.1  christos 
    250           1.1  christos int
    251           1.1  christos ApDumpAllTables (
    252           1.1  christos     void)
    253           1.1  christos {
    254           1.1  christos     ACPI_TABLE_HEADER       *Table;
    255           1.1  christos     UINT32                  Instance = 0;
    256           1.1  christos     ACPI_PHYSICAL_ADDRESS   Address;
    257           1.1  christos     ACPI_STATUS             Status;
    258       1.1.1.2  christos     int                     TableStatus;
    259           1.1  christos     UINT32                  i;
    260           1.1  christos 
    261           1.1  christos 
    262           1.1  christos     /* Get and dump all available ACPI tables */
    263           1.1  christos 
    264           1.1  christos     for (i = 0; i < AP_MAX_ACPI_FILES; i++)
    265           1.1  christos     {
    266           1.1  christos         Status = AcpiOsGetTableByIndex (i, &Table, &Instance, &Address);
    267           1.1  christos         if (ACPI_FAILURE (Status))
    268           1.1  christos         {
    269           1.1  christos             /* AE_LIMIT means that no more tables are available */
    270           1.1  christos 
    271           1.1  christos             if (Status == AE_LIMIT)
    272           1.1  christos             {
    273           1.1  christos                 return (0);
    274           1.1  christos             }
    275           1.1  christos             else if (i == 0)
    276           1.1  christos             {
    277       1.1.1.7  christos                 fprintf (stderr, "Could not get ACPI tables, %s\n",
    278           1.1  christos                     AcpiFormatException (Status));
    279           1.1  christos                 return (-1);
    280           1.1  christos             }
    281           1.1  christos             else
    282           1.1  christos             {
    283       1.1.1.7  christos                 fprintf (stderr, "Could not get ACPI table at index %u, %s\n",
    284           1.1  christos                     i, AcpiFormatException (Status));
    285           1.1  christos                 continue;
    286           1.1  christos             }
    287           1.1  christos         }
    288           1.1  christos 
    289       1.1.1.2  christos         TableStatus = ApDumpTableBuffer (Table, Instance, Address);
    290       1.1.1.2  christos         ACPI_FREE (Table);
    291       1.1.1.2  christos 
    292       1.1.1.2  christos         if (TableStatus)
    293           1.1  christos         {
    294       1.1.1.2  christos             break;
    295           1.1  christos         }
    296           1.1  christos     }
    297           1.1  christos 
    298           1.1  christos     /* Something seriously bad happened if the loop terminates here */
    299           1.1  christos 
    300           1.1  christos     return (-1);
    301           1.1  christos }
    302           1.1  christos 
    303           1.1  christos 
    304           1.1  christos /******************************************************************************
    305           1.1  christos  *
    306           1.1  christos  * FUNCTION:    ApDumpTableByAddress
    307           1.1  christos  *
    308           1.1  christos  * PARAMETERS:  AsciiAddress        - Address for requested ACPI table
    309           1.1  christos  *
    310           1.1  christos  * RETURN:      Status
    311           1.1  christos  *
    312           1.1  christos  * DESCRIPTION: Get an ACPI table via a physical address and dump it.
    313           1.1  christos  *
    314           1.1  christos  ******************************************************************************/
    315           1.1  christos 
    316           1.1  christos int
    317           1.1  christos ApDumpTableByAddress (
    318           1.1  christos     char                    *AsciiAddress)
    319           1.1  christos {
    320           1.1  christos     ACPI_PHYSICAL_ADDRESS   Address;
    321           1.1  christos     ACPI_TABLE_HEADER       *Table;
    322           1.1  christos     ACPI_STATUS             Status;
    323           1.1  christos     int                     TableStatus;
    324           1.1  christos     UINT64                  LongAddress;
    325           1.1  christos 
    326           1.1  christos 
    327           1.1  christos     /* Convert argument to an integer physical address */
    328           1.1  christos 
    329       1.1.1.9  christos     Status = AcpiUtStrtoul64 (AsciiAddress, &LongAddress);
    330           1.1  christos     if (ACPI_FAILURE (Status))
    331           1.1  christos     {
    332       1.1.1.7  christos         fprintf (stderr, "%s: Could not convert to a physical address\n",
    333           1.1  christos             AsciiAddress);
    334           1.1  christos         return (-1);
    335           1.1  christos     }
    336           1.1  christos 
    337           1.1  christos     Address = (ACPI_PHYSICAL_ADDRESS) LongAddress;
    338           1.1  christos     Status = AcpiOsGetTableByAddress (Address, &Table);
    339           1.1  christos     if (ACPI_FAILURE (Status))
    340           1.1  christos     {
    341       1.1.1.7  christos         fprintf (stderr, "Could not get table at 0x%8.8X%8.8X, %s\n",
    342           1.1  christos             ACPI_FORMAT_UINT64 (Address),
    343           1.1  christos             AcpiFormatException (Status));
    344           1.1  christos         return (-1);
    345           1.1  christos     }
    346           1.1  christos 
    347           1.1  christos     TableStatus = ApDumpTableBuffer (Table, 0, Address);
    348       1.1.1.2  christos     ACPI_FREE (Table);
    349           1.1  christos     return (TableStatus);
    350           1.1  christos }
    351           1.1  christos 
    352           1.1  christos 
    353           1.1  christos /******************************************************************************
    354           1.1  christos  *
    355           1.1  christos  * FUNCTION:    ApDumpTableByName
    356           1.1  christos  *
    357           1.1  christos  * PARAMETERS:  Signature           - Requested ACPI table signature
    358           1.1  christos  *
    359           1.1  christos  * RETURN:      Status
    360           1.1  christos  *
    361           1.1  christos  * DESCRIPTION: Get an ACPI table via a signature and dump it. Handles
    362           1.1  christos  *              multiple tables with the same signature (SSDTs).
    363           1.1  christos  *
    364           1.1  christos  ******************************************************************************/
    365           1.1  christos 
    366           1.1  christos int
    367           1.1  christos ApDumpTableByName (
    368           1.1  christos     char                    *Signature)
    369           1.1  christos {
    370  1.1.1.10.2.1  christos     char                    LocalSignature [ACPI_NAMESEG_SIZE + 1];
    371           1.1  christos     UINT32                  Instance;
    372           1.1  christos     ACPI_TABLE_HEADER       *Table;
    373           1.1  christos     ACPI_PHYSICAL_ADDRESS   Address;
    374           1.1  christos     ACPI_STATUS             Status;
    375       1.1.1.2  christos     int                     TableStatus;
    376           1.1  christos 
    377           1.1  christos 
    378  1.1.1.10.2.1  christos     if (strlen (Signature) != ACPI_NAMESEG_SIZE)
    379           1.1  christos     {
    380       1.1.1.7  christos         fprintf (stderr,
    381           1.1  christos             "Invalid table signature [%s]: must be exactly 4 characters\n",
    382           1.1  christos             Signature);
    383           1.1  christos         return (-1);
    384           1.1  christos     }
    385           1.1  christos 
    386           1.1  christos     /* Table signatures are expected to be uppercase */
    387           1.1  christos 
    388       1.1.1.4  christos     strcpy (LocalSignature, Signature);
    389           1.1  christos     AcpiUtStrupr (LocalSignature);
    390           1.1  christos 
    391           1.1  christos     /* To be friendly, handle tables whose signatures do not match the name */
    392           1.1  christos 
    393  1.1.1.10.2.1  christos     if (ACPI_COMPARE_NAMESEG (LocalSignature, "FADT"))
    394           1.1  christos     {
    395       1.1.1.4  christos         strcpy (LocalSignature, ACPI_SIG_FADT);
    396           1.1  christos     }
    397  1.1.1.10.2.1  christos     else if (ACPI_COMPARE_NAMESEG (LocalSignature, "MADT"))
    398           1.1  christos     {
    399       1.1.1.4  christos         strcpy (LocalSignature, ACPI_SIG_MADT);
    400           1.1  christos     }
    401           1.1  christos 
    402           1.1  christos     /* Dump all instances of this signature (to handle multiple SSDTs) */
    403           1.1  christos 
    404           1.1  christos     for (Instance = 0; Instance < AP_MAX_ACPI_FILES; Instance++)
    405           1.1  christos     {
    406           1.1  christos         Status = AcpiOsGetTableByName (LocalSignature, Instance,
    407           1.1  christos             &Table, &Address);
    408           1.1  christos         if (ACPI_FAILURE (Status))
    409           1.1  christos         {
    410           1.1  christos             /* AE_LIMIT means that no more tables are available */
    411           1.1  christos 
    412           1.1  christos             if (Status == AE_LIMIT)
    413           1.1  christos             {
    414           1.1  christos                 return (0);
    415           1.1  christos             }
    416           1.1  christos 
    417       1.1.1.7  christos             fprintf (stderr,
    418           1.1  christos                 "Could not get ACPI table with signature [%s], %s\n",
    419           1.1  christos                 LocalSignature, AcpiFormatException (Status));
    420           1.1  christos             return (-1);
    421           1.1  christos         }
    422           1.1  christos 
    423       1.1.1.2  christos         TableStatus = ApDumpTableBuffer (Table, Instance, Address);
    424       1.1.1.2  christos         ACPI_FREE (Table);
    425       1.1.1.2  christos 
    426       1.1.1.2  christos         if (TableStatus)
    427           1.1  christos         {
    428       1.1.1.2  christos             break;
    429           1.1  christos         }
    430           1.1  christos     }
    431           1.1  christos 
    432           1.1  christos     /* Something seriously bad happened if the loop terminates here */
    433           1.1  christos 
    434           1.1  christos     return (-1);
    435           1.1  christos }
    436           1.1  christos 
    437           1.1  christos 
    438           1.1  christos /******************************************************************************
    439           1.1  christos  *
    440           1.1  christos  * FUNCTION:    ApDumpTableFromFile
    441           1.1  christos  *
    442           1.1  christos  * PARAMETERS:  Pathname            - File containing the binary ACPI table
    443           1.1  christos  *
    444           1.1  christos  * RETURN:      Status
    445           1.1  christos  *
    446           1.1  christos  * DESCRIPTION: Dump an ACPI table from a binary file
    447           1.1  christos  *
    448           1.1  christos  ******************************************************************************/
    449           1.1  christos 
    450           1.1  christos int
    451           1.1  christos ApDumpTableFromFile (
    452           1.1  christos     char                    *Pathname)
    453           1.1  christos {
    454           1.1  christos     ACPI_TABLE_HEADER       *Table;
    455           1.1  christos     UINT32                  FileSize = 0;
    456       1.1.1.2  christos     int                     TableStatus = -1;
    457           1.1  christos 
    458           1.1  christos 
    459           1.1  christos     /* Get the entire ACPI table from the file */
    460           1.1  christos 
    461           1.1  christos     Table = ApGetTableFromFile (Pathname, &FileSize);
    462           1.1  christos     if (!Table)
    463           1.1  christos     {
    464           1.1  christos         return (-1);
    465           1.1  christos     }
    466           1.1  christos 
    467       1.1.1.6  christos     if (!AcpiUtValidNameseg (Table->Signature))
    468       1.1.1.6  christos     {
    469       1.1.1.7  christos         fprintf (stderr,
    470       1.1.1.6  christos             "No valid ACPI signature was found in input file %s\n",
    471       1.1.1.6  christos             Pathname);
    472       1.1.1.6  christos     }
    473       1.1.1.6  christos 
    474           1.1  christos     /* File must be at least as long as the table length */
    475           1.1  christos 
    476           1.1  christos     if (Table->Length > FileSize)
    477           1.1  christos     {
    478       1.1.1.7  christos         fprintf (stderr,
    479           1.1  christos             "Table length (0x%X) is too large for input file (0x%X) %s\n",
    480           1.1  christos             Table->Length, FileSize, Pathname);
    481       1.1.1.2  christos         goto Exit;
    482           1.1  christos     }
    483           1.1  christos 
    484           1.1  christos     if (Gbl_VerboseMode)
    485           1.1  christos     {
    486       1.1.1.7  christos         fprintf (stderr,
    487           1.1  christos             "Input file:  %s contains table [%4.4s], 0x%X (%u) bytes\n",
    488           1.1  christos             Pathname, Table->Signature, FileSize, FileSize);
    489           1.1  christos     }
    490           1.1  christos 
    491           1.1  christos     TableStatus = ApDumpTableBuffer (Table, 0, 0);
    492           1.1  christos 
    493       1.1.1.2  christos Exit:
    494       1.1.1.2  christos     ACPI_FREE (Table);
    495       1.1.1.2  christos     return (TableStatus);
    496           1.1  christos }
    497