diff --git a/sys/contrib/dev/acpica/common/acfileio.c b/sys/contrib/dev/acpica/common/acfileio.c index ca1e9199f3e3..819e7ceaa7e6 100644 --- a/sys/contrib/dev/acpica/common/acfileio.c +++ b/sys/contrib/dev/acpica/common/acfileio.c @@ -1,696 +1,779 @@ /****************************************************************************** * * Module Name: acfileio - Get ACPI tables from file * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("acfileio") /* Local prototypes */ static ACPI_STATUS AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, ACPI_TABLE_HEADER **Table); static ACPI_STATUS AcCheckTextModeCorruption ( ACPI_TABLE_HEADER *Table); /******************************************************************************* * * FUNCTION: AcDeleteTableList * * PARAMETERS: ListHead - List to delete * * RETURN: Status * * DESCRIPTION: Delete a list of tables. This is useful for removing memory * allocated by AcGetAllTablesFromFile * ******************************************************************************/ void AcDeleteTableList ( ACPI_NEW_TABLE_DESC *ListHead) { ACPI_NEW_TABLE_DESC *Current = ListHead; ACPI_NEW_TABLE_DESC *Previous = Current; while (Current) { Current = Current->Next; AcpiOsFree (Previous); Previous = Current; } } /******************************************************************************* * * FUNCTION: AcGetAllTablesFromFile * * PARAMETERS: Filename - Table filename * GetOnlyAmlTables - TRUE if the tables must be AML tables * ReturnListHead - Where table list is returned * * RETURN: Status * * DESCRIPTION: Get all ACPI tables from within a single file. * ******************************************************************************/ ACPI_STATUS AcGetAllTablesFromFile ( char *Filename, UINT8 GetOnlyAmlTables, ACPI_NEW_TABLE_DESC **ReturnListHead) { ACPI_NEW_TABLE_DESC *ListHead = NULL; ACPI_NEW_TABLE_DESC *ListTail = NULL; ACPI_NEW_TABLE_DESC *TableDesc; FILE *File; ACPI_TABLE_HEADER *Table = NULL; UINT32 FileSize; ACPI_STATUS Status = AE_OK; File = fopen (Filename, "rb"); if (!File) { fprintf (stderr, "Could not open input file: %s\n", Filename); if (errno == ENOENT) { return (AE_NOT_EXIST); } return (AE_ERROR); } /* Get the file size */ FileSize = CmGetFileSize (File); if (FileSize == ACPI_UINT32_MAX) { Status = AE_ERROR; goto Exit; } fprintf (stderr, "Input file %s, Length 0x%X (%u) bytes\n", Filename, FileSize, FileSize); /* We must have at least one ACPI table header */ if (FileSize < sizeof (ACPI_TABLE_HEADER)) { Status = AE_BAD_HEADER; goto Exit; } /* Check for an non-binary file */ if (!AcIsFileBinary (File)) { fprintf (stderr, " %s: File does not appear to contain a valid AML table\n", Filename); Status = AE_TYPE; goto Exit; } /* Read all tables within the file */ while (ACPI_SUCCESS (Status)) { /* Get one entire ACPI table */ Status = AcGetOneTableFromFile ( Filename, File, GetOnlyAmlTables, &Table); if (Status == AE_CTRL_TERMINATE) { Status = AE_OK; break; } else if (Status == AE_TYPE) { Status = AE_OK; goto Exit; } else if (ACPI_FAILURE (Status)) { goto Exit; } /* Print table header for iASL/disassembler only */ #ifdef ACPI_ASL_COMPILER AcpiTbPrintTableHeader (0, Table); #endif /* Allocate and link a table descriptor */ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); if (!TableDesc) { AcpiOsFree (Table); Status = AE_NO_MEMORY; goto Exit; } TableDesc->Table = Table; TableDesc->Next = NULL; /* Link at the end of the local table list */ if (!ListHead) { ListHead = TableDesc; ListTail = TableDesc; } else { ListTail->Next = TableDesc; ListTail = TableDesc; } } /* Add the local table list to the end of the global list */ if (*ReturnListHead) { ListTail = *ReturnListHead; while (ListTail->Next) { ListTail = ListTail->Next; } ListTail->Next = ListHead; } else { *ReturnListHead = ListHead; } Exit: fclose(File); return (Status); } /******************************************************************************* * * FUNCTION: AcGetOneTableFromFile * * PARAMETERS: Filename - File where table is located * File - Open FILE pointer to Filename * GetOnlyAmlTables - TRUE if the tables must be AML tables. * ReturnTable - Where a pointer to the table is returned * * RETURN: Status * * DESCRIPTION: Read the next ACPI table from a file. Implements support * for multiple tables within a single file. File must already * be open. * * Note: Loading an RSDP is not supported. * ******************************************************************************/ static ACPI_STATUS AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, ACPI_TABLE_HEADER **ReturnTable) { ACPI_STATUS Status = AE_OK; ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *Table; INT32 Count; - long TableOffset; - + UINT32 TableLength; + UINT32 HeaderLength; + long TableOffset = 0; *ReturnTable = NULL; /* Get the table header to examine signature and length */ + /* + * Special handling for the CDAT table (both the Length field + * and the Checksum field are not in the standard positions). + * (The table header is non-standard). + */ + if (AcpiGbl_CDAT) + { + HeaderLength = sizeof (ACPI_TABLE_CDAT); + } + else + { + HeaderLength = sizeof (ACPI_TABLE_HEADER); + } + + Status = AcValidateTableHeader (File, TableOffset); + if (ACPI_FAILURE (Status)) + { + return (Status); + } TableOffset = ftell (File); - Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File); - if (Count != sizeof (ACPI_TABLE_HEADER)) + Count = fread (&TableHeader, 1, HeaderLength, File); + if (Count != (INT32) HeaderLength) { return (AE_CTRL_TERMINATE); } if (GetOnlyAmlTables) { /* Validate the table signature/header (limited ASCII chars) */ - Status = AcValidateTableHeader (File, TableOffset); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - /* * Table must be an AML table (DSDT/SSDT). * Used for iASL -e option only. */ if (!AcpiUtIsAmlTable (&TableHeader)) { fprintf (stderr, " %s: Table [%4.4s] is not an AML table - ignoring\n", Filename, TableHeader.Signature); return (AE_TYPE); } } + /* + * Special handling for the CDAT table (both the Length field + * and the Checksum field are not in the standard positions). + */ + if (AcpiGbl_CDAT) + { + TableLength = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader)->Length; + } + else + { + TableLength = TableHeader.Length; + } + /* Allocate a buffer for the entire table */ - Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length); + Table = AcpiOsAllocate ((ACPI_SIZE) TableLength); if (!Table) { return (AE_NO_MEMORY); } /* Read the entire ACPI table, including header */ fseek (File, TableOffset, SEEK_SET); - - Count = fread (Table, 1, TableHeader.Length, File); + Count = fread (Table, 1, TableLength, File); /* * Checks for data table headers happen later in the execution. Only verify * for Aml tables at this point in the code. */ - if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length) + if (GetOnlyAmlTables && Count != (INT32) TableLength) { Status = AE_ERROR; goto ErrorExit; } - /* Validate the checksum (just issue a warning) */ + /* + * Validate the checksum (just issue a warning if incorrect). + * Note: CDAT is special cased here because the table does + * not have the checksum field in the standard position. + */ + if (AcpiGbl_CDAT) + { + Status = AcpiUtVerifyCdatChecksum ((ACPI_TABLE_CDAT *) Table, TableLength); + } else + { + Status = AcpiUtVerifyChecksum (Table, TableLength); + } - Status = AcpiTbVerifyChecksum (Table, TableHeader.Length); if (ACPI_FAILURE (Status)) { Status = AcCheckTextModeCorruption (Table); if (ACPI_FAILURE (Status)) { goto ErrorExit; } } *ReturnTable = Table; return (AE_OK); ErrorExit: AcpiOsFree (Table); return (Status); } /******************************************************************************* * * FUNCTION: AcIsFileBinary * * PARAMETERS: File - Open input file * * RETURN: TRUE if file appears to be binary * * DESCRIPTION: Scan a file for any non-ASCII bytes. * * Note: Maintains current file position. * ******************************************************************************/ BOOLEAN AcIsFileBinary ( FILE *File) { UINT8 Byte; BOOLEAN IsBinary = FALSE; long FileOffset; /* Scan entire file for any non-ASCII bytes */ FileOffset = ftell (File); while (fread (&Byte, 1, 1, File) == 1) { if (!isprint (Byte) && !isspace (Byte)) { IsBinary = TRUE; goto Exit; } } Exit: fseek (File, FileOffset, SEEK_SET); return (IsBinary); } /******************************************************************************* * * FUNCTION: AcValidateTableHeader * * PARAMETERS: File - Open input file * * RETURN: Status * * DESCRIPTION: Determine if a file seems to contain one or more binary ACPI * tables, via the * following checks on what would be the table header: * 1) File must be at least as long as an ACPI_TABLE_HEADER * 2) There must be enough room in the file to hold entire table * 3) Signature, OemId, OemTableId, AslCompilerId must be ASCII * * Note: There can be multiple definition blocks per file, so we cannot * expect/compare the file size to be equal to the table length. 12/2015. * * Note: Maintains current file position. * ******************************************************************************/ ACPI_STATUS AcValidateTableHeader ( FILE *File, long TableOffset) { ACPI_TABLE_HEADER TableHeader; + ACPI_TABLE_CDAT *CdatTableHeader = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader); + UINT32 HeaderLength; ACPI_SIZE Actual; long OriginalOffset; UINT32 FileSize; UINT32 i; ACPI_FUNCTION_TRACE (AcValidateTableHeader); + /* Determine the type of table header */ + + if (AcpiGbl_CDAT) + { + HeaderLength = sizeof (ACPI_TABLE_CDAT); + } + else + { + HeaderLength = sizeof (ACPI_TABLE_HEADER); + } /* Read a potential table header */ OriginalOffset = ftell (File); if (fseek (File, TableOffset, SEEK_SET)) { fprintf (stderr, "SEEK error\n"); } - Actual = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File); + Actual = fread (&TableHeader, 1, HeaderLength, File); if (fseek (File, OriginalOffset, SEEK_SET)) { fprintf (stderr, "SEEK error\n"); } - if (Actual < sizeof (ACPI_TABLE_HEADER)) + if (Actual < HeaderLength) { fprintf (stderr, "Could not read entire table header: Actual %u, Requested %u\n", - (UINT32) Actual, (UINT32) sizeof (ACPI_TABLE_HEADER)); + (UINT32) Actual, HeaderLength); return (AE_ERROR); } /* Validate the signature (limited ASCII chars) */ - if (!AcpiUtValidNameseg (TableHeader.Signature)) + if (!AcpiGbl_CDAT && !AcpiUtValidNameseg (TableHeader.Signature)) { + /* + * The "-ds cdat" option was not used, and the signature is not valid. + * + * For CDAT we are assuming that there should be at least one non-ASCII + * byte in the (normally) 4-character Signature field (at least the + * high-order byte should be zero). Otherwise, this is OK. + */ + fprintf (stderr, + "\nTable appears to be a CDAT table, which has no signature.\n" + "If this is in fact a CDAT table, use the -ds option on the\n" + "command line to specify the table type (signature):\n" + "\"iasl -d -ds CDAT \" or \"iasl -ds CDAT -T CDAT\"\n\n"); + return (AE_BAD_SIGNATURE); } /* Validate table length against bytes remaining in the file */ FileSize = CmGetFileSize (File); - if (TableHeader.Length > (UINT32) (FileSize - TableOffset)) + if (!AcpiGbl_CDAT) + { + /* Standard ACPI table header */ + + if (TableHeader.Length > (UINT32) (FileSize - TableOffset)) + { + fprintf (stderr, "Table [%4.4s] is too long for file - " + "needs: 0x%.2X, remaining in file: 0x%.2X\n", + TableHeader.Signature, TableHeader.Length, + (UINT32) (FileSize - TableOffset)); + return (AE_BAD_HEADER); + } + } + else if (CdatTableHeader->Length > (UINT32) (FileSize - TableOffset)) { - fprintf (stderr, "Table [%4.4s] is too long for file - " + /* Special header for CDAT table */ + + fprintf (stderr, "Table [CDAT] is too long for file - " "needs: 0x%.2X, remaining in file: 0x%.2X\n", - TableHeader.Signature, TableHeader.Length, + CdatTableHeader->Length, (UINT32) (FileSize - TableOffset)); return (AE_BAD_HEADER); } + /* For CDAT table, there are no ASCII fields in the header, we are done */ + + if (AcpiGbl_CDAT) + { + return (AE_OK); + } + /* - * These fields must be ASCII: OemId, OemTableId, AslCompilerId. + * These standard fields must be ASCII: OemId, OemTableId, AslCompilerId. * We allow a NULL terminator in OemId and OemTableId. */ for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { if (!ACPI_IS_ASCII ((UINT8) TableHeader.AslCompilerId[i])) { goto BadCharacters; } } for (i = 0; (i < ACPI_OEM_ID_SIZE) && (TableHeader.OemId[i]); i++) { if (!ACPI_IS_ASCII ((UINT8) TableHeader.OemId[i])) { goto BadCharacters; } } for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (TableHeader.OemTableId[i]); i++) { if (!ACPI_IS_ASCII ((UINT8) TableHeader.OemTableId[i])) { goto BadCharacters; } } return (AE_OK); BadCharacters: ACPI_WARNING ((AE_INFO, "Table header for [%4.4s] has invalid ASCII character(s)", TableHeader.Signature)); return (AE_OK); } /******************************************************************************* * * FUNCTION: AcCheckTextModeCorruption * * PARAMETERS: Table - Table buffer starting with table header * * RETURN: Status * * DESCRIPTION: Check table for text mode file corruption where all linefeed * characters (LF) have been replaced by carriage return linefeed * pairs (CR/LF). * ******************************************************************************/ static ACPI_STATUS AcCheckTextModeCorruption ( ACPI_TABLE_HEADER *Table) { UINT32 i; UINT32 Pairs = 0; UINT8 *Buffer = ACPI_CAST_PTR (UINT8, Table); /* Scan entire table to determine if each LF has been prefixed with a CR */ for (i = 1; i < Table->Length; i++) { if (Buffer[i] == 0x0A) { if (Buffer[i - 1] != 0x0D) { /* The LF does not have a preceding CR, table not corrupted */ return (AE_OK); } else { /* Found a CR/LF pair */ Pairs++; } i++; } } if (!Pairs) { return (AE_OK); } /* * Entire table scanned, each CR is part of a CR/LF pair -- * meaning that the table was treated as a text file somewhere. * * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the * original table are left untouched by the text conversion process -- * meaning that we cannot simply replace CR/LF pairs with LFs. */ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n"); AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs); AcpiOsPrintf ("Table cannot be repaired!\n"); return (AE_BAD_VALUE); } diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c index c45b609d4f3f..7aac349458d9 100644 --- a/sys/contrib/dev/acpica/common/adisasm.c +++ b/sys/contrib/dev/acpica/common/adisasm.c @@ -1,819 +1,819 @@ /****************************************************************************** * * Module Name: adisasm - Application-level disassembler routines * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #include #include #include #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("adisasm") /* Local prototypes */ static ACPI_STATUS AdDoExternalFileList ( char *Filename); static ACPI_STATUS AdDisassembleOneTable ( ACPI_TABLE_HEADER *Table, FILE *File, char *Filename, char *DisasmFilename); static ACPI_STATUS AdReparseOneTable ( ACPI_TABLE_HEADER *Table, FILE *File, ACPI_OWNER_ID OwnerId); ACPI_TABLE_DESC LocalTables[1]; ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /* Stubs for everything except ASL compiler */ #ifndef ACPI_ASL_COMPILER BOOLEAN AcpiDsIsResultUsed ( ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState) { return (TRUE); } ACPI_STATUS AcpiDsMethodError ( ACPI_STATUS Status, ACPI_WALK_STATE *WalkState) { return (Status); } #endif /******************************************************************************* * * FUNCTION: AdInitialize * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: ACPICA and local initialization * ******************************************************************************/ ACPI_STATUS AdInitialize ( void) { ACPI_STATUS Status; /* ACPICA subsystem initialization */ Status = AcpiOsInitialize (); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not initialize ACPICA subsystem: %s\n", AcpiFormatException (Status)); return (Status); } Status = AcpiUtInitGlobals (); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not initialize ACPICA globals: %s\n", AcpiFormatException (Status)); return (Status); } Status = AcpiUtMutexInitialize (); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not initialize ACPICA mutex objects: %s\n", AcpiFormatException (Status)); return (Status); } Status = AcpiNsRootInitialize (); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not initialize ACPICA namespace: %s\n", AcpiFormatException (Status)); return (Status); } /* Setup the Table Manager (cheat - there is no RSDT) */ AcpiGbl_RootTableList.MaxTableCount = 1; AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; return (AE_OK); } /****************************************************************************** * * FUNCTION: AdAmlDisassemble * * PARAMETERS: Filename - AML input filename * OutToFile - TRUE if output should go to a file * Prefix - Path prefix for output * OutFilename - where the filename is returned * * RETURN: Status * * DESCRIPTION: Disassembler entry point. Disassemble an entire ACPI table. * *****************************************************************************/ ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, char *Filename, char *Prefix, char **OutFilename) { ACPI_STATUS Status; char *DisasmFilename = NULL; FILE *File = NULL; ACPI_TABLE_HEADER *Table = NULL; ACPI_NEW_TABLE_DESC *ListHead = NULL; /* * Input: AML code from either a file or via GetTables (memory or * registry) */ if (Filename) { /* Get the list of all AML tables in the file */ Status = AcGetAllTablesFromFile (Filename, ACPI_GET_ALL_TABLES, &ListHead); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get ACPI tables from %s, %s\n", Filename, AcpiFormatException (Status)); return (Status); } /* Process any user-specified files for external objects */ Status = AdDoExternalFileList (Filename); if (ACPI_FAILURE (Status)) { return (Status); } } else { Status = AdGetLocalTables (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get ACPI tables, %s\n", AcpiFormatException (Status)); return (Status); } if (!AcpiGbl_DmOpt_Disasm) { return (AE_OK); } /* Obtained the local tables, just disassemble the DSDT */ Status = AcpiGetTable (ACPI_SIG_DSDT, 0, &Table); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get DSDT, %s\n", AcpiFormatException (Status)); return (Status); } AcpiOsPrintf ("\nDisassembly of DSDT\n"); Prefix = AdGenerateFilename ("dsdt", Table->OemTableId); } /* * Output: ASL code. Redirect to a file if requested */ if (OutToFile) { /* Create/Open a disassembly output file */ DisasmFilename = FlGenerateFilename (Prefix, FILE_SUFFIX_DISASSEMBLY); if (!DisasmFilename) { fprintf (stderr, "Could not generate output filename\n"); Status = AE_ERROR; goto Cleanup; } File = fopen (DisasmFilename, "w+"); if (!File) { fprintf (stderr, "Could not open output file %s\n", DisasmFilename); Status = AE_ERROR; goto Cleanup; } } *OutFilename = DisasmFilename; /* Disassemble all AML tables within the file */ while (ListHead) { Status = AdDisassembleOneTable (ListHead->Table, File, Filename, DisasmFilename); if (ACPI_FAILURE (Status)) { break; } ListHead = ListHead->Next; } Cleanup: if (Table && !AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table)) { ACPI_FREE (Table); } AcDeleteTableList (ListHead); if (File) { fclose (File); AcpiOsRedirectOutput (stdout); } AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); AcpiGbl_ParseOpRoot = NULL; return (Status); } /****************************************************************************** * * FUNCTION: AdDisassembleOneTable * * PARAMETERS: Table - Raw AML table * File - Pointer for the input file * Filename - AML input filename * DisasmFilename - Output filename * * RETURN: Status * * DESCRIPTION: Disassemble a single ACPI table. AML or data table. * *****************************************************************************/ static ACPI_STATUS AdDisassembleOneTable ( ACPI_TABLE_HEADER *Table, FILE *File, char *Filename, char *DisasmFilename) { ACPI_STATUS Status; ACPI_OWNER_ID OwnerId; #ifdef ACPI_ASL_COMPILER /* * For ASL-/ASL+ converter: replace the temporary "XXXX" * table signature with the original. This "XXXX" makes * it harder for the AML interpreter to run the badaml * (.xxx) file produced from the converter in case if * it fails to get deleted. */ if (AcpiGbl_CaptureComments) { strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAMESEG_SIZE); } #endif /* ForceAmlDisassembly means to assume the table contains valid AML */ if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table)) { if (File) { AcpiOsRedirectOutput (File); } AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE); /* This is a "Data Table" (non-AML table) */ AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n", - Table->Signature); + AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature); AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] " "FieldName : FieldValue (in hex)\n */\n\n"); AcpiDmDumpDataTable (Table); fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n", - Table->Signature); + AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature); if (File) { fprintf (stderr, "Formatted output: %s - %u bytes\n", DisasmFilename, CmGetFileSize (File)); } return (AE_OK); } /* Initialize the converter output file */ ASL_CV_INIT_FILETREE(Table, File); /* * This is an AML table (DSDT or SSDT). * Always parse the tables, only option is what to display */ Status = AdParseTable (Table, &OwnerId, TRUE, FALSE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not parse ACPI tables, %s\n", AcpiFormatException (Status)); return (Status); } /* Redirect output for code generation and debugging output */ if (File) { AcpiOsRedirectOutput (File); } /* Debug output, namespace and parse tree */ if (AslCompilerdebug && File) { AcpiOsPrintf ("/**** Before second load\n"); NsSetupNamespaceListing (File); NsDisplayNamespace (); AcpiOsPrintf ("*****/\n"); } /* Load namespace from names created within control methods */ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); /* * Cross reference the namespace here, in order to * generate External() statements */ AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); if (AslCompilerdebug) { AcpiDmDumpTree (AcpiGbl_ParseOpRoot); } /* Find possible calls to external control methods */ AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot); /* * If we found any external control methods, we must reparse * the entire tree with the new information (namely, the * number of arguments per method) */ if (AcpiDmGetUnresolvedExternalMethodCount ()) { Status = AdReparseOneTable (Table, File, OwnerId); if (ACPI_FAILURE (Status)) { return (Status); } } /* * Now that the namespace is finalized, we can perform namespace * transforms. * * 1) Convert fixed-offset references to resource descriptors * to symbolic references (Note: modifies namespace) */ AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); /* Optional displays */ if (AcpiGbl_DmOpt_Disasm) { /* This is the real disassembly */ AdDisplayTables (Filename, Table); /* Dump hex table if requested (-vt) */ AcpiDmDumpDataTable (Table); fprintf (stderr, "Disassembly completed\n"); if (File) { fprintf (stderr, "ASL Output: %s - %u bytes\n", DisasmFilename, CmGetFileSize (File)); } if (AslGbl_MapfileFlag) { fprintf (stderr, "%14s %s - %u bytes\n", AslGbl_FileDescs[ASL_FILE_MAP_OUTPUT].ShortDescription, AslGbl_Files[ASL_FILE_MAP_OUTPUT].Filename, FlGetFileSize (ASL_FILE_MAP_OUTPUT)); } } return (AE_OK); } /****************************************************************************** * * FUNCTION: AdReparseOneTable * * PARAMETERS: Table - Raw AML table * File - Pointer for the input file * OwnerId - ID for this table * * RETURN: Status * * DESCRIPTION: Reparse a table that has already been loaded. Used to * integrate information about external control methods. * These methods may have been previously parsed incorrectly. * *****************************************************************************/ static ACPI_STATUS AdReparseOneTable ( ACPI_TABLE_HEADER *Table, FILE *File, ACPI_OWNER_ID OwnerId) { ACPI_STATUS Status; ACPI_COMMENT_ADDR_NODE *AddrListHead; fprintf (stderr, "\nFound %u external control methods, " "reparsing with new information\n", AcpiDmGetUnresolvedExternalMethodCount ()); /* Reparse, rebuild namespace */ AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); AcpiGbl_ParseOpRoot = NULL; AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode); AcpiGbl_RootNode = NULL; AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; AcpiGbl_RootNodeStruct.Parent = NULL; AcpiGbl_RootNodeStruct.Child = NULL; AcpiGbl_RootNodeStruct.Peer = NULL; AcpiGbl_RootNodeStruct.Object = NULL; AcpiGbl_RootNodeStruct.Flags = 0; Status = AcpiNsRootInitialize (); if (ACPI_FAILURE (Status)) { return (Status); } /* New namespace, add the external definitions first */ AcpiDmAddExternalListToNamespace (); /* For -ca option: clear the list of comment addresses. */ while (AcpiGbl_CommentAddrListHead) { AddrListHead= AcpiGbl_CommentAddrListHead; AcpiGbl_CommentAddrListHead = AcpiGbl_CommentAddrListHead->Next; AcpiOsFree(AddrListHead); } /* Parse the table again. No need to reload it, however */ Status = AdParseTable (Table, NULL, FALSE, FALSE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not parse ACPI tables, %s\n", AcpiFormatException (Status)); return (Status); } /* Cross reference the namespace again */ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); /* Debug output - namespace and parse tree */ if (AslCompilerdebug) { AcpiOsPrintf ("/**** After second load and resource conversion\n"); if (File) { NsSetupNamespaceListing (File); NsDisplayNamespace (); } AcpiOsPrintf ("*****/\n"); AcpiDmDumpTree (AcpiGbl_ParseOpRoot); } return (AE_OK); } /****************************************************************************** * * FUNCTION: AdDoExternalFileList * * PARAMETERS: Filename - Input file for the table * * RETURN: Status * * DESCRIPTION: Process all tables found in the -e external files list * *****************************************************************************/ static ACPI_STATUS AdDoExternalFileList ( char *Filename) { ACPI_EXTERNAL_FILE *ExternalFileList; char *ExternalFilename; ACPI_NEW_TABLE_DESC *ExternalListHead = NULL; ACPI_STATUS Status; ACPI_STATUS GlobalStatus = AE_OK; ACPI_OWNER_ID OwnerId; /* * External filenames are specified on the command line like this: * Example: iasl -e file1,file2,file3 -d xxx.aml */ ExternalFileList = AcpiGbl_ExternalFileList; /* Process each external file */ while (ExternalFileList) { ExternalFilename = ExternalFileList->Path; if (!strcmp (ExternalFilename, Filename)) { /* Next external file */ ExternalFileList = ExternalFileList->Next; continue; } AcpiOsPrintf ("External object resolution file %16s\n", ExternalFilename); Status = AcGetAllTablesFromFile ( ExternalFilename, ACPI_GET_ONLY_AML_TABLES, &ExternalListHead); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ExternalFileList = ExternalFileList->Next; GlobalStatus = AE_TYPE; continue; } AcDeleteTableList (ExternalListHead); return (Status); } /* Load external tables for symbol resolution */ while (ExternalListHead) { Status = AdParseTable ( ExternalListHead->Table, &OwnerId, TRUE, TRUE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", AcpiFormatException (Status)); AcDeleteTableList (ExternalListHead); return (Status); } /* * Load namespace from names created within control methods * Set owner id of nodes in external table */ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); ExternalListHead = ExternalListHead->Next; } /* Next external file */ ExternalFileList = ExternalFileList->Next; } AcDeleteTableList (ExternalListHead); if (ACPI_FAILURE (GlobalStatus)) { return (GlobalStatus); } /* Clear external list generated by Scope in external tables */ if (AcpiGbl_ExternalFileList) { AcpiDmClearExternalList (); } /* Load any externals defined in the optional external ref file */ AcpiDmGetExternalsFromFile (); return (AE_OK); } diff --git a/sys/contrib/dev/acpica/common/ahtable.c b/sys/contrib/dev/acpica/common/ahtable.c index 227fee2b5132..b925be84ec6b 100644 --- a/sys/contrib/dev/acpica/common/ahtable.c +++ b/sys/contrib/dev/acpica/common/ahtable.c @@ -1,274 +1,276 @@ /****************************************************************************** * * Module Name: ahtable - Table of known ACPI tables with descriptions * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include /* Local prototypes */ const AH_TABLE * AcpiAhGetTableInfo ( char *Signature); extern const AH_TABLE AcpiGbl_SupportedTables[]; /******************************************************************************* * * FUNCTION: AcpiAhGetTableInfo * * PARAMETERS: Signature - ACPI signature (4 chars) to match * * RETURN: Pointer to a valid AH_TABLE. Null if no match found. * * DESCRIPTION: Find a match in the "help" table of supported ACPI tables * ******************************************************************************/ const AH_TABLE * AcpiAhGetTableInfo ( char *Signature) { const AH_TABLE *Info; for (Info = AcpiGbl_SupportedTables; Info->Signature; Info++) { if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature)) { return (Info); } } return (NULL); } /* * Note: Any tables added here should be duplicated within AcpiDmTableData * in the file common/dmtable.c */ const AH_TABLE AcpiGbl_SupportedTables[] = { {ACPI_SIG_AEST, "Arm Error Source Table"}, {ACPI_SIG_AGDI, "Arm Generic Diagnostic Dump and Reset Device Interface Table"}, {ACPI_SIG_ASF, "Alert Standard Format Table"}, {ACPI_SIG_BDAT, "BIOS Data ACPI Table"}, {ACPI_SIG_BERT, "Boot Error Record Table"}, {ACPI_SIG_BGRT, "Boot Graphics Resource Table"}, {ACPI_SIG_BOOT, "Simple Boot Flag Table"}, + {ACPI_SIG_CCEL, "CC-Event Log Table"}, + {ACPI_SIG_CDAT, "Coherent Device Attribute Table"}, {ACPI_SIG_CEDT, "CXL Early Discovery Table"}, {ACPI_SIG_CPEP, "Corrected Platform Error Polling Table"}, {ACPI_SIG_CSRT, "Core System Resource Table"}, {ACPI_SIG_DBG2, "Debug Port Table type 2"}, {ACPI_SIG_DBGP, "Debug Port Table"}, {ACPI_SIG_DMAR, "DMA Remapping Table"}, {ACPI_SIG_DRTM, "Dynamic Root of Trust for Measurement Table"}, {ACPI_SIG_DSDT, "Differentiated System Description Table (AML table)"}, {ACPI_SIG_ECDT, "Embedded Controller Boot Resources Table"}, {ACPI_SIG_EINJ, "Error Injection Table"}, {ACPI_SIG_ERST, "Error Record Serialization Table"}, {ACPI_SIG_FACS, "Firmware ACPI Control Structure"}, {ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)"}, {ACPI_SIG_FPDT, "Firmware Performance Data Table"}, {ACPI_SIG_GTDT, "Generic Timer Description Table"}, {ACPI_SIG_HEST, "Hardware Error Source Table"}, {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"}, {ACPI_SIG_HPET, "High Precision Event Timer Table"}, {ACPI_SIG_IORT, "IO Remapping Table"}, {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_LPIT, "Low Power Idle Table"}, {ACPI_SIG_MADT, "Multiple APIC Description Table (MADT)"}, {ACPI_SIG_MCFG, "Memory Mapped Configuration Table"}, {ACPI_SIG_MCHI, "Management Controller Host Interface Table"}, {ACPI_SIG_MPST, "Memory Power State Table"}, {ACPI_SIG_MSCT, "Maximum System Characteristics Table"}, {ACPI_SIG_MSDM, "Microsoft Data Management Table"}, {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_NHLT, "Non HD Audio Link Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PDTT, "Platform Debug Trigger Table"}, {ACPI_SIG_PHAT, "Platform Health Assessment Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_PRMT, "Platform Runtime Mechanism Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, {ACPI_SIG_RGRT, "Regulatory Graphics Resource Table"}, {ACPI_RSDP_NAME,"Root System Description Pointer"}, {ACPI_SIG_RSDT, "Root System Description Table"}, {ACPI_SIG_S3PT, "S3 Performance Table"}, {ACPI_SIG_SBST, "Smart Battery Specification Table"}, {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"}, {ACPI_SIG_SDEV, "Secure Devices Table"}, {ACPI_SIG_SLIC, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, "System Locality Information Table"}, {ACPI_SIG_SPCR, "Serial Port Console Redirection Table"}, {ACPI_SIG_SPMI, "Server Platform Management Interface Table"}, {ACPI_SIG_SRAT, "System Resource Affinity Table"}, {ACPI_SIG_SSDT, "Secondary System Description Table (AML table)"}, {ACPI_SIG_STAO, "Status Override Table"}, {ACPI_SIG_SVKL, "Storage Volume Key Location Table"}, {ACPI_SIG_TCPA, "Trusted Computing Platform Alliance Table"}, {ACPI_SIG_TDEL, "TD-Event Log Table"}, {ACPI_SIG_TPM2, "Trusted Platform Module hardware interface Table"}, {ACPI_SIG_UEFI, "UEFI Boot Optimization Table"}, {ACPI_SIG_VIOT, "Virtual I/O Translation Table"}, {ACPI_SIG_WAET, "Windows ACPI Emulated Devices Table"}, {ACPI_SIG_WDAT, "Watchdog Action Table"}, {ACPI_SIG_WDDT, "Watchdog Description Table"}, {ACPI_SIG_WDRT, "Watchdog Resource Table"}, {ACPI_SIG_WPBT, "Windows Platform Binary Table"}, {ACPI_SIG_WSMT, "Windows SMM Security Mitigations Table"}, {ACPI_SIG_XENV, "Xen Environment Table"}, {ACPI_SIG_XSDT, "Extended System Description Table"}, {NULL, NULL} }; diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c index 7378a8555bb0..5e92903e0ecb 100644 --- a/sys/contrib/dev/acpica/common/ahuuids.c +++ b/sys/contrib/dev/acpica/common/ahuuids.c @@ -1,257 +1,260 @@ /****************************************************************************** * * Module Name: ahuuids - Table of known ACPI-related UUIDs * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("ahuuids") /* * Table of "known" (ACPI-related) UUIDs */ const AH_UUID Gbl_AcpiUuids[] = { {"[Controllers]", NULL}, {"GPIO Controller", UUID_GPIO_CONTROLLER}, {"USB Controller", UUID_USB_CONTROLLER}, {"SATA Controller", UUID_SATA_CONTROLLER}, {"[Devices]", NULL}, {"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE}, {"HID I2C Device", UUID_I2C_DEVICE}, {"Power Button Device", UUID_POWER_BUTTON}, {"Memory Device", UUID_MEMORY_DEVICE}, {"Generic Buttons Device", UUID_GENERIC_BUTTONS_DEVICE}, {"NVDIMM Root Device", UUID_NVDIMM_ROOT_DEVICE}, {"Control Method Battery", UUID_CONTROL_METHOD_BATTERY}, {"[Interfaces]", NULL}, {"Device Labeling Interface", UUID_DEVICE_LABELING}, {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, {"[Non-volatile DIMM and NFIT table]", NULL}, {"NVDIMM Device", UUID_NFIT_DIMM}, {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, {"NVDIMM Control Region", UUID_CONTROL_REGION}, {"NVDIMM Data Region", UUID_DATA_REGION}, {"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK}, {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, {"Microsoft NVDIMM Command set",UUID_NFIT_DIMM_N_MSFT}, {"HP NDIMM HPE1", UUID_NFIT_DIMM_N_HPE1}, {"HP NDIMM HPE2", UUID_NFIT_DIMM_N_HPE2}, {"Virtual NVDIMM", UUID_NFIT_DIMM_N_HYPERV}, {"[Processor Properties]", NULL}, {"Cache Properties", UUID_CACHE_PROPERTIES}, {"Physical Package Property", UUID_PHYSICAL_PROPERTY}, {"[Miscellaneous]", NULL}, {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, {"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT}, {"Thermal Extensions", UUID_THERMAL_EXTENSIONS}, {"Device Properties for _DSD", UUID_DEVICE_PROPERTIES}, {"Device Graphs for _DSD", UUID_DEVICE_GRAPHS}, {"Hierarchical Data Extension", UUID_HIERARCHICAL_DATA_EXTENSION}, {"ARM Coresight Graph", UUID_CORESIGHT_GRAPH}, {"USB4 Capabilities", UUID_USB4_CAPABILITIES}, + {"First Function ID for _DSM", UUID_1ST_FUNCTION_ID}, + {"Second Function ID for _DSM", UUID_2ND_FUNCTION_ID}, + {NULL, NULL} }; /******************************************************************************* * * FUNCTION: AcpiAhMatchUuid * * PARAMETERS: Data - Data buffer containing a UUID * * RETURN: ASCII description string for the UUID if it is found. * * DESCRIPTION: Returns a description string for "known" UUIDs, which are * are UUIDs that are related to ACPI in some way. * ******************************************************************************/ const char * AcpiAhMatchUuid ( UINT8 *Data) { const AH_UUID *Info; UINT8 UuidBuffer[UUID_BUFFER_LENGTH]; /* Walk the table of known ACPI-related UUIDs */ for (Info = Gbl_AcpiUuids; Info->Description; Info++) { /* Null string means description is a UUID class */ if (!Info->String) { continue; } AcpiUtConvertStringToUuid (Info->String, UuidBuffer); if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH)) { return (Info->Description); } } return (NULL); } diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c index 78c75ab803f8..c5582530d497 100644 --- a/sys/contrib/dev/acpica/common/dmtable.c +++ b/sys/contrib/dev/acpica/common/dmtable.c @@ -1,2281 +1,2301 @@ /****************************************************************************** * * Module Name: dmtable - Support for ACPI tables that contain no AML code * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtable") const AH_TABLE * AcpiAhGetTableInfo ( char *Signature); /* Common format strings for commented values */ #define UINT8_FORMAT "%2.2X [%s]\n" #define UINT8_FORMAT_NO_NEWLINE "%2.2X [%s]" #define UINT16_FORMAT "%4.4X [%s]\n" #define UINT32_FORMAT "%8.8X [%s]\n" #define STRING_FORMAT "[%s]\n" /* These tables map a subtable type to a description string */ static const char *AcpiDmAestResourceNames[] = { "Cache Resource", "TLB Resource", "Generic Resource", "Unknown Resource Type" /* Reserved */ }; static const char *AcpiDmAestSubnames[] = { "Processor Error Node", "Memory Error Node", "SMMU Error Node", "Vendor-defined Error Node", "GIC Error Node", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmAestCacheNames[] = { "Data Cache", "Instruction Cache", "Unified Cache", "Unknown Cache Type" /* Reserved */ }; static const char *AcpiDmAestGicNames[] = { "GIC CPU", "GIC Distributor", "GIC Redistributor", "GIC ITS", "Unknown GIC Interface Type" /* Reserved */ }; static const char *AcpiDmAestXfaceNames[] = { "System Register Interface", "Memory Mapped Interface", "Unknown Interface Type" /* Reserved */ }; static const char *AcpiDmAestXruptNames[] = { "Fault Handling Interrupt", "Error Recovery Interrupt", "Unknown Interrupt Type" /* Reserved */ }; static const char *AcpiDmAsfSubnames[] = { "ASF Information", "ASF Alerts", "ASF Remote Control", "ASF RMCP Boot Options", "ASF Address", "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmCdatSubnames[] = +{ + "Device Scoped Memory Affinity Structure (DSMAS)", + "Device scoped Latency and Bandwidth Information Structure (DSLBIS)", + "Device Scoped Memory Side Cache Information Structure (DSMSCIS)", + "Device Scoped Initiator Structure (DSIS)", + "Device Scoped EFI Memory Type Structure (DSEMTS)", + "Switch Scoped Latency and Bandwidth Information Structure (SSLBIS)", + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmCedtSubnames[] = { "CXL Host Bridge Structure", "CXL Fixed Memory Window Structure", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmDmarSubnames[] = { "Hardware Unit Definition", "Reserved Memory Region", "Root Port ATS Capability", "Remapping Hardware Static Affinity", "ACPI Namespace Device Declaration", "SoC Integrated Address Translation Cache", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmDmarScope[] = { "Reserved value", "PCI Endpoint Device", "PCI Bridge Device", "IOAPIC Device", "Message-capable HPET Device", "Namespace Device", "Unknown Scope Type" /* Reserved */ }; static const char *AcpiDmEinjActions[] = { "Begin Operation", "Get Trigger Table", "Set Error Type", "Get Error Type", "End Operation", "Execute Operation", "Check Busy Status", "Get Command Status", "Set Error Type With Address", "Get Execute Timings", "Unknown Action" }; static const char *AcpiDmEinjInstructions[] = { "Read Register", "Read Register Value", "Write Register", "Write Register Value", "Noop", "Flush Cacheline", "Unknown Instruction" }; static const char *AcpiDmErstActions[] = { "Begin Write Operation", "Begin Read Operation", "Begin Clear Operation", "End Operation", "Set Record Offset", "Execute Operation", "Check Busy Status", "Get Command Status", "Get Record Identifier", "Set Record Identifier", "Get Record Count", "Begin Dummy Write", "Unused/Unknown Action", "Get Error Address Range", "Get Error Address Length", "Get Error Attributes", "Execute Timings", "Unknown Action" }; static const char *AcpiDmErstInstructions[] = { "Read Register", "Read Register Value", "Write Register", "Write Register Value", "Noop", "Load Var1", "Load Var2", "Store Var1", "Add", "Subtract", "Add Value", "Subtract Value", "Stall", "Stall While True", "Skip Next If True", "GoTo", "Set Source Address", "Set Destination Address", "Move Data", "Unknown Instruction" }; static const char *AcpiDmGtdtSubnames[] = { "Generic Timer Block", "Generic Watchdog Timer", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmHestSubnames[] = { "IA-32 Machine Check Exception", "IA-32 Corrected Machine Check", "IA-32 Non-Maskable Interrupt", "Unknown Subtable Type", /* 3 - Reserved */ "Unknown Subtable Type", /* 4 - Reserved */ "Unknown Subtable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", "Generic Hardware Error Source", "Generic Hardware Error Source V2", "IA-32 Deferred Machine Check", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmHestNotifySubnames[] = { "Polled", "External Interrupt", "Local Interrupt", "SCI", "NMI", "CMCI", /* ACPI 5.0 */ "MCE", /* ACPI 5.0 */ "GPIO", /* ACPI 6.0 */ "SEA", /* ACPI 6.1 */ "SEI", /* ACPI 6.1 */ "GSIV", /* ACPI 6.1 */ "Software Delegated Exception", /* ACPI 6.2 */ "Unknown Notify Type" /* Reserved */ }; static const char *AcpiDmHmatSubnames[] = { "Memory Proximity Domain Attributes", "System Locality Latency and Bandwidth Information", "Memory Side Cache Information", "Unknown Structure Type" /* Reserved */ }; static const char *AcpiDmMadtSubnames[] = { "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */ "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */ "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */ "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */ "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */ "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */ "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */ "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */ "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */ "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */ "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */ "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */ "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */ "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */ "Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */ "Mutiprocessor Wakeup", /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */ + "CPU Core Interrupt Controller", /* ACPI_MADT_TYPE_CORE_PIC */ + "Legacy I/O Interrupt Controller", /* ACPI_MADT_TYPE_LIO_PIC */ + "HT Interrupt Controller", /* ACPI_MADT_TYPE_HT_PIC */ + "Extend I/O Interrupt Controller", /* ACPI_MADT_TYPE_EIO_PIC */ + "MSI Interrupt Controller", /* ACPI_MADT_TYPE_MSI_PIC */ + "Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */ + "LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */ "Unknown Subtable Type", /* Reserved */ "Types 80-FF are used for OEM data" /* Reserved for OEM data */ }; static const char *AcpiDmNfitSubnames[] = { "System Physical Address Range", /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */ "Memory Range Map", /* ACPI_NFIT_TYPE_MEMORY_MAP */ "Interleave Info", /* ACPI_NFIT_TYPE_INTERLEAVE */ "SMBIOS Information", /* ACPI_NFIT_TYPE_SMBIOS */ "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */ "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */ "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */ "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmNhltLinkTypeNames[] = { "Reserved for HD-Audio", /* ACPI_NHLT_RESERVED_HD_AUDIO */ "Reserved for DSP", /* ACPI_NHLT_RESERVED_DSP */ "Type PDM", /* ACPI_NHLT_PDM */ "Type SSP", /* ACPI_NHLT_SSP */ "Reserved for SlimBus", /* ACPI_NHLT_RESERVED_SLIMBUS */ "Reserved for SoundWire", /* ACPI_NHLT_RESERVED_SOUNDWIRE */ "Unknown Link Type" /* Reserved */ }; static const char *AcpiDmNhltDirectionNames[] = { "Render", /* ACPI_NHLT_DIR_RENDER */ "Capture", /* ACPI_NHLT_DIR_CAPTURE */ "Render with Loopback", /* ACPI_NHLT_DIR_RENDER_LOOPBACK */ "Feedback for Render", /* ACPI_NHLT_DIR_RENDER_FEEDBACK */ "Unknown Direction" /* Reserved */ }; static const char *AcpiDmNhltMicTypeNames[] = { "Omnidirectional", /* ACPI_NHLT_MIC_OMNIDIRECTIONAL */ "Subcardioid", /* ACPI_NHLT_MIC_SUBCARDIOID */ "Cardioid", /* ACPI_NHLT_MIC_CARDIOID */ "SuperCardioid", /* ACPI_NHLT_MIC_SUPER_CARDIOID */ "HyperCardioid", /* ACPI_NHLT_MIC_HYPER_CARDIOID */ "8 Shaped", /* ACPI_NHLT_MIC_8_SHAPED */ "Reserved Mic Type", /* Reserved */ "Vendor Defined", /* ACPI_NHLT_MIC_VENDOR_DEFINED */ "Unknown Mic Type" /* ACPI_NHLT_MIC_RESERVED */ }; static const char *AcpiDmNhltMicPositionNames[] = { "Top", /* ACPI_NHLT_MIC_POSITION_TOP */ "Bottom", /* ACPI_NHLT_MIC_POSITION_BOTTOM */ "Left", /* ACPI_NHLT_MIC_POSITION_LEFT */ "Right", /* ACPI_NHLT_MIC_POSITION_RIGHT */ "Front", /* ACPI_NHLT_MIC_POSITION_FRONT */ "Back", /* ACPI_NHLT_MIC_POSITION_BACK */ "Unknown Mic Position" /* 6 and above are reserved */ }; static const char *AcpiDmNhltMicArrayTypeNames[] = { "Unknown Array Type", /* ACPI_NHLT_ARRAY_TYPE_RESERVED */ "Small Linear 2-element", /* ACPI_NHLT_SMALL_LINEAR_2ELEMENT */ "Big Linear 2-element", /* ACPI_NHLT_BIG_LINEAR_2ELEMENT */ "Linear 4-element 1st Geometry", /* ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT */ "Planar L-shaped 4-element", /* ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT */ "Linear 4-element 2nd Geometry", /* ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT */ "Vendor Defined" /* ACPI_NHLT_VENDOR_DEFINED */ }; static const char *AcpiDmNhltConfigTypeNames[] = { "Generic Type", /* ACPI_NHLT_CONFIG_TYPE_GENERIC */ "Microphone Array", /* ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY */ "Reserved", /* ACPI_NHLT_CONFIG_TYPE_RESERVED */ "Render Feedback", /* ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK */ "Unknown Config Type" /* ACPI_NHLT_CONFIG_TYPE_RESERVED */ }; static const char *AcpiDmPcctSubnames[] = { "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */ "HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */ "HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */ "Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */ "Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */ "HW Registers based Comm Subspace", /* ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmPhatSubnames[] = { "Firmware Version Data", /* ACPI_PHAT_TYPE_FW_VERSION_DATA */ "Firmware Health Data", /* ACPI_PHAT_TYPE_FW_HEALTH_DATA */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmPmttSubnames[] = { "Socket", /* ACPI_PMTT_TYPE_SOCKET */ "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown Subtable Type", /* Reserved */ "Vendor Specific" /* ACPI_PMTT_TYPE_VENDOR */ }; static const char *AcpiDmPpttSubnames[] = { "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */ "Cache Type", /* ACPI_PPTT_TYPE_CACHE */ "ID", /* ACPI_PPTT_TYPE_ID */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmRgrtSubnames[] = { "Unknown/Reserved Image Type", /* ACPI_RGRT_TYPE_RESERVED0 */ "Type PNG" /* ACPI_RGRT_IMAGE_TYPE_PNG */ }; static const char *AcpiDmSdevSubnames[] = { "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */ "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", "Memory Affinity", "Processor Local x2APIC Affinity", "GICC Affinity", "GIC ITS Affinity", /* Acpi 6.2 */ "Generic Initiator Affinity", /* Acpi 6.3 */ "Generic Port Affinity", /* Acpi 6.4 */ "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmTpm2Subnames[] = { "Illegal Start Method value", "Reserved", "ACPI Start Method", "Reserved", "Reserved", "Reserved", "Memory Mapped I/O", "Command Response Buffer", "Command Response Buffer with ACPI Start Method", "Reserved", "Reserved", "Command Response Buffer with ARM SMC", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmIvrsSubnames[] = { "Hardware Definition Block (IVHD)", "Hardware Definition Block - Mixed Format (IVHD)", "Memory Definition Block (IVMD)", "Unknown/Reserved Subtable Type" /* Reserved */ }; static const char *AcpiDmIvrsDevEntryNames[] = { "Unknown/Reserved Device Entry Type", /* 0- Reserved */ "Device Entry: Select All Devices", /* 1 */ "Device Entry: Select One Device", /* 2 */ "Device Entry: Start of Range", /* 3 */ "Device Entry: End of Range", /* 4 */ "Device Entry: Alias Select", /* 66 */ "Device Entry: Alias Start of Range", /* 67 */ "Unknown/Reserved Device Entry Type", /* 68- Reserved */ "Unknown/Reserved Device Entry Type", /* 69- Reserved */ "Device Entry: Extended Select", /* 70 */ "Device Entry: Extended Start of Range", /* 71 */ "Device Entry: Special Device", /* 72 */ "Device Entry: ACPI HID Named Device", /* 240 */ "Unknown/Reserved Device Entry Type" /* Reserved */ }; static const char *AcpiDmLpitSubnames[] = { "Native C-state Idle Structure", "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmViotSubnames[] = { "Unknown Subtable Type", /* 0 -Reserved */ "PCI Range", "MMIO Endpoint", "VirtIO-PCI IOMMU", "VirtIO-MMIO IOMMU", "Unknown Subtable Type" /* Reserved */ }; #define ACPI_FADT_PM_RESERVED 9 static const char *AcpiDmFadtProfiles[] = { "Unspecified", "Desktop", "Mobile", "Workstation", "Enterprise Server", "SOHO Server", "Appliance PC", "Performance Server", "Tablet", "Unknown Profile Type" }; #define ACPI_GAS_WIDTH_RESERVED 5 static const char *AcpiDmGasAccessWidth[] = { "Undefined/Legacy", "Byte Access:8", "Word Access:16", "DWord Access:32", "QWord Access:64", "Unknown Width Encoding" }; /******************************************************************************* * * ACPI Table Data, indexed by signature. * * Each entry contains: Signature, Table Info, Handler, DtHandler, * Template, Description * * Simple tables have only a TableInfo structure, complex tables have a * handler. This table must be NULL terminated. RSDP and FACS are * special-cased elsewhere. * * Note: Any tables added here should be duplicated within * AcpiGbl_SupportedTables in the file common/ahtable.c * ******************************************************************************/ const ACPI_DMTABLE_DATA AcpiDmTableData[] = { {ACPI_SIG_AEST, NULL, AcpiDmDumpAest, DtCompileAest, TemplateAest}, {ACPI_SIG_AGDI, AcpiDmTableInfoAgdi, NULL, NULL, TemplateAgdi}, {ACPI_SIG_APMT, NULL, AcpiDmDumpApmt, DtCompileApmt, TemplateApmt}, {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf}, {ACPI_SIG_BDAT, AcpiDmTableInfoBdat, NULL, NULL, TemplateBdat}, {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, + {ACPI_SIG_CCEL, AcpiDmTableInfoCcel, NULL, NULL, TemplateCcel}, + {ACPI_SIG_CDAT, NULL, AcpiDmDumpCdat, NULL, TemplateCdat}, {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp}, {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar}, {ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm}, {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt}, {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj}, {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst}, {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt}, {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt}, {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest}, {ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet}, {ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort}, {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs}, {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg}, {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi}, {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct}, {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_NHLT, AcpiDmTableInfoNhlt, AcpiDmDumpNhlt, DtCompileNhlt, TemplateNhlt}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, {ACPI_SIG_PHAT, NULL, AcpiDmDumpPhat, DtCompilePhat, TemplatePhat}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt}, {ACPI_SIG_PRMT, NULL, AcpiDmDumpPrmt, DtCompilePrmt, TemplatePrmt}, {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf}, {ACPI_SIG_RGRT, NULL, AcpiDmDumpRgrt, DtCompileRgrt, TemplateRgrt}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt}, {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei}, {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit}, {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr}, {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat}, {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao}, {ACPI_SIG_SVKL, AcpiDmTableInfoSvkl, AcpiDmDumpSvkl, DtCompileSvkl, TemplateSvkl}, {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, {ACPI_SIG_TDEL, AcpiDmTableInfoTdel, NULL, NULL, TemplateTdel}, {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, {ACPI_SIG_VIOT, AcpiDmTableInfoViot, AcpiDmDumpViot, DtCompileViot, TemplateViot}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet}, {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat}, {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt}, {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt}, {ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt}, {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt}, {ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv}, {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt}, {NULL, NULL, NULL, NULL, NULL} }; -/******************************************************************************* - * - * FUNCTION: AcpiDmGenerateChecksum - * - * PARAMETERS: Table - Pointer to table to be checksummed - * Length - Length of the table - * OriginalChecksum - Value of the checksum field - * - * RETURN: 8 bit checksum of buffer - * - * DESCRIPTION: Computes an 8 bit checksum of the table. - * - ******************************************************************************/ - -UINT8 -AcpiDmGenerateChecksum ( - void *Table, - UINT32 Length, - UINT8 OriginalChecksum) -{ - UINT8 Checksum; - - - /* Sum the entire table as-is */ - - Checksum = AcpiTbChecksum ((UINT8 *) Table, Length); - - /* Subtract off the existing checksum value in the table */ - - Checksum = (UINT8) (Checksum - OriginalChecksum); - - /* Compute the final checksum */ - - Checksum = (UINT8) (0 - Checksum); - return (Checksum); -} - - /******************************************************************************* * * FUNCTION: AcpiDmGetTableData * * PARAMETERS: Signature - ACPI signature (4 chars) to match * * RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found. * * DESCRIPTION: Find a match in the global table of supported ACPI tables * ******************************************************************************/ const ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature) { const ACPI_DMTABLE_DATA *Info; for (Info = AcpiDmTableData; Info->Signature; Info++) { if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature)) { return (Info); } } return (NULL); } /******************************************************************************* * * FUNCTION: AcpiDmDumpDataTable * * PARAMETERS: Table - An ACPI table * * RETURN: None. * * DESCRIPTION: Format the contents of an ACPI data table (any table other * than an SSDT or DSDT that does not contain executable AML code) * ******************************************************************************/ void AcpiDmDumpDataTable ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; const ACPI_DMTABLE_DATA *TableData; UINT32 Length; /* Ignore tables that contain AML */ if (AcpiUtIsAmlTable (Table)) { if (AslGbl_VerboseTemplates) { /* Dump the raw table data */ Length = Table->Length; AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, Length, Length); AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY, 0); AcpiOsPrintf (" */\n"); } return; } /* * Handle tables that don't use the common ACPI table header structure. - * Currently, these are the FACS, RSDP, and S3PT. + * Currently, these are the FACS, RSDP, S3PT and CDAT. */ if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS)) { Length = Table->Length; Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); if (ACPI_FAILURE (Status)) { return; } } else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Signature)) { Length = AcpiDmDumpRsdp (Table); } else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT)) { Length = AcpiDmDumpS3pt (Table); } + else if (!AcpiUtValidNameseg (Table->Signature)) + { + /* + * For CDAT we are assuming that there should be at least one non-ASCII + * byte in the (normally) 4-character Signature field (at least the + * high-order byte should be zero). + */ + if (AcpiGbl_CDAT) + { + /* + * Invalid signature and <-ds CDAT> was specified on the command line. + * Therefore, we have a CDAT table. + */ + AcpiDmDumpCdat (Table); + } + else + { + fprintf (stderr, "Table has an invalid signature\n"); + } + + return; + } else { /* * All other tables must use the common ACPI table header, dump it now */ Length = Table->Length; Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); /* Match signature and dispatch appropriately */ TableData = AcpiDmGetTableData (Table->Signature); if (!TableData) { if (!strncmp (Table->Signature, "OEM", 3)) { AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", Table->Signature); } else { AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n", Table->Signature); fprintf (stderr, "Unknown ACPI table signature [%4.4s], ", Table->Signature); if (!AcpiGbl_ForceAmlDisassembly) { fprintf (stderr, "decoding ACPI table header only\n"); } else { fprintf (stderr, "assuming table contains valid AML code\n"); } } } else if (TableData->TableHandler) { /* Complex table, has a handler */ TableData->TableHandler (Table); } else if (TableData->TableInfo) { /* Simple table, just walk the info table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo); if (ACPI_FAILURE (Status)) { return; } } } if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates) { /* Dump the raw table data */ AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, Length, Length); AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY, 0); } } /******************************************************************************* * * FUNCTION: AcpiDmLineHeader * * PARAMETERS: Offset - Current byte offset, from table start * ByteLength - Length of the field in bytes, 0 for flags * Name - Name of this field * * RETURN: None * * DESCRIPTION: Utility routines for formatting output lines. Displays the * current table offset in hex and decimal, the field length, * and the field name. * ******************************************************************************/ void AcpiDmLineHeader ( UINT32 Offset, UINT32 ByteLength, char *Name) { /* Allow a null name for fields that span multiple lines (large buffers) */ if (!Name) { Name = ""; } if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */ { if (ByteLength) { AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name); } else { if (*Name) { AcpiOsPrintf ("%41s : ", Name); } else { AcpiOsPrintf ("%41s ", Name); } } } else /* Normal disassembler or verbose template */ { if (ByteLength) { - AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ", + AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %27s : ", Offset, Offset, ByteLength, Name); } else { if (*Name) { AcpiOsPrintf ("%44s : ", Name); } else { AcpiOsPrintf ("%44s ", Name); } } } } void AcpiDmLineHeader2 ( UINT32 Offset, UINT32 ByteLength, char *Name, UINT32 Value) { if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */ { if (ByteLength) { AcpiOsPrintf ("[%.4d] %30s %3d : ", ByteLength, Name, Value); } else { AcpiOsPrintf ("%36s % 3d : ", Name, Value); } } else /* Normal disassembler or verbose template */ { if (ByteLength) { - AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ", + AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %24s %3d : ", Offset, Offset, ByteLength, Name, Value); } else { - AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ", + AcpiOsPrintf ("[%3.3Xh %4.4u ] %24s %3d : ", Offset, Offset, Name, Value); } } } /******************************************************************************* * * FUNCTION: AcpiDmDumpTable * * PARAMETERS: TableLength - Length of the entire ACPI table * TableOffset - Starting offset within the table for this * sub-descriptor (0 if main table) * Table - The ACPI table * SubtableLength - Length of this sub-descriptor * Info - Info table for this ACPI table * * RETURN: Status * * DESCRIPTION: Display ACPI table contents by walking the Info table. * * Note: This function must remain in sync with DtGetFieldLength. * ******************************************************************************/ ACPI_STATUS AcpiDmDumpTable ( UINT32 TableLength, UINT32 TableOffset, void *Table, UINT32 SubtableLength, ACPI_DMTABLE_INFO *Info) { UINT8 *Target; UINT32 CurrentOffset; UINT32 ByteLength; UINT8 Temp8; UINT16 Temp16; UINT32 Temp32; UINT64 Value; const AH_TABLE *TableData; const char *Name; BOOLEAN LastOutputBlankLine = FALSE; ACPI_STATUS Status; char RepairedName[8]; if (!Info) { AcpiOsPrintf ("Display not implemented\n"); return (AE_NOT_IMPLEMENTED); } /* Walk entire Info table; Null name terminates */ for (; Info->Name; Info++) { /* * Target points to the field within the ACPI Table. CurrentOffset is * the offset of the field from the start of the main table. */ Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset); CurrentOffset = TableOffset + Info->Offset; /* Check for beyond subtable end or (worse) beyond EOT */ if (SubtableLength && (Info->Offset > SubtableLength)) { AcpiOsPrintf ( "/**** ACPI subtable terminates early (Len %u) - " "may be older version (dump table) */\n", SubtableLength); /* Move on to next subtable */ return (AE_OK); } if (CurrentOffset >= TableLength) { AcpiOsPrintf ( "/**** ACPI table terminates " - "in the middle of a data structure! (dump table) */\n"); + "in the middle of a data structure! (dump table) \n" + "CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength); return (AE_BAD_DATA); } /* Generate the byte length for this field */ switch (Info->Opcode) { case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: case ACPI_DMT_ACCWIDTH: case ACPI_DMT_CEDT: case ACPI_DMT_IVRS: case ACPI_DMT_IVRS_DE: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: case ACPI_DMT_NHLT1: case ACPI_DMT_NHLT1a: case ACPI_DMT_NHLT1b: case ACPI_DMT_NHLT1c: case ACPI_DMT_NHLT1d: case ACPI_DMT_NHLT1f: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: case ACPI_DMT_RGRT: case ACPI_DMT_SDEV: case ACPI_DMT_SRAT: case ACPI_DMT_AEST: case ACPI_DMT_AEST_RES: case ACPI_DMT_AEST_XFACE: case ACPI_DMT_AEST_XRUPT: case ACPI_DMT_ASF: + case ACPI_DMT_CDAT: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: case ACPI_DMT_EINJACT: case ACPI_DMT_EINJINST: case ACPI_DMT_ERSTACT: case ACPI_DMT_ERSTINST: case ACPI_DMT_DMAR_SCOPE: case ACPI_DMT_VIOT: ByteLength = 1; break; case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: case ACPI_DMT_HMAT: case ACPI_DMT_NFIT: case ACPI_DMT_NHLT1e: case ACPI_DMT_PHAT: ByteLength = 2; break; case ACPI_DMT_UINT24: ByteLength = 3; break; case ACPI_DMT_UINT32: case ACPI_DMT_AEST_CACHE: case ACPI_DMT_AEST_GIC: case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_LPIT: case ACPI_DMT_TPM2: ByteLength = 4; break; case ACPI_DMT_UINT40: ByteLength = 5; break; case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: ByteLength = 6; break; case ACPI_DMT_UINT56: case ACPI_DMT_BUF7: ByteLength = 7; break; case ACPI_DMT_UINT64: case ACPI_DMT_NAME8: ByteLength = 8; break; case ACPI_DMT_BUF10: ByteLength = 10; break; case ACPI_DMT_BUF12: ByteLength = 12; break; case ACPI_DMT_BUF16: case ACPI_DMT_UUID: ByteLength = 16; break; case ACPI_DMT_BUF18: ByteLength = 18; break; case ACPI_DMT_BUF128: ByteLength = 128; break; case ACPI_DMT_WPBT_UNICODE: ByteLength = SubtableLength; CurrentOffset = sizeof (ACPI_TABLE_WPBT); break; case ACPI_DMT_UNICODE: case ACPI_DMT_BUFFER: case ACPI_DMT_RAW_BUFFER: ByteLength = SubtableLength; break; case ACPI_DMT_PMTT_VENDOR: /* * Calculate the length of the vendor data for the PMTT table: * Length = (Current Subtable ptr + Subtable length) - * Start of the vendor data (Target) */ ByteLength = ((ACPI_CAST_PTR (char, Table) + (ACPI_CAST_PTR (ACPI_PMTT_HEADER, Table)->Length)) - ACPI_CAST_PTR (char, Target)); break; case ACPI_DMT_STRING: ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1; break; case ACPI_DMT_IVRS_UNTERMINATED_STRING: ByteLength = ((ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, Target) -1)->UidLength); break; case ACPI_DMT_GAS: if (!LastOutputBlankLine) { AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; } ByteLength = sizeof (ACPI_GENERIC_ADDRESS); break; case ACPI_DMT_HESTNTFY: if (!LastOutputBlankLine) { AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; } ByteLength = sizeof (ACPI_HEST_NOTIFY); break; case ACPI_DMT_IORTMEM: if (!LastOutputBlankLine) { LastOutputBlankLine = FALSE; } ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS); break; default: ByteLength = 0; break; } /* Check if we are beyond a subtable, or (worse) beyond EOT */ if (CurrentOffset + ByteLength > TableLength) { if (SubtableLength) { AcpiOsPrintf ( "/**** ACPI subtable terminates early - " "may be older version (dump table) */\n"); /* Move on to next subtable */ return (AE_OK); } AcpiOsPrintf ( "/**** ACPI table terminates " "in the middle of a data structure! */\n"); return (AE_BAD_DATA); } if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) { AcpiOsPrintf ("%s", Info->Name); continue; } /* Start a new line and decode the opcode */ AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name); switch (Info->Opcode) { /* Single-bit Flag fields. Note: Opcode is the bit position */ case ACPI_DMT_FLAG0: case ACPI_DMT_FLAG1: case ACPI_DMT_FLAG2: case ACPI_DMT_FLAG3: case ACPI_DMT_FLAG4: case ACPI_DMT_FLAG5: case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01); break; /* 2-bit Flag fields */ case ACPI_DMT_FLAGS0: AcpiOsPrintf ("%1.1X\n", *Target & 0x03); break; case ACPI_DMT_FLAGS1: AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03); break; case ACPI_DMT_FLAGS2: AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03); break; case ACPI_DMT_FLAGS8_2: AcpiOsPrintf ("%2.2X\n", (*Target >> 2) & 0xFF); break; case ACPI_DMT_FLAGS4: AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03); break; case ACPI_DMT_FLAGS4_0: AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F); break; case ACPI_DMT_FLAGS4_4: AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F); break; case ACPI_DMT_FLAGS4_8: AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F); break; case ACPI_DMT_FLAGS4_12: AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F); break; case ACPI_DMT_FLAGS16_16: AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF); break; /* Integer Data Types */ case ACPI_DMT_UINT8: case ACPI_DMT_UINT16: case ACPI_DMT_UINT24: case ACPI_DMT_UINT32: case ACPI_DMT_UINT40: case ACPI_DMT_UINT48: case ACPI_DMT_UINT56: case ACPI_DMT_UINT64: /* * Dump bytes - high byte first, low byte last. * Note: All ACPI tables are little-endian. */ Value = 0; for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--) { AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]); Value |= Target[Temp8 - 1]; Value <<= 8; } if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL)) { AcpiOsPrintf (" [Optional field not present]"); } AcpiOsPrintf ("\n"); break; case ACPI_DMT_BUF7: case ACPI_DMT_BUF10: case ACPI_DMT_BUF12: case ACPI_DMT_BUF16: case ACPI_DMT_BUF18: case ACPI_DMT_BUF128: /* * Buffer: Size depends on the opcode and was set above. * Each hex byte is separated with a space. * Multiple lines are separated by line continuation char. */ for (Temp16 = 0; Temp16 < ByteLength; Temp16++) { AcpiOsPrintf ("%2.2X", Target[Temp16]); if ((UINT32) (Temp16 + 1) < ByteLength) { if ((Temp16 > 0) && (!((Temp16+1) % 16))) { AcpiOsPrintf (" \\\n"); /* Line continuation */ AcpiDmLineHeader (0, 0, NULL); } else { AcpiOsPrintf (" "); } } } AcpiOsPrintf ("\n"); break; case ACPI_DMT_UUID: /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */ (void) AcpiUtConvertUuidToString ((char *) Target, AslGbl_MsgBuffer); AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer); break; case ACPI_DMT_STRING: AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target)); break; case ACPI_DMT_IVRS_UNTERMINATED_STRING: AcpiOsPrintf ("\"%.*s\"\n", ByteLength, ACPI_CAST_PTR (char, Target)); break; /* Fixed length ASCII name fields */ case ACPI_DMT_SIG: AcpiUtCheckAndRepairAscii (Target, RepairedName, 4); AcpiOsPrintf ("\"%.4s\" ", RepairedName); TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target)); if (TableData) { AcpiOsPrintf (STRING_FORMAT, TableData->Description); } else { AcpiOsPrintf ("\n"); } break; case ACPI_DMT_NAME4: AcpiUtCheckAndRepairAscii (Target, RepairedName, 4); AcpiOsPrintf ("\"%.4s\"\n", RepairedName); break; case ACPI_DMT_NAME6: AcpiUtCheckAndRepairAscii (Target, RepairedName, 6); AcpiOsPrintf ("\"%.6s\"\n", RepairedName); break; case ACPI_DMT_NAME8: AcpiUtCheckAndRepairAscii (Target, RepairedName, 8); AcpiOsPrintf ("\"%.8s\"\n", RepairedName); break; /* Special Data Types */ case ACPI_DMT_CHKSUM: /* Checksum, display and validate */ AcpiOsPrintf ("%2.2X", *Target); - Temp8 = AcpiDmGenerateChecksum (Table, + Temp8 = AcpiUtGenerateChecksum (Table, ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) { AcpiOsPrintf ( " /* Incorrect checksum, should be %2.2X */", Temp8); } AcpiOsPrintf ("\n"); break; case ACPI_DMT_SPACEID: /* Address Space ID */ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target)); break; case ACPI_DMT_ACCWIDTH: /* Encoded Access Width */ Temp8 = *Target; if (Temp8 > ACPI_GAS_WIDTH_RESERVED) { Temp8 = ACPI_GAS_WIDTH_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]); break; case ACPI_DMT_GAS: /* Generic Address Structure */ AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure"); Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); if (ACPI_FAILURE (Status)) { return (Status); } AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; case ACPI_DMT_AEST: /* AEST subtable types */ Temp8 = *Target; if (Temp8 > ACPI_AEST_NODE_TYPE_RESERVED) { Temp8 = ACPI_AEST_NODE_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAestSubnames[Temp8]); break; case ACPI_DMT_AEST_CACHE: /* AEST cache resource subtable */ Temp32 = *Target; if (Temp32 > ACPI_AEST_CACHE_RESERVED) { Temp32 = ACPI_AEST_CACHE_RESERVED; } AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmAestCacheNames[Temp32]); break; case ACPI_DMT_AEST_GIC: /* AEST GIC error subtable */ Temp32 = *Target; if (Temp32 > ACPI_AEST_GIC_RESERVED) { Temp32 = ACPI_AEST_GIC_RESERVED; } AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmAestGicNames[Temp32]); break; case ACPI_DMT_AEST_RES: /* AEST resource type subtable */ Temp8 = *Target; if (Temp8 > ACPI_AEST_RESOURCE_RESERVED) { Temp8 = ACPI_AEST_RESOURCE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAestResourceNames[Temp8]); break; case ACPI_DMT_AEST_XFACE: /* AEST interface structure types */ Temp8 = *Target; if (Temp8 > ACPI_AEST_XFACE_RESERVED) { Temp8 = ACPI_AEST_XFACE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAestXfaceNames[Temp8]); break; case ACPI_DMT_AEST_XRUPT: /* AEST interrupt structure types */ Temp8 = *Target; if (Temp8 > ACPI_AEST_XRUPT_RESERVED) { Temp8 = ACPI_AEST_XRUPT_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAestXruptNames[Temp8]); break; case ACPI_DMT_ASF: /* ASF subtable types */ Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */ if (Temp16 > ACPI_ASF_TYPE_RESERVED) { Temp16 = ACPI_ASF_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]); break; + case ACPI_DMT_CDAT: + + /* CDAT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_CDAT_TYPE_RESERVED) + { + Temp8 = ACPI_CDAT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmCdatSubnames[Temp8]); + break; + case ACPI_DMT_CEDT: /* CEDT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_CEDT_TYPE_RESERVED) { Temp8 = ACPI_CEDT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmCedtSubnames[Temp8]); break; case ACPI_DMT_DMAR: /* DMAR subtable types */ Temp16 = ACPI_GET16 (Target); if (Temp16 > ACPI_DMAR_TYPE_RESERVED) { Temp16 = ACPI_DMAR_TYPE_RESERVED; } AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; case ACPI_DMT_DMAR_SCOPE: /* DMAR device scope types */ Temp8 = *Target; if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED) { Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]); break; case ACPI_DMT_EINJACT: /* EINJ Action types */ Temp8 = *Target; if (Temp8 > ACPI_EINJ_ACTION_RESERVED) { Temp8 = ACPI_EINJ_ACTION_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]); break; case ACPI_DMT_EINJINST: /* EINJ Instruction types */ Temp8 = *Target; if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED) { Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]); break; case ACPI_DMT_ERSTACT: /* ERST Action types */ Temp8 = *Target; if (Temp8 > ACPI_ERST_ACTION_RESERVED) { Temp8 = ACPI_ERST_ACTION_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]); break; case ACPI_DMT_ERSTINST: /* ERST Instruction types */ Temp8 = *Target; if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED) { Temp8 = ACPI_ERST_INSTRUCTION_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]); break; case ACPI_DMT_GTDT: /* GTDT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_GTDT_TYPE_RESERVED) { Temp8 = ACPI_GTDT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]); break; case ACPI_DMT_HEST: /* HEST subtable types */ Temp16 = ACPI_GET16 (Target); if (Temp16 > ACPI_HEST_TYPE_RESERVED) { Temp16 = ACPI_HEST_TYPE_RESERVED; } AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]); break; case ACPI_DMT_HESTNTFY: AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure"); Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); if (ACPI_FAILURE (Status)) { return (Status); } AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; case ACPI_DMT_HESTNTYP: /* HEST Notify types */ Temp8 = *Target; if (Temp8 > ACPI_HEST_NOTIFY_RESERVED) { Temp8 = ACPI_HEST_NOTIFY_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]); break; case ACPI_DMT_HMAT: /* HMAT subtable types */ Temp16 = *Target; if (Temp16 > ACPI_HMAT_TYPE_RESERVED) { Temp16 = ACPI_HMAT_TYPE_RESERVED; } AcpiOsPrintf (UINT16_FORMAT, *Target, AcpiDmHmatSubnames[Temp16]); break; case ACPI_DMT_IORTMEM: AcpiOsPrintf (STRING_FORMAT, "IORT Memory Access Properties"); Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc); if (ACPI_FAILURE (Status)) { return (Status); } LastOutputBlankLine = TRUE; break; case ACPI_DMT_MADT: /* MADT subtable types */ Temp8 = *Target; if ((Temp8 >= ACPI_MADT_TYPE_RESERVED) && (Temp8 < ACPI_MADT_TYPE_OEM_RESERVED)) { Temp8 = ACPI_MADT_TYPE_RESERVED; } else if (Temp8 >= ACPI_MADT_TYPE_OEM_RESERVED) { Temp8 = ACPI_MADT_TYPE_RESERVED + 1; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]); break; case ACPI_DMT_NFIT: /* NFIT subtable types */ Temp16 = ACPI_GET16 (Target); if (Temp16 > ACPI_NFIT_TYPE_RESERVED) { Temp16 = ACPI_NFIT_TYPE_RESERVED; } AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmNfitSubnames[Temp16]); break; case ACPI_DMT_NHLT1: /* NHLT link types */ Temp8 = *Target; if (Temp8 > ACPI_NHLT_TYPE_RESERVED) { Temp8 = ACPI_NHLT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmNhltLinkTypeNames[Temp8]); break; case ACPI_DMT_NHLT1a: /* NHLT direction */ Temp8 = *Target; if (Temp8 > ACPI_NHLT_DIR_RESERVED) { Temp8 = ACPI_NHLT_DIR_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmNhltDirectionNames[Temp8]); break; case ACPI_DMT_NHLT1b: /* NHLT microphone type */ Temp8 = *Target; if (Temp8 > ACPI_NHLT_MIC_RESERVED) { Temp8 = ACPI_NHLT_MIC_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmNhltMicTypeNames[Temp8]); break; case ACPI_DMT_NHLT1c: /* NHLT microphone position */ Temp8 = *Target; if (Temp8 > ACPI_NHLT_MIC_POSITION_RESERVED) { Temp8 = ACPI_NHLT_MIC_POSITION_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmNhltMicPositionNames[Temp8]); break; case ACPI_DMT_NHLT1d: /* NHLT microphone array type */ Temp8 = *Target & ACPI_NHLT_ARRAY_TYPE_MASK; if (Temp8 < ACPI_NHLT_ARRAY_TYPE_RESERVED) { Temp8 = ACPI_NHLT_ARRAY_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT_NO_NEWLINE, *Target, AcpiDmNhltMicArrayTypeNames[Temp8 - ACPI_NHLT_ARRAY_TYPE_RESERVED]); Temp8 = *Target; if (Temp8 & ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT) { AcpiOsPrintf (" [%s]", "SNR and Sensitivity"); } AcpiOsPrintf ("\n"); break; case ACPI_DMT_NHLT1e: /* NHLT Endpoint Device ID */ Temp16 = ACPI_GET16 (Target); if (Temp16 == 0xAE20) { Name = "PDM DMIC"; } else if (Temp16 == 0xAE30) { Name = "BT Sideband"; } else if (Temp16 == 0xAE34) { Name = "I2S/TDM Codecs"; } else { Name = "Unknown Device ID"; } AcpiOsPrintf (UINT16_FORMAT, Temp16, Name); break; case ACPI_DMT_NHLT1f: /* NHLT ConfigType field */ Temp8 = *Target; if (Temp8 > ACPI_NHLT_CONFIG_TYPE_RESERVED) { Temp8 = ACPI_NHLT_CONFIG_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmNhltConfigTypeNames[Temp8]); break; case ACPI_DMT_PCCT: /* PCCT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_PCCT_TYPE_RESERVED) { Temp8 = ACPI_PCCT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]); break; case ACPI_DMT_PHAT: - /* PMTT subtable types */ + /* PHAT subtable types */ - Temp16 = *Target; + Temp16 = ACPI_GET16 (Target); if (Temp16 > ACPI_PHAT_TYPE_RESERVED) { Temp16 = ACPI_PHAT_TYPE_RESERVED; } - AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16(Target), + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmPhatSubnames[Temp16]); break; case ACPI_DMT_PMTT: /* PMTT subtable types */ Temp8 = *Target; if (Temp8 == ACPI_PMTT_TYPE_VENDOR) { Temp8 = ACPI_PMTT_TYPE_RESERVED + 1; } else if (Temp8 > ACPI_PMTT_TYPE_RESERVED) { Temp8 = ACPI_PMTT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]); break; case ACPI_DMT_PPTT: /* PPTT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_PPTT_TYPE_RESERVED) { Temp8 = ACPI_PPTT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPpttSubnames[Temp8]); break; case ACPI_DMT_UNICODE: case ACPI_DMT_WPBT_UNICODE: if (ByteLength == 0) { AcpiOsPrintf ("/* Zero-length Data */\n"); break; } - AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength); + AcpiDmDumpUnicode (Table, 0, ByteLength); break; case ACPI_DMT_RAW_BUFFER: case ACPI_DMT_BUFFER: case ACPI_DMT_PMTT_VENDOR: if (ByteLength == 0) { AcpiOsPrintf ("/* Zero-length Data */\n"); break; } AcpiDmDumpBuffer (Target, 0, ByteLength, CurrentOffset, NULL); break; case ACPI_DMT_RGRT: /* RGRT subtable types */ Temp8 = *Target; if (Temp8 >= ACPI_RGRT_TYPE_RESERVED) { Temp8 = ACPI_RGRT_TYPE_RESERVED0; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmRgrtSubnames[Temp8]); break; case ACPI_DMT_SDEV: /* SDEV subtable types */ Temp8 = *Target; if (Temp8 > ACPI_SDEV_TYPE_RESERVED) { Temp8 = ACPI_SDEV_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSdevSubnames[Temp8]); break; case ACPI_DMT_SRAT: /* SRAT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_SRAT_TYPE_RESERVED) { Temp8 = ACPI_SRAT_TYPE_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); break; case ACPI_DMT_TPM2: /* TPM2 Start Method types */ Temp8 = *Target; if (Temp8 > ACPI_TPM2_RESERVED) { Temp8 = ACPI_TPM2_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmTpm2Subnames[Temp8]); break; case ACPI_DMT_FADTPM: /* FADT Preferred PM Profile names */ Temp8 = *Target; if (Temp8 > ACPI_FADT_PM_RESERVED) { Temp8 = ACPI_FADT_PM_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]); break; case ACPI_DMT_IVRS: /* IVRS subtable types */ Temp8 = *Target; switch (Temp8) { case ACPI_IVRS_TYPE_HARDWARE1: case ACPI_IVRS_TYPE_HARDWARE2: Name = AcpiDmIvrsSubnames[0]; break; case ACPI_IVRS_TYPE_HARDWARE3: Name = AcpiDmIvrsSubnames[1]; break; case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: Name = AcpiDmIvrsSubnames[2]; break; default: Name = AcpiDmIvrsSubnames[3]; break; } AcpiOsPrintf (UINT8_FORMAT, *Target, Name); break; case ACPI_DMT_IVRS_DE: /* IVRS device entry types */ Temp8 = *Target; switch (Temp8) { case ACPI_IVRS_TYPE_ALL: case ACPI_IVRS_TYPE_SELECT: case ACPI_IVRS_TYPE_START: case ACPI_IVRS_TYPE_END: Name = AcpiDmIvrsDevEntryNames[Temp8]; break; case ACPI_IVRS_TYPE_ALIAS_SELECT: case ACPI_IVRS_TYPE_ALIAS_START: case ACPI_IVRS_TYPE_EXT_SELECT: case ACPI_IVRS_TYPE_EXT_START: case ACPI_IVRS_TYPE_SPECIAL: Name = AcpiDmIvrsDevEntryNames[Temp8 - 61]; break; case ACPI_IVRS_TYPE_HID: Name = AcpiDmIvrsDevEntryNames[Temp8 - 228]; break; default: Name = AcpiDmIvrsDevEntryNames[0]; /* Unknown/Reserved */ break; } AcpiOsPrintf (UINT8_FORMAT, *Target, Name); break; case ACPI_DMT_LPIT: /* LPIT subtable types */ Temp32 = ACPI_GET32 (Target); if (Temp32 > ACPI_LPIT_TYPE_RESERVED) { Temp32 = ACPI_LPIT_TYPE_RESERVED; } AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target), AcpiDmLpitSubnames[Temp32]); break; case ACPI_DMT_VIOT: /* VIOT subtable types */ Temp8 = *Target; if (Temp8 > ACPI_VIOT_RESERVED) { Temp8 = ACPI_VIOT_RESERVED; } AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmViotSubnames[Temp8]); break; case ACPI_DMT_EXIT: return (AE_OK); default: ACPI_ERROR ((AE_INFO, "**** Invalid table opcode [0x%X] ****\n", Info->Opcode)); return (AE_SUPPORT); } } if (TableOffset && !SubtableLength) { /* * If this table is not the main table, the subtable must have a * valid length */ AcpiOsPrintf ("Invalid zero length subtable\n"); return (AE_BAD_DATA); } return (AE_OK); } diff --git a/sys/contrib/dev/acpica/common/dmtables.c b/sys/contrib/dev/acpica/common/dmtables.c index 13ecdf40909e..72af05952701 100644 --- a/sys/contrib/dev/acpica/common/dmtables.c +++ b/sys/contrib/dev/acpica/common/dmtables.c @@ -1,613 +1,613 @@ /****************************************************************************** * * Module Name: dmtables - disassembler ACPI table support * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #include #include #include #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("dmtables") /* Local prototypes */ static void AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); static ACPI_STATUS AdStoreTable ( ACPI_TABLE_HEADER *Table, UINT32 *TableIndex); extern ACPI_TABLE_DESC LocalTables[1]; extern ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /****************************************************************************** * * FUNCTION: AdDisassemblerHeader * * PARAMETERS: Filename - Input file for the table * TableType - Either AML or DataTable * * RETURN: None * * DESCRIPTION: Create the disassembler header, including ACPICA signon with * current time and date. * *****************************************************************************/ void AdDisassemblerHeader ( char *Filename, UINT8 TableType) { time_t Timer; time (&Timer); /* Header and input table info */ AcpiOsPrintf ("/*\n"); AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * ")); if (TableType == ACPI_IS_AML_TABLE) { if (AcpiGbl_CstyleDisassembly) { AcpiOsPrintf ( " * Disassembling to symbolic ASL+ operators\n" " *\n"); } else { AcpiOsPrintf ( " * Disassembling to non-symbolic legacy ASL operators\n" " *\n"); } } AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); AcpiOsPrintf (" *\n"); } /****************************************************************************** * * FUNCTION: AdCreateTableHeader * * PARAMETERS: Filename - Input file for the table * Table - Pointer to the raw table * * RETURN: None * * DESCRIPTION: Create the ASL table header, including ACPICA signon with * current time and date. * *****************************************************************************/ static void AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table) { UINT8 Checksum; /* Reset globals for External statements */ AcpiGbl_NumExternalMethods = 0; AcpiGbl_ResolvedExternalMethods = 0; /* * Print file header and dump original table header */ AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE); AcpiOsPrintf (" * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length); /* Print and validate the revision */ AcpiOsPrintf (" * Revision 0x%2.2X", Table->Revision); switch (Table->Revision) { case 0: AcpiOsPrintf (" **** Invalid Revision"); break; case 1: /* Revision of DSDT controls the ACPI integer width */ if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT)) { AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support"); } break; default: break; } /* Print and validate the table checksum */ AcpiOsPrintf ("\n * Checksum 0x%2.2X", Table->Checksum); - Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length); + Checksum = AcpiUtChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length); if (Checksum) { AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X", (UINT8) (Table->Checksum - Checksum)); } AcpiOsPrintf ("\n"); AcpiOsPrintf (" * OEM ID \"%.6s\"\n", Table->OemId); AcpiOsPrintf (" * OEM Table ID \"%.8s\"\n", Table->OemTableId); AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision); AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId); AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision); AcpiOsPrintf (" */\n"); /* * Print comments that come before this definition block. */ if (AcpiGbl_CaptureComments) { ASL_CV_PRINT_ONE_COMMENT(AcpiGbl_ParseOpRoot,AML_COMMENT_STANDARD, NULL, 0); } /* * Open the ASL definition block. * * Note: the AMLFilename string is left zero-length in order to just let * the compiler create it when the disassembled file is compiled. This * makes it easier to rename the disassembled ASL file if needed. */ AcpiOsPrintf ( "DefinitionBlock (\"\", \"%4.4s\", %u, \"%.6s\", \"%.8s\", 0x%8.8X)\n", Table->Signature, Table->Revision, Table->OemId, Table->OemTableId, Table->OemRevision); } /****************************************************************************** * * FUNCTION: AdDisplayTables * * PARAMETERS: Filename - Input file for the table * Table - Pointer to the raw table * * RETURN: Status * * DESCRIPTION: Display (disassemble) loaded tables and dump raw tables * *****************************************************************************/ ACPI_STATUS AdDisplayTables ( char *Filename, ACPI_TABLE_HEADER *Table) { if (!AcpiGbl_ParseOpRoot) { return (AE_NOT_EXIST); } if (!AcpiGbl_DmOpt_Listing) { AdCreateTableHeader (Filename, Table); } AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX); MpEmitMappingInfo (); if (AcpiGbl_DmOpt_Listing) { AcpiOsPrintf ("\n\nTable Header:\n"); AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), DB_BYTE_DISPLAY, ACPI_UINT32_MAX); AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length); AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)), Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); } return (AE_OK); } /******************************************************************************* * * FUNCTION: AdStoreTable * * PARAMETERS: Table - Table header * TableIndex - Where the table index is returned * * RETURN: Status and table index. * * DESCRIPTION: Add an ACPI table to the global table list * ******************************************************************************/ static ACPI_STATUS AdStoreTable ( ACPI_TABLE_HEADER *Table, UINT32 *TableIndex) { ACPI_STATUS Status; ACPI_TABLE_DESC *TableDesc; Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc); if (ACPI_FAILURE (Status)) { return (Status); } /* Initialize added table */ AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table); Status = AcpiTbValidateTable (TableDesc); return (Status); } /****************************************************************************** * * FUNCTION: AdGetLocalTables * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Get the ACPI tables from either memory or a file * *****************************************************************************/ ACPI_STATUS AdGetLocalTables ( void) { ACPI_STATUS Status; ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *NewTable; UINT32 TableIndex; /* Get the DSDT via table override */ ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT); Status = AcpiOsTableOverride (&TableHeader, &NewTable); if (ACPI_FAILURE (Status) || !NewTable) { fprintf (stderr, "Could not obtain DSDT\n"); return (AE_NO_ACPI_TABLES); } AdWriteTable (NewTable, NewTable->Length, ACPI_SIG_DSDT, NewTable->OemTableId); /* Store DSDT in the Table Manager */ Status = AdStoreTable (NewTable, &TableIndex); if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not store DSDT\n"); return (AE_NO_ACPI_TABLES); } return (AE_OK); } /****************************************************************************** * * FUNCTION: AdParseTable * * PARAMETERS: Table - Pointer to the raw table * OwnerId - Returned OwnerId of the table * LoadTable - If add table to the global table list * External - If this is an external table * * RETURN: Status * * DESCRIPTION: Parse an ACPI AML table * *****************************************************************************/ ACPI_STATUS AdParseTable ( ACPI_TABLE_HEADER *Table, ACPI_OWNER_ID *OwnerId, BOOLEAN LoadTable, BOOLEAN External) { ACPI_STATUS Status = AE_OK; ACPI_WALK_STATE *WalkState; UINT8 *AmlStart; UINT32 AmlLength; UINT32 TableIndex; if (!Table) { return (AE_NOT_EXIST); } /* Pass 1: Parse everything except control method bodies */ fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature); AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER); AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)); AcpiUtSetIntegerWidth (Table->Revision); /* Create the root object */ AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart); if (!AcpiGbl_ParseOpRoot) { return (AE_NO_MEMORY); } #ifdef ACPI_ASL_COMPILER if (AcpiGbl_CaptureComments) { AcpiGbl_ParseOpRoot->Common.CvFilename = AcpiGbl_FileTreeRoot->Filename; } else { AcpiGbl_ParseOpRoot->Common.CvFilename = NULL; } #endif /* Create and initialize a new walk state */ WalkState = AcpiDsCreateWalkState (0, AcpiGbl_ParseOpRoot, NULL, NULL); if (!WalkState) { return (AE_NO_MEMORY); } Status = AcpiDsInitAmlWalk (WalkState, AcpiGbl_ParseOpRoot, NULL, AmlStart, AmlLength, NULL, ACPI_IMODE_LOAD_PASS1); if (ACPI_FAILURE (Status)) { return (Status); } WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; Status = AcpiPsParseAml (WalkState); if (ACPI_FAILURE (Status)) { return (Status); } /* If LoadTable is FALSE, we are parsing the last loaded table */ TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1; /* Pass 2 */ if (LoadTable) { Status = AdStoreTable (Table, &TableIndex); if (ACPI_FAILURE (Status)) { return (Status); } Status = AcpiTbAllocateOwnerId (TableIndex); if (ACPI_FAILURE (Status)) { return (Status); } if (OwnerId) { Status = AcpiTbGetOwnerId (TableIndex, OwnerId); if (ACPI_FAILURE (Status)) { return (Status); } } } fprintf (stderr, "Pass 2 parse of [%4.4s]\n", (char *) Table->Signature); Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2, TableIndex, NULL); if (ACPI_FAILURE (Status)) { return (Status); } /* No need to parse control methods of external table */ if (External) { return (AE_OK); } /* * Pass 3: Parse control methods and link their parse trees * into the main parse tree */ fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n"); (void) AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot); fprintf (stderr, "\n"); /* Process Resource Templates */ AcpiDmFindResources (AcpiGbl_ParseOpRoot); fprintf (stderr, "Parsing completed\n"); return (AE_OK); } diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c index b87c276cc625..e4bb62eaab6e 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump.c +++ b/sys/contrib/dev/acpica/common/dmtbdump.c @@ -1,659 +1,659 @@ /****************************************************************************** * * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbdump") /* Local prototypes */ static void AcpiDmValidateFadtLength ( UINT32 Revision, UINT32 Length); /******************************************************************************* * * FUNCTION: AcpiDmDumpBuffer * * PARAMETERS: Table - ACPI Table or subtable * BufferOffset - Offset of buffer from Table above * Length - Length of the buffer * AbsoluteOffset - Offset of buffer in the main ACPI table * Header - Name of the buffer field (printed on the * first line only.) * * RETURN: None * * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the * disassembler output format.) * ******************************************************************************/ void AcpiDmDumpBuffer ( void *Table, UINT32 BufferOffset, UINT32 Length, UINT32 AbsoluteOffset, char *Header) { UINT8 *Buffer; UINT8 BufChar; UINT32 i; UINT32 j; if (!Length) { return; } Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset; i = 0; while (i < Length) { if ((Length > 16) && (i != 0)) { if ((Length - i) < 16) AcpiOsPrintf ("\n/* %3.3Xh %4.4u %3u */ ", AbsoluteOffset, AbsoluteOffset, Length - i); else AcpiOsPrintf ("\n/* %3.3Xh %4.4u 16 */ ", AbsoluteOffset, AbsoluteOffset); } AbsoluteOffset += 16; /* Emit the raw data bytes*/ for (j = 0; j < 16; j++) { if (i + j >= Length) { /* Dump fill spaces */ AcpiOsPrintf ("%*s", (48 - (3 * (Length -i))), " "); break; } AcpiOsPrintf ("%.02X ", Buffer[(ACPI_SIZE) i + j]); } /* Emit the ASCII equivalent to the raw data bytes */ for (j = 0; j < 16; j++) { if (i + j >= Length) { AcpiOsPrintf (" */\\\n"); return; } /* * Add comment characters so rest of line is ignored when * compiled */ if (j == 0) { AcpiOsPrintf ("/* "); } BufChar = Buffer[(ACPI_SIZE) i + j]; if (isprint (BufChar)) { AcpiOsPrintf ("%c", BufChar); } else { AcpiOsPrintf ("."); } } /* Done with that line. */ /* Close the comment and insert a backslash - line continuation character */ if (Length > 16) { AcpiOsPrintf (" */\\"); } else { AcpiOsPrintf (" */\\"); } i += 16; /* Point to next line */ } AcpiOsPrintf ("\n"); } /******************************************************************************* * * FUNCTION: AcpiDmDumpUnicode * * PARAMETERS: Table - ACPI Table or subtable * BufferOffset - Offset of buffer from Table above * ByteLength - Length of the buffer * * RETURN: None * * DESCRIPTION: Validate and dump the contents of a buffer that contains * unicode data. The output is a standard ASCII string. If it * appears that the data is not unicode, the buffer is dumped * as hex characters. * ******************************************************************************/ void AcpiDmDumpUnicode ( void *Table, UINT32 BufferOffset, UINT32 ByteLength) { UINT8 *Buffer; UINT32 Length; UINT32 i; Buffer = ((UINT8 *) Table) + BufferOffset; Length = ByteLength - 2; /* Last two bytes are the null terminator */ /* Ensure all low bytes are entirely printable ASCII */ for (i = 0; i < Length; i += 2) { if (!isprint (Buffer[i])) { goto DumpRawBuffer; } } /* Ensure all high bytes are zero */ for (i = 1; i < Length; i += 2) { if (Buffer[i]) { goto DumpRawBuffer; } } /* Dump the buffer as a normal string */ AcpiOsPrintf ("\""); for (i = 0; i < Length; i += 2) { AcpiOsPrintf ("%c", Buffer[i]); } AcpiOsPrintf ("\"\n"); return; DumpRawBuffer: AcpiDmDumpBuffer (Table, BufferOffset, ByteLength, BufferOffset, NULL); AcpiOsPrintf ("\n"); } /******************************************************************************* * * FUNCTION: AcpiDmDumpRsdp * * PARAMETERS: Table - A RSDP * * RETURN: Length of the table (there is not always a length field, * use revision or length if available (ACPI 2.0+)) * * DESCRIPTION: Format the contents of a RSDP * ******************************************************************************/ UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table) { ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); UINT32 Length = sizeof (ACPI_RSDP_COMMON); UINT8 Checksum; ACPI_STATUS Status; /* Dump the common ACPI 1.0 portion */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); if (ACPI_FAILURE (Status)) { return (Length); } /* Validate the first checksum */ - Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON), + Checksum = AcpiUtGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON), Rsdp->Checksum); if (Checksum != Rsdp->Checksum) { AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n", Checksum); } /* The RSDP for ACPI 2.0+ contains more data and has a Length field */ if (Rsdp->Revision > 0) { Length = Rsdp->Length; Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); if (ACPI_FAILURE (Status)) { return (Length); } /* Validate the extended checksum over entire RSDP */ - Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP), + Checksum = AcpiUtGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP), Rsdp->ExtendedChecksum); if (Checksum != Rsdp->ExtendedChecksum) { AcpiOsPrintf ( "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n", Checksum); } } return (Length); } /******************************************************************************* * * FUNCTION: AcpiDmDumpRsdt * * PARAMETERS: Table - A RSDT * * RETURN: None * * DESCRIPTION: Format the contents of a RSDT * ******************************************************************************/ void AcpiDmDumpRsdt ( ACPI_TABLE_HEADER *Table) { UINT32 *Array; UINT32 Entries; UINT32 Offset; UINT32 i; /* Point to start of table pointer array */ Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry; Offset = sizeof (ACPI_TABLE_HEADER); /* RSDT uses 32-bit pointers */ Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32); for (i = 0; i < Entries; i++) { AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i); AcpiOsPrintf ("%8.8X\n", Array[i]); Offset += sizeof (UINT32); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpXsdt * * PARAMETERS: Table - A XSDT * * RETURN: None * * DESCRIPTION: Format the contents of a XSDT * ******************************************************************************/ void AcpiDmDumpXsdt ( ACPI_TABLE_HEADER *Table) { UINT64 *Array; UINT32 Entries; UINT32 Offset; UINT32 i; /* Point to start of table pointer array */ Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry; Offset = sizeof (ACPI_TABLE_HEADER); /* XSDT uses 64-bit pointers */ Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64); for (i = 0; i < Entries; i++) { AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i); AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i])); Offset += sizeof (UINT64); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpFadt * * PARAMETERS: Table - A FADT * * RETURN: None * * DESCRIPTION: Format the contents of a FADT * * NOTE: We cannot depend on the FADT version to indicate the actual * contents of the FADT because of BIOS bugs. The table length * is the only reliable indicator. * ******************************************************************************/ void AcpiDmDumpFadt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1); if (ACPI_FAILURE (Status)) { return; } /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */ if ((Table->Length > ACPI_FADT_V1_SIZE) && (Table->Length <= ACPI_FADT_V2_SIZE)) { Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2); if (ACPI_FAILURE (Status)) { return; } } /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ else if (Table->Length > ACPI_FADT_V2_SIZE) { Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3); if (ACPI_FAILURE (Status)) { return; } /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ if (Table->Length > ACPI_FADT_V3_SIZE) { Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); if (ACPI_FAILURE (Status)) { return; } } /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ if (Table->Length > ACPI_FADT_V3_SIZE) { Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6); if (ACPI_FAILURE (Status)) { return; } } } /* Validate various fields in the FADT, including length */ AcpiTbCreateLocalFadt (Table, Table->Length); /* Validate FADT length against the revision */ AcpiDmValidateFadtLength (Table->Revision, Table->Length); } /******************************************************************************* * * FUNCTION: AcpiDmValidateFadtLength * * PARAMETERS: Revision - FADT revision (Header->Revision) * Length - FADT length (Header->Length * * RETURN: None * * DESCRIPTION: Check the FADT revision against the expected table length for * that revision. Issue a warning if the length is not what was * expected. This seems to be such a common BIOS bug that the * FADT revision has been rendered virtually meaningless. * ******************************************************************************/ static void AcpiDmValidateFadtLength ( UINT32 Revision, UINT32 Length) { UINT32 ExpectedLength; switch (Revision) { case 0: AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n"); return; case 1: ExpectedLength = ACPI_FADT_V1_SIZE; break; case 2: ExpectedLength = ACPI_FADT_V2_SIZE; break; case 3: case 4: ExpectedLength = ACPI_FADT_V3_SIZE; break; case 5: ExpectedLength = ACPI_FADT_V5_SIZE; break; default: return; } if (Length == ExpectedLength) { return; } AcpiOsPrintf ( "\n// ACPI Warning: FADT revision %X does not match length: " "found %X expected %X\n", Revision, Length, ExpectedLength); } diff --git a/sys/contrib/dev/acpica/common/dmtbdump1.c b/sys/contrib/dev/acpica/common/dmtbdump1.c index c21d641d25a0..1c40e5f6def8 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump1.c +++ b/sys/contrib/dev/acpica/common/dmtbdump1.c @@ -1,1954 +1,2147 @@ /****************************************************************************** * * Module Name: dmtbdump1 - Dump ACPI data tables that contain no AML code * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include +#include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbdump1") /******************************************************************************* * * FUNCTION: AcpiDmDumpAest * * PARAMETERS: Table - A AEST table * * RETURN: None * * DESCRIPTION: Format the contents of a AEST table * * NOTE: Assumes the following table structure: * For all AEST Error Nodes: * 1) An AEST Error Node, followed immediately by: * 2) Any node-specific data * 3) An Interface Structure (one) * 4) A list (array) of Interrupt Structures * * AEST - ARM Error Source table. Conforms to: * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020 * ******************************************************************************/ void AcpiDmDumpAest ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_HEADER); ACPI_AEST_HEADER *Subtable; ACPI_AEST_HEADER *NodeHeader; ACPI_AEST_PROCESSOR *ProcessorSubtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_SIZE Length; UINT8 Type; /* Very small, generic main table. AEST consists of mostly subtables */ while (Offset < Table->Length) { NodeHeader = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); /* Dump the common error node (subtable) header */ Status = AcpiDmDumpTable (Table->Length, Offset, NodeHeader, NodeHeader->Length, AcpiDmTableInfoAestHdr); if (ACPI_FAILURE (Status)) { return; } Type = NodeHeader->Type; /* Setup the node-specific subtable based on the header Type field */ switch (Type) { case ACPI_AEST_PROCESSOR_ERROR_NODE: InfoTable = AcpiDmTableInfoAestProcError; Length = sizeof (ACPI_AEST_PROCESSOR); break; case ACPI_AEST_MEMORY_ERROR_NODE: InfoTable = AcpiDmTableInfoAestMemError; Length = sizeof (ACPI_AEST_MEMORY); break; case ACPI_AEST_SMMU_ERROR_NODE: InfoTable = AcpiDmTableInfoAestSmmuError; Length = sizeof (ACPI_AEST_SMMU); break; case ACPI_AEST_VENDOR_ERROR_NODE: InfoTable = AcpiDmTableInfoAestVendorError; Length = sizeof (ACPI_AEST_VENDOR); break; case ACPI_AEST_GIC_ERROR_NODE: InfoTable = AcpiDmTableInfoAestGicError; Length = sizeof (ACPI_AEST_GIC); break; /* Error case below */ default: AcpiOsPrintf ("\n**** Unknown AEST Error Subtable type 0x%X\n", Type); return; } /* Point past the common header (to the node-specific data) */ Offset += sizeof (ACPI_AEST_HEADER); Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); AcpiOsPrintf ("\n"); /* Dump the node-specific subtable */ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); if (Type == ACPI_AEST_PROCESSOR_ERROR_NODE) { /* * Special handling for PROCESSOR_ERROR_NODE subtables * (to handle the Resource Substructure via the ResourceType * field). */ /* Point past the node-specific data */ Offset += Length; ProcessorSubtable = ACPI_CAST_PTR (ACPI_AEST_PROCESSOR, Subtable); switch (ProcessorSubtable->ResourceType) { /* Setup the Resource Substructure subtable */ case ACPI_AEST_CACHE_RESOURCE: InfoTable = AcpiDmTableInfoAestCacheRsrc; Length = sizeof (ACPI_AEST_PROCESSOR_CACHE); break; case ACPI_AEST_TLB_RESOURCE: InfoTable = AcpiDmTableInfoAestTlbRsrc; Length = sizeof (ACPI_AEST_PROCESSOR_TLB); break; case ACPI_AEST_GENERIC_RESOURCE: InfoTable = AcpiDmTableInfoAestGenRsrc; Length = sizeof (ACPI_AEST_PROCESSOR_GENERIC); break; /* Error case below */ default: AcpiOsPrintf ("\n**** Unknown AEST Processor Resource type 0x%X\n", ProcessorSubtable->ResourceType); return; } ProcessorSubtable = ACPI_ADD_PTR (ACPI_AEST_PROCESSOR, Table, Offset); /* Dump the resource substructure subtable */ Status = AcpiDmDumpTable (Table->Length, Offset, ProcessorSubtable, Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); } /* Point past the resource substructure or the node-specific data */ Offset += Length; /* Dump the interface structure, required to be present */ Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); if (Subtable->Type >= ACPI_AEST_XFACE_RESERVED) { AcpiOsPrintf ("\n**** Unknown AEST Node Interface type 0x%X\n", Subtable->Type); return; } Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, sizeof (ACPI_AEST_NODE_INTERFACE), AcpiDmTableInfoAestXface); if (ACPI_FAILURE (Status)) { return; } /* Point past the interface structure */ AcpiOsPrintf ("\n"); Offset += sizeof (ACPI_AEST_NODE_INTERFACE); /* Dump the entire interrupt structure array, if present */ if (NodeHeader->NodeInterruptOffset) { Length = NodeHeader->NodeInterruptCount; Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); while (Length) { /* Dump the interrupt structure */ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, sizeof (ACPI_AEST_NODE_INTERRUPT), AcpiDmTableInfoAestXrupt); if (ACPI_FAILURE (Status)) { return; } /* Point to the next interrupt structure */ Offset += sizeof (ACPI_AEST_NODE_INTERRUPT); Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); Length--; AcpiOsPrintf ("\n"); } } } } /******************************************************************************* * * FUNCTION: AcpiDmDumpApmt * * PARAMETERS: Table - A APMT table * * RETURN: None * * DESCRIPTION: Format the contents of a APMT. This table type consists * of an open-ended number of subtables. * * * APMT - ARM Performance Monitoring Unit table. Conforms to: * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document * ARM DEN0117 v1.0 November 25, 2021 * ******************************************************************************/ void AcpiDmDumpApmt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_APMT_NODE *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_APMT); UINT32 NodeNum = 0; /* There is no main table (other than the standard ACPI header) */ /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); if (Subtable->Type >= ACPI_APMT_NODE_TYPE_COUNT) { AcpiOsPrintf ("\n**** Unknown APMT subtable type 0x%X\n", Subtable->Type); return; } AcpiOsPrintf ("/* APMT Node-%u */\n", NodeNum++); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoApmtNode); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Subtable, Subtable->Length); AcpiOsPrintf ("\n"); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpAsf * * PARAMETERS: Table - A ASF table * * RETURN: None * * DESCRIPTION: Format the contents of a ASF table * ******************************************************************************/ void AcpiDmDumpAsf ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_HEADER); ACPI_ASF_INFO *Subtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT8 *DataTable = NULL; UINT32 DataCount = 0; UINT32 DataLength = 0; UINT32 DataOffset = 0; UINT32 i; UINT8 Type; /* No main table, only subtables */ Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Header.Length, AcpiDmTableInfoAsfHdr); if (ACPI_FAILURE (Status)) { return; } /* The actual type is the lower 7 bits of Type */ Type = (UINT8) (Subtable->Header.Type & 0x7F); switch (Type) { case ACPI_ASF_TYPE_INFO: InfoTable = AcpiDmTableInfoAsf0; break; case ACPI_ASF_TYPE_ALERT: InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; case ACPI_ASF_TYPE_CONTROL: InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; case ACPI_ASF_TYPE_BOOT: InfoTable = AcpiDmTableInfoAsf3; break; case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; default: AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", Subtable->Header.Type); return; } Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Header.Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Dump variable-length extra data */ switch (Type) { case ACPI_ASF_TYPE_ALERT: case ACPI_ASF_TYPE_CONTROL: for (i = 0; i < DataCount; i++) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, DataOffset, DataTable, DataLength, DataInfoTable); if (ACPI_FAILURE (Status)) { return; } DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength); DataOffset += DataLength; } break; case ACPI_ASF_TYPE_ADDRESS: for (i = 0; i < DataLength; i++) { if (!(i % 16)) { AcpiDmLineHeader (DataOffset, 1, "Addresses"); } AcpiOsPrintf ("%2.2X ", *DataTable); DataTable++; DataOffset++; if (DataOffset > Table->Length) { AcpiOsPrintf ( "**** ACPI table terminates in the middle of a " "data structure! (ASF! table)\n"); return; } } AcpiOsPrintf ("\n"); break; default: break; } AcpiOsPrintf ("\n"); /* Point to next subtable */ if (!Subtable->Header.Length) { AcpiOsPrintf ("Invalid zero subtable header length\n"); return; } Offset += Subtable->Header.Length; Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, Subtable->Header.Length); } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpCdat + * + * PARAMETERS: InTable - A CDAT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a CDAT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpCdat ( + ACPI_TABLE_HEADER *InTable) +{ + ACPI_TABLE_CDAT *Table = ACPI_CAST_PTR (ACPI_TABLE_CDAT, InTable); + ACPI_STATUS Status; + ACPI_CDAT_HEADER *Subtable; + ACPI_TABLE_CDAT *CdatTable = ACPI_CAST_PTR (ACPI_TABLE_CDAT, Table); + ACPI_DMTABLE_INFO *InfoTable; + UINT32 Length = CdatTable->Length; + UINT32 Offset = sizeof (ACPI_TABLE_CDAT); + UINT32 SubtableLength; + UINT32 SubtableType; + INT32 EntriesLength; + + + /* Main table */ + + Status = AcpiDmDumpTable (Offset, 0, CdatTable, 0, + AcpiDmTableInfoCdatTableHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, sizeof (ACPI_TABLE_CDAT)); + while (Offset < Table->Length) + { + /* Dump the common subtable header */ + + DbgPrint (ASL_DEBUG_OUTPUT, "0) HeaderOffset: %X\n", Offset); + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + sizeof (ACPI_CDAT_HEADER), AcpiDmTableInfoCdatHeader); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point past the common subtable header, decode the subtable type */ + + Offset += sizeof (ACPI_CDAT_HEADER); + SubtableType = Subtable->Type; + + switch (Subtable->Type) + { + case ACPI_CDAT_TYPE_DSMAS: + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + SubtableLength = sizeof (ACPI_CDAT_DSMAS); + + InfoTable = AcpiDmTableInfoCdat0; + break; + + case ACPI_CDAT_TYPE_DSLBIS: + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + SubtableLength = sizeof (ACPI_CDAT_DSLBIS); + DbgPrint (ASL_DEBUG_OUTPUT, "1) Offset: %X\n", Offset); + + InfoTable = AcpiDmTableInfoCdat1; + break; + + case ACPI_CDAT_TYPE_DSMSCIS: + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + SubtableLength = sizeof (ACPI_CDAT_DSMSCIS); + + InfoTable = AcpiDmTableInfoCdat2; + break; + + case ACPI_CDAT_TYPE_DSIS: + DbgPrint (ASL_DEBUG_OUTPUT, "2) Offset: %X ", Offset); + SubtableLength = sizeof (ACPI_CDAT_DSIS); + DbgPrint (ASL_DEBUG_OUTPUT, "1) input pointer: %p\n", Table); + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + DbgPrint (ASL_DEBUG_OUTPUT, "1) output pointers: %p, %p, Offset: %X\n", + Table, Subtable, Offset); + DbgPrint (ASL_DEBUG_OUTPUT, "3) Offset: %X\n", Offset); + + InfoTable = AcpiDmTableInfoCdat3; + break; + + case ACPI_CDAT_TYPE_DSEMTS: + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + SubtableLength = sizeof (ACPI_CDAT_DSEMTS); + + InfoTable = AcpiDmTableInfoCdat4; + break; + + case ACPI_CDAT_TYPE_SSLBIS: + SubtableLength = Subtable->Length; + + InfoTable = AcpiDmTableInfoCdat5; + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + break; + + default: + fprintf (stderr, "ERROR: Unknown SubtableType: %X\n", Subtable->Type); + return; + } + + DbgPrint (ASL_DEBUG_OUTPUT, "SubtableType: %X, Length: %X Actual " + "Length: %X Offset: %X tableptr: %p\n", SubtableType, + Subtable->Length, SubtableLength, Offset, Table); + + /* + * Do the subtable-specific fields + */ + Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Type: %X, Offset: %X, SubtableLength: %X\n", + SubtableType, Offset, SubtableLength); + + /* Additional sub-subtables, dependent on the main subtable type */ + + switch (SubtableType) + { + case ACPI_CDAT_TYPE_SSLBIS: + Offset += sizeof (ACPI_CDAT_SSLBIS); + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, + Offset); + + DbgPrint (ASL_DEBUG_OUTPUT, "Case SSLBIS, Offset: %X, SubtableLength: %X " + "Subtable->Length %X\n", Offset, SubtableLength, Subtable->Length); + + /* Generate the total length of all the SSLBE entries */ + + EntriesLength = SubtableLength - sizeof (ACPI_CDAT_HEADER) - + sizeof (ACPI_CDAT_SSLBIS); + DbgPrint (ASL_DEBUG_OUTPUT, "EntriesLength: %X, Offset: %X, Table->Length: %X\n", + EntriesLength, Offset, Table->Length); + + /* Do each of the SSLBE Entries */ + + while ((EntriesLength > 0) && (Offset < Table->Length)) + { + AcpiOsPrintf ("\n"); + + Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset, + AcpiDmTableInfoCdatEntries); + if (ACPI_FAILURE (Status)) + { + return; + } + + EntriesLength -= sizeof (ACPI_CDAT_SSLBE); + Offset += sizeof (ACPI_CDAT_SSLBE); + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + } + + SubtableLength = 0; + break; + + default: + break; + } + + DbgPrint (ASL_DEBUG_OUTPUT, "Offset: %X, Subtable Length: %X\n", + Offset, SubtableLength); + + /* Point to next subtable */ + + Offset += SubtableLength; + Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset); + } + + return; +} + + /******************************************************************************* * * FUNCTION: AcpiDmDumpCedt * * PARAMETERS: Table - A CEDT table * * RETURN: None * * DESCRIPTION: Format the contents of a CEDT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpCedt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_CEDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CEDT); /* There is no main table (other than the standard ACPI header) */ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoCedtHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_CEDT_TYPE_CHBS: Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoCedt0); - if (ACPI_FAILURE (Status)) { + if (ACPI_FAILURE (Status)) + { return; } break; - case ACPI_CEDT_TYPE_CFMWS: { + case ACPI_CEDT_TYPE_CFMWS: + { ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; unsigned int i, max = 0x01 << (ptr->InterleaveWays); /* print out table with first "Interleave target" */ Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoCedt1); - if (ACPI_FAILURE (Status)) { + if (ACPI_FAILURE (Status)) + { return; } /* Now, print out any interleave targets beyond the first. */ - for (i = 1; i < max; i++) { - unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); + for (i = 1; i < max; i++) + { + unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveTargets); unsigned int *trg = &(ptr->InterleaveTargets[i]); + Status = AcpiDmDumpTable (Length, loc_offset, trg, Subtable->Length, AcpiDmTableInfoCedt1_te); - if (ACPI_FAILURE (Status)) { + if (ACPI_FAILURE (Status)) + { return; } } break; } default: AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", Subtable->Type); /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } } /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpCpep * * PARAMETERS: Table - A CPEP table * * RETURN: None * * DESCRIPTION: Format the contents of a CPEP. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_CPEP_POLLING *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CPEP); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable */ Offset += Subtable->Header.Length; Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, Subtable->Header.Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpCsrt * * PARAMETERS: Table - A CSRT table * * RETURN: None * * DESCRIPTION: Format the contents of a CSRT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpCsrt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_CSRT_GROUP *Subtable; ACPI_CSRT_SHARED_INFO *SharedInfoTable; ACPI_CSRT_DESCRIPTOR *SubSubtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CSRT); UINT32 SubOffset; UINT32 SubSubOffset; UINT32 InfoLength; /* The main table only contains the ACPI header, thus already handled */ /* Subtables (Resource Groups) */ Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); while (Offset < Table->Length) { /* Resource group subtable */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoCsrt0); if (ACPI_FAILURE (Status)) { return; } /* Shared info subtable (One per resource group) */ SubOffset = sizeof (ACPI_CSRT_GROUP); SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, Offset + SubOffset); AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); if (ACPI_FAILURE (Status)) { return; } SubOffset += Subtable->SharedInfoLength; /* Sub-Subtables (Resource Descriptors) */ SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, Offset + SubOffset); while ((SubOffset < Subtable->Length) && ((Offset + SubOffset) < Table->Length)) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, SubSubtable->Length, AcpiDmTableInfoCsrt2); if (ACPI_FAILURE (Status)) { return; } SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR); /* Resource-specific info buffer */ InfoLength = SubSubtable->Length - SubSubOffset; if (InfoLength) { Status = AcpiDmDumpTable (Length, Offset + SubOffset + SubSubOffset, Table, InfoLength, AcpiDmTableInfoCsrt2a); if (ACPI_FAILURE (Status)) { return; } } /* Point to next sub-subtable */ SubOffset += SubSubtable->Length; SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, SubSubtable->Length); } /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpDbg2 * * PARAMETERS: Table - A DBG2 table * * RETURN: None * * DESCRIPTION: Format the contents of a DBG2. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpDbg2 ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_DBG2_DEVICE *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DBG2); UINT32 i; UINT32 ArrayOffset; UINT32 AbsoluteOffset; UINT8 *Array; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoDbg2Device); if (ACPI_FAILURE (Status)) { return; } /* Dump the BaseAddress array */ for (i = 0; i < Subtable->RegisterCount; i++) { ArrayOffset = Subtable->BaseAddressOffset + (sizeof (ACPI_GENERIC_ADDRESS) * i); AbsoluteOffset = Offset + ArrayOffset; Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, Subtable->Length, AcpiDmTableInfoDbg2Addr); if (ACPI_FAILURE (Status)) { return; } } /* Dump the AddressSize array */ for (i = 0; i < Subtable->RegisterCount; i++) { ArrayOffset = Subtable->AddressSizeOffset + (sizeof (UINT32) * i); AbsoluteOffset = Offset + ArrayOffset; Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, Subtable->Length, AcpiDmTableInfoDbg2Size); if (ACPI_FAILURE (Status)) { return; } } /* Dump the Namestring (required) */ AcpiOsPrintf ("\n"); ArrayOffset = Subtable->NamepathOffset; AbsoluteOffset = Offset + ArrayOffset; Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, Subtable->Length, AcpiDmTableInfoDbg2Name); if (ACPI_FAILURE (Status)) { return; } /* Dump the OemData (optional) */ if (Subtable->OemDataOffset) { Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, Table, Subtable->OemDataLength, AcpiDmTableInfoDbg2OemData); if (ACPI_FAILURE (Status)) { return; } } /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpDmar * * PARAMETERS: Table - A DMAR table * * RETURN: None * * DESCRIPTION: Format the contents of a DMAR. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_DMAR_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DMAR); ACPI_DMTABLE_INFO *InfoTable; ACPI_DMAR_DEVICE_SCOPE *ScopeTable; UINT32 ScopeOffset; UINT8 *PciPath; UINT32 PathOffset; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoDmarHdr); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); switch (Subtable->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: InfoTable = AcpiDmTableInfoDmar0; ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); break; case ACPI_DMAR_TYPE_RESERVED_MEMORY: InfoTable = AcpiDmTableInfoDmar1; ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); break; case ACPI_DMAR_TYPE_ROOT_ATS: InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: InfoTable = AcpiDmTableInfoDmar3; ScopeOffset = sizeof (ACPI_DMAR_RHSA); break; case ACPI_DMAR_TYPE_NAMESPACE: InfoTable = AcpiDmTableInfoDmar4; ScopeOffset = sizeof (ACPI_DMAR_ANDD); break; case ACPI_DMAR_TYPE_SATC: InfoTable = AcpiDmTableInfoDmar5; ScopeOffset = sizeof (ACPI_DMAR_SATC); break; default: AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", Subtable->Type); return; } Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* * Dump the optional device scope entries */ if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) { /* These types do not support device scopes */ goto NextSubtable; } ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); while (ScopeOffset < Subtable->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, ScopeTable->Length, AcpiDmTableInfoDmarScope); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); /* Dump the PCI Path entries for this device scope */ PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, sizeof (ACPI_DMAR_DEVICE_SCOPE)); while (PathOffset < ScopeTable->Length) { AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path"); AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); /* Point to next PCI Path entry */ PathOffset += 2; PciPath += 2; AcpiOsPrintf ("\n"); } /* Point to next device scope entry */ ScopeOffset += ScopeTable->Length; ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, ScopeTable, ScopeTable->Length); } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpDrtm * * PARAMETERS: Table - A DRTM table * * RETURN: None * * DESCRIPTION: Format the contents of a DRTM. * ******************************************************************************/ void AcpiDmDumpDrtm ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset; ACPI_DRTM_VTABLE_LIST *DrtmVtl; ACPI_DRTM_RESOURCE_LIST *DrtmRl; ACPI_DRTM_DPS_ID *DrtmDps; UINT32 Count; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoDrtm); if (ACPI_FAILURE (Status)) { return; } Offset = sizeof (ACPI_TABLE_DRTM); /* Sub-tables */ /* Dump ValidatedTable length */ DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset); AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables), AcpiDmTableInfoDrtm0); if (ACPI_FAILURE (Status)) { return; } Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables); /* Dump Validated table addresses */ Count = 0; while ((Offset < Table->Length) && (DrtmVtl->ValidatedTableCount > Count)) { Status = AcpiDmDumpTable (Table->Length, Offset, ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64), AcpiDmTableInfoDrtm0a); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (UINT64); Count++; } /* Dump ResourceList length */ DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset); AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources), AcpiDmTableInfoDrtm1); if (ACPI_FAILURE (Status)) { return; } Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); /* Dump the Resource List */ Count = 0; while ((Offset < Table->Length) && (DrtmRl->ResourceCount > Count)) { Status = AcpiDmDumpTable (Table->Length, Offset, ACPI_ADD_PTR (void, Table, Offset), sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_DRTM_RESOURCE); Count++; } /* Dump DPS */ DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); AcpiOsPrintf ("\n"); (void) AcpiDmDumpTable (Table->Length, Offset, DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); } /******************************************************************************* * * FUNCTION: AcpiDmDumpEinj * * PARAMETERS: Table - A EINJ table * * RETURN: None * * DESCRIPTION: Format the contents of a EINJ. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_EINJ); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpErst * * PARAMETERS: Table - A ERST table * * RETURN: None * * DESCRIPTION: Format the contents of a ERST. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpErst ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_ERST); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpFpdt * * PARAMETERS: Table - A FPDT table * * RETURN: None * * DESCRIPTION: Format the contents of a FPDT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpFpdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_FPDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_FPDT); ACPI_DMTABLE_INFO *InfoTable; /* There is no main table (other than the standard ACPI header) */ /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoFpdtHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_FPDT_TYPE_BOOT: InfoTable = AcpiDmTableInfoFpdt0; break; case ACPI_FPDT_TYPE_S3PERF: InfoTable = AcpiDmTableInfoFpdt1; break; default: AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", Subtable->Type); /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } goto NextSubtable; } Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpGtdt * * PARAMETERS: Table - A GTDT table * * RETURN: None * * DESCRIPTION: Format the contents of a GTDT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpGtdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_GTDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_GTDT); ACPI_DMTABLE_INFO *InfoTable; UINT32 SubtableLength; UINT32 GtCount; ACPI_GTDT_TIMER_ENTRY *GtxTable; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt); if (ACPI_FAILURE (Status)) { return; } /* Rev 3 fields */ Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); if (Table->Revision > 2) { SubtableLength = sizeof (ACPI_GTDT_EL2); Status = AcpiDmDumpTable (Length, Offset, Subtable, SubtableLength, AcpiDmTableInfoGtdtEl2); if (ACPI_FAILURE (Status)) { return; } Offset += SubtableLength; } Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); /* Subtables */ while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoGtdtHdr); if (ACPI_FAILURE (Status)) { return; } GtCount = 0; switch (Subtable->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, Subtable))->TimerCount; InfoTable = AcpiDmTableInfoGtdt0; break; case ACPI_GTDT_TYPE_WATCHDOG: SubtableLength = sizeof (ACPI_GTDT_WATCHDOG); InfoTable = AcpiDmTableInfoGtdt1; break; default: /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", Subtable->Type); return; } Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Point to end of current subtable (each subtable above is of fixed length) */ Offset += SubtableLength; /* If there are any Gt Timer Blocks from above, dump them now */ if (GtCount) { GtxTable = ACPI_ADD_PTR ( ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength); SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); while (GtCount) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, GtxTable, sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_GTDT_TIMER_ENTRY); GtxTable++; GtCount--; } } /* Point to next subtable */ Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpHest * * PARAMETERS: Table - A HEST table * * RETURN: None * * DESCRIPTION: Format the contents of a HEST. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_HEST_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_HEST); ACPI_DMTABLE_INFO *InfoTable; UINT32 SubtableLength; UINT32 BankCount; ACPI_HEST_IA_ERROR_BANK *BankTable; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); while (Offset < Table->Length) { BankCount = 0; switch (Subtable->Type) { case ACPI_HEST_TYPE_IA32_CHECK: InfoTable = AcpiDmTableInfoHest0; SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, Subtable))->NumHardwareBanks; break; case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: InfoTable = AcpiDmTableInfoHest1; SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED); BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, Subtable))->NumHardwareBanks; break; case ACPI_HEST_TYPE_IA32_NMI: InfoTable = AcpiDmTableInfoHest2; SubtableLength = sizeof (ACPI_HEST_IA_NMI); break; case ACPI_HEST_TYPE_AER_ROOT_PORT: InfoTable = AcpiDmTableInfoHest6; SubtableLength = sizeof (ACPI_HEST_AER_ROOT); break; case ACPI_HEST_TYPE_AER_ENDPOINT: InfoTable = AcpiDmTableInfoHest7; SubtableLength = sizeof (ACPI_HEST_AER); break; case ACPI_HEST_TYPE_AER_BRIDGE: InfoTable = AcpiDmTableInfoHest8; SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE); break; case ACPI_HEST_TYPE_GENERIC_ERROR: InfoTable = AcpiDmTableInfoHest9; SubtableLength = sizeof (ACPI_HEST_GENERIC); break; case ACPI_HEST_TYPE_GENERIC_ERROR_V2: InfoTable = AcpiDmTableInfoHest10; SubtableLength = sizeof (ACPI_HEST_GENERIC_V2); break; case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: InfoTable = AcpiDmTableInfoHest11; SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK); BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK, Subtable))->NumHardwareBanks; break; default: /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", Subtable->Type); return; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, SubtableLength, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Point to end of current subtable (each subtable above is of fixed length) */ Offset += SubtableLength; /* If there are any (fixed-length) Error Banks from above, dump them now */ if (BankCount) { BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable, SubtableLength); SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK); while (BankCount) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, BankTable, sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_HEST_IA_ERROR_BANK); BankTable++; BankCount--; } } /* Point to next subtable */ Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpHmat * * PARAMETERS: Table - A HMAT table * * RETURN: None * * DESCRIPTION: Format the contents of a HMAT. * ******************************************************************************/ void AcpiDmDumpHmat ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_HMAT_STRUCTURE *HmatStruct; ACPI_HMAT_LOCALITY *HmatLocality; ACPI_HMAT_CACHE *HmatCache; UINT32 Offset; UINT32 SubtableOffset; UINT32 Length; ACPI_DMTABLE_INFO *InfoTable; UINT32 i, j; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat); if (ACPI_FAILURE (Status)) { return; } Offset = sizeof (ACPI_TABLE_HMAT); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); /* Dump HMAT structure header */ HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset); if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE)) { AcpiOsPrintf ("Invalid HMAT structure length\n"); return; } Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct, HmatStruct->Length, AcpiDmTableInfoHmatHdr); if (ACPI_FAILURE (Status)) { return; } switch (HmatStruct->Type) { case ACPI_HMAT_TYPE_ADDRESS_RANGE: InfoTable = AcpiDmTableInfoHmat0; Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN); break; case ACPI_HMAT_TYPE_LOCALITY: InfoTable = AcpiDmTableInfoHmat1; Length = sizeof (ACPI_HMAT_LOCALITY); break; case ACPI_HMAT_TYPE_CACHE: InfoTable = AcpiDmTableInfoHmat2; Length = sizeof (ACPI_HMAT_CACHE); break; default: AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n", HmatStruct->Type); /* Attempt to continue */ goto NextSubtable; } /* Dump HMAT structure body */ if (HmatStruct->Length < Length) { AcpiOsPrintf ("Invalid HMAT structure length\n"); return; } Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct, HmatStruct->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Dump HMAT structure additionals */ switch (HmatStruct->Type) { case ACPI_HMAT_TYPE_LOCALITY: HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct); SubtableOffset = sizeof (ACPI_HMAT_LOCALITY); /* Dump initiator proximity domains */ if ((UINT32)(HmatStruct->Length - SubtableOffset) < (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4)) { AcpiOsPrintf ("Invalid initiator proximity domain number\n"); return; } for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset), 4, AcpiDmTableInfoHmat1a); if (ACPI_FAILURE (Status)) { return; } SubtableOffset += 4; } /* Dump target proximity domains */ if ((UINT32)(HmatStruct->Length - SubtableOffset) < (UINT32)(HmatLocality->NumberOfTargetPDs * 4)) { AcpiOsPrintf ("Invalid target proximity domain number\n"); return; } for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset), 4, AcpiDmTableInfoHmat1b); if (ACPI_FAILURE (Status)) { return; } SubtableOffset += 4; } /* Dump latency/bandwidth entris */ if ((UINT32)(HmatStruct->Length - SubtableOffset) < (UINT32)(HmatLocality->NumberOfInitiatorPDs * HmatLocality->NumberOfTargetPDs * 2)) { AcpiOsPrintf ("Invalid latency/bandwidth entry number\n"); return; } for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++) { for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++) { Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset), 2, AcpiDmTableInfoHmat1c); if (ACPI_FAILURE(Status)) { return; } SubtableOffset += 2; } } break; case ACPI_HMAT_TYPE_CACHE: HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct); SubtableOffset = sizeof (ACPI_HMAT_CACHE); /* Dump SMBIOS handles */ if ((UINT32)(HmatStruct->Length - SubtableOffset) < (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2)) { AcpiOsPrintf ("Invalid SMBIOS handle number\n"); return; } for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset), 2, AcpiDmTableInfoHmat2a); if (ACPI_FAILURE (Status)) { return; } SubtableOffset += 2; } break; default: break; } NextSubtable: /* Point to next HMAT structure subtable */ Offset += (HmatStruct->Length); } } diff --git a/sys/contrib/dev/acpica/common/dmtbdump2.c b/sys/contrib/dev/acpica/common/dmtbdump2.c index 8371b8748977..aff5453efdda 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump2.c +++ b/sys/contrib/dev/acpica/common/dmtbdump2.c @@ -1,2872 +1,2938 @@ /****************************************************************************** * * Module Name: dmtbdump2 - Dump ACPI data tables that contain no AML code * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ +#include #include #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbdump2") /******************************************************************************* * * FUNCTION: AcpiDmDumpIort * * PARAMETERS: Table - A IORT table * * RETURN: None * * DESCRIPTION: Format the contents of a IORT * ******************************************************************************/ void AcpiDmDumpIort ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_TABLE_IORT *Iort; ACPI_IORT_NODE *IortNode; ACPI_IORT_ITS_GROUP *IortItsGroup = NULL; ACPI_IORT_SMMU *IortSmmu = NULL; ACPI_IORT_RMR *IortRmr = NULL; UINT32 Offset; UINT32 NodeOffset; UINT32 Length; ACPI_DMTABLE_INFO *InfoTable; char *String; UINT32 i; UINT32 MappingByteLength; UINT8 Revision; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort); if (ACPI_FAILURE (Status)) { return; } Revision = Table->Revision; /* IORT Revisions E, E.a and E.c have known issues and are not supported */ if (Revision == 1 || Revision == 2 || Revision == 4) { AcpiOsPrintf ("\n**** Unsupported IORT revision 0x%X\n", Revision); return; } Iort = ACPI_CAST_PTR (ACPI_TABLE_IORT, Table); Offset = sizeof (ACPI_TABLE_IORT); /* Dump the OptionalPadding (optional) */ if (Iort->NodeOffset > Offset) { Status = AcpiDmDumpTable (Table->Length, Offset, Table, Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad); if (ACPI_FAILURE (Status)) { return; } } Offset = Iort->NodeOffset; while (Offset < Table->Length) { /* Common subtable header */ IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset); AcpiOsPrintf ("\n"); Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData); if (Revision == 0) { Status = AcpiDmDumpTable (Table->Length, Offset, IortNode, Length, AcpiDmTableInfoIortHdr); } else if (Revision >= 3) { Status = AcpiDmDumpTable (Table->Length, Offset, IortNode, Length, AcpiDmTableInfoIortHdr3); } if (ACPI_FAILURE (Status)) { return; } NodeOffset = Length; switch (IortNode->Type) { case ACPI_IORT_NODE_ITS_GROUP: InfoTable = AcpiDmTableInfoIort0; Length = ACPI_OFFSET (ACPI_IORT_ITS_GROUP, Identifiers); IortItsGroup = ACPI_ADD_PTR (ACPI_IORT_ITS_GROUP, IortNode, NodeOffset); break; case ACPI_IORT_NODE_NAMED_COMPONENT: InfoTable = AcpiDmTableInfoIort1; Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); Length += strlen (String) + 1; break; case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: InfoTable = AcpiDmTableInfoIort2; Length = IortNode->Length - NodeOffset; break; case ACPI_IORT_NODE_SMMU: InfoTable = AcpiDmTableInfoIort3; Length = ACPI_OFFSET (ACPI_IORT_SMMU, Interrupts); IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset); break; case ACPI_IORT_NODE_SMMU_V3: InfoTable = AcpiDmTableInfoIort4; Length = IortNode->Length - NodeOffset; break; case ACPI_IORT_NODE_PMCG: InfoTable = AcpiDmTableInfoIort5; Length = IortNode->Length - NodeOffset; break; case ACPI_IORT_NODE_RMR: InfoTable = AcpiDmTableInfoIort6; Length = IortNode->Length - NodeOffset; IortRmr = ACPI_ADD_PTR (ACPI_IORT_RMR, IortNode, NodeOffset); break; default: AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n", IortNode->Type); /* Attempt to continue */ if (!IortNode->Length) { AcpiOsPrintf ("Invalid zero length IORT node\n"); return; } goto NextSubtable; } /* Dump the node subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } NodeOffset += Length; /* Dump the node specific data */ switch (IortNode->Type) { case ACPI_IORT_NODE_ITS_GROUP: /* Validate IortItsGroup to avoid compiler warnings */ if (IortItsGroup) { for (i = 0; i < IortItsGroup->ItsCount; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 4, AcpiDmTableInfoIort0a); if (ACPI_FAILURE (Status)) { return; } NodeOffset += 4; } } break; case ACPI_IORT_NODE_NAMED_COMPONENT: /* Dump the Padding (optional) */ if (IortNode->Length > NodeOffset) { MappingByteLength = IortNode->MappingCount * sizeof (ACPI_IORT_ID_MAPPING); Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, Table, IortNode->Length - NodeOffset - MappingByteLength, AcpiDmTableInfoIort1a); if (ACPI_FAILURE (Status)) { return; } } break; case ACPI_IORT_NODE_SMMU: AcpiOsPrintf ("\n"); /* Validate IortSmmu to avoid compiler warnings */ if (IortSmmu) { Length = 2 * sizeof (UINT64); NodeOffset = IortSmmu->GlobalInterruptOffset; Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, AcpiDmTableInfoIort3a); if (ACPI_FAILURE (Status)) { return; } NodeOffset = IortSmmu->ContextInterruptOffset; for (i = 0; i < IortSmmu->ContextInterruptCount; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 8, AcpiDmTableInfoIort3b); if (ACPI_FAILURE (Status)) { return; } NodeOffset += 8; } NodeOffset = IortSmmu->PmuInterruptOffset; for (i = 0; i < IortSmmu->PmuInterruptCount; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 8, AcpiDmTableInfoIort3c); if (ACPI_FAILURE (Status)) { return; } NodeOffset += 8; } } break; case ACPI_IORT_NODE_RMR: /* Validate IortRmr to avoid compiler warnings */ if (IortRmr) { NodeOffset = IortRmr->RmrOffset; Length = sizeof (ACPI_IORT_RMR_DESC); for (i = 0; i < IortRmr->RmrCount; i++) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, AcpiDmTableInfoIort6a); if (ACPI_FAILURE (Status)) { return; } NodeOffset += Length; } } break; default: break; } /* Dump the ID mappings */ NodeOffset = IortNode->MappingOffset; for (i = 0; i < IortNode->MappingCount; i++) { AcpiOsPrintf ("\n"); Length = sizeof (ACPI_IORT_ID_MAPPING); Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), Length, AcpiDmTableInfoIortMap); if (ACPI_FAILURE (Status)) { return; } NodeOffset += Length; } NextSubtable: /* Point to next node subtable */ Offset += IortNode->Length; } } /******************************************************************************* * * FUNCTION: AcpiDmDumpIvrs * * PARAMETERS: Table - A IVRS table * * RETURN: None * * DESCRIPTION: Format the contents of a IVRS. Notes: * The IVRS is essentially a flat table, with the following * structure: *
*
* * * ... * * * * ... * ******************************************************************************/ void AcpiDmDumpIvrs ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_IVRS); UINT32 EntryOffset; UINT32 EntryLength; UINT32 EntryType; ACPI_IVRS_DEVICE_HID *HidSubtable; ACPI_IVRS_DE_HEADER *DeviceEntry; ACPI_IVRS_HEADER *Subtable; ACPI_DMTABLE_INFO *InfoTable; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); while (Offset < Table->Length) { switch (Subtable->Type) { /* Type 10h, IVHD (I/O Virtualization Hardware Definition) */ case ACPI_IVRS_TYPE_HARDWARE1: AcpiOsPrintf ("\n"); InfoTable = AcpiDmTableInfoIvrsHware1; break; /* Types 11h, 40h, IVHD (I/O Virtualization Hardware Definition) */ case ACPI_IVRS_TYPE_HARDWARE2: case ACPI_IVRS_TYPE_HARDWARE3: AcpiOsPrintf ("\n"); InfoTable = AcpiDmTableInfoIvrsHware23; break; /* Types 20h-22h, IVMD (I/O Virtualization Memory Definition Block) */ case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: AcpiOsPrintf ("\n"); InfoTable = AcpiDmTableInfoIvrsMemory; break; default: AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n", Subtable->Type); /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } goto NextSubtable; } /* Dump the subtable */ Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* The hardware subtables (IVHD) can contain multiple device entries */ if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1 || Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2 || Subtable->Type == ACPI_IVRS_TYPE_HARDWARE3) { if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1) { EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE1); DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable, sizeof (ACPI_IVRS_HARDWARE1)); } else { /* ACPI_IVRS_TYPE_HARDWARE2, HARDWARE3 subtable types */ EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE2); DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable, sizeof (ACPI_IVRS_HARDWARE2)); } /* Process all of the Device Entries */ while (EntryOffset < (Offset + Subtable->Length)) { AcpiOsPrintf ("\n"); /* * Upper 2 bits of Type encode the length of the device entry * * 00 = 4 byte * 01 = 8 byte * 1x = variable length */ EntryType = DeviceEntry->Type; EntryLength = EntryType >> 6 == 1 ? 8 : 4; switch (EntryType) { /* 4-byte device entries */ case ACPI_IVRS_TYPE_PAD4: case ACPI_IVRS_TYPE_ALL: case ACPI_IVRS_TYPE_SELECT: case ACPI_IVRS_TYPE_START: case ACPI_IVRS_TYPE_END: InfoTable = AcpiDmTableInfoIvrs4; break; /* 8-byte entries, type A */ case ACPI_IVRS_TYPE_ALIAS_SELECT: case ACPI_IVRS_TYPE_ALIAS_START: InfoTable = AcpiDmTableInfoIvrs8a; break; /* 8-byte entries, type B */ case ACPI_IVRS_TYPE_PAD8: case ACPI_IVRS_TYPE_EXT_SELECT: case ACPI_IVRS_TYPE_EXT_START: InfoTable = AcpiDmTableInfoIvrs8b; break; /* 8-byte entries, type C */ case ACPI_IVRS_TYPE_SPECIAL: InfoTable = AcpiDmTableInfoIvrs8c; break; /* Variable-length entries */ case ACPI_IVRS_TYPE_HID: EntryLength = 4; InfoTable = AcpiDmTableInfoIvrsHid; break; default: InfoTable = AcpiDmTableInfoIvrs4; AcpiOsPrintf ( "\n**** Unknown IVRS device entry type/length: " "0x%.2X/0x%X at offset 0x%.4X: (header below)\n", EntryType, EntryLength, EntryOffset); break; } /* Dump the Device Entry */ Status = AcpiDmDumpTable (Table->Length, EntryOffset, DeviceEntry, EntryLength, InfoTable); if (ACPI_FAILURE (Status)) { return; } HidSubtable = ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, DeviceEntry); EntryOffset += EntryLength; DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, HidSubtable, EntryLength); if (EntryType == ACPI_IVRS_TYPE_HID) { /* * Determine if the HID is an integer or a string. * An integer is defined to be 32 bits, with the upper 32 bits * set to zero. (from the ACPI Spec): "The HID can be a 32-bit * integer or a character string. If an integer, the lower * 4 bytes of the field contain the integer and the upper * 4 bytes are padded with 0". */ if (UtIsIdInteger ((UINT8 *) &HidSubtable->AcpiHid)) { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->AcpiHid, 8, AcpiDmTableInfoIvrsHidInteger); } else { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->AcpiHid, 8, AcpiDmTableInfoIvrsHidString); } if (ACPI_FAILURE (Status)) { return; } EntryOffset += 8; /* * Determine if the CID is an integer or a string. The format * of the CID is the same as the HID above. From ACPI Spec: * "If present, CID must be a single Compatible Device ID * following the same format as the HID field." */ if (UtIsIdInteger ((UINT8 *) &HidSubtable->AcpiCid)) { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->AcpiCid, 8, AcpiDmTableInfoIvrsCidInteger); } else { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->AcpiCid, 8, AcpiDmTableInfoIvrsCidString); } if (ACPI_FAILURE (Status)) { return; } EntryOffset += 8; EntryLength = HidSubtable->UidLength; if (EntryLength > ACPI_IVRS_UID_NOT_PRESENT) { /* Dump the UID based upon the UidType field (String or Integer) */ if (HidSubtable->UidType == ACPI_IVRS_UID_IS_STRING) { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->UidType, EntryLength, AcpiDmTableInfoIvrsUidString); if (ACPI_FAILURE (Status)) { return; } } else /* ACPI_IVRS_UID_IS_INTEGER */ { Status = AcpiDmDumpTable (Table->Length, EntryOffset, &HidSubtable->UidType, EntryLength, AcpiDmTableInfoIvrsUidInteger); if (ACPI_FAILURE (Status)) { return; } } } EntryOffset += EntryLength+2; DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Table, EntryOffset); } } } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpLpit * * PARAMETERS: Table - A LPIT table * * RETURN: None * * DESCRIPTION: Format the contents of a LPIT. This table type consists * of an open-ended number of subtables. Note: There are no * entries in the main table. An LPIT consists of the table * header and then subtables only. * ******************************************************************************/ void AcpiDmDumpLpit ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_LPIT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_LPIT); ACPI_DMTABLE_INFO *InfoTable; UINT32 SubtableLength; /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_LPIT_TYPE_NATIVE_CSTATE: InfoTable = AcpiDmTableInfoLpit0; SubtableLength = sizeof (ACPI_LPIT_NATIVE); break; default: /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", Subtable->Type); return; } Status = AcpiDmDumpTable (Length, Offset, Subtable, SubtableLength, InfoTable); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("\n"); /* Point to next subtable */ Offset += SubtableLength; Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Subtable, SubtableLength); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpMadt * * PARAMETERS: Table - A MADT table * * RETURN: None * * DESCRIPTION: Format the contents of a MADT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpMadt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_SUBTABLE_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_MADT); ACPI_DMTABLE_INFO *InfoTable; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); DbgPrint (ASL_PARSE_OUTPUT, "//0B) Offset %X, from table start: 0x%8.8X%8.8X\n", Offset, ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table))); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoMadtHdr); if (ACPI_FAILURE (Status)) { return; } DbgPrint (ASL_PARSE_OUTPUT, "subtableType: %X\n", Subtable->Type); switch (Subtable->Type) { case ACPI_MADT_TYPE_LOCAL_APIC: InfoTable = AcpiDmTableInfoMadt0; break; case ACPI_MADT_TYPE_IO_APIC: InfoTable = AcpiDmTableInfoMadt1; break; case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: InfoTable = AcpiDmTableInfoMadt2; break; case ACPI_MADT_TYPE_NMI_SOURCE: InfoTable = AcpiDmTableInfoMadt3; break; case ACPI_MADT_TYPE_LOCAL_APIC_NMI: InfoTable = AcpiDmTableInfoMadt4; break; case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: InfoTable = AcpiDmTableInfoMadt5; break; case ACPI_MADT_TYPE_IO_SAPIC: InfoTable = AcpiDmTableInfoMadt6; break; case ACPI_MADT_TYPE_LOCAL_SAPIC: InfoTable = AcpiDmTableInfoMadt7; break; case ACPI_MADT_TYPE_INTERRUPT_SOURCE: InfoTable = AcpiDmTableInfoMadt8; break; case ACPI_MADT_TYPE_LOCAL_X2APIC: InfoTable = AcpiDmTableInfoMadt9; break; case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: InfoTable = AcpiDmTableInfoMadt10; break; case ACPI_MADT_TYPE_GENERIC_INTERRUPT: InfoTable = AcpiDmTableInfoMadt11; break; case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: InfoTable = AcpiDmTableInfoMadt12; break; case ACPI_MADT_TYPE_GENERIC_MSI_FRAME: InfoTable = AcpiDmTableInfoMadt13; break; case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: InfoTable = AcpiDmTableInfoMadt14; break; case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: InfoTable = AcpiDmTableInfoMadt15; break; case ACPI_MADT_TYPE_MULTIPROC_WAKEUP: InfoTable = AcpiDmTableInfoMadt16; break; default: if ((Subtable->Type >= ACPI_MADT_TYPE_RESERVED) && (Subtable->Type < ACPI_MADT_TYPE_OEM_RESERVED)) { AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", Subtable->Type); goto NextSubtable; } else if (Subtable->Type >= ACPI_MADT_TYPE_OEM_RESERVED) { DbgPrint (ASL_PARSE_OUTPUT, "//[Found an OEM structure, type = %0x]\n", Subtable->Type); Offset += sizeof (ACPI_SUBTABLE_HEADER); DbgPrint (ASL_PARSE_OUTPUT, "//[0) Subtable->Length = %X, Subtable = %p, Offset = %X]\n", Subtable->Length, Subtable, Offset); DbgPrint (ASL_PARSE_OUTPUT, "//[0A) Offset from table start: 0x%8.8X%8.8X]\n", ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table))); } /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } /* Dump the OEM data */ Status = AcpiDmDumpTable (Length, Offset, ACPI_CAST_PTR (UINT8, Table) + Offset, Subtable->Length - sizeof (ACPI_SUBTABLE_HEADER), AcpiDmTableInfoMadt17); if (ACPI_FAILURE (Status)) { return; } DbgPrint (ASL_PARSE_OUTPUT, "//[1) Subtable->Length = %X, Offset = %X]\n", Subtable->Length, Offset); Offset -= sizeof (ACPI_SUBTABLE_HEADER); goto NextSubtable; } DbgPrint (ASL_PARSE_OUTPUT, "//[2) Subtable->Length = %X, Offset = %X]\n", Subtable->Length, Offset); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } NextSubtable: /* Point to next subtable */ DbgPrint (ASL_PARSE_OUTPUT, "//[3) Subtable->Length = %X, Offset = %X]\n", Subtable->Length, Offset); DbgPrint (ASL_PARSE_OUTPUT, "//[4) Offset from table start: 0x%8.8X%8.8X (%p) %p]\n", ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (UINT8, Subtable) - ACPI_CAST_PTR (UINT8, Table)), Subtable, Table); if (Offset > Table->Length) { return; } Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, Subtable->Length); DbgPrint (ASL_PARSE_OUTPUT, "//[5) Next Subtable %p, length %X]\n", Subtable, Subtable->Length); DbgPrint (ASL_PARSE_OUTPUT, "//[5B) Offset from table start: 0x%8.8X%8.8X (%p)]\n", ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table)), Subtable); Offset = ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table); if (Offset >= Table->Length) { return; } } } /******************************************************************************* * * FUNCTION: AcpiDmDumpMcfg * * PARAMETERS: Table - A MCFG Table * * RETURN: None * * DESCRIPTION: Format the contents of a MCFG table * ******************************************************************************/ void AcpiDmDumpMcfg ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_MCFG); ACPI_MCFG_ALLOCATION *Subtable; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset); while (Offset < Table->Length) { if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length) { AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n", (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); return; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_MCFG_ALLOCATION); Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Subtable, sizeof (ACPI_MCFG_ALLOCATION)); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpMpst * * PARAMETERS: Table - A MPST Table * * RETURN: None * * DESCRIPTION: Format the contents of a MPST table * ******************************************************************************/ void AcpiDmDumpMpst ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_MPST); ACPI_MPST_POWER_NODE *Subtable0; ACPI_MPST_POWER_STATE *Subtable0A; ACPI_MPST_COMPONENT *Subtable0B; ACPI_MPST_DATA_HDR *Subtable1; ACPI_MPST_POWER_DATA *Subtable2; UINT16 SubtableCount; UINT32 PowerStateCount; UINT32 ComponentCount; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst); if (ACPI_FAILURE (Status)) { return; } /* Subtable: Memory Power Node(s) */ SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount; Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset); while ((Offset < Table->Length) && SubtableCount) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0, sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0); if (ACPI_FAILURE (Status)) { return; } /* Extract the sub-subtable counts */ PowerStateCount = Subtable0->NumPowerStates; ComponentCount = Subtable0->NumPhysicalComponents; Offset += sizeof (ACPI_MPST_POWER_NODE); /* Sub-subtables - Memory Power State Structure(s) */ Subtable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, Subtable0, sizeof (ACPI_MPST_POWER_NODE)); while (PowerStateCount) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0A, sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A); if (ACPI_FAILURE (Status)) { return; } Subtable0A++; PowerStateCount--; Offset += sizeof (ACPI_MPST_POWER_STATE); } /* Sub-subtables - Physical Component ID Structure(s) */ Subtable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, Subtable0A); if (ComponentCount) { AcpiOsPrintf ("\n"); } while (ComponentCount) { Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0B, sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B); if (ACPI_FAILURE (Status)) { return; } Subtable0B++; ComponentCount--; Offset += sizeof (ACPI_MPST_COMPONENT); } /* Point to next Memory Power Node subtable */ SubtableCount--; Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Subtable0, sizeof (ACPI_MPST_POWER_NODE) + (sizeof (ACPI_MPST_POWER_STATE) * Subtable0->NumPowerStates) + (sizeof (ACPI_MPST_COMPONENT) * Subtable0->NumPhysicalComponents)); } /* Subtable: Count of Memory Power State Characteristic structures */ AcpiOsPrintf ("\n"); Subtable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable0); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable1, sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1); if (ACPI_FAILURE (Status)) { return; } SubtableCount = Subtable1->CharacteristicsCount; Offset += sizeof (ACPI_MPST_DATA_HDR); /* Subtable: Memory Power State Characteristics structure(s) */ Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1, sizeof (ACPI_MPST_DATA_HDR)); while ((Offset < Table->Length) && SubtableCount) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable2, sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2); if (ACPI_FAILURE (Status)) { return; } Subtable2++; SubtableCount--; Offset += sizeof (ACPI_MPST_POWER_DATA); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpMsct * * PARAMETERS: Table - A MSCT table * * RETURN: None * * DESCRIPTION: Format the contents of a MSCT * ******************************************************************************/ void AcpiDmDumpMsct ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_MSCT); ACPI_MSCT_PROXIMITY *Subtable; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable */ Offset += sizeof (ACPI_MSCT_PROXIMITY); Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Subtable, sizeof (ACPI_MSCT_PROXIMITY)); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpNfit * * PARAMETERS: Table - A NFIT table * * RETURN: None * * DESCRIPTION: Format the contents of an NFIT. * ******************************************************************************/ void AcpiDmDumpNfit ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_NFIT); UINT32 FieldOffset = 0; UINT32 Length; ACPI_NFIT_HEADER *Subtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_NFIT_INTERLEAVE *Interleave = NULL; ACPI_NFIT_SMBIOS *SmbiosInfo = NULL; ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL; UINT32 i; /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset); while (Offset < Table->Length) { /* NFIT subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoNfitHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: InfoTable = AcpiDmTableInfoNfit0; break; case ACPI_NFIT_TYPE_MEMORY_MAP: InfoTable = AcpiDmTableInfoNfit1; break; case ACPI_NFIT_TYPE_INTERLEAVE: /* Has a variable number of 32-bit values at the end */ InfoTable = AcpiDmTableInfoNfit2; FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE); break; case ACPI_NFIT_TYPE_SMBIOS: SmbiosInfo = ACPI_CAST_PTR (ACPI_NFIT_SMBIOS, Subtable); InfoTable = AcpiDmTableInfoNfit3; break; case ACPI_NFIT_TYPE_CONTROL_REGION: InfoTable = AcpiDmTableInfoNfit4; break; case ACPI_NFIT_TYPE_DATA_REGION: InfoTable = AcpiDmTableInfoNfit5; break; case ACPI_NFIT_TYPE_FLUSH_ADDRESS: /* Has a variable number of 64-bit addresses at the end */ InfoTable = AcpiDmTableInfoNfit6; FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); break; case ACPI_NFIT_TYPE_CAPABILITIES: /* ACPI 6.0A */ InfoTable = AcpiDmTableInfoNfit7; break; default: AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", Subtable->Type); /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } goto NextSubtable; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Per-subtable variable-length fields */ switch (Subtable->Type) { case ACPI_NFIT_TYPE_INTERLEAVE: Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable); for (i = 0; i < Interleave->LineCount; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, &Interleave->LineOffset[i], sizeof (UINT32), AcpiDmTableInfoNfit2a); if (ACPI_FAILURE (Status)) { return; } FieldOffset += sizeof (UINT32); } break; case ACPI_NFIT_TYPE_SMBIOS: Length = Subtable->Length - sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8); if (Length) { Status = AcpiDmDumpTable (Table->Length, sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8), SmbiosInfo, Length, AcpiDmTableInfoNfit3a); if (ACPI_FAILURE (Status)) { return; } } break; case ACPI_NFIT_TYPE_FLUSH_ADDRESS: Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable); for (i = 0; i < Hint->HintCount; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, &Hint->HintAddress[i], sizeof (UINT64), AcpiDmTableInfoNfit6a); if (ACPI_FAILURE (Status)) { return; } FieldOffset += sizeof (UINT64); } break; default: break; } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpNhlt * * PARAMETERS: Table - A NHLT table * * RETURN: None * * DESCRIPTION: Format the contents of an NHLT. * ******************************************************************************/ void AcpiDmDumpNhlt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; UINT32 Offset; UINT32 TableLength = Table->Length; UINT32 EndpointCount; UINT8 FormatsCount; ACPI_NHLT_ENDPOINT *Subtable; ACPI_NHLT_FORMAT_CONFIG *FormatSubtable; ACPI_TABLE_NHLT *InfoTable; UINT32 CapabilitiesSize; UINT32 i; UINT32 j; UINT32 EndpointEndOffset; UINT8 ConfigType = 0; UINT8 ArrayType; UINT8 MicrophoneCount; ACPI_NHLT_VENDOR_MIC_COUNT *MicCount; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A *DevSpecific; ACPI_NHLT_FORMATS_CONFIG *FormatsConfig; ACPI_NHLT_DEVICE_INFO_COUNT *Count; ACPI_NHLT_DEVICE_INFO *DeviceInfo; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B *Capabilities; /* Main table */ AcpiOsPrintf (" /* Main table */\n"); Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoNhlt); if (ACPI_FAILURE (Status)) { return; } /* Get the Endpoint Descriptor Count */ InfoTable = ACPI_ADD_PTR (ACPI_TABLE_NHLT, Table, 0); EndpointCount = InfoTable->EndpointCount; /* Subtables */ Offset = sizeof (ACPI_TABLE_NHLT); while (Offset < TableLength) { /* A variable number of Endpoint Descriptors - process each */ for (i = 0; i < EndpointCount; i++) { /* Do the Endpoint Descriptor table */ Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); /* Check for endpoint descriptor length beyond end-of-table */ if (Subtable->DescriptorLength > TableLength) { Offset += 1; AcpiOsPrintf ("\n /* Endpoint Descriptor Length larger than" " table size: %X, table %X, adjusting table offset (+1) */\n", Subtable->DescriptorLength, TableLength); Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); } AcpiOsPrintf ("\n /* Endpoint Descriptor #%u */\n", i+1); Status = AcpiDmDumpTable (TableLength, Offset, Subtable, Subtable->DescriptorLength, AcpiDmTableInfoNhlt0); if (ACPI_FAILURE (Status)) { return; } EndpointEndOffset = Subtable->DescriptorLength + Offset; /* Check for endpoint descriptor beyond end-of-table */ if (Subtable->DescriptorLength > TableLength) { AcpiOsPrintf ("\n /* Endpoint Descriptor Length larger than table size: %X, table %X */\n", Subtable->DescriptorLength, TableLength); } Offset += sizeof (ACPI_NHLT_ENDPOINT); Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); /* Do the Device Specific table */ AcpiOsPrintf ("\n /* Endpoint Device_Specific_Config table */\n"); DevSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Subtable); CapabilitiesSize = DevSpecific->CapabilitiesSize; Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B), AcpiDmTableInfoNhlt5b); if (ACPI_FAILURE (Status)) { return; } ArrayType = 0; /* Different subtables based upon capabilities_size */ switch (CapabilitiesSize) { case 0: Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); break; case 1: Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C), AcpiDmTableInfoNhlt5c); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C); break; case 2: Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG), AcpiDmTableInfoNhlt5); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG); break; case 3: default: /* Extract the ConfigType and ArrayType */ ConfigType = DevSpecific->ConfigType; ArrayType = DevSpecific->ArrayType; Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A), AcpiDmTableInfoNhlt5a); if (ACPI_FAILURE (Status)) { return; } /* Capabilities Size == 3 */ Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A); break; case 7: ConfigType = DevSpecific->ConfigType; Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); DevSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Subtable); AcpiOsPrintf ("\n /* Render Feedback Device-Specific table */\n"); Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG), AcpiDmTableInfoNhlt5); if (ACPI_FAILURE (Status)) { return; } /* Capabilities Size = 7 */ Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG); if (ConfigType == ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK) { Subtable = ACPI_ADD_PTR (ACPI_NHLT_ENDPOINT, Table, Offset); DevSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Subtable); Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_RENDER_FEEDBACK_DEVICE_SPECIFIC_CONFIG), AcpiDmTableInfoNhlt6b); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_RENDER_FEEDBACK_DEVICE_SPECIFIC_CONFIG); } break; } /* Check for a vendor-defined mic array */ if (ConfigType == ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY) { if ((ArrayType & ACPI_NHLT_ARRAY_TYPE_MASK) == ACPI_NHLT_VENDOR_DEFINED) { /* Vendor-defined microphone array; get the microphone count first */ AcpiOsPrintf ("\n /* Vendor-defined microphone count */\n"); MicCount = ACPI_ADD_PTR (ACPI_NHLT_VENDOR_MIC_COUNT, Table, Offset); MicrophoneCount = MicCount->MicrophoneCount; Status = AcpiDmDumpTable (TableLength, Offset, MicCount, sizeof (ACPI_NHLT_VENDOR_MIC_COUNT), AcpiDmTableInfoNhlt6a); Offset += sizeof (ACPI_NHLT_VENDOR_MIC_COUNT); if (ACPI_FAILURE (Status)) { return; } /* Get the vendor microphone config structure(s) */ for (j = 0; j < MicrophoneCount; j++) { AcpiOsPrintf ("\n /* Vendor-defined microphone array #%u*/\n", j+1); DevSpecific = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Table, Offset); Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_VENDOR_MIC_CONFIG), AcpiDmTableInfoNhlt6); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_VENDOR_MIC_CONFIG); } /* Check for Microphone SNR and sensitivity extension */ if ((ArrayType & ACPI_NHLT_ARRAY_TYPE_EXT_MASK) == ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT) { AcpiOsPrintf ("\n /* Microphone SNR and sensitivity array */\n"); DevSpecific = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Table, Offset); Status = AcpiDmDumpTable (TableLength, Offset, DevSpecific, sizeof (ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION), AcpiDmTableInfoNhlt9); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION); } } } /* Do the Formats_Config table - starts with the FormatsCount field */ FormatsConfig = ACPI_ADD_PTR (ACPI_NHLT_FORMATS_CONFIG, Table, Offset); FormatsCount = FormatsConfig->FormatsCount; AcpiOsPrintf ("\n /* Formats_Config table */\n"); /* Dump the FormatsCount value */ if (FormatsCount > 0) { Status = AcpiDmDumpTable (TableLength, Offset, FormatsConfig, sizeof (ACPI_NHLT_FORMATS_CONFIG), AcpiDmTableInfoNhlt4); if (ACPI_FAILURE (Status)) { return; } } Offset += sizeof (ACPI_NHLT_FORMATS_CONFIG); /* A variable number of Format_Config Descriptors - process each */ for (j = 0; j < FormatsCount; j++) { FormatSubtable = ACPI_ADD_PTR (ACPI_NHLT_FORMAT_CONFIG, Table, Offset); CapabilitiesSize = FormatSubtable->CapabilitySize; /* Do the Wave_extensible struct */ AcpiOsPrintf ("\n /* Wave_Format_Extensible table #%u */\n", j+1); Status = AcpiDmDumpTable (TableLength, Offset, FormatSubtable, sizeof (ACPI_NHLT_FORMAT_CONFIG), AcpiDmTableInfoNhlt3); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_FORMAT_CONFIG); if (CapabilitiesSize > 0) { UINT8* CapabilitiesBuf = ACPI_ADD_PTR (UINT8, Table, Offset); /* Do the Capabilities array (of bytes) */ AcpiOsPrintf ("\n /* Specific_Config table #%u */\n", j+1); Status = AcpiDmDumpTable (TableLength, Offset, CapabilitiesBuf, CapabilitiesSize, AcpiDmTableInfoNhlt3a); if (ACPI_FAILURE (Status)) { return; } Offset += CapabilitiesSize; /* + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); */ } } /* for (j = 0; j < FormatsCount; j++) */ /* * If we are not done with the current Endpoint yet, then there must be * some non documented structure(s) yet to be processed. First, get * the count of such structure(s). */ if (Offset < EndpointEndOffset) { AcpiOsPrintf ("\n /* Structures that are not part of NHLT spec */\n"); Count = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_INFO_COUNT, Table, Offset); Status = AcpiDmDumpTable (TableLength, Offset, Count, sizeof (ACPI_NHLT_DEVICE_INFO_COUNT), AcpiDmTableInfoNhlt7); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_DEVICE_INFO_COUNT); /* Variable number of device structures */ for (j = 0; j < Count->StructureCount; j++) { DeviceInfo = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_INFO, Table, Offset); AcpiOsPrintf ("\n /* Device Info structure #%u (not part of NHLT spec) */\n", j+1); /* * Dump the following Device Info fields: * 1) Device ID * 2) Device Instance ID * 3) Device Port ID */ Status = AcpiDmDumpTable (TableLength, Offset, DeviceInfo, sizeof (ACPI_NHLT_DEVICE_INFO), AcpiDmTableInfoNhlt7a); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_DEVICE_INFO); } /* * Check that the current offset is not beyond the end of * this endpoint descriptor. If it is not, print those * undocumented bytes. */ if (Offset < EndpointEndOffset) { /* Unknown data at the end of the Endpoint */ UINT32 size = EndpointEndOffset - Offset; UINT8* buffer = ACPI_ADD_PTR (UINT8, Table, Offset); AcpiOsPrintf ("\n /* Unknown data at the end of the Endpoint, size: %X */\n", size); Status = AcpiDmDumpTable (TableLength, Offset, buffer, size, AcpiDmTableInfoNhlt7b); Offset = EndpointEndOffset; } /* Should be at the end of the Endpoint structure. */ } } /* for (i = 0; i < EndpointCount; i++) */ /* * Done with all of the Endpoint Descriptors, Emit the table terminator * (if such a legacy structure is present -- not in NHLT specification) */ if (Offset < TableLength) { Capabilities = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B, Table, Offset); AcpiOsPrintf ("\n/* Terminating specific config (not part of NHLT spec) */\n"); Status = AcpiDmDumpTable (TableLength, Offset, Capabilities, sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B), AcpiDmTableInfoNhlt5b); if (ACPI_FAILURE (Status)) { return; } Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); if (Capabilities->CapabilitiesSize > 0) { UINT32 remainingBytes = TableLength - Offset; UINT8* buffer = ACPI_ADD_PTR (UINT8, Table, Offset); if (remainingBytes != Capabilities->CapabilitiesSize) AcpiOsPrintf ("\n/* Incorrect config size, should be %X, is %X */\n", Capabilities->CapabilitiesSize, remainingBytes); Status = AcpiDmDumpTable (TableLength, Offset, buffer, remainingBytes, AcpiDmTableInfoNhlt3a); } } return; } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPcct * * PARAMETERS: Table - A PCCT table * * RETURN: None * * DESCRIPTION: Format the contents of a PCCT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpPcct ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_PCCT_SUBSPACE *Subtable; ACPI_DMTABLE_INFO *InfoTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_PCCT); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Header.Length, AcpiDmTableInfoPcctHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Header.Type) { case ACPI_PCCT_TYPE_GENERIC_SUBSPACE: InfoTable = AcpiDmTableInfoPcct0; break; case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE: InfoTable = AcpiDmTableInfoPcct1; break; case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: InfoTable = AcpiDmTableInfoPcct2; break; case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE: InfoTable = AcpiDmTableInfoPcct3; break; case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE: InfoTable = AcpiDmTableInfoPcct4; break; case ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE: InfoTable = AcpiDmTableInfoPcct5; break; default: AcpiOsPrintf ( "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n", Subtable->Header.Type); return; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Header.Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable */ Offset += Subtable->Header.Length; Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Subtable, Subtable->Header.Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPdtt * * PARAMETERS: Table - A PDTT table * * RETURN: None * * DESCRIPTION: Format the contents of a Pdtt. This is a variable-length * table that contains an open-ended number of IDs * at the end of the table. * ******************************************************************************/ void AcpiDmDumpPdtt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_PDTT_CHANNEL *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_PDTT); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPdtt); if (ACPI_FAILURE (Status)) { return; } /* Subtables. Currently there is only one type, but can be multiples */ Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_PDTT_CHANNEL), AcpiDmTableInfoPdtt0); if (ACPI_FAILURE (Status)) { return; } /* Point to next subtable */ Offset += sizeof (ACPI_PDTT_CHANNEL); Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Subtable, sizeof (ACPI_PDTT_CHANNEL)); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPhat * * PARAMETERS: Table - A PHAT table * * RETURN: None * * DESCRIPTION: Format the contents of a PHAT. * ******************************************************************************/ void AcpiDmDumpPhat ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_DMTABLE_INFO *InfoTable; ACPI_PHAT_HEADER *Subtable; ACPI_PHAT_VERSION_DATA *VersionData; UINT32 RecordCount; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_PHAT); + UINT32 OriginalOffset; UINT32 SubtableLength; UINT32 PathLength; UINT32 VendorLength; + UINT16 RecordType; + const wchar_t *WideString; Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, sizeof (ACPI_TABLE_PHAT)); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, 0, Subtable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_PHAT_HEADER), AcpiDmTableInfoPhatHdr); if (ACPI_FAILURE (Status)) { return; } + DbgPrint (ASL_DEBUG_OUTPUT, "\n/* %u, Subtable->Type %X */\n", + __LINE__, Subtable->Type); + switch (Subtable->Type) { case ACPI_PHAT_TYPE_FW_VERSION_DATA: InfoTable = AcpiDmTableInfoPhat0; - SubtableLength = sizeof (ACPI_PHAT_VERSION_DATA); + SubtableLength = Offset += sizeof (ACPI_PHAT_VERSION_DATA); break; case ACPI_PHAT_TYPE_FW_HEALTH_DATA: InfoTable = AcpiDmTableInfoPhat1; - SubtableLength = sizeof (ACPI_PHAT_HEALTH_DATA); + SubtableLength = Offset += sizeof (ACPI_PHAT_TYPE_FW_HEALTH_DATA); break; default: - AcpiOsPrintf ("\n**** Unknown PHAT subtable type 0x%X\n\n", + DbgPrint (ASL_DEBUG_OUTPUT, "\n**** Unknown PHAT subtable type 0x%X\n\n", Subtable->Type); return; } - Status = AcpiDmDumpTable (Length, 0, Subtable, + Status = AcpiDmDumpTable (Length, SubtableLength, Subtable, SubtableLength, InfoTable); if (ACPI_FAILURE (Status)) { return; } + OriginalOffset = Offset; switch (Subtable->Type) { case ACPI_PHAT_TYPE_FW_VERSION_DATA: VersionData = ACPI_CAST_PTR (ACPI_PHAT_VERSION_DATA, Subtable); RecordCount = VersionData->ElementCount; - while (RecordCount) + RecordType = *ACPI_CAST_PTR (UINT8, Subtable); + + /* + * Skip past a zero-valued block (not part of the ACPI PHAT specification). + * First, check for a zero length record and a zero element count + */ + if (!VersionData->Header.Length && !VersionData->ElementCount) { - Status = AcpiDmDumpTable (Length, Offset, - ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_VERSION_DATA)), + while (RecordType == 0) + { + Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, Offset); + RecordType = *ACPI_CAST_PTR (UINT8, Subtable); + RecordCount = VersionData->ElementCount; + Offset += 1; + } + + Offset -= 1; + AcpiOsPrintf ("\n/* Warning: Block of zeros found above starting at Offset %X Length %X */\n" + "/* (not compliant to PHAT specification -- ignoring block) */\n", + OriginalOffset - 12, Offset - OriginalOffset + 12); + } + + DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, RecordCount: %X, Offset %X, SubtableLength %X */\n", + __LINE__, RecordCount, Offset, SubtableLength); + + /* Emit each of the version elements */ + + while (RecordCount && VersionData->Header.Length) + { + AcpiOsPrintf ("\n/* Version Element #%Xh Offset %Xh */\n\n", + VersionData->ElementCount - RecordCount + 1, Offset); + + Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, Offset); + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_PHAT_VERSION_ELEMENT), AcpiDmTableInfoPhat0a); if (ACPI_FAILURE (Status)) { return; } + Offset += sizeof (ACPI_PHAT_VERSION_ELEMENT); RecordCount--; } break; case ACPI_PHAT_TYPE_FW_HEALTH_DATA: - /* account for the null terminator */ + /* + * Get the length of the Device Path (UEFI wide string). + * Include the wide null terminator (+2), + */ + WideString = ACPI_ADD_PTR (wchar_t, Subtable, + sizeof (ACPI_PHAT_HEALTH_DATA)); + + PathLength = (wcslen (WideString) * 2) + 2; + DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, PathLength %X, Offset %X, Table->Length %X */\n", + __LINE__, PathLength, Offset, Length); - PathLength = strlen (ACPI_ADD_PTR (char, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA))) + 1; Status = AcpiDmDumpTable (Length, Offset, ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)), PathLength, AcpiDmTableInfoPhat1a); + Offset += PathLength; if (ACPI_FAILURE (Status)) { return; } - /* Get vendor data - data length is the remaining subtable length */ + /* Get Device-Specific Data - length of which is the remaining subtable length. */ VendorLength = Subtable->Length - sizeof (ACPI_PHAT_HEALTH_DATA) - PathLength; - Status = AcpiDmDumpTable (Length, 0, - ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength), - VendorLength, AcpiDmTableInfoPhat1b); + DbgPrint (ASL_DEBUG_OUTPUT, "%u, Subtable->Length %X, VendorLength %X, Offset %X PathLength: %X\n", + __LINE__, Subtable->Length, VendorLength, Offset, PathLength); + + if (VendorLength) + { + /* Point past the Device Path, Compile the Device-Specific Data */ + + Status = AcpiDmDumpTable (Length, Offset, + ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength), + VendorLength, AcpiDmTableInfoPhat1b); + if (ACPI_FAILURE (Status)) + { + return; + } + + Offset += VendorLength; + } + if (ACPI_FAILURE (Status)) { return; } break; default: AcpiOsPrintf ("\n**** Unknown PHAT subtable type 0x%X\n\n", Subtable->Type); return; } /* Next subtable */ - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, - Subtable->Length); + DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, Bottom of main loop: Offset %X, " + "Subtable->Length %X, Table->Length %X */\n", + __LINE__, Offset, Subtable->Length, Table->Length); + + Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, + Offset); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPmtt * * PARAMETERS: Table - A PMTT table * * RETURN: None * * DESCRIPTION: Format the contents of a PMTT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpPmtt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_PMTT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_PMTT); /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Each of the types below contain the common subtable header */ AcpiOsPrintf ("\n"); switch (Subtable->Type) { case ACPI_PMTT_TYPE_SOCKET: Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoPmtt0); if (ACPI_FAILURE (Status)) { return; } break; case ACPI_PMTT_TYPE_CONTROLLER: Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoPmtt1); if (ACPI_FAILURE (Status)) { return; } break; case ACPI_PMTT_TYPE_DIMM: Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoPmtt2); if (ACPI_FAILURE (Status)) { return; } break; case ACPI_PMTT_TYPE_VENDOR: Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoPmttVendor); if (ACPI_FAILURE (Status)) { return; } break; default: AcpiOsPrintf ( "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", Subtable->Type); return; } /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable, Subtable->Length); } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPptt * * PARAMETERS: Table - A PMTT table * * RETURN: None * * DESCRIPTION: Format the contents of a PPTT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpPptt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_SUBTABLE_HEADER *Subtable; ACPI_PPTT_PROCESSOR *PpttProcessor; UINT8 Length; UINT8 SubtableOffset; UINT32 Offset = sizeof (ACPI_TABLE_FPDT); ACPI_DMTABLE_INFO *InfoTable; UINT32 i; /* There is no main table (other than the standard ACPI header) */ /* Subtables */ Offset = sizeof (ACPI_TABLE_HEADER); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); /* Common subtable header */ Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); if (Subtable->Length < sizeof (ACPI_SUBTABLE_HEADER)) { AcpiOsPrintf ("Invalid subtable length\n"); return; } Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoPpttHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_PPTT_TYPE_PROCESSOR: InfoTable = AcpiDmTableInfoPptt0; Length = sizeof (ACPI_PPTT_PROCESSOR); break; case ACPI_PPTT_TYPE_CACHE: InfoTable = AcpiDmTableInfoPptt1; Length = sizeof (ACPI_PPTT_CACHE); break; case ACPI_PPTT_TYPE_ID: InfoTable = AcpiDmTableInfoPptt2; Length = sizeof (ACPI_PPTT_ID); break; default: AcpiOsPrintf ("\n**** Unknown PPTT subtable type 0x%X\n\n", Subtable->Type); /* Attempt to continue */ goto NextSubtable; } if (Subtable->Length < Length) { AcpiOsPrintf ("Invalid subtable length\n"); return; } Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } SubtableOffset = Length; switch (Subtable->Type) { case ACPI_PPTT_TYPE_PROCESSOR: PpttProcessor = ACPI_CAST_PTR (ACPI_PPTT_PROCESSOR, Subtable); /* Dump SMBIOS handles */ if ((UINT8)(Subtable->Length - SubtableOffset) < (UINT8)(PpttProcessor->NumberOfPrivResources * 4)) { AcpiOsPrintf ("Invalid private resource number\n"); return; } for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++) { Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset), 4, AcpiDmTableInfoPptt0a); if (ACPI_FAILURE (Status)) { return; } SubtableOffset += 4; } break; case ACPI_PPTT_TYPE_CACHE: if (Table->Revision < 3) { break; } Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset), sizeof (ACPI_PPTT_CACHE_V1), AcpiDmTableInfoPptt1a); if (ACPI_FAILURE (Status)) { return; } break; default: break; } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; } } /******************************************************************************* * * FUNCTION: AcpiDmDumpPrmt * * PARAMETERS: Table - A PRMT table * * RETURN: None * * DESCRIPTION: Format the contents of a PRMT. This table type consists * of an open-ended number of subtables. * ******************************************************************************/ void AcpiDmDumpPrmt ( ACPI_TABLE_HEADER *Table) { UINT32 CurrentOffset = sizeof (ACPI_TABLE_HEADER); ACPI_TABLE_PRMT_HEADER *PrmtHeader; ACPI_PRMT_MODULE_INFO *PrmtModuleInfo; ACPI_PRMT_HANDLER_INFO *PrmtHandlerInfo; ACPI_STATUS Status; UINT32 i, j; /* Main table header */ PrmtHeader = ACPI_ADD_PTR (ACPI_TABLE_PRMT_HEADER, Table, CurrentOffset); Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHeader, sizeof (ACPI_TABLE_PRMT_HEADER), AcpiDmTableInfoPrmtHdr); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Invalid PRMT header\n"); return; } CurrentOffset += sizeof (ACPI_TABLE_PRMT_HEADER); /* PRM Module Information Structure array */ for (i = 0; i < PrmtHeader->ModuleInfoCount; ++i) { PrmtModuleInfo = ACPI_ADD_PTR (ACPI_PRMT_MODULE_INFO, Table, CurrentOffset); Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtModuleInfo, sizeof (ACPI_PRMT_MODULE_INFO), AcpiDmTableInfoPrmtModule); CurrentOffset += sizeof (ACPI_PRMT_MODULE_INFO); /* PRM handler information structure array */ for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; ++j) { PrmtHandlerInfo = ACPI_ADD_PTR (ACPI_PRMT_HANDLER_INFO, Table, CurrentOffset); Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHandlerInfo, sizeof (ACPI_PRMT_HANDLER_INFO), AcpiDmTableInfoPrmtHandler); CurrentOffset += sizeof (ACPI_PRMT_HANDLER_INFO); } } } /******************************************************************************* * * FUNCTION: AcpiDmDumpRgrt * * PARAMETERS: Table - A RGRT table * * RETURN: None * * DESCRIPTION: Format the contents of a RGRT * ******************************************************************************/ void AcpiDmDumpRgrt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_TABLE_RGRT *Subtable = ACPI_CAST_PTR (ACPI_TABLE_RGRT, Table); UINT32 Offset = sizeof (ACPI_TABLE_RGRT); /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoRgrt); if (ACPI_FAILURE (Status)) { return; } /* Dump the binary image as a subtable */ Status = AcpiDmDumpTable (Table->Length, Offset, &Subtable->Image, Table->Length - Offset, AcpiDmTableInfoRgrt0); if (ACPI_FAILURE (Status)) { return; } } /******************************************************************************* * * FUNCTION: AcpiDmDumpS3pt * * PARAMETERS: Table - A S3PT table * * RETURN: Length of the table * * DESCRIPTION: Format the contents of a S3PT * ******************************************************************************/ UINT32 AcpiDmDumpS3pt ( ACPI_TABLE_HEADER *Tables) { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_S3PT); ACPI_FPDT_HEADER *Subtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables); /* Main table */ Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt); if (ACPI_FAILURE (Status)) { return 0; } Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset); while (Offset < S3ptTable->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoS3ptHdr); if (ACPI_FAILURE (Status)) { return 0; } switch (Subtable->Type) { case ACPI_S3PT_TYPE_RESUME: InfoTable = AcpiDmTableInfoS3pt0; break; case ACPI_S3PT_TYPE_SUSPEND: InfoTable = AcpiDmTableInfoS3pt1; break; default: AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", Subtable->Type); /* Attempt to continue */ if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return 0; } goto NextSubtable; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return 0; } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length); } return (S3ptTable->Length); } /******************************************************************************* * * FUNCTION: AcpiDmDumpSdev * * PARAMETERS: Table - A SDEV table * * RETURN: None * * DESCRIPTION: Format the contents of a SDEV. This is a variable-length * table that contains variable strings and vendor data. * ******************************************************************************/ void AcpiDmDumpSdev ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; ACPI_SDEV_HEADER *Subtable; ACPI_SDEV_PCIE *Pcie; ACPI_SDEV_NAMESPACE *Namesp; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *SecureComponentInfoTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_SDEV); UINT16 PathOffset; UINT16 PathLength; UINT16 VendorDataOffset; UINT16 VendorDataLength; ACPI_SDEV_SECURE_COMPONENT *SecureComponent = NULL; UINT32 CurrentOffset = 0; /* Main table */ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSdev); if (ACPI_FAILURE (Status)) { return; } /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoSdevHdr); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: InfoTable = AcpiDmTableInfoSdev0; break; case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: InfoTable = AcpiDmTableInfoSdev1; break; default: goto NextSubtable; } AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Table->Length, 0, Subtable, Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } switch (Subtable->Type) { case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: CurrentOffset = sizeof (ACPI_SDEV_NAMESPACE); if (Subtable->Flags & ACPI_SDEV_SECURE_COMPONENTS_PRESENT) { SecureComponent = ACPI_CAST_PTR (ACPI_SDEV_SECURE_COMPONENT, ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_SDEV_NAMESPACE))); Status = AcpiDmDumpTable (Table->Length, CurrentOffset, ACPI_ADD_PTR(UINT8, Subtable, sizeof (ACPI_SDEV_NAMESPACE)), sizeof (ACPI_SDEV_SECURE_COMPONENT), AcpiDmTableInfoSdev0b); if (ACPI_FAILURE (Status)) { return; } CurrentOffset += sizeof (ACPI_SDEV_SECURE_COMPONENT); Status = AcpiDmDumpTable (Table->Length, CurrentOffset, ACPI_ADD_PTR(UINT8, Subtable, SecureComponent->SecureComponentOffset), sizeof (ACPI_SDEV_HEADER), AcpiDmTableInfoSdevSecCompHdr); if (ACPI_FAILURE (Status)) { return; } CurrentOffset += sizeof (ACPI_SDEV_HEADER); switch (Subtable->Type) { case ACPI_SDEV_TYPE_ID_COMPONENT: SecureComponentInfoTable = AcpiDmTableInfoSdevSecCompId; break; case ACPI_SDEV_TYPE_MEM_COMPONENT: SecureComponentInfoTable = AcpiDmTableInfoSdevSecCompMem; break; default: goto NextSubtable; } Status = AcpiDmDumpTable (Table->Length, CurrentOffset, ACPI_ADD_PTR(UINT8, Subtable, SecureComponent->SecureComponentOffset), SecureComponent->SecureComponentLength, SecureComponentInfoTable); CurrentOffset += SecureComponent->SecureComponentLength; } /* Dump the PCIe device ID(s) */ Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable); PathOffset = Namesp->DeviceIdOffset; PathLength = Namesp->DeviceIdLength; if (PathLength) { Status = AcpiDmDumpTable (Table->Length, CurrentOffset, ACPI_ADD_PTR (UINT8, Namesp, PathOffset), PathLength, AcpiDmTableInfoSdev0a); if (ACPI_FAILURE (Status)) { return; } CurrentOffset += PathLength; } /* Dump the vendor-specific data */ VendorDataLength = Namesp->VendorDataLength; VendorDataOffset = Namesp->DeviceIdOffset + Namesp->DeviceIdLength; if (VendorDataLength) { Status = AcpiDmDumpTable (Table->Length, 0, ACPI_ADD_PTR (UINT8, Namesp, VendorDataOffset), VendorDataLength, AcpiDmTableInfoSdev1b); if (ACPI_FAILURE (Status)) { return; } } break; case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: /* PCI path substructures */ Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable); PathOffset = Pcie->PathOffset; PathLength = Pcie->PathLength; while (PathLength) { Status = AcpiDmDumpTable (Table->Length, PathOffset + Offset, ACPI_ADD_PTR (UINT8, Pcie, PathOffset), sizeof (ACPI_SDEV_PCIE_PATH), AcpiDmTableInfoSdev1a); if (ACPI_FAILURE (Status)) { return; } PathOffset += sizeof (ACPI_SDEV_PCIE_PATH); PathLength -= sizeof (ACPI_SDEV_PCIE_PATH); } /* VendorData */ VendorDataLength = Pcie->VendorDataLength; VendorDataOffset = Pcie->PathOffset + Pcie->PathLength; if (VendorDataLength) { Status = AcpiDmDumpTable (Table->Length, 0, ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset), VendorDataLength, AcpiDmTableInfoSdev1b); if (ACPI_FAILURE (Status)) { return; } } break; default: goto NextSubtable; } NextSubtable: /* Point to next subtable */ Offset += Subtable->Length; Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Subtable, Subtable->Length); } } diff --git a/sys/contrib/dev/acpica/common/dmtbinfo1.c b/sys/contrib/dev/acpica/common/dmtbinfo1.c index 8ce79320db3b..620521d4168c 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo1.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo1.c @@ -1,1419 +1,1529 @@ /****************************************************************************** * * Module Name: dmtbinfo1 - Table info for non-AML tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbinfo1") /* * How to add a new table: * * - Add the C table definition to the actbl1.h or actbl2.h header. * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below. * - Define the table in this file (for the disassembler). If any * new data types are required (ACPI_DMT_*), see below. * - Add an external declaration for the new table definition (AcpiDmTableInfo*) * in acdisam.h * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData) * If a simple table (with no subtables), no disassembly code is needed. * Otherwise, create the AcpiDmDump* function for to disassemble the table * and add it to the dmtbdump.c file. * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c * - Create a template for the new table * - Add data table compiler support * * How to add a new data type (ACPI_DMT_*): * * - Add new type at the end of the ACPI_DMT list in acdisasm.h * - Add length and implementation cases in dmtable.c (disassembler) * - Add type and length cases in dtutils.c (DT compiler) */ /* * ACPI Table Information, used to dump formatted ACPI tables * * Each entry is of the form: */ /******************************************************************************* * * AEST - ARM Error Source table. Conforms to: * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020 * ******************************************************************************/ /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestHdr[] = { {ACPI_DMT_AEST, ACPI_AESTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT16, ACPI_AESTH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_AESTH_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_AESTH_OFFSET (NodeSpecificOffset), "Node Specific Offset", 0}, {ACPI_DMT_UINT32, ACPI_AESTH_OFFSET (NodeInterfaceOffset), "Node Interface Offset", 0}, {ACPI_DMT_UINT32, ACPI_AESTH_OFFSET (NodeInterruptOffset), "Node Interrupt Array Offset", 0}, {ACPI_DMT_UINT32, ACPI_AESTH_OFFSET (NodeInterruptCount), "Node Interrupt Array Count", 0}, {ACPI_DMT_UINT64, ACPI_AESTH_OFFSET (TimestampRate), "Timestamp Rate", 0}, {ACPI_DMT_UINT64, ACPI_AESTH_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_AESTH_OFFSET (ErrorInjectionRate), "Error Injection Rate", 0}, ACPI_DMT_TERMINATOR }; /* * AEST subtables (nodes) */ /* 0: Processor Error */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestProcError[] = { {ACPI_DMT_UINT32, ACPI_AEST0_OFFSET (ProcessorId), "Processor ID", 0}, {ACPI_DMT_AEST_RES, ACPI_AEST0_OFFSET (ResourceType), "Resource Type", 0}, {ACPI_DMT_UINT8, ACPI_AEST0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_AEST0_OFFSET (Flags), "Flags (decoded Below)", 0}, {ACPI_DMT_FLAG0, ACPI_AEST0_FLAG_OFFSET (Flags, 0), "Global", 0}, {ACPI_DMT_FLAG1, ACPI_AEST0_FLAG_OFFSET (Flags, 0), "Shared", 0}, {ACPI_DMT_UINT8, ACPI_AEST0_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT64, ACPI_AEST0_OFFSET (ProcessorAffinity), "Processor Affinity Structure", 0}, ACPI_DMT_TERMINATOR }; /* 0RT: Processor Cache Resource */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestCacheRsrc[] = { {ACPI_DMT_UINT32, ACPI_AEST0A_OFFSET (CacheReference), "Cache Reference", 0}, {ACPI_DMT_UINT32, ACPI_AEST0A_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 1RT: ProcessorTLB Resource */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestTlbRsrc[] = { {ACPI_DMT_UINT32, ACPI_AEST0B_OFFSET (TlbLevel), "TLB Level", 0}, {ACPI_DMT_UINT32, ACPI_AEST0B_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 2RT: Processor Generic Resource */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestGenRsrc[] = { {ACPI_DMT_RAW_BUFFER, 0, "Resource", 0}, ACPI_DMT_TERMINATOR }; /* 1: Memory Error */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestMemError[] = { {ACPI_DMT_UINT32, ACPI_AEST1_OFFSET (SratProximityDomain), "Srat Proximity Domain", 0}, ACPI_DMT_TERMINATOR }; /* 2: Smmu Error */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestSmmuError[] = { {ACPI_DMT_UINT32, ACPI_AEST2_OFFSET (IortNodeReference), "Iort Node Reference", 0}, {ACPI_DMT_UINT32, ACPI_AEST2_OFFSET (SubcomponentReference), "Subcomponent Reference", 0}, ACPI_DMT_TERMINATOR }; /* 3: Vendor Defined */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorError[] = { {ACPI_DMT_UINT32, ACPI_AEST3_OFFSET (AcpiHid), "ACPI HID", 0}, {ACPI_DMT_UINT32, ACPI_AEST3_OFFSET (AcpiUid), "ACPI UID", 0}, {ACPI_DMT_BUF16, ACPI_AEST3_OFFSET (VendorSpecificData), "Vendor Specific Data", 0}, ACPI_DMT_TERMINATOR }; /* 4: Gic Error */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestGicError[] = { {ACPI_DMT_AEST_GIC, ACPI_AEST4_OFFSET (InterfaceType), "GIC Interface Type", 0}, {ACPI_DMT_UINT32, ACPI_AEST4_OFFSET (InstanceId), "Instance ID", 0}, ACPI_DMT_TERMINATOR }; /* AestXface: Node Interface Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface[] = { {ACPI_DMT_AEST_XFACE, ACPI_AEST0D_OFFSET (Type), "Interface Type", 0}, {ACPI_DMT_UINT24, ACPI_AEST0D_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_AEST0D_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Shared Interface", 0}, {ACPI_DMT_FLAG1, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Clear MISCx Registers", 0}, {ACPI_DMT_UINT64, ACPI_AEST0D_OFFSET (Address), "Address", 0}, {ACPI_DMT_UINT32, ACPI_AEST0D_OFFSET (ErrorRecordIndex), "Error Record Index", 0}, {ACPI_DMT_UINT32, ACPI_AEST0D_OFFSET (ErrorRecordCount), "Error Record Count", 0}, {ACPI_DMT_UINT64, ACPI_AEST0D_OFFSET (ErrorRecordImplemented),"Error Record Implemented", 0}, {ACPI_DMT_UINT64, ACPI_AEST0D_OFFSET (ErrorStatusReporting), "Error Status Reporting", 0}, {ACPI_DMT_UINT64, ACPI_AEST0D_OFFSET (AddressingMode), "Addressing Mode", 0}, ACPI_DMT_TERMINATOR }; /* AestXrupt: Node Interrupt Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXrupt[] = { {ACPI_DMT_AEST_XRUPT, ACPI_AEST0E_OFFSET (Type), "Interrupt Type", 0}, {ACPI_DMT_UINT16, ACPI_AEST0E_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_AEST0E_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_AEST0E_FLAG_OFFSET (Flags, 0), "Level Triggered", 0}, {ACPI_DMT_UINT32, ACPI_AEST0E_OFFSET (Gsiv), "Gsiv", 0}, {ACPI_DMT_UINT8, ACPI_AEST0E_OFFSET (IortId), "IortId", 0}, {ACPI_DMT_UINT24, ACPI_AEST0E_OFFSET (Reserved1[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * ASF - Alert Standard Format table (Signature "ASF!") * ******************************************************************************/ /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[] = { {ACPI_DMT_ASF, ACPI_ASF0_OFFSET (Header.Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Header.Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (Header.Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* 0: ASF Information */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] = { {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value", 0}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval", 0}, {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID", 0}, {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID", 0}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 1: ASF Alerts */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[] = { {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (AssertMask), "AssertMask", 0}, {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DeassertMask), "DeassertMask", 0}, {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (Alerts), "Alert Count", 0}, {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DataLength), "Alert Data Length", 0}, ACPI_DMT_TERMINATOR }; /* 1a: ASF Alert data */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[] = { {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Address), "Address", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Command), "Command", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Mask), "Mask", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Value), "Value", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorType), "SensorType", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Offset), "Offset", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SourceType), "SourceType", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Severity), "Severity", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorNumber), "SensorNumber", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Entity), "Entity", 0}, {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Instance), "Instance", 0}, ACPI_DMT_TERMINATOR }; /* 2: ASF Remote Control */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[] = { {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (Controls), "Control Count", 0}, {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (DataLength), "Control Data Length", 0}, {ACPI_DMT_UINT16, ACPI_ASF2_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 2a: ASF Control data */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[] = { {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Function), "Function", 0}, {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Address), "Address", 0}, {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Command), "Command", 0}, {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Value), "Value", 0}, ACPI_DMT_TERMINATOR }; /* 3: ASF RMCP Boot Options */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[] = { {ACPI_DMT_BUF7, ACPI_ASF3_OFFSET (Capabilities[0]), "Capabilities", 0}, {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (CompletionCode), "Completion Code", 0}, {ACPI_DMT_UINT32, ACPI_ASF3_OFFSET (EnterpriseId), "Enterprise ID", 0}, {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (Command), "Command", 0}, {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (Parameter), "Parameter", 0}, {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (BootOptions), "Boot Options", 0}, {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (OemParameters), "Oem Parameters", 0}, ACPI_DMT_TERMINATOR }; /* 4: ASF Address */ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[] = { {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (EpromAddress), "Eprom Address", 0}, {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (Devices), "Device Count", DT_COUNT}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * BDAT - BIOS Data ACPI Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoBdat[] = { {ACPI_DMT_GAS, ACPI_BDAT_OFFSET (Gas), "BDAT Generic Address", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * BERT - Boot Error Record table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] = { {ACPI_DMT_UINT32, ACPI_BERT_OFFSET (RegionLength), "Boot Error Region Length", 0}, {ACPI_DMT_UINT64, ACPI_BERT_OFFSET (Address), "Boot Error Region Address", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * BGRT - Boot Graphics Resource Table (ACPI 5.0) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[] = { {ACPI_DMT_UINT16, ACPI_BGRT_OFFSET (Version), "Version", 0}, {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Displayed", 0}, {ACPI_DMT_FLAGS1, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Orientation Offset", 0}, {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (ImageType), "Image Type", 0}, {ACPI_DMT_UINT64, ACPI_BGRT_OFFSET (ImageAddress), "Image Address", 0}, {ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetX), "Image OffsetX", 0}, {ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetY), "Image OffsetY", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * BOOT - Simple Boot Flag Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = { {ACPI_DMT_UINT8, ACPI_BOOT_OFFSET (CmosIndex), "Boot Register Index", 0}, {ACPI_DMT_UINT24, ACPI_BOOT_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; +/******************************************************************************* + * + * CDAT - Coherent Device Attribute Table + * + ******************************************************************************/ + + /* Table header (not ACPI-compliant) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdatTableHdr[] = +{ + {ACPI_DMT_UINT32, ACPI_CDAT_OFFSET (Length), "CDAT Table Length", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_CDAT_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT_OFFSET (Checksum), "Checksum", 0}, + {ACPI_DMT_UINT48, ACPI_CDAT_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_CDAT_OFFSET (Sequence), "Sequence", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Common subtable header */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdatHeader[] = +{ + {ACPI_DMT_CDAT, ACPI_CDATH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_CDATH_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_CDATH_OFFSET (Length), "Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat0[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT0_OFFSET (DsmadHandle), "DSMAD Handle", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT0_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT0_OFFSET (DpaBaseAddress), "DPA Base Address", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT0_OFFSET (DpaLength), "DPA Length", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat1[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Handle), "Handle", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (DataType), "Data Type", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT1_OFFSET (EntryBaseUnit), "Entry Base Unit", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[0]), "Entry0", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[1]), "Entry1", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[2]), "Entry2", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat2[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT2_OFFSET (DsmasHandle), "DSMAS Handle", 0}, + {ACPI_DMT_UINT24, ACPI_CDAT2_OFFSET (Reserved[3]), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT2_OFFSET (SideCacheSize), "Side Cache Size", 0}, + {ACPI_DMT_UINT32, ACPI_CDAT2_OFFSET (CacheAttributes), "Cache Attributes", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 3: Device Scoped Initiator Structure (DSIS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat3[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT3_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT3_OFFSET (Handle), "Handle", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT3_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat4[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT4_OFFSET (DsmasHandle), "DSMAS Handle", 0}, + {ACPI_DMT_UINT8, ACPI_CDAT4_OFFSET (MemoryType), "Memory Type", 0}, + {ACPI_DMT_UINT16, ACPI_CDAT4_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT4_OFFSET (DpaOffset), "DPA Offset", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT4_OFFSET (RangeLength), "DPA Range Length", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdat5[] = +{ + {ACPI_DMT_UINT8, ACPI_CDAT5_OFFSET (DataType), "Data Type", 0}, + {ACPI_DMT_UINT24, ACPI_CDAT5_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CDAT5_OFFSET (EntryBaseUnit), "Entry Base Unit", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Switch Scoped Latency and Bandwidth Entry (SSLBE) (For subtable 5 above) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCdatEntries[] = +{ + {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (PortxId), "Port X Id", 0}, + {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (PortyId), "Port Y Id", 0}, + {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (LatencyOrBandwidth), "Latency or Bandwidth", 0}, + {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * * CEDT - CXL Early Discovery Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = { {ACPI_DMT_CEDT, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* 0: CXL Host Bridge Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = { {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Uid), "Associated host bridge", 0}, {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (CxlVersion), "Specification version", 0}, {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Base), "Register base", 0}, {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Length), "Register length", 0}, ACPI_DMT_TERMINATOR }; /* 1: CXL Fixed Memory Window Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] = { {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0}, {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0}, {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0}, {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0}, {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0}, {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Restrictions), "Restrictions", 0}, {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (QtgId), "QtgId", 0}, {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (InterleaveTargets), "First Target", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] = { {ACPI_DMT_UINT32, ACPI_CEDT1_TE_OFFSET (InterleaveTarget), "Next Target", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * CPEP - Corrected Platform Error Polling table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[] = { {ACPI_DMT_UINT64, ACPI_CPEP_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] = { {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID", 0}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID", 0}, {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * CSRT - Core System Resource Table * ******************************************************************************/ /* Main table consists only of the standard ACPI table header */ /* Resource Group subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[] = { {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (VendorId), "Vendor ID", 0}, {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (SubvendorId), "Subvendor ID", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (DeviceId), "Device ID", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (SubdeviceId), "Subdevice ID", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (SharedInfoLength), "Shared Info Length", 0}, ACPI_DMT_TERMINATOR }; /* Shared Info subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[] = { {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (MajorVersion), "Major Version", 0}, {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (MinorVersion), "Minor Version", 0}, {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MmioBaseLow), "MMIO Base Address Low", 0}, {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MmioBaseHigh), "MMIO Base Address High", 0}, {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (GsiInterrupt), "GSI Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (InterruptPolarity), "Interrupt Polarity", 0}, {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (InterruptMode), "Interrupt Mode", 0}, {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (NumChannels), "Num Channels", 0}, {ACPI_DMT_UINT8, ACPI_CSRT1_OFFSET (DmaAddressWidth), "DMA Address Width", 0}, {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (BaseRequestLine), "Base Request Line", 0}, {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (NumHandshakeSignals), "Num Handshake Signals", 0}, {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (MaxBlockSize), "Max Block Size", 0}, ACPI_DMT_TERMINATOR }; /* Resource Descriptor subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[] = { {ACPI_DMT_UINT32, ACPI_CSRT2_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_CSRT2_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT16, ACPI_CSRT2_OFFSET (Subtype), "Subtype", 0}, {ACPI_DMT_UINT32, ACPI_CSRT2_OFFSET (Uid), "UID", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2a[] = { {ACPI_DMT_RAW_BUFFER, 0, "ResourceInfo", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * DBG2 - Debug Port Table 2 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[] = { {ACPI_DMT_UINT32, ACPI_DBG2_OFFSET (InfoOffset), "Info Offset", 0}, {ACPI_DMT_UINT32, ACPI_DBG2_OFFSET (InfoCount), "Info Count", 0}, ACPI_DMT_TERMINATOR }; /* Debug Device Information Subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[] = { {ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (RegisterCount), "Register Count", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathLength), "Namepath Length", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathOffset), "Namepath Offset", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortType), "Port Type", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortSubtype), "Port Subtype", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (BaseAddressOffset), "Base Address Offset", 0}, {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (AddressSizeOffset), "Address Size Offset", 0}, ACPI_DMT_TERMINATOR }; /* Variable-length data for the subtable */ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[] = { {ACPI_DMT_GAS, 0, "Base Address Register", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[] = { {ACPI_DMT_UINT32, 0, "Address Size", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] = { {ACPI_DMT_STRING, 0, "Namepath", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] = { {ACPI_DMT_RAW_BUFFER, 0, "OEM Data", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * DBGP - Debug Port * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[] = { {ACPI_DMT_UINT8, ACPI_DBGP_OFFSET (Type), "Interface Type", 0}, {ACPI_DMT_UINT24, ACPI_DBGP_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_DBGP_OFFSET (DebugPort), "Debug Port Register", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * DMAR - DMA Remapping table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[] = { {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width", 0}, {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_BUF10, ACPI_DMAR_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] = { {ACPI_DMT_DMAR, ACPI_DMAR0_OFFSET (Header.Type), "Subtable Type", 0}, {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Header.Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* Common device scope entry */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] = { {ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0}, {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0}, {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number", 0}, ACPI_DMT_TERMINATOR }; /* DMAR Subtables */ /* 0: Hardware Unit Definition */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[] = { {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number", 0}, {ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address", 0}, ACPI_DMT_TERMINATOR }; /* 1: Reserved Memory Definition */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[] = { {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Segment), "PCI Segment Number", 0}, {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (EndAddress), "End Address (limit)", 0}, ACPI_DMT_TERMINATOR }; /* 2: Root Port ATS Capability Definition */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[] = { {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_DMAR2_OFFSET (Segment), "PCI Segment Number", 0}, ACPI_DMT_TERMINATOR }; /* 3: Remapping Hardware Static Affinity Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] = { {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain", 0}, ACPI_DMT_TERMINATOR }; /* 4: ACPI Namespace Device Declaration Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] = { {ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0}, {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0}, ACPI_DMT_TERMINATOR }; /* 5: Hardware Unit Definition */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar5[] = { {ACPI_DMT_UINT8, ACPI_DMAR5_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT8, ACPI_DMAR5_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_DMAR5_OFFSET (Segment), "PCI Segment Number", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * DRTM - Dynamic Root of Trust for Measurement table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[] = { {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (EntryBaseAddress), "Entry Base Address", 0}, {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (EntryLength), "Entry Length", 0}, {ACPI_DMT_UINT32, ACPI_DRTM_OFFSET (EntryAddress32), "Entry 32", 0}, {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (EntryAddress64), "Entry 64", 0}, {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (ExitAddress), "Exit Address", 0}, {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (LogAreaAddress), "Log Area Start", 0}, {ACPI_DMT_UINT32, ACPI_DRTM_OFFSET (LogAreaLength), "Log Area Length", 0}, {ACPI_DMT_UINT64, ACPI_DRTM_OFFSET (ArchDependentAddress), "Arch Dependent Address", 0}, {ACPI_DMT_UINT32, ACPI_DRTM_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_DRTM_FLAG_OFFSET (Flags, 0), "Namespace in TCB", 0}, {ACPI_DMT_FLAG1, ACPI_DRTM_FLAG_OFFSET (Flags, 0), "Gap Code on S3 Resume", 0}, {ACPI_DMT_FLAG2, ACPI_DRTM_FLAG_OFFSET (Flags, 0), "Gap Code on DLME_Exit", 0}, {ACPI_DMT_FLAG3, ACPI_DRTM_FLAG_OFFSET (Flags, 0), "PCR_Authorities Changed", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[] = { {ACPI_DMT_UINT32, ACPI_DRTM0_OFFSET (ValidatedTableCount), "Validated Table Count", DT_COUNT}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[] = { {ACPI_DMT_UINT64, 0, "Table Address", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1[] = { {ACPI_DMT_UINT32, ACPI_DRTM1_OFFSET (ResourceCount), "Resource Count", DT_COUNT}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1a[] = { {ACPI_DMT_UINT56, ACPI_DRTM1a_OFFSET (Size[0]), "Size", DT_OPTIONAL}, {ACPI_DMT_UINT8, ACPI_DRTM1a_OFFSET (Type), "Type", 0}, {ACPI_DMT_FLAG0, ACPI_DRTM1a_FLAG_OFFSET (Type, 0), "Resource Type", 0}, {ACPI_DMT_FLAG7, ACPI_DRTM1a_FLAG_OFFSET (Type, 0), "Protections", 0}, {ACPI_DMT_UINT64, ACPI_DRTM1a_OFFSET (Address), "Address", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[] = { {ACPI_DMT_UINT32, ACPI_DRTM2_OFFSET (DpsIdLength), "DLME Platform Id Length", DT_COUNT}, {ACPI_DMT_BUF16, ACPI_DRTM2_OFFSET (DpsId), "DLME Platform Id", DT_COUNT}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * ECDT - Embedded Controller Boot Resources Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[] = { {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Control), "Command/Status Register", 0}, {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Data), "Data Register", 0}, {ACPI_DMT_UINT32, ACPI_ECDT_OFFSET (Uid), "UID", 0}, {ACPI_DMT_UINT8, ACPI_ECDT_OFFSET (Gpe), "GPE Number", 0}, {ACPI_DMT_STRING, ACPI_ECDT_OFFSET (Id[0]), "Namepath", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * EINJ - Error Injection table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] = { {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", 0}, {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] = { {ACPI_DMT_EINJACT, ACPI_EINJ0_OFFSET (Action), "Action", 0}, {ACPI_DMT_EINJINST, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0}, {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_EINJ0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0}, {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_EINJ0_OFFSET (RegisterRegion), "Register Region", 0}, {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Value), "Value", 0}, {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Mask), "Mask", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * ERST - Error Record Serialization table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoErst[] = { {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", 0}, {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Entries), "Instruction Entry Count", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[] = { {ACPI_DMT_ERSTACT, ACPI_ERST0_OFFSET (Action), "Action", 0}, {ACPI_DMT_ERSTINST, ACPI_ERST0_OFFSET (Instruction), "Instruction", 0}, {ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_ERST0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0}, {ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_ERST0_OFFSET (RegisterRegion), "Register Region", 0}, {ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Value), "Value", 0}, {ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Mask), "Mask", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * FPDT - Firmware Performance Data Table (ACPI 5.0) * ******************************************************************************/ /* Main table consists of only the standard ACPI header - subtables follow */ /* FPDT subtable header */ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[] = { {ACPI_DMT_UINT16, ACPI_FPDTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Revision), "Revision", 0}, ACPI_DMT_TERMINATOR }; /* 0: Firmware Basic Boot Performance Record */ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[] = { {ACPI_DMT_UINT32, ACPI_FPDT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_FPDT1_OFFSET (Address), "FPDT Boot Record Address", 0}, ACPI_DMT_TERMINATOR }; /* 1: S3 Performance Table Pointer Record */ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] = { {ACPI_DMT_UINT32, ACPI_FPDT1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_FPDT1_OFFSET (Address), "S3PT Record Address", 0}, ACPI_DMT_TERMINATOR }; #if 0 /* Boot Performance Record, not supported at this time. */ {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ResetEnd), "Reset End", 0}, {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (LoadStart), "Load Image Start", 0}, {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (StartupStart), "Start Image Start", 0}, {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesEntry), "Exit Services Entry", 0}, {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesExit), "Exit Services Exit", 0}, #endif /******************************************************************************* * * GTDT - Generic Timer Description Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] = { {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterBlockAddresss), "Counter Block Address", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_NEW_LINE, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Interrupt), "Secure EL1 Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Flags), "EL1 Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Always On", 0}, ACPI_DMT_NEW_LINE, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Interrupt), "Non-Secure EL1 Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Flags), "NEL1 Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0}, ACPI_DMT_NEW_LINE, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0}, ACPI_DMT_NEW_LINE, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Interrupt), "Non-Secure EL2 Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Flags), "NEL2 Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0}, {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0}, ACPI_DMT_NEW_LINE, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerCount), "Platform Timer Count", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerOffset), "Platform Timer Offset", 0}, ACPI_DMT_TERMINATOR }; /* GDTD EL2 timer info. This table is appended to AcpiDmTableInfoGtdt for rev 3 and later */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtEl2[] = { {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerGsiv), "Virtual EL2 Timer GSIV", 0}, {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerFlags), "Virtual EL2 Timer Flags", 0}, ACPI_DMT_TERMINATOR }; /* GTDT Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] = { {ACPI_DMT_GTDT, ACPI_GTDTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT16, ACPI_GTDTH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* GTDT Subtables */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[] = { {ACPI_DMT_UINT8, ACPI_GTDT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_GTDT0_OFFSET (BlockAddress), "Block Address", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerCount), "Timer Count", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerOffset), "Timer Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[] = { {ACPI_DMT_UINT8 , ACPI_GTDT0a_OFFSET (FrameNumber), "Frame Number", 0}, {ACPI_DMT_UINT24, ACPI_GTDT0a_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (El0BaseAddress), "EL0 Base Address", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerInterrupt), "Timer Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerFlags), "Timer Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Polarity", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerFlags), "Virtual Timer Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Polarity", 0}, {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (CommonFlags), "Common Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Secure", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Always On", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[] = { {ACPI_DMT_UINT8, ACPI_GTDT1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (RefreshFrameAddress), "Refresh Frame Address", 0}, {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (ControlFrameAddress), "Control Frame Address", 0}, {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerInterrupt), "Timer Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerFlags), "Timer Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0}, {ACPI_DMT_FLAG1, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Security", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * HEST - Hardware Error Source table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] = { {ACPI_DMT_UINT32, ACPI_HEST_OFFSET (ErrorSourceCount), "Error Source Count", 0}, ACPI_DMT_TERMINATOR }; /* Common HEST structures for subtables */ #define ACPI_DM_HEST_HEADER \ {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type", 0}, \ {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id", 0} #define ACPI_DM_HEST_AER \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags (decoded below)", DT_FLAG}, \ {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Firmware First", 0}, \ {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Global", 0}, \ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus", 0}, \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device", 0}, \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function", 0}, \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl", 0}, \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities", 0} /* HEST Subtables */ /* 0: IA32 Machine Check Exception */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HEST0_FLAG_OFFSET (Flags,0), "Firmware First", 0}, {ACPI_DMT_FLAG2, ACPI_HEST0_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data", 0}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; /* 1: IA32 Corrected Machine Check */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HEST1_FLAG_OFFSET (Flags,0), "Firmware First", 0}, {ACPI_DMT_FLAG2, ACPI_HEST1_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; /* 2: IA32 Non-Maskable Interrupt */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0}, ACPI_DMT_TERMINATOR }; /* 6: PCI Express Root Port AER */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] = { ACPI_DM_HEST_HEADER, ACPI_DM_HEST_AER, {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command", 0}, ACPI_DMT_TERMINATOR }; /* 7: PCI Express AER (AER Endpoint) */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[] = { ACPI_DM_HEST_HEADER, ACPI_DM_HEST_AER, ACPI_DMT_TERMINATOR }; /* 8: PCI Express/PCI-X Bridge AER */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] = { ACPI_DM_HEST_HEADER, ACPI_DM_HEST_AER, {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableMask2), "2nd Uncorrectable Mask", 0}, {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableSeverity2), "2nd Uncorrectable Severity", 0}, {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (AdvancedCapabilities2), "2nd Advanced Capabilities", 0}, ACPI_DMT_TERMINATOR }; /* 9: Generic Hardware Error Source */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (RelatedSourceId), "Related Source Id", 0}, {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0}, {ACPI_DMT_GAS, ACPI_HEST9_OFFSET (ErrorStatusAddress), "Error Status Address", 0}, {ACPI_DMT_HESTNTFY, ACPI_HEST9_OFFSET (Notify), "Notify", 0}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorBlockLength), "Error Status Block Length", 0}, ACPI_DMT_TERMINATOR }; /* 10: Generic Hardware Error Source - Version 2 */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST10_OFFSET (RelatedSourceId), "Related Source Id", 0}, {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0}, {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ErrorStatusAddress), "Error Status Address", 0}, {ACPI_DMT_HESTNTFY, ACPI_HEST10_OFFSET (Notify), "Notify", 0}, {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (ErrorBlockLength), "Error Status Block Length", 0}, {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ReadAckRegister), "Read Ack Register", 0}, {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckPreserve), "Read Ack Preserve", 0}, {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckWrite), "Read Ack Write", 0}, ACPI_DMT_TERMINATOR }; /* 11: IA32 Deferred Machine Check */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[] = { ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST11_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HEST11_FLAG_OFFSET (Flags,0), "Firmware First", 0}, {ACPI_DMT_FLAG2, ACPI_HEST11_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_HESTNTFY, ACPI_HEST11_OFFSET (Notify), "Notify", 0}, {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, {ACPI_DMT_UINT24, ACPI_HEST11_OFFSET (Reserved2[0]), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; /* Notification Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] = { {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0}, {ACPI_DMT_UINT8, ACPI_HESTN_OFFSET (Length), "Notify Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_HESTN_OFFSET (ConfigWriteEnable), "Configuration Write Enable", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollInterval), "PollInterval", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (Vector), "Vector", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdValue), "Polling Threshold Value", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdWindow), "Polling Threshold Window", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdValue), "Error Threshold Value", 0}, {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdWindow), "Error Threshold Window", 0}, ACPI_DMT_TERMINATOR }; /* * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and * ACPI_HEST_IA_CORRECTED structures. */ ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[] = { {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (BankNumber), "Bank Number", 0}, {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (ClearStatusOnInit), "Clear Status On Init", 0}, {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (StatusFormat), "Status Format", 0}, {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (ControlRegister), "Control Register", 0}, {ACPI_DMT_UINT64, ACPI_HESTB_OFFSET (ControlData), "Control Data", 0}, {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (StatusRegister), "Status Register", 0}, {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (AddressRegister), "Address Register", 0}, {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (MiscRegister), "Misc Register", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * HMAT - Heterogeneous Memory Attributes Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[] = { {ACPI_DMT_UINT32, ACPI_HMAT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Common HMAT structure header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] = { {ACPI_DMT_HMAT, ACPI_HMATH_OFFSET (Type), "Structure Type", 0}, {ACPI_DMT_UINT16, ACPI_HMATH_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_HMATH_OFFSET (Length), "Length", 0}, ACPI_DMT_TERMINATOR }; /* HMAT subtables */ /* 0x00: Memory proximity domain attributes */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] = { {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0}, {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (InitiatorPD), "Attached Initiator Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0}, {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved3), "Reserved3", 0}, {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved4), "Reserved4", 0}, ACPI_DMT_TERMINATOR }; /* 0x01: System Locality Latency and Bandwidth Information */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[] = { {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAGS4_0, ACPI_HMAT1_FLAG_OFFSET (Flags,0), "Memory Hierarchy", 0}, /* First 4 bits */ {ACPI_DMT_FLAG4, ACPI_HMAT1_FLAG_OFFSET (Flags,0), "Use Minimum Transfer Size", 0}, {ACPI_DMT_FLAG5, ACPI_HMAT1_FLAG_OFFSET (Flags,0), "Non-sequential Transfers", 0}, {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (DataType), "Data Type", 0}, {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (MinTransferSize), "Minimum Transfer Size", 0}, {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfInitiatorPDs), "Initiator Proximity Domains #", 0}, {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfTargetPDs), "Target Proximity Domains #", 0}, {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (Reserved2), "Reserved2", 0}, {ACPI_DMT_UINT64, ACPI_HMAT1_OFFSET (EntryBaseUnit), "Entry Base Unit", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[] = { {ACPI_DMT_UINT32, 0, "Initiator Proximity Domain List", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[] = { {ACPI_DMT_UINT32, 0, "Target Proximity Domain List", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[] = { {ACPI_DMT_UINT16, 0, "Entry", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 0x02: Memory Side Cache Information */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[] = { {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT64, ACPI_HMAT2_OFFSET (CacheSize), "Memory Side Cache Size", 0}, {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (CacheAttributes), "Cache Attributes (decoded below)", 0}, {ACPI_DMT_FLAGS4_0, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Total Cache Levels", 0}, {ACPI_DMT_FLAGS4_4, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Level", 0}, {ACPI_DMT_FLAGS4_8, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Associativity", 0}, {ACPI_DMT_FLAGS4_12, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Write Policy", 0}, {ACPI_DMT_FLAGS16_16, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Line Size", 0}, {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (Reserved2), "Reserved2", 0}, {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (NumberOfSMBIOSHandles), "SMBIOS Handle #", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[] = { {ACPI_DMT_UINT16, 0, "SMBIOS Handle", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * HPET - High Precision Event Timer table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] = { {ACPI_DMT_UINT32, ACPI_HPET_OFFSET (Id), "Hardware Block ID", 0}, {ACPI_DMT_GAS, ACPI_HPET_OFFSET (Address), "Timer Block Register", 0}, {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Sequence), "Sequence Number", 0}, {ACPI_DMT_UINT16, ACPI_HPET_OFFSET (MinimumTick), "Minimum Clock Ticks", 0}, {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect", 0}, {ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect", 0}, ACPI_DMT_TERMINATOR }; /*! [End] no source code translation !*/ diff --git a/sys/contrib/dev/acpica/common/dmtbinfo2.c b/sys/contrib/dev/acpica/common/dmtbinfo2.c index bac6a1d2a1d4..e1f67db99ef7 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo2.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo2.c @@ -1,2129 +1,2132 @@ /****************************************************************************** * * Module Name: dmtbinfo2 - Table info for non-AML tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbinfo2") /* * How to add a new table: * * - Add the C table definition to the actbl1.h or actbl2.h header. * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below. * - Define the table in this file (for the disassembler). If any * new data types are required (ACPI_DMT_*), see below. * - Add an external declaration for the new table definition (AcpiDmTableInfo*) * in acdisam.h * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData) * If a simple table (with no subtables), no disassembly code is needed. * Otherwise, create the AcpiDmDump* function for to disassemble the table * and add it to the dmtbdump.c file. * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c * - Create a template for the new table * - Add data table compiler support * * How to add a new data type (ACPI_DMT_*): * * - Add new type at the end of the ACPI_DMT list in acdisasm.h * - Add length and implementation cases in dmtable.c (disassembler) * - Add type and length cases in dtutils.c (DT compiler) */ /* * Remaining tables are not consumed directly by the ACPICA subsystem */ /******************************************************************************* * * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface * * Conforms to "ACPI for Arm Components 1.1, Platform Design Document" * ARM DEN0093 v1.1 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoAgdi[] = { {ACPI_DMT_UINT8, ACPI_AGDI_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_AGDI_FLAG_OFFSET (Flags, 0), "Signalling mode", 0}, {ACPI_DMT_UINT24, ACPI_AGDI_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_AGDI_OFFSET (SdeiEvent), "SdeiEvent", 0}, {ACPI_DMT_UINT32, ACPI_AGDI_OFFSET (Gsiv), "Gsiv", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * APMT - ARM Performance Monitoring Unit Table * * Conforms to: * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document * ARM DEN0117 v1.0 November 25, 2021 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoApmtNode[] = { {ACPI_DMT_UINT16, ACPI_APMTN_OFFSET (Length), "Length of APMT Node", 0}, {ACPI_DMT_UINT8, ACPI_APMTN_OFFSET (Flags), "Node Flags", 0}, {ACPI_DMT_FLAG0, ACPI_APMTN_FLAG_OFFSET (Flags, 0), "Dual Page Extension", 0}, {ACPI_DMT_FLAG1, ACPI_APMTN_FLAG_OFFSET (Flags, 0), "Processor Affinity Type", 0}, {ACPI_DMT_FLAG2, ACPI_APMTN_FLAG_OFFSET (Flags, 0), "64-bit Atomic Support", 0}, {ACPI_DMT_UINT8, ACPI_APMTN_OFFSET (Type), "Node Type", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (Id), "Unique Node Identifier", 0}, {ACPI_DMT_UINT64, ACPI_APMTN_OFFSET (InstPrimary), "Primary Node Instance", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (InstSecondary), "Secondary Node Instance", 0}, {ACPI_DMT_UINT64, ACPI_APMTN_OFFSET (BaseAddress0), "Page 0 Base Address", 0}, {ACPI_DMT_UINT64, ACPI_APMTN_OFFSET (BaseAddress1), "Page 1 Base Address", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (OvflwIrq), "Overflow Interrupt ID", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (OvflwIrqFlags), "Overflow Interrupt Flags", 0}, {ACPI_DMT_FLAG0, ACPI_APMTN_FLAG_OFFSET (OvflwIrqFlags, 0), "Interrupt Mode", 0}, {ACPI_DMT_FLAG1, ACPI_APMTN_FLAG_OFFSET (OvflwIrqFlags, 0), "Interrupt Type", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (ProcAffinity), "Processor Affinity", 0}, {ACPI_DMT_UINT32, ACPI_APMTN_OFFSET (ImplId), "Implementation ID", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * IORT - IO Remapping Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoIort[] = { {ACPI_DMT_UINT32, ACPI_IORT_OFFSET (NodeCount), "Node Count", 0}, {ACPI_DMT_UINT32, ACPI_IORT_OFFSET (NodeOffset), "Node Offset", 0}, {ACPI_DMT_UINT32, ACPI_IORT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Optional padding field */ ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[] = { {ACPI_DMT_RAW_BUFFER, 0, "Optional Padding", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[] = { {ACPI_DMT_UINT8, ACPI_IORTH_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT16, ACPI_IORTH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_IORTH_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (Identifier), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (MappingCount), "Mapping Count", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (MappingOffset), "Mapping Offset", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable)- Revision 3 */ ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr3[] = { {ACPI_DMT_UINT8, ACPI_IORTH_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT16, ACPI_IORTH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_IORTH_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (Identifier), "Identifier", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (MappingCount), "Mapping Count", 0}, {ACPI_DMT_UINT32, ACPI_IORTH_OFFSET (MappingOffset), "Mapping Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[] = { {ACPI_DMT_UINT32, ACPI_IORTM_OFFSET (InputBase), "Input base", DT_OPTIONAL}, {ACPI_DMT_UINT32, ACPI_IORTM_OFFSET (IdCount), "ID Count", 0}, {ACPI_DMT_UINT32, ACPI_IORTM_OFFSET (OutputBase), "Output Base", 0}, {ACPI_DMT_UINT32, ACPI_IORTM_OFFSET (OutputReference), "Output Reference", 0}, {ACPI_DMT_UINT32, ACPI_IORTM_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORTM_FLAG_OFFSET (Flags, 0), "Single Mapping", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[] = { {ACPI_DMT_UINT32, ACPI_IORTA_OFFSET (CacheCoherency), "Cache Coherency", 0}, {ACPI_DMT_UINT8, ACPI_IORTA_OFFSET (Hints), "Hints (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORTA_FLAG_OFFSET (Hints, 0), "Transient", 0}, {ACPI_DMT_FLAG1, ACPI_IORTA_FLAG_OFFSET (Hints, 0), "Write Allocate", 0}, {ACPI_DMT_FLAG2, ACPI_IORTA_FLAG_OFFSET (Hints, 0), "Read Allocate", 0}, {ACPI_DMT_FLAG3, ACPI_IORTA_FLAG_OFFSET (Hints, 0), "Override", 0}, {ACPI_DMT_UINT16, ACPI_IORTA_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_IORTA_OFFSET (MemoryFlags), "Memory Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORTA_FLAG_OFFSET (MemoryFlags, 0), "Coherency", 0}, {ACPI_DMT_FLAG1, ACPI_IORTA_FLAG_OFFSET (MemoryFlags, 0), "Device Attribute", 0}, ACPI_DMT_TERMINATOR }; /* IORT subtables */ /* 0x00: ITS Group */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[] = { {ACPI_DMT_UINT32, ACPI_IORT0_OFFSET (ItsCount), "ItsCount", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[] = { {ACPI_DMT_UINT32, 0, "Identifiers", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 0x01: Named Component */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort1[] = { {ACPI_DMT_UINT32, ACPI_IORT1_OFFSET (NodeFlags), "Node Flags", 0}, {ACPI_DMT_IORTMEM, ACPI_IORT1_OFFSET (MemoryProperties), "Memory Properties", 0}, {ACPI_DMT_UINT8, ACPI_IORT1_OFFSET (MemoryAddressLimit), "Memory Size Limit", 0}, {ACPI_DMT_STRING, ACPI_IORT1_OFFSET (DeviceName[0]), "Device Name", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort1a[] = { {ACPI_DMT_RAW_BUFFER, 0, "Padding", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 0x02: PCI Root Complex */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[] = { {ACPI_DMT_IORTMEM, ACPI_IORT2_OFFSET (MemoryProperties), "Memory Properties", 0}, {ACPI_DMT_UINT32, ACPI_IORT2_OFFSET (AtsAttribute), "ATS Attribute", 0}, {ACPI_DMT_UINT32, ACPI_IORT2_OFFSET (PciSegmentNumber), "PCI Segment Number", 0}, {ACPI_DMT_UINT8, ACPI_IORT2_OFFSET (MemoryAddressLimit), "Memory Size Limit", 0}, {ACPI_DMT_UINT16, ACPI_IORT2_OFFSET (PasidCapabilities), "PASID Capabilities", 0}, {ACPI_DMT_UINT8, ACPI_IORT2_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 0x03: SMMUv1/2 */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[] = { {ACPI_DMT_UINT64, ACPI_IORT3_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_IORT3_OFFSET (Span), "Span", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (Model), "Model", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT3_FLAG_OFFSET (Flags, 0), "DVM Supported", 0}, {ACPI_DMT_FLAG1, ACPI_IORT3_FLAG_OFFSET (Flags, 0), "Coherent Walk", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (GlobalInterruptOffset), "Global Interrupt Offset", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (ContextInterruptCount), "Context Interrupt Count", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (ContextInterruptOffset), "Context Interrupt Offset", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (PmuInterruptCount), "PMU Interrupt Count", 0}, {ACPI_DMT_UINT32, ACPI_IORT3_OFFSET (PmuInterruptOffset), "PMU Interrupt Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[] = { {ACPI_DMT_UINT32, ACPI_IORT3A_OFFSET (NSgIrpt), "NSgIrpt", 0}, {ACPI_DMT_UINT32, ACPI_IORT3A_OFFSET (NSgIrptFlags), "NSgIrpt Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT3a_FLAG_OFFSET (NSgIrptFlags, 0), "Edge Triggered", 0}, {ACPI_DMT_UINT32, ACPI_IORT3A_OFFSET (NSgCfgIrpt), "NSgCfgIrpt", 0}, {ACPI_DMT_UINT32, ACPI_IORT3A_OFFSET (NSgCfgIrptFlags), "NSgCfgIrpt Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT3a_FLAG_OFFSET (NSgCfgIrptFlags, 0), "Edge Triggered", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[] = { {ACPI_DMT_UINT64, 0, "Context Interrupt", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[] = { {ACPI_DMT_UINT64, 0, "PMU Interrupt", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 0x04: SMMUv3 */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = { {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC Override", 0}, {ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU Override", 0}, {ACPI_DMT_FLAG3, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "Proximity Domain Valid", 0}, + {ACPI_DMT_FLAG4, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "DeviceID Valid", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS Address", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (EventGsiv), "Event GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (IdMappingIndex), "Device ID Mapping Index", 0}, ACPI_DMT_TERMINATOR }; /* 0x05: PMCG */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[] = { {ACPI_DMT_UINT64, ACPI_IORT5_OFFSET (Page0BaseAddress), "Page 0 Base Address", 0}, {ACPI_DMT_UINT32, ACPI_IORT5_OFFSET (OverflowGsiv), "Overflow Interrupt GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT5_OFFSET (NodeReference), "Node Reference", 0}, {ACPI_DMT_UINT64, ACPI_IORT5_OFFSET (Page1BaseAddress), "Page 1 Base Address", 0}, ACPI_DMT_TERMINATOR }; /* 0x06: RMR */ ACPI_DMTABLE_INFO AcpiDmTableInfoIort6[] = { {ACPI_DMT_UINT32, ACPI_IORT6_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_IORT6_FLAG_OFFSET (Flags, 0), "Remapping Permitted", 0}, {ACPI_DMT_FLAG1, ACPI_IORT6_FLAG_OFFSET (Flags, 0), "Access Privileged", 0}, {ACPI_DMT_FLAGS8_2, ACPI_IORT6_FLAG_OFFSET (Flags, 0), "Access Attributes", 0}, {ACPI_DMT_UINT32, ACPI_IORT6_OFFSET (RmrCount), "Number of RMR Descriptors", 0}, {ACPI_DMT_UINT32, ACPI_IORT6_OFFSET (RmrOffset), "RMR Descriptor Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIort6a[] = { {ACPI_DMT_UINT64, ACPI_IORT6A_OFFSET (BaseAddress), "Base Address of RMR", DT_OPTIONAL}, {ACPI_DMT_UINT64, ACPI_IORT6A_OFFSET (Length), "Length of RMR", 0}, {ACPI_DMT_UINT32, ACPI_IORT6A_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * IVRS - I/O Virtualization Reporting Structure * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[] = { {ACPI_DMT_UINT32, ACPI_IVRS_OFFSET (Info), "Virtualization Info", 0}, {ACPI_DMT_UINT64, ACPI_IVRS_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* IVRS subtables */ /* 0x10: I/O Virtualization Hardware Definition (IVHD) Block */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHware1[] = { {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_IVRS_FLAG_OFFSET (Flags,0), "HtTunEn", 0}, {ACPI_DMT_FLAG1, ACPI_IVRS_FLAG_OFFSET (Flags,0), "PassPW", 0}, {ACPI_DMT_FLAG2, ACPI_IVRS_FLAG_OFFSET (Flags,0), "ResPassPW", 0}, {ACPI_DMT_FLAG3, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Isoc Control", 0}, {ACPI_DMT_FLAG4, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Iotlb Support", 0}, {ACPI_DMT_FLAG5, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Coherent", 0}, {ACPI_DMT_FLAG6, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Prefetch Support", 0}, {ACPI_DMT_FLAG7, ACPI_IVRS_FLAG_OFFSET (Flags,0), "PPR Support", 0}, {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId", 0}, {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (CapabilityOffset), "Capability Offset", 0}, {ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group", 0}, {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info", 0}, {ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (FeatureReporting), "Feature Reporting", 0}, ACPI_DMT_TERMINATOR }; /* 0x11, 0x40: I/O Virtualization Hardware Definition (IVHD) Block */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHware23[] = { {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_IVRS_FLAG_OFFSET (Flags,0), "HtTunEn", 0}, {ACPI_DMT_FLAG1, ACPI_IVRS_FLAG_OFFSET (Flags,0), "PassPW", 0}, {ACPI_DMT_FLAG2, ACPI_IVRS_FLAG_OFFSET (Flags,0), "ResPassPW", 0}, {ACPI_DMT_FLAG3, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Isoc Control", 0}, {ACPI_DMT_FLAG4, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Iotlb Support", 0}, {ACPI_DMT_FLAG5, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Coherent", 0}, {ACPI_DMT_FLAG6, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Prefetch Support", 0}, {ACPI_DMT_FLAG7, ACPI_IVRS_FLAG_OFFSET (Flags,0), "PPR Support", 0}, {ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (Header.Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (Header.DeviceId), "DeviceId", 0}, {ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (CapabilityOffset), "Capability Offset", 0}, {ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (PciSegmentGroup), "PCI Segment Group", 0}, {ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (Info), "Virtualization Info", 0}, {ACPI_DMT_UINT32, ACPI_IVRS01_OFFSET (Attributes), "Attributes", 0}, {ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (EfrRegisterImage), "EFR Image", 0}, {ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition (IVMD) Device Entry Block */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsMemory[] = { {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Unity", 0}, {ACPI_DMT_FLAG1, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Readable", 0}, {ACPI_DMT_FLAG2, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Writeable", 0}, {ACPI_DMT_FLAG3, ACPI_IVRS_FLAG_OFFSET (Flags,0), "Exclusion Range", 0}, {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId", 0}, {ACPI_DMT_UINT16, ACPI_IVRS1_OFFSET (AuxData), "Auxiliary Data", 0}, {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (StartAddress), "Start Address", 0}, {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (MemoryLength), "Memory Length", 0}, ACPI_DMT_TERMINATOR }; /* Device entry header for IVHD block */ #define ACPI_DMT_IVRS_DE_HEADER \ {ACPI_DMT_IVRS_DE, ACPI_IVRSD_OFFSET (Type), "Subtable Type", 0}, \ {ACPI_DMT_UINT16, ACPI_IVRSD_OFFSET (Id), "Device ID", 0}, \ {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (DataSetting), "Data Setting (decoded below)", 0}, \ {ACPI_DMT_FLAG0, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "INITPass", 0}, \ {ACPI_DMT_FLAG1, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "EIntPass", 0}, \ {ACPI_DMT_FLAG2, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "NMIPass", 0}, \ {ACPI_DMT_FLAG3, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "Reserved", 0}, \ {ACPI_DMT_FLAGS4, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "System MGMT", 0}, \ {ACPI_DMT_FLAG6, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "LINT0 Pass", 0}, \ {ACPI_DMT_FLAG7, ACPI_IVRSDE_FLAG_OFFSET (DataSetting, 0), "LINT1 Pass", 0} /* 4-byte device entry (Types 1,2,3,4) */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[] = { ACPI_DMT_IVRS_DE_HEADER, ACPI_DMT_TERMINATOR }; /* 8-byte device entry (Type Alias Select, Alias Start of Range) */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[] = { ACPI_DMT_IVRS_DE_HEADER, {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_IVRS8A_OFFSET (UsedId), "Source Used Device ID", 0}, {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 8-byte device entry (Type Extended Select, Extended Start of Range) */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[] = { ACPI_DMT_IVRS_DE_HEADER, {ACPI_DMT_UINT32, ACPI_IVRS8B_OFFSET (ExtendedData), "Extended Data", 0}, ACPI_DMT_TERMINATOR }; /* 8-byte device entry (Type Special Device) */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] = { ACPI_DMT_IVRS_DE_HEADER, {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Handle), "Handle", 0}, {ACPI_DMT_UINT16, ACPI_IVRS8C_OFFSET (UsedId), "Source Used Device ID", 0}, {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Variety), "Variety", 0}, ACPI_DMT_TERMINATOR }; /* Variable-length Device Entry Type 0xF0 */ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHid[] = { ACPI_DMT_IVRS_DE_HEADER, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsUidString[] = { {ACPI_DMT_UINT8, 0, "UID Format", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_UINT8, 1, "UID Length", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_IVRS_UNTERMINATED_STRING, 2, "UID", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsUidInteger[] = { {ACPI_DMT_UINT8, 0, "UID Format", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_UINT8, 1, "UID Length", DT_DESCRIBES_OPTIONAL}, {ACPI_DMT_UINT64, 2, "UID", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHidString[] = { {ACPI_DMT_NAME8, 0, "ACPI HID", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHidInteger[] = { {ACPI_DMT_UINT64, 0, "ACPI HID", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsCidString[] = { {ACPI_DMT_NAME8, 0, "ACPI CID", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsCidInteger[] = { {ACPI_DMT_UINT64, 0, "ACPI CID", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * LPIT - Low Power Idle Table * ******************************************************************************/ /* Main table consists only of the standard ACPI table header */ /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[] = { {ACPI_DMT_LPIT, ACPI_LPITH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (UniqueId), "Unique ID", 0}, {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "State Disabled", 0}, {ACPI_DMT_FLAG1, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "No Counter", 0}, ACPI_DMT_TERMINATOR }; /* LPIT Subtables */ /* 0: Native C-state */ ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] = { {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (EntryTrigger), "Entry Trigger", 0}, {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Residency), "Residency", 0}, {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Latency), "Latency", 0}, {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (ResidencyCounter), "Residency Counter", 0}, {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * MADT - Multiple APIC Description Table and subtables * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[] = { {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Address), "Local Apic Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT_FLAG_OFFSET (Flags,0), "PC-AT Compatibility", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[] = { {ACPI_DMT_MADT, ACPI_MADTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_MADTH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* MADT Subtables */ /* 0: processor APIC */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[] = { {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (ProcessorId), "Processor ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, {ACPI_DMT_FLAG1, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Runtime Online Capable", 0}, ACPI_DMT_TERMINATOR }; /* 1: IO APIC */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[] = { {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Id), "I/O Apic ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (Address), "Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (GlobalIrqBase), "Interrupt", 0}, ACPI_DMT_TERMINATOR }; /* 2: Interrupt Override */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2[] = { {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (Bus), "Bus", 0}, {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (SourceIrq), "Source", 0}, {ACPI_DMT_UINT32, ACPI_MADT2_OFFSET (GlobalIrq), "Interrupt", 0}, {ACPI_DMT_UINT16, ACPI_MADT2_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAGS0, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Polarity", 0}, {ACPI_DMT_FLAGS2, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0}, ACPI_DMT_TERMINATOR }; /* 3: NMI Sources */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3[] = { {ACPI_DMT_UINT16, ACPI_MADT3_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAGS0, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Polarity", 0}, {ACPI_DMT_FLAGS2, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0}, {ACPI_DMT_UINT32, ACPI_MADT3_OFFSET (GlobalIrq), "Interrupt", 0}, ACPI_DMT_TERMINATOR }; /* 4: Local APIC NMI */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4[] = { {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (ProcessorId), "Processor ID", 0}, {ACPI_DMT_UINT16, ACPI_MADT4_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAGS0, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Polarity", 0}, {ACPI_DMT_FLAGS2, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0}, {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (Lint), "Interrupt Input LINT", 0}, ACPI_DMT_TERMINATOR }; /* 5: Address Override */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5[] = { {ACPI_DMT_UINT16, ACPI_MADT5_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_MADT5_OFFSET (Address), "APIC Address", 0}, ACPI_DMT_TERMINATOR }; /* 6: I/O Sapic */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6[] = { {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Id), "I/O Sapic ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT6_OFFSET (GlobalIrqBase), "Interrupt Base", 0}, {ACPI_DMT_UINT64, ACPI_MADT6_OFFSET (Address), "Address", 0}, ACPI_DMT_TERMINATOR }; /* 7: Local Sapic */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[] = { {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (ProcessorId), "Processor ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Id), "Local Sapic ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Eid), "Local Sapic EID", 0}, {ACPI_DMT_UINT24, ACPI_MADT7_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT7_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (Uid), "Processor UID", 0}, {ACPI_DMT_STRING, ACPI_MADT7_OFFSET (UidString[0]), "Processor UID String", 0}, ACPI_DMT_TERMINATOR }; /* 8: Platform Interrupt Source */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[] = { {ACPI_DMT_UINT16, ACPI_MADT8_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAGS0, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Polarity", 0}, {ACPI_DMT_FLAGS2, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0}, {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Type), "InterruptType", 0}, {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Id), "Processor ID", 0}, {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Eid), "Processor EID", 0}, {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (IoSapicVector), "I/O Sapic Vector", 0}, {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (GlobalIrq), "Interrupt", 0}, {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT8_OFFSET (Flags), "CPEI Override", 0}, ACPI_DMT_TERMINATOR }; /* 9: Processor Local X2_APIC (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[] = { {ACPI_DMT_UINT16, ACPI_MADT9_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LocalApicId), "Processor x2Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT9_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (Uid), "Processor UID", 0}, ACPI_DMT_TERMINATOR }; /* 10: Local X2_APIC NMI (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] = { {ACPI_DMT_UINT16, ACPI_MADT10_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAGS0, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Polarity", 0}, {ACPI_DMT_FLAGS2, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0}, {ACPI_DMT_UINT32, ACPI_MADT10_OFFSET (Uid), "Processor UID", 0}, {ACPI_DMT_UINT8, ACPI_MADT10_OFFSET (Lint), "Interrupt Input LINT", 0}, {ACPI_DMT_UINT24, ACPI_MADT10_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 11: Generic Interrupt Controller (ACPI 5.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = { {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (CpuInterfaceNumber), "CPU Interface Number", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0}, {ACPI_DMT_FLAG1, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Performance Interrupt Trigger Mode", 0}, {ACPI_DMT_FLAG2, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Virtual GIC Interrupt Trigger Mode", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicvBaseAddress), "Virtual GIC Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GichBaseAddress), "Hypervisor GIC Base Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (VgicInterrupt), "Virtual GIC Interrupt", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0}, {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (EfficiencyClass), "Efficiency Class", 0}, {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (SpeInterrupt), "SPE Overflow Interrupt", 0}, ACPI_DMT_TERMINATOR }; /* 12: Generic Interrupt Distributor (ACPI 5.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] = { {ACPI_DMT_UINT16, ACPI_MADT12_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GicId), "Local GIC Hardware ID", 0}, {ACPI_DMT_UINT64, ACPI_MADT12_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GlobalIrqBase), "Interrupt Base", 0}, {ACPI_DMT_UINT8, ACPI_MADT12_OFFSET (Version), "Version", 0}, {ACPI_DMT_UINT24, ACPI_MADT12_OFFSET (Reserved2[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 13: Generic MSI Frame (ACPI 5.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[] = { {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (MsiFrameId), "MSI Frame ID", 0}, {ACPI_DMT_UINT64, ACPI_MADT13_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT13_FLAG_OFFSET (Flags,0), "Select SPI", 0}, {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiCount), "SPI Count", 0}, {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiBase), "SPI Base", 0}, ACPI_DMT_TERMINATOR }; /* 14: Generic Redistributor (ACPI 5.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] = { {ACPI_DMT_UINT16, ACPI_MADT14_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_MADT14_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT14_OFFSET (Length), "Length", 0}, ACPI_DMT_TERMINATOR }; /* 15: Generic Translator (ACPI 6.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[] = { {ACPI_DMT_UINT16, ACPI_MADT15_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MADT15_OFFSET (TranslationId), "Translation ID", 0}, {ACPI_DMT_UINT64, ACPI_MADT15_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_MADT15_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 16: Multiprocessor wakeup structure (ACPI 6.4) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[] = { {ACPI_DMT_UINT16, ACPI_MADT16_OFFSET (MailboxVersion), "Mailbox Version", 0}, {ACPI_DMT_UINT32, ACPI_MADT16_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_MADT16_OFFSET (BaseAddress), "Mailbox Address", 0}, ACPI_DMT_TERMINATOR }; /* 17: OEM data structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[] = { {ACPI_DMT_RAW_BUFFER, 0, "OEM Data", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * MCFG - PCI Memory Mapped Configuration table and Subtable * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[] = { {ACPI_DMT_UINT64, ACPI_MCFG_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[] = { {ACPI_DMT_UINT64, ACPI_MCFG0_OFFSET (Address), "Base Address", 0}, {ACPI_DMT_UINT16, ACPI_MCFG0_OFFSET (PciSegment), "Segment Group Number", 0}, {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (StartBusNumber), "Start Bus Number", 0}, {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (EndBusNumber), "End Bus Number", 0}, {ACPI_DMT_UINT32, ACPI_MCFG0_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * MCHI - Management Controller Host Interface table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] = { {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterfaceType), "Interface Type", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Protocol), "Protocol", 0}, {ACPI_DMT_UINT64, ACPI_MCHI_OFFSET (ProtocolData), "Protocol Data", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Gpe), "Gpe", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDeviceFlag), "Pci Device Flag", 0}, {ACPI_DMT_UINT32, ACPI_MCHI_OFFSET (GlobalInterrupt), "Global Interrupt", 0}, {ACPI_DMT_GAS, ACPI_MCHI_OFFSET (ControlRegister), "Control Register", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciSegment), "Pci Segment", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciBus), "Pci Bus", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDevice), "Pci Device", 0}, {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciFunction), "Pci Function", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * MPST - Memory Power State Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[] = { {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (ChannelId), "Channel ID", 0}, {ACPI_DMT_UINT24, ACPI_MPST_OFFSET (Reserved1[0]), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (PowerNodeCount), "Power Node Count", 0}, {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* MPST subtables */ /* 0: Memory Power Node Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[] = { {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Node Enabled", 0}, {ACPI_DMT_FLAG1, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Power Managed", 0}, {ACPI_DMT_FLAG2, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Hot Plug Capable", 0}, {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (NodeId), "Node ID", 0}, {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", 0}, {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeAddress), "Range Address", 0}, {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeLength), "Range Length", 0}, {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0}, {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0}, ACPI_DMT_TERMINATOR }; /* 0A: Sub-subtable - Memory Power State Structure (follows Memory Power Node above) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[] = { {ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (PowerState), "Power State", 0}, {ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (InfoIndex), "InfoIndex", 0}, ACPI_DMT_TERMINATOR }; /* 0B: Sub-subtable - Physical Component ID Structure (follows Memory Power State(s) above) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[] = { {ACPI_DMT_UINT16, ACPI_MPST0B_OFFSET (ComponentId), "Component Id", 0}, ACPI_DMT_TERMINATOR }; /* 01: Power Characteristics Count (follows all Power Node(s) above) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] = { {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (CharacteristicsCount), "Characteristics Count", 0}, {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 02: Memory Power State Characteristics Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] = { {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (StructureId), "Structure ID", 0}, {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Memory Preserved", 0}, {ACPI_DMT_FLAG1, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Entry", 0}, {ACPI_DMT_FLAG2, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Exit", 0}, {ACPI_DMT_UINT16, ACPI_MPST2_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (AveragePower), "Average Power", 0}, {ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (PowerSaving), "Power Saving", 0}, {ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (ExitLatency), "Exit Latency", 0}, {ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * MSCT - Maximum System Characteristics Table (ACPI 4.0) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[] = { {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (ProximityOffset), "Proximity Offset", 0}, {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxProximityDomains), "Max Proximity Domains", 0}, {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxClockDomains), "Max Clock Domains", 0}, {ACPI_DMT_UINT64, ACPI_MSCT_OFFSET (MaxAddress), "Max Physical Address", 0}, ACPI_DMT_TERMINATOR }; /* Subtable - Maximum Proximity Domain Information. Version 1 */ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] = { {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeStart), "Domain Range Start", 0}, {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeEnd), "Domain Range End", 0}, {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (ProcessorCapacity), "Processor Capacity", 0}, {ACPI_DMT_UINT64, ACPI_MSCT0_OFFSET (MemoryCapacity), "Memory Capacity", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * NFIT - NVDIMM Firmware Interface Table and Subtables - (ACPI 6.0) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[] = { {ACPI_DMT_UINT32, ACPI_NFIT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfitHdr[] = { {ACPI_DMT_NFIT, ACPI_NFITH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT16, ACPI_NFITH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* 0: System Physical Address Range Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[] = { {ACPI_DMT_UINT16, ACPI_NFIT0_OFFSET (RangeIndex), "Range Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Add/Online Operation Only", 0}, {ACPI_DMT_FLAG1, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Proximity Domain Valid", 0}, {ACPI_DMT_FLAG2, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Location Cookie Valid", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Region Type GUID", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Address), "Address Range Base", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Length), "Address Range Length", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (MemoryMapping), "Memory Map Attribute", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (LocationCookie), "Location Cookie", 0}, /* ACPI 6.4 */ ACPI_DMT_TERMINATOR }; /* 1: Memory Device to System Address Range Map Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[] = { {ACPI_DMT_UINT32, ACPI_NFIT1_OFFSET (DeviceHandle), "Device Handle", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (PhysicalId), "Physical Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (RegionId), "Region Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (RangeIndex), "Range Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (RegionIndex), "Control Region Index", 0}, {ACPI_DMT_UINT64, ACPI_NFIT1_OFFSET (RegionSize), "Region Size", 0}, {ACPI_DMT_UINT64, ACPI_NFIT1_OFFSET (RegionOffset), "Region Offset", 0}, {ACPI_DMT_UINT64, ACPI_NFIT1_OFFSET (Address), "Address Region Base", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (InterleaveIndex), "Interleave Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (InterleaveWays), "Interleave Ways", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (Flags), "Flags", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Save to device failed", 0}, {ACPI_DMT_FLAG1, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Restore from device failed", 0}, {ACPI_DMT_FLAG2, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Platform flush failed", 0}, {ACPI_DMT_FLAG3, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Device not armed", 0}, {ACPI_DMT_FLAG4, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events observed", 0}, {ACPI_DMT_FLAG5, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events enabled", 0}, {ACPI_DMT_FLAG6, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Mapping failed", 0}, {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 2: Interleave Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2[] = { {ACPI_DMT_UINT16, ACPI_NFIT2_OFFSET (InterleaveIndex), "Interleave Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT2_OFFSET (LineCount), "Line Count", 0}, {ACPI_DMT_UINT32, ACPI_NFIT2_OFFSET (LineSize), "Line Size", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2a[] = { {ACPI_DMT_UINT32, 0, "Line Offset", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 3: SMBIOS Management Information Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3[] = { {ACPI_DMT_UINT32, ACPI_NFIT3_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3a[] = { {ACPI_DMT_RAW_BUFFER, 0, "SMBIOS Table Entries", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 4: NVDIMM Control Region Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[] = { {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (RegionIndex), "Region Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (VendorId), "Vendor Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (DeviceId), "Device Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (RevisionId), "Revision Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (SubsystemVendorId), "Subsystem Vendor Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (SubsystemDeviceId), "Subsystem Device Id", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (SubsystemRevisionId), "Subsystem Revision Id", 0}, {ACPI_DMT_UINT8, ACPI_NFIT4_OFFSET (ValidFields), "Valid Fields", 0}, {ACPI_DMT_UINT8, ACPI_NFIT4_OFFSET (ManufacturingLocation), "Manufacturing Location", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (ManufacturingDate), "Manufacturing Date", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT4_OFFSET (SerialNumber), "Serial Number", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (Code), "Code", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (Windows), "Window Count", 0}, {ACPI_DMT_UINT64, ACPI_NFIT4_OFFSET (WindowSize), "Window Size", 0}, {ACPI_DMT_UINT64, ACPI_NFIT4_OFFSET (CommandOffset), "Command Offset", 0}, {ACPI_DMT_UINT64, ACPI_NFIT4_OFFSET (CommandSize), "Command Size", 0}, {ACPI_DMT_UINT64, ACPI_NFIT4_OFFSET (StatusOffset), "Status Offset", 0}, {ACPI_DMT_UINT64, ACPI_NFIT4_OFFSET (StatusSize), "Status Size", 0}, {ACPI_DMT_UINT16, ACPI_NFIT4_OFFSET (Flags), "Flags", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_NFIT4_FLAG_OFFSET (Flags,0), "Windows buffered", 0}, {ACPI_DMT_UINT48, ACPI_NFIT4_OFFSET (Reserved1[0]), "Reserved1", 0}, ACPI_DMT_TERMINATOR }; /* 5: NVDIMM Block Data Window Region Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[] = { {ACPI_DMT_UINT16, ACPI_NFIT5_OFFSET (RegionIndex), "Region Index", 0}, {ACPI_DMT_UINT16, ACPI_NFIT5_OFFSET (Windows), "Window Count", 0}, {ACPI_DMT_UINT64, ACPI_NFIT5_OFFSET (Offset), "Offset", 0}, {ACPI_DMT_UINT64, ACPI_NFIT5_OFFSET (Size), "Size", 0}, {ACPI_DMT_UINT64, ACPI_NFIT5_OFFSET (Capacity), "Capacity", 0}, {ACPI_DMT_UINT64, ACPI_NFIT5_OFFSET (StartAddress), "Start Address", 0}, ACPI_DMT_TERMINATOR }; /* 6: Flush Hint Address Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[] = { {ACPI_DMT_UINT32, ACPI_NFIT6_OFFSET (DeviceHandle), "Device Handle", 0}, {ACPI_DMT_UINT16, ACPI_NFIT6_OFFSET (HintCount), "Hint Count", 0}, {ACPI_DMT_UINT48, ACPI_NFIT6_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] = { {ACPI_DMT_UINT64, 0, "Hint Address", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = { {ACPI_DMT_UINT8, ACPI_NFIT7_OFFSET (HighestCapability), "Highest Capability", 0}, {ACPI_DMT_UINT24, ACPI_NFIT7_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Capabilities), "Capabilities (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Cache Flush to NVDIMM", 0}, {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to NVDIMM", 0}, {ACPI_DMT_FLAG2, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Mirroring", 0}, {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * NHLT - Non HD Audio Link Table. Conforms to Intel Smart Sound Technology * NHLT Specification, January 2020 Revision 0.8.1 * ******************************************************************************/ /* Main table */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt[] = { {ACPI_DMT_UINT8, ACPI_NHLT_OFFSET (EndpointCount), "Endpoint Count", 0}, ACPI_DMT_TERMINATOR }; /* Endpoint config */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt0[] = { {ACPI_DMT_UINT32, ACPI_NHLT0_OFFSET (DescriptorLength), "Descriptor Length", DT_LENGTH}, {ACPI_DMT_NHLT1, ACPI_NHLT0_OFFSET (LinkType), "Link Type", 0}, {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (InstanceId), "Instance Id", 0}, {ACPI_DMT_UINT16, ACPI_NHLT0_OFFSET (VendorId), "Vendor Id", 0}, {ACPI_DMT_NHLT1e, ACPI_NHLT0_OFFSET (DeviceId), "Device Id", 0}, {ACPI_DMT_UINT16, ACPI_NHLT0_OFFSET (RevisionId), "Revision Id", 0}, {ACPI_DMT_UINT32, ACPI_NHLT0_OFFSET (SubsystemId), "Subsystem Id", 0}, {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (DeviceType), "Device Type", 0}, {ACPI_DMT_NHLT1a, ACPI_NHLT0_OFFSET (Direction), "Direction", 0}, {ACPI_DMT_UINT8, ACPI_NHLT0_OFFSET (VirtualBusId), "Virtual Bus Id", 0}, ACPI_DMT_TERMINATOR }; /* Device_Specific config */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt1[] = { {ACPI_DMT_UINT32, ACPI_NHLT1_OFFSET (CapabilitiesSize), "Capabilities Size", 0}, {ACPI_DMT_UINT8, ACPI_NHLT1_OFFSET (VirtualSlot), "Virtual Slot", 0}, {ACPI_DMT_NHLT1f, ACPI_NHLT1_OFFSET (ConfigType), "Config Type", 0}, ACPI_DMT_TERMINATOR }; /* Wave Format Extensible */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt2[] = { {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (FormatTag), "Format Tag", 0}, {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ChannelCount), "Channel Count", 0}, {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (SamplesPerSec), "Samples Per Second", 0}, {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (AvgBytesPerSec), "Average Bytes Per Second", 0}, {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (BlockAlign), "Block Alignment", 0}, {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (BitsPerSample), "Bits Per Sample", 0}, {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ExtraFormatSize), "Extra Format Size", 0}, {ACPI_DMT_UINT16, ACPI_NHLT2_OFFSET (ValidBitsPerSample), "Valid Bits Per Sample", 0}, {ACPI_DMT_UINT32, ACPI_NHLT2_OFFSET (ChannelMask), "Channel Mask", 0}, {ACPI_DMT_UUID, ACPI_NHLT2_OFFSET (SubFormatGuid), "SubFormat GUID", 0}, ACPI_DMT_TERMINATOR }; /* Format Config (wave_format_extensible structure) */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3[] = { {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.FormatTag), "Format Tag", 0}, {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ChannelCount), "Channel Count", 0}, {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.SamplesPerSec), "Samples Per Second", 0}, {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.AvgBytesPerSec), "Average Bytes Per Second", 0}, {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.BlockAlign), "Block Alignment", 0}, {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.BitsPerSample), "Bits Per Sample", 0}, {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ExtraFormatSize), "Extra Format Size", 0}, {ACPI_DMT_UINT16, ACPI_NHLT3_OFFSET (Format.ValidBitsPerSample), "Valid Bits Per Sample", 0}, {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (Format.ChannelMask), "Channel Mask", 0}, {ACPI_DMT_UUID, ACPI_NHLT3_OFFSET (Format.SubFormatGuid), "SubFormat GUID", 0}, {ACPI_DMT_UINT32, ACPI_NHLT3_OFFSET (CapabilitySize), "Capabilities Length", 0}, ACPI_DMT_TERMINATOR }; /* * We treat the binary Capabilities field as its own subtable (to make * ACPI_DMT_RAW_BUFFER work properly). */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3a[] = { {ACPI_DMT_RAW_BUFFER, 0, "Capabilities", 0}, ACPI_DMT_TERMINATOR }; /* Formats Config */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt4[] = { {ACPI_DMT_UINT8, ACPI_NHLT4_OFFSET (FormatsCount), "Formats Count", 0}, ACPI_DMT_TERMINATOR }; /* Specific Config, CapabilitiesSize == 2 */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5[] = { {ACPI_DMT_UINT8, ACPI_NHLT5_OFFSET (VirtualSlot), "Virtual Slot", 0}, {ACPI_DMT_NHLT1f, ACPI_NHLT5_OFFSET (ConfigType), "Config Type", 0}, ACPI_DMT_TERMINATOR }; /* Specific Config, CapabilitiesSize == 3 */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5a[] = { {ACPI_DMT_UINT8, ACPI_NHLT5A_OFFSET (VirtualSlot), "Virtual Slot", 0}, {ACPI_DMT_NHLT1f, ACPI_NHLT5A_OFFSET (ConfigType), "Config Type", 0}, {ACPI_DMT_NHLT1d, ACPI_NHLT5A_OFFSET (ArrayType), "Array Type", 0}, ACPI_DMT_TERMINATOR }; /* Specific Config, CapabilitiesSize == 0 */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5b[] = { {ACPI_DMT_UINT32, ACPI_NHLT5B_OFFSET (CapabilitiesSize), "Capabilities Size", 0}, ACPI_DMT_TERMINATOR }; /* Specific Config, CapabilitiesSize == 1 */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5c[] = { {ACPI_DMT_UINT8, ACPI_NHLT5C_OFFSET (VirtualSlot), "Virtual Slot", 0}, ACPI_DMT_TERMINATOR }; /* Microphone array Config */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6a[] = { {ACPI_DMT_UINT8, ACPI_NHLT6A_OFFSET (MicrophoneCount), "Microphone Count", 0}, ACPI_DMT_TERMINATOR }; /* Render Feedback Device Config, CapabilitiesSize == 7 */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6b[] = { {ACPI_DMT_UINT8, ACPI_NHLT6B_OFFSET (FeedbackVirtualSlot), "Feedback Virtual Slot", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6B_OFFSET (FeedbackChannels), "Feedback Channels", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6B_OFFSET (FeedbackValidBitsPerSample),"Valid Bits Per Sample", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6[] = { {ACPI_DMT_NHLT1b, ACPI_NHLT6_OFFSET (Type), "Type", 0}, {ACPI_DMT_NHLT1c, ACPI_NHLT6_OFFSET (Panel), "Panel", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (SpeakerPositionDistance), "Speaker Position Distance", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (HorizontalOffset), "Horizontal Offset", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (VerticalOffset), "Vertical Offset", 0}, {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (FrequencyLowBand), "Frequency Low Band", 0}, {ACPI_DMT_UINT8, ACPI_NHLT6_OFFSET (FrequencyHighBand), "Frequency High Band", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (DirectionAngle), "Direction Angle", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (ElevationAngle), "Elevation Angle", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkVerticalAngleBegin), "Work Vertical Angle Begin", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkVerticalAngleEnd), "Work Vertical Angle End", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkHorizontalAngleBegin), "Work Horizontal Angle Begin", 0}, {ACPI_DMT_UINT16, ACPI_NHLT6_OFFSET (WorkHorizontalAngleEnd), "Work Horizontal Angle End", 0}, ACPI_DMT_TERMINATOR }; /* Number of DeviceInfo structures */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7[] = { {ACPI_DMT_UINT8, ACPI_NHLT7_OFFSET (StructureCount), "Device Info struct count", 0}, ACPI_DMT_TERMINATOR }; /* The DeviceInfo structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7a[] = { {ACPI_DMT_UUID, ACPI_NHLT7A_OFFSET (DeviceId), "Device ID GUID", 0}, {ACPI_DMT_UINT8, ACPI_NHLT7A_OFFSET (DeviceInstanceId), "Device Instance ID", 0}, {ACPI_DMT_UINT8, ACPI_NHLT7A_OFFSET (DevicePortId), "Device Port ID", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7b[] = { {ACPI_DMT_RAW_BUFFER, 0, "Bytes", 0}, ACPI_DMT_TERMINATOR }; /* Sensitivity Extension */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt9[] = { {ACPI_DMT_UINT32, ACPI_NHLT9_OFFSET (SNR), "Signal-to-noise ratio", 0}, {ACPI_DMT_UINT32, ACPI_NHLT9_OFFSET (Sensitivity), "Mic Sensitivity", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PCCT - Platform Communications Channel Table (ACPI 5.0) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] = { {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Platform", 0}, {ACPI_DMT_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* PCCT subtables */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[] = { {ACPI_DMT_PCCT, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* 0: Generic Communications Subspace */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] = { {ACPI_DMT_UINT48, ACPI_PCCT0_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT0_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (PreserveMask), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (WriteMask), "Write Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (Latency), "Command Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, {ACPI_DMT_UINT16, ACPI_PCCT0_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, ACPI_DMT_TERMINATOR }; /* 1: HW-reduced Communications Subspace (ACPI 5.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] = { {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0}, {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT1_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (PreserveMask), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (WriteMask), "Write Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (Latency), "Command Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, {ACPI_DMT_UINT16, ACPI_PCCT1_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, ACPI_DMT_TERMINATOR }; /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] = { {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_PCCT2_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG1, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Mode", 0}, {ACPI_DMT_UINT8, ACPI_PCCT2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (PreserveMask), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (WriteMask), "Write Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (Latency), "Command Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, {ACPI_DMT_UINT16, ACPI_PCCT2_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (PlatformAckRegister), "Platform ACK Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckWriteMask), "ACK Write Mask", 0}, ACPI_DMT_TERMINATOR }; /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[] = { {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG1, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Mode", 0}, {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (PreserveMask), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (WriteMask), "Write Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Latency), "Command Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (PlatformAckRegister), "Platform ACK Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckSetMask), "ACK Set Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (Reserved2), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdCompleteRegister), "Command Complete Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdUpdateRegister), "Command Update Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (ErrorStatusRegister), "Error Status Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (ErrorStatusMask), "Error Status Mask", 0}, ACPI_DMT_TERMINATOR }; /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[] = { {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG1, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Mode", 0}, {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (PreserveMask), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (WriteMask), "Write Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Latency), "Command Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (PlatformAckRegister), "Platform ACK Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckSetMask), "ACK Set Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (Reserved2), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdCompleteRegister), "Command Complete Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdUpdateRegister), "Command Update Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (ErrorStatusRegister), "Error Status Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (ErrorStatusMask), "Error Status Mask", 0}, ACPI_DMT_TERMINATOR }; /* 5: HW Registers based Communications Subspace */ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct5[] = { {ACPI_DMT_UINT16, ACPI_PCCT5_OFFSET (Version), "Version", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (Length), "Length", 0}, {ACPI_DMT_GAS, ACPI_PCCT5_OFFSET (DoorbellRegister), "Doorbell Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (DoorbellPreserve), "Preserve Mask", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (DoorbellWrite), "Write Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT5_OFFSET (CmdCompleteRegister), "Command Complete Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0}, {ACPI_DMT_GAS, ACPI_PCCT5_OFFSET (ErrorStatusRegister), "Error Status Register", 0}, {ACPI_DMT_UINT64, ACPI_PCCT5_OFFSET (ErrorStatusMask), "Error Status Mask", 0}, {ACPI_DMT_UINT32, ACPI_PCCT5_OFFSET (NominalLatency), "Nominal Latency", 0}, {ACPI_DMT_UINT32, ACPI_PCCT5_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PDTT - Platform Debug Trigger Table (ACPI 6.2) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt[] = { {ACPI_DMT_UINT8, ACPI_PDTT_OFFSET (TriggerCount), "Trigger Count", 0}, {ACPI_DMT_UINT24, ACPI_PDTT_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_PDTT_OFFSET (ArrayOffset), "Array Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[] = { {ACPI_DMT_UINT8, ACPI_PDTT0_OFFSET (SubchannelId), "Subchannel Id", 0}, {ACPI_DMT_UINT8, ACPI_PDTT0_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Runtime Trigger", 0}, {ACPI_DMT_FLAG1, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Wait for Completion", 0}, {ACPI_DMT_FLAG2, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Trigger Order", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PHAT - Platform Health Assessment Table (ACPI 6.4) * ******************************************************************************/ +/* Common subtable header */ + ACPI_DMTABLE_INFO AcpiDmTableInfoPhatHdr[] = { - {ACPI_DMT_PHAT, ACPI_PHATH_OFFSET (Type), "Subtable Type", 0}, - {ACPI_DMT_UINT16, ACPI_PHATH_OFFSET (Length), "Length", 0}, - {ACPI_DMT_UINT8, ACPI_PHATH_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_PHAT, ACPI_PHATH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT16, ACPI_PHATH_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_PHATH_OFFSET (Revision), "Revision", 0}, ACPI_DMT_TERMINATOR }; /* 0: Firmware version table */ ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0[] = { - {ACPI_DMT_UINT24, ACPI_PHAT0_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_PHAT0_OFFSET (ElementCount), "Element Count", 0}, + {ACPI_DMT_UINT24, ACPI_PHAT0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_PHAT0_OFFSET (ElementCount), "Element Count", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0a[] = { - {ACPI_DMT_UUID, ACPI_PHAT0A_OFFSET (Guid), "GUID", 0}, - {ACPI_DMT_UINT64, ACPI_PHAT0A_OFFSET (VersionValue), "Version Value", 0}, - {ACPI_DMT_UINT32, ACPI_PHAT0A_OFFSET (ProducerId), "Producer ID", 0}, + {ACPI_DMT_UUID, ACPI_PHAT0A_OFFSET (Guid), "GUID", 0}, + {ACPI_DMT_UINT64, ACPI_PHAT0A_OFFSET (VersionValue), "Version Value", 0}, + {ACPI_DMT_UINT32, ACPI_PHAT0A_OFFSET (ProducerId), "Producer ID", 0}, ACPI_DMT_TERMINATOR }; /* 1: Firmware Health Data Record */ ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1[] = { - {ACPI_DMT_UINT16, ACPI_PHAT1_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT8, ACPI_PHAT1_OFFSET (Health), "Health", 0}, - {ACPI_DMT_UUID, ACPI_PHAT1_OFFSET (DeviceGuid), "Device GUID", 0}, - {ACPI_DMT_UINT32, ACPI_PHAT1_OFFSET (DeviceSpecificOffset), "Device specific offset", 0}, + {ACPI_DMT_UINT16, ACPI_PHAT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_PHAT1_OFFSET (Health), "Health", 0}, + {ACPI_DMT_UUID, ACPI_PHAT1_OFFSET (DeviceGuid), "Device GUID", 0}, + {ACPI_DMT_UINT32, ACPI_PHAT1_OFFSET (DeviceSpecificOffset), "Device-Specific Offset", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1a[] = { - {ACPI_DMT_STRING, 0, "Namepath", 0}, + {ACPI_DMT_UNICODE, 0, "Device Path", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1b[] = { - {ACPI_DMT_RAW_BUFFER, 0, "Vendor Data", 0}, + {ACPI_DMT_RAW_BUFFER, 0, "Device-Specific Data", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PMTT - Platform Memory Topology Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[] = { {ACPI_DMT_UINT32, ACPI_PMTT_OFFSET (MemoryDeviceCount), "Memory Device Count", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ #define ACPI_DM_PMTT_HEADER \ {ACPI_DMT_PMTT, ACPI_PMTTH_OFFSET (Type), "Subtable Type", 0}, \ {ACPI_DMT_UINT8, ACPI_PMTTH_OFFSET (Reserved1), "Reserved", 0}, \ {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Length), "Length", DT_LENGTH}, \ {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, \ {ACPI_DMT_FLAG0, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Top-level Device", 0}, \ {ACPI_DMT_FLAG1, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Physical Element", 0}, \ {ACPI_DMT_FLAGS2, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Memory Type", 0}, \ {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Reserved2), "Reserved", 0}, \ {ACPI_DMT_UINT32, ACPI_PMTTH_OFFSET (MemoryDeviceCount), "Memory Device Count", 0} /* PMTT Subtables */ /* 0: Socket */ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[] = { ACPI_DM_PMTT_HEADER, {ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (SocketId), "Socket ID", 0}, {ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 1: Memory Controller */ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[] = { ACPI_DM_PMTT_HEADER, {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (ControllerId), "Controller ID", 0}, {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 2: Physical Component */ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] = { ACPI_DM_PMTT_HEADER, {ACPI_DMT_UINT32, ACPI_PMTT2_OFFSET (BiosHandle), "Bios Handle", 0}, ACPI_DMT_TERMINATOR }; /* 0xFF: Vendor Specific */ ACPI_DMTABLE_INFO AcpiDmTableInfoPmttVendor[] = { ACPI_DM_PMTT_HEADER, {ACPI_DMT_UUID, ACPI_PMTT_VENDOR_OFFSET (TypeUuid), "Type Uuid", 0}, {ACPI_DMT_PMTT_VENDOR, ACPI_PMTT_VENDOR_OFFSET (Specific), "Vendor Data", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PPTT - Processor Properties Topology Table (ACPI 6.2) * ******************************************************************************/ /* Main table consists of only the standard ACPI header - subtables follow */ /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[] = { {ACPI_DMT_PPTT, ACPI_PPTTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_PPTTH_OFFSET (Length), "Length", 0}, ACPI_DMT_TERMINATOR }; /* 0: Processor hierarchy node */ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] = { {ACPI_DMT_UINT16, ACPI_PPTT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0}, {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0}, {ACPI_DMT_FLAG2, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Processor is a thread", 0}, {ACPI_DMT_FLAG3, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Node is a leaf", 0}, {ACPI_DMT_FLAG4, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Identical Implementation", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[] = { {ACPI_DMT_UINT32, 0, "Private Resource", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 1: Cache type */ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] = { {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Size valid", 0}, {ACPI_DMT_FLAG1, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Number of Sets valid", 0}, {ACPI_DMT_FLAG2, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Associativity valid", 0}, {ACPI_DMT_FLAG3, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Allocation Type valid", 0}, {ACPI_DMT_FLAG4, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Cache Type valid", 0}, {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Write Policy valid", 0}, {ACPI_DMT_FLAG6, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Line Size valid", 0}, {ACPI_DMT_FLAG7, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Cache ID valid", 0}, {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NextLevelOfCache), "Next Level of Cache", 0}, {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Size), "Size", 0}, {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NumberOfSets), "Number of Sets", 0}, {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Associativity), "Associativity", 0}, {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Attributes), "Attributes", 0}, {ACPI_DMT_FLAGS0, ACPI_PPTT1_OFFSET (Attributes), "Allocation Type", 0}, {ACPI_DMT_FLAGS2, ACPI_PPTT1_OFFSET (Attributes), "Cache Type", 0}, {ACPI_DMT_FLAG4, ACPI_PPTT1_OFFSET (Attributes), "Write Policy", 0}, {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (LineSize), "Line Size", 0}, ACPI_DMT_TERMINATOR }; /* 1: cache type v1 */ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1a[] = { {ACPI_DMT_UINT32, ACPI_PPTT1A_OFFSET (CacheId), "Cache ID", 0}, ACPI_DMT_TERMINATOR }; /* 2: ID */ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] = { {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "Vendor ID", 0}, {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "Level1 ID", 0}, {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "Level2 ID", 0}, {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "Major revision", 0}, {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "Minor revision", 0}, {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "Spin revision", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * PRMT - Platform Runtime Mechanism Table * Version 1 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtHdr[] = { {ACPI_DMT_UUID, ACPI_PRMTH_OFFSET (PlatformGuid[0]), "Platform GUID", 0}, {ACPI_DMT_UINT32, ACPI_PRMTH_OFFSET (ModuleInfoOffset), "Module info offset", 0}, {ACPI_DMT_UINT32, ACPI_PRMTH_OFFSET (ModuleInfoCount), "Module info count", 0}, ACPI_DMT_NEW_LINE, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtModule[] = { {ACPI_DMT_UINT16, ACPI_PRMT0_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT16, ACPI_PRMT0_OFFSET (Length), "Length", 0}, {ACPI_DMT_UUID, ACPI_PRMT0_OFFSET (ModuleGuid[0]), "Module GUID", 0}, {ACPI_DMT_UINT16, ACPI_PRMT0_OFFSET (MajorRev), "Major Revision", 0}, {ACPI_DMT_UINT16, ACPI_PRMT0_OFFSET (MinorRev), "Minor Revision", 0}, {ACPI_DMT_UINT16, ACPI_PRMT0_OFFSET (HandlerInfoCount), "Handler Info Count", 0}, {ACPI_DMT_UINT32, ACPI_PRMT0_OFFSET (HandlerInfoOffset), "Handler Info Offset", 0}, {ACPI_DMT_UINT64, ACPI_PRMT0_OFFSET (MmioListPointer), "Mmio List pointer", 0}, ACPI_DMT_NEW_LINE, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtHandler[] = { {ACPI_DMT_UINT16, ACPI_PRMT1_OFFSET (Revision), "Revision", 0}, {ACPI_DMT_UINT16, ACPI_PRMT1_OFFSET (Length), "Length", 0}, {ACPI_DMT_UUID, ACPI_PRMT1_OFFSET (HandlerGuid[0]), "Handler GUID", 0}, {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (HandlerAddress), "Handler address", 0}, - {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (StaticDataBufferAddress),"Satic Data Address", 0}, + {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (StaticDataBufferAddress),"Static Data Address", 0}, {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (AcpiParamBufferAddress), "ACPI Parameter Address", 0}, ACPI_DMT_NEW_LINE, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * RASF - RAS Feature table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[] = { {ACPI_DMT_BUF12, ACPI_RASF_OFFSET (ChannelId[0]), "Channel ID", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * RGRT - Regulatory Graphics Resource Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt[] = { {ACPI_DMT_UINT16, ACPI_RGRT_OFFSET (Version), "Version", 0}, {ACPI_DMT_RGRT, ACPI_RGRT_OFFSET (ImageType), "Image Type", 0}, {ACPI_DMT_UINT8, ACPI_RGRT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* * We treat the binary image field as its own subtable (to make * ACPI_DMT_RAW_BUFFER work properly). */ ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt0[] = { {ACPI_DMT_RAW_BUFFER, 0, "Image", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * S3PT - S3 Performance Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[] = { {ACPI_DMT_SIG, ACPI_S3PT_OFFSET (Signature[0]), "Signature", 0}, {ACPI_DMT_UINT32, ACPI_S3PT_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* S3PT subtable header */ ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[] = { {ACPI_DMT_UINT16, ACPI_S3PTH_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Length), "Length", DT_LENGTH}, {ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Revision), "Revision", 0}, ACPI_DMT_TERMINATOR }; /* 0: Basic S3 Resume Performance Record */ ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[] = { {ACPI_DMT_UINT32, ACPI_S3PT0_OFFSET (ResumeCount), "Resume Count", 0}, {ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (FullResume), "Full Resume", 0}, {ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (AverageResume), "Average Resume", 0}, ACPI_DMT_TERMINATOR }; /* 1: Basic S3 Suspend Performance Record */ ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[] = { {ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendStart), "Suspend Start", 0}, {ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendEnd), "Suspend End", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SBST - Smart Battery Specification Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] = { {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (WarningLevel), "Warning Level", 0}, {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (LowLevel), "Low Level", 0}, {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (CriticalLevel), "Critical Level", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SDEI - Software Delegated Exception Interface Descriptor Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[] = { ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SDEV - Secure Devices Table (ACPI 6.2) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSdev[] = { ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdevHdr[] = { {ACPI_DMT_SDEV, ACPI_SDEVH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_SDEVH_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_SDEVH_FLAG_OFFSET (Flags,0), "Allow handoff to unsecure OS", 0}, {ACPI_DMT_FLAG1, ACPI_SDEVH_FLAG_OFFSET (Flags,0), "Secure access components present", 0}, {ACPI_DMT_UINT16, ACPI_SDEVH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* SDEV Subtables */ /* 0: Namespace Device Based Secure Device Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0[] = { {ACPI_DMT_UINT16, ACPI_SDEV0_OFFSET (DeviceIdOffset), "Device ID Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEV0_OFFSET (DeviceIdLength), "Device ID Length", 0}, {ACPI_DMT_UINT16, ACPI_SDEV0_OFFSET (VendorDataOffset), "Vendor Data Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEV0_OFFSET (VendorDataLength), "Vendor Data Length", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0a[] = { {ACPI_DMT_STRING, 0, "Namepath", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0b[] = { {ACPI_DMT_UINT16, ACPI_SDEV0B_OFFSET (SecureComponentOffset), "Secure Access Components Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEV0B_OFFSET (SecureComponentLength), "Secure Access Components Length", 0}, ACPI_DMT_TERMINATOR }; /* Secure access components */ /* Common secure access components header secure access component */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompHdr[] = { {ACPI_DMT_UINT8, ACPI_SDEVCH_OFFSET (Type), "Secure Component Type", 0}, {ACPI_DMT_UINT8, ACPI_SDEVCH_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_UINT16, ACPI_SDEVCH_OFFSET (Length), "Length", 0}, ACPI_DMT_TERMINATOR }; /* 0: Identification Based Secure Access Component */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompId[] = { {ACPI_DMT_UINT16, ACPI_SDEVC0_OFFSET (HardwareIdOffset), "Hardware ID Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEVC0_OFFSET (HardwareIdLength), "Hardware ID Length", 0}, {ACPI_DMT_UINT16, ACPI_SDEVC0_OFFSET (SubsystemIdOffset), "Subsystem ID Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEVC0_OFFSET (SubsystemIdLength), "Subsystem ID Length", 0}, {ACPI_DMT_UINT16, ACPI_SDEVC0_OFFSET (HardwareRevision), "Hardware Revision", 0}, {ACPI_DMT_UINT8, ACPI_SDEVC0_OFFSET (HardwareRevPresent), "Hardware Rev Present", 0}, {ACPI_DMT_UINT8, ACPI_SDEVC0_OFFSET (ClassCodePresent), "Class Code Present", 0}, {ACPI_DMT_UINT8, ACPI_SDEVC0_OFFSET (PciBaseClass), "PCI Base Class", 0}, {ACPI_DMT_UINT8, ACPI_SDEVC0_OFFSET (PciSubClass), "PCI SubClass", 0}, {ACPI_DMT_UINT8, ACPI_SDEVC0_OFFSET (PciProgrammingXface), "PCI Programming Xface", 0}, ACPI_DMT_TERMINATOR }; /* 1: Memory Based Secure Access Component */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompMem[] = { {ACPI_DMT_UINT32, ACPI_SDEVC1_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_SDEVC1_OFFSET (MemoryBaseAddress), "Memory Base Address", 0}, {ACPI_DMT_UINT64, ACPI_SDEVC1_OFFSET (MemoryLength), "Memory Length", 0}, ACPI_DMT_TERMINATOR }; /* 1: PCIe Endpoint Device Based Device Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1[] = { {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (Segment), "Segment", 0}, {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (StartBus), "Start Bus", 0}, {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (PathOffset), "Path Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (PathLength), "Path Length", 0}, {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (VendorDataOffset), "Vendor Data Offset", 0}, {ACPI_DMT_UINT16, ACPI_SDEV1_OFFSET (VendorDataLength), "Vendor Data Length", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1a[] = { {ACPI_DMT_UINT8, ACPI_SDEV1A_OFFSET (Device), "Device", 0}, {ACPI_DMT_UINT8, ACPI_SDEV1A_OFFSET (Function), "Function", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1b[] = { {ACPI_DMT_RAW_BUFFER, 0, "Vendor Data", 0}, /*, DT_OPTIONAL}, */ ACPI_DMT_TERMINATOR }; /*! [End] no source code translation !*/ diff --git a/sys/contrib/dev/acpica/common/dmtbinfo3.c b/sys/contrib/dev/acpica/common/dmtbinfo3.c index 38fe8f9d23ac..3fbdf0799303 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo3.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo3.c @@ -1,869 +1,886 @@ /****************************************************************************** * * Module Name: dmtbinfo3 - Table info for non-AML tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include /* This module used for application-level code only */ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtbinfo3") /* * How to add a new table: * * - Add the C table definition to the actbl1.h or actbl2.h header. * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below. * - Define the table in this file (for the disassembler). If any * new data types are required (ACPI_DMT_*), see below. * - Add an external declaration for the new table definition (AcpiDmTableInfo*) * in acdisam.h * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData) * If a simple table (with no subtables), no disassembly code is needed. * Otherwise, create the AcpiDmDump* function for to disassemble the table * and add it to the dmtbdump.c file. * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c * - Create a template for the new table * - Add data table compiler support * * How to add a new data type (ACPI_DMT_*): * * - Add new type at the end of the ACPI_DMT list in acdisasm.h * - Add length and implementation cases in dmtable.c (disassembler) * - Add type and length cases in dtutils.c (DT compiler) */ /* * ACPI Table Information, used to dump formatted ACPI tables * * Each entry is of the form: */ +/******************************************************************************* + * + * CCEL - CC-Event Log Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCcel[] = +{ + {ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCType), "CC Type", 0}, + {ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCSubType), "CC Sub Type", 0}, + {ACPI_DMT_UINT32, ACPI_CCEL_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaMinimumLength), "Log Area Minimum Length", 0}, + {ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaStartAddress), "Log Area Start Address", 0}, + ACPI_DMT_TERMINATOR +}; + + /******************************************************************************* * * SLIC - Software Licensing Description Table. This table contains the standard * ACPI header followed by proprietary data structures * ******************************************************************************/ /* Single subtable, a proprietary format, so treat it as a buffer */ ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] = { {ACPI_DMT_RAW_BUFFER, 0, "Software Licensing Structure", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SLIT - System Locality Information Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] = { {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SPCR - Serial Port Console Redirection table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] = { {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterfaceType), "Interface Type", 0}, {ACPI_DMT_UINT24, ACPI_SPCR_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_SPCR_OFFSET (SerialPort), "Serial Port Register", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PcInterrupt), "PCAT-compatible IRQ", 0}, {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Interrupt), "Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (BaudRate), "Baud Rate", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Parity), "Parity", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (StopBits), "Stop Bits", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (FlowControl), "Flow Control", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (TerminalType), "Terminal Type", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciDeviceId), "PCI Device ID", 0}, {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciVendorId), "PCI Vendor ID", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciBus), "PCI Bus", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciDevice), "PCI Device", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciFunction), "PCI Function", 0}, {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (PciFlags), "PCI Flags", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciSegment), "PCI Segment", 0}, {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SPMI - Server Platform Management Interface table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] = { {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */ {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDeviceFlag), "PCI Device Flag", 0}, {ACPI_DMT_UINT32, ACPI_SPMI_OFFSET (Interrupt), "Interrupt", 0}, {ACPI_DMT_GAS, ACPI_SPMI_OFFSET (IpmiRegister), "IPMI Register", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciSegment), "PCI Segment", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciBus), "PCI Bus", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDevice), "PCI Device", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciFunction), "PCI Function", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SRAT - System Resource Affinity Table and Subtables * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat[] = { {ACPI_DMT_UINT32, ACPI_SRAT_OFFSET (TableRevision), "Table Revision", 0}, {ACPI_DMT_UINT64, ACPI_SRAT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Common Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[] = { {ACPI_DMT_SRAT, ACPI_SRATH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT8, ACPI_SRATH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* SRAT Subtables */ /* 0: Processor Local APIC/SAPIC Affinity */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] = { {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ProximityDomainLo), "Proximity Domain Low(8)", 0}, {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ApicId), "Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0}, {ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0}, {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0}, ACPI_DMT_TERMINATOR }; /* 1: Memory Affinity */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] = { {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved1", 0}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length", 0}, {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved2", 0}, {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable", 0}, {ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile", 0}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved3", 0}, ACPI_DMT_TERMINATOR }; /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] = { {ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; /* 3: GICC Affinity (ACPI 5.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] = { {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0}, {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0}, ACPI_DMT_TERMINATOR }; /* 4: GCC ITS Affinity (ACPI 6.2) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = { {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UINT16, ACPI_SRAT4_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ItsId), "ITS ID", 0}, ACPI_DMT_TERMINATOR }; /* Common SRAT structure for Generic Affinity Subtables */ #define ACPI_DM_SRAT_GENERIC_AFFINITY \ {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, \ {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, \ {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, \ {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, \ {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, \ {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, \ {ACPI_DMT_FLAG1, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Architectural Transactions", 0}, \ {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0} /* 5: Generic Initiator Affinity Structure (ACPI 6.3) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[] = { ACPI_DM_SRAT_GENERIC_AFFINITY, ACPI_DMT_TERMINATOR }; /* 6: Generic Port Affinity Structure (ACPI 6.4) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat6[] = { ACPI_DM_SRAT_GENERIC_AFFINITY, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * STAO - Status Override Table (_STA override) - ACPI 6.0 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoStao[] = { {ACPI_DMT_UINT8, ACPI_STAO_OFFSET (IgnoreUart), "Ignore UART", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[] = { {ACPI_DMT_STRING, 0, "Namepath", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * SVKL - Storage Volume Key Location table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoSvkl[] = { {ACPI_DMT_UINT32, ACPI_SVKL_OFFSET (Count), "Key Count", 0}, ACPI_DMT_TERMINATOR }; /* SVKL subtables */ ACPI_DMTABLE_INFO AcpiDmTableInfoSvkl0[] = { {ACPI_DMT_UINT16, ACPI_SVKL0_OFFSET (Type), "Key Type", 0}, {ACPI_DMT_UINT16, ACPI_SVKL0_OFFSET (Format), "Key Format", 0}, {ACPI_DMT_UINT32, ACPI_SVKL0_OFFSET (Size), "Key Size", 0}, {ACPI_DMT_UINT64, ACPI_SVKL0_OFFSET (Address), "Key Address", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * TCPA - Trusted Computing Platform Alliance table (Client) * * NOTE: There are two versions of the table with the same signature -- * the client version and the server version. The common PlatformClass * field is used to differentiate the two types of tables. * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[] = { {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (PlatformClass), "Platform Class", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[] = { {ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, {ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[] = { {ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, {ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (LogAddress), "Event Log Address", 0}, {ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (SpecRevision), "Specification Revision", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Device Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Pci Device", 0}, {ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Bus is Pnp", 0}, {ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Address Valid", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Interrupt Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Mode", 0}, {ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Polarity", 0}, {ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "GPE SCI Triggered", 0}, {ACPI_DMT_FLAG3, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Global System Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (GpeNumber), "Gpe Number", 0}, {ACPI_DMT_UINT24, ACPI_TCPA_SERVER_OFFSET (Reserved2[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (GlobalInterrupt), "Global Interrupt", 0}, {ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (Address), "Address", 0}, {ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (Reserved3), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (ConfigAddress), "Configuration Address", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Group), "Pci Group", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Bus), "Pci Bus", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Device), "Pci Device", 0}, {ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Function), "Pci Function", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * TDEL - TD-Event Log Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoTdel[] = { {ACPI_DMT_UINT32, ACPI_TDEL_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TDEL_OFFSET (LogAreaMinimumLength), "Log Area Minimum Length", 0}, {ACPI_DMT_UINT64, ACPI_TDEL_OFFSET (LogAreaStartAddress), "Log Area Start Address", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table * ******************************************************************************/ /* TPM2 revision 3 */ ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[] = { {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TPM23_OFFSET (ControlAddress), "Control Address", 0}, {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (StartMethod), "Start Method", 0}, ACPI_DMT_TERMINATOR }; /* Trailer in the case that StartMethod == 2 */ ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[] = { {ACPI_DMT_UINT32, ACPI_TPM23A_OFFSET (Reserved), "Reserved", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* TPM2 revision 4 */ ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, {ACPI_DMT_TPM2, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, ACPI_DMT_TERMINATOR }; /* Optional trailer. LogLength and LogAddress are additionally optional */ ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2a[] = { {ACPI_DMT_BUF12, ACPI_TPM2A_OFFSET (MethodParameters), "Method Parameters", DT_OPTIONAL}, {ACPI_DMT_UINT32, ACPI_TPM2A_OFFSET (MinimumLogLength), "Minimum Log Length", DT_OPTIONAL}, {ACPI_DMT_UINT64, ACPI_TPM2A_OFFSET (LogAddress), "Log Address", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; /* 11: Start Method for ARM SMC */ ACPI_DMTABLE_INFO AcpiDmTableInfoTpm211[] = { {ACPI_DMT_UINT32, ACPI_TPM211_OFFSET (GlobalInterrupt), "Global Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_TPM211_OFFSET (InterruptFlags), "Interrupt Flags", 0}, {ACPI_DMT_UINT8, ACPI_TPM211_OFFSET (OperationFlags), "Operation Flags", 0}, {ACPI_DMT_UINT16, ACPI_TPM211_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_TPM211_OFFSET (FunctionId), "Function ID", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * UEFI - UEFI Boot optimization Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] = { {ACPI_DMT_UUID, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier", 0}, {ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * VIOT - Virtual I/O Translation Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoViot[] = { {ACPI_DMT_UINT16, ACPI_VIOT_OFFSET (NodeCount), "Node count", 0}, {ACPI_DMT_UINT16, ACPI_VIOT_OFFSET (NodeOffset), "Node offset", 0}, {ACPI_DMT_UINT64, ACPI_VIOT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* Common VIOT subtable header */ ACPI_DMTABLE_INFO AcpiDmTableInfoViotHeader[] = { {ACPI_DMT_VIOT, ACPI_VIOTH_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT8, ACPI_VIOTH_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_VIOTH_OFFSET (Length), "Length", DT_LENGTH}, ACPI_DMT_TERMINATOR }; /* VIOT Subtables */ /* 0x01: PCI Range Node */ ACPI_DMTABLE_INFO AcpiDmTableInfoViot1[] = { {ACPI_DMT_UINT32, ACPI_VIOT1_OFFSET (EndpointStart), "Endpoint start", 0}, {ACPI_DMT_UINT16, ACPI_VIOT1_OFFSET (SegmentStart), "PCI Segment start", 0}, {ACPI_DMT_UINT16, ACPI_VIOT1_OFFSET (SegmentEnd), "PCI Segment end", 0}, {ACPI_DMT_UINT16, ACPI_VIOT1_OFFSET (BdfStart), "PCI BDF start", 0}, {ACPI_DMT_UINT16, ACPI_VIOT1_OFFSET (BdfEnd), "PCI BDF end", 0}, {ACPI_DMT_UINT16, ACPI_VIOT1_OFFSET (OutputNode), "Output node", 0}, {ACPI_DMT_UINT48, ACPI_VIOT1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 0x02: MMIO Endpoint Node */ ACPI_DMTABLE_INFO AcpiDmTableInfoViot2[] = { {ACPI_DMT_UINT32, ACPI_VIOT2_OFFSET (Endpoint), "Endpoint", 0}, {ACPI_DMT_UINT64, ACPI_VIOT2_OFFSET (BaseAddress), "Base address", 0}, {ACPI_DMT_UINT16, ACPI_VIOT2_OFFSET (OutputNode), "Output node", 0}, {ACPI_DMT_UINT48, ACPI_VIOT2_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 0x03: PCI Virtio-IOMMU Node */ ACPI_DMTABLE_INFO AcpiDmTableInfoViot3[] = { {ACPI_DMT_UINT16, ACPI_VIOT3_OFFSET (Segment), "PCI Segment", 0}, {ACPI_DMT_UINT16, ACPI_VIOT3_OFFSET (Bdf), "PCI BDF number", 0}, {ACPI_DMT_UINT64, ACPI_VIOT3_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; /* 0x04: MMIO Virtio-IOMMU Node */ ACPI_DMTABLE_INFO AcpiDmTableInfoViot4[] = { {ACPI_DMT_UINT32, ACPI_VIOT4_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_VIOT4_OFFSET (BaseAddress), "Base address", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WAET - Windows ACPI Emulated devices Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[] = { {ACPI_DMT_UINT32, ACPI_WAET_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_WAET_OFFSET (Flags), "RTC needs no INT ack", 0}, {ACPI_DMT_FLAG1, ACPI_WAET_OFFSET (Flags), "PM timer, one read only", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WDAT - Watchdog Action Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[] = { {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (HeaderLength), "Header Length", DT_LENGTH}, {ACPI_DMT_UINT16, ACPI_WDAT_OFFSET (PciSegment), "PCI Segment", 0}, {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciBus), "PCI Bus", 0}, {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciDevice), "PCI Device", 0}, {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciFunction), "PCI Function", 0}, {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (TimerPeriod), "Timer Period", 0}, {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MaxCount), "Max Count", 0}, {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MinCount), "Min Count", 0}, {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_WDAT_OFFSET (Flags), "Enabled", 0}, {ACPI_DMT_FLAG7, ACPI_WDAT_OFFSET (Flags), "Stopped When Asleep", 0}, {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved2[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (Entries), "Watchdog Entry Count", 0}, ACPI_DMT_TERMINATOR }; /* WDAT Subtables - Watchdog Instruction Entries */ ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] = { {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Action), "Watchdog Action", 0}, {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Instruction), "Instruction", 0}, {ACPI_DMT_UINT16, ACPI_WDAT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_WDAT0_OFFSET (RegisterRegion), "Register Region", 0}, {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Value), "Value", 0}, {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Mask), "Register Mask", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WDDT - Watchdog Description Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[] = { {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (SpecVersion), "Specification Version", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (TableVersion), "Table Version", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (PciVendorId), "PCI Vendor ID", 0}, {ACPI_DMT_GAS, ACPI_WDDT_OFFSET (Address), "Timer Register", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MaxCount), "Max Count", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MinCount), "Min Count", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Period), "Period", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Status), "Status (decoded below)", 0}, /* Status Flags byte 0 */ {ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Status,0), "Available", 0}, {ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Status,0), "Active", 0}, {ACPI_DMT_FLAG2, ACPI_WDDT_FLAG_OFFSET (Status,0), "OS Owns", 0}, /* Status Flags byte 1 */ {ACPI_DMT_FLAG3, ACPI_WDDT_FLAG_OFFSET (Status,1), "User Reset", 0}, {ACPI_DMT_FLAG4, ACPI_WDDT_FLAG_OFFSET (Status,1), "Timeout Reset", 0}, {ACPI_DMT_FLAG5, ACPI_WDDT_FLAG_OFFSET (Status,1), "Power Fail Reset", 0}, {ACPI_DMT_FLAG6, ACPI_WDDT_FLAG_OFFSET (Status,1), "Unknown Reset", 0}, {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Capability), "Capability (decoded below)", 0}, /* Capability Flags byte 0 */ {ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Auto Reset", 0}, {ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Timeout Alert", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WDRT - Watchdog Resource Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] = { {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (ControlRegister), "Control Register", 0}, {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (CountRegister), "Count Register", 0}, {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciDeviceId), "PCI Device ID", 0}, {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciVendorId), "PCI Vendor ID", 0}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciBus), "PCI Bus", 0}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciDevice), "PCI Device", 0}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciFunction), "PCI Function", 0}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment", 0}, {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (MaxCount), "Max Count", 0}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WPBT - Windows Platform Environment Table (ACPI 6.0) * Version 1 * * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011 * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[] = { {ACPI_DMT_UINT32, ACPI_WPBT_OFFSET (HandoffSize), "Handoff Size", 0}, {ACPI_DMT_UINT64, ACPI_WPBT_OFFSET (HandoffAddress), "Handoff Address", 0}, {ACPI_DMT_UINT8, ACPI_WPBT_OFFSET (Layout), "Layout", 0}, {ACPI_DMT_UINT8, ACPI_WPBT_OFFSET (Type), "Type", 0}, {ACPI_DMT_UINT16, ACPI_WPBT_OFFSET (ArgumentsLength), "Arguments Length", 0}, ACPI_DMT_TERMINATOR }; ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] = { {ACPI_DMT_WPBT_UNICODE, ACPI_WPBT2_OFFSET (UnicodeString), "Command-line Arguments", DT_DESCRIBES_OPTIONAL}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * WSMT - Windows SMM Security Mitigations Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[] = { {ACPI_DMT_UINT32, ACPI_WSMT_OFFSET (ProtectionFlags), "Protection Flags", 0}, {ACPI_DMT_FLAG0, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "FIXED_COMM_BUFFERS", 0}, {ACPI_DMT_FLAG1, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "COMM_BUFFER_NESTED_PTR_PROTECTION", 0}, {ACPI_DMT_FLAG2, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "SYSTEM_RESOURCE_PROTECTION", 0}, ACPI_DMT_TERMINATOR }; /******************************************************************************* * * XENV - Xen Environment table (ACPI 6.0) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[] = { {ACPI_DMT_UINT64, ACPI_XENV_OFFSET (GrantTableAddress), "Grant Table Address", 0}, {ACPI_DMT_UINT64, ACPI_XENV_OFFSET (GrantTableSize), "Grant Table Size", 0}, {ACPI_DMT_UINT32, ACPI_XENV_OFFSET (EventInterrupt), "Event Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_XENV_OFFSET (EventFlags), "Event Flags", 0}, ACPI_DMT_TERMINATOR }; /*! [Begin] no source code translation */ /* * Generic types (used in UEFI and custom tables) * * Examples: * * Buffer : cc 04 ff bb * UINT8 : 11 * UINT16 : 1122 * UINT24 : 112233 * UINT32 : 11223344 * UINT56 : 11223344556677 * UINT64 : 1122334455667788 * * String : "This is string" * Unicode : "This string encoded to Unicode" * * GUID : 11223344-5566-7788-99aa-bbccddeeff00 * DevicePath : "\PciRoot(0)\Pci(0x1f,1)\Usb(0,0)" */ #define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName) \ {{FieldType, 0, FieldName, 0}, ACPI_DMT_TERMINATOR} ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] = { ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT8, "UINT8"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT16, "UINT16"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT24, "UINT24"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT32, "UINT32"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT40, "UINT40"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT48, "UINT48"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT56, "UINT56"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT64, "UINT64"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "String"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UNICODE, "Unicode"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_BUFFER, "Buffer"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_BUF16, "BUF16"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UUID, "GUID"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "DevicePath"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_LABEL, "Label"), {ACPI_DMT_TERMINATOR} }; /*! [End] no source code translation !*/ diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c index ca2d5a727972..3c4f643f3764 100644 --- a/sys/contrib/dev/acpica/compiler/aslcodegen.c +++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c @@ -1,818 +1,891 @@ /****************************************************************************** * * Module Name: aslcodegen - AML code generation * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include "aslcompiler.y.h" #include #include +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcodegen") /* Local prototypes */ static ACPI_STATUS CgAmlWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); static void CgWriteAmlOpcode ( ACPI_PARSE_OBJECT *Op); static void CgWriteTableHeader ( ACPI_PARSE_OBJECT *Op); static void CgWriteNode ( ACPI_PARSE_OBJECT *Op); static void CgUpdateHeader ( ACPI_PARSE_OBJECT *Op); +static void +CgUpdateCdatHeader ( + ACPI_PARSE_OBJECT *Op); + /******************************************************************************* * * FUNCTION: CgGenerateAmlOutput * * PARAMETERS: None. * * RETURN: None * * DESCRIPTION: Generate AML code. Currently generates the listing file * simultaneously. * ******************************************************************************/ void CgGenerateAmlOutput ( void) { /* Generate the AML output file */ TrWalkParseTree (AslGbl_CurrentDB, ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_DB_SEPARATELY, CgAmlWriteWalk, NULL, NULL); DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); - CgUpdateHeader (AslGbl_CurrentDB); + if (AcpiGbl_CDAT) + { + CgUpdateCdatHeader (AslGbl_CurrentDB); + } + else + { + CgUpdateHeader (AslGbl_CurrentDB); + } } /******************************************************************************* * * FUNCTION: CgAmlWriteWalk * * PARAMETERS: ASL_WALK_CALLBACK * * RETURN: Status * * DESCRIPTION: Parse tree walk to generate the AML code. * ******************************************************************************/ static ACPI_STATUS CgAmlWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) { /* Generate the AML for this node */ CgWriteNode (Op); if (!AslGbl_DebugFlag) { return (AE_OK); } /* Print header at level 0. Alignment assumes 32-bit pointers */ if (!Level) { DbgPrint (ASL_TREE_OUTPUT, "\nFinal parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2); } /* Dump ParseOp name and possible value */ switch (Op->Asl.ParseOpcode) { case PARSEOP_NAMESEG: case PARSEOP_NAMESTRING: case PARSEOP_METHODCALL: case PARSEOP_STRING_LITERAL: UtDumpStringOp (Op, Level); break; default: UtDumpBasicOp (Op, Level); break; } DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG2, /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, /* 4 */ Op->Asl.AmlOpcodeLength, /* 5 */ Op->Asl.AmlPkgLenBytes, /* 6 */ Op->Asl.AmlLength, /* 7 */ Op->Asl.AmlSubtreeLength, /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, /* 9 */ Op, /* 10 */ Op->Asl.Parent, /* 11 */ Op->Asl.Child, /* 12 */ Op->Asl.Next, /* 13 */ Op->Asl.CompileFlags, /* 14 */ Op->Asl.AcpiBtype, /* 15 */ Op->Asl.FinalAmlLength, /* 16 */ Op->Asl.Column, /* 17 */ Op->Asl.LineNumber, /* 18 */ Op->Asl.EndLine, /* 19 */ Op->Asl.LogicalLineNumber, /* 20 */ Op->Asl.EndLogicalLine); TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT); DbgPrint (ASL_TREE_OUTPUT, "\n"); return (AE_OK); } /******************************************************************************* * * FUNCTION: CgLocalWriteAmlData * * PARAMETERS: Op - Current parse op * Buffer - Buffer to write * Length - Size of data in buffer * * RETURN: None * * DESCRIPTION: Write a buffer of AML data to the AML output file. * ******************************************************************************/ void CgLocalWriteAmlData ( ACPI_PARSE_OBJECT *Op, void *Buffer, UINT32 Length) { /* Write the raw data to the AML file */ FlWriteFile (ASL_FILE_AML_OUTPUT, Buffer, Length); /* Update the final AML length for this node (used for listings) */ if (Op) { Op->Asl.FinalAmlLength += Length; } } /******************************************************************************* * * FUNCTION: CgWriteAmlOpcode * * PARAMETERS: Op - Parse node with an AML opcode * * RETURN: None. * * DESCRIPTION: Write the AML opcode corresponding to a parse node. * ******************************************************************************/ static void CgWriteAmlOpcode ( ACPI_PARSE_OBJECT *Op) { UINT8 PkgLenFirstByte; UINT32 i; union { UINT16 Opcode; UINT8 OpcodeBytes[2]; } Aml; union { UINT32 Len; UINT8 LenBytes[4]; } PkgLen; /* We expect some DEFAULT_ARGs, just ignore them */ if (Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) { return; } /* * Before printing the bytecode, generate comment byte codes * associated with this node. */ if (AcpiGbl_CaptureComments) { CgWriteAmlComment(Op); } switch (Op->Asl.AmlOpcode) { case AML_UNASSIGNED_OPCODE: /* These opcodes should not get here */ printf ("Found a node with an unassigned AML opcode\n"); FlPrintFile (ASL_FILE_STDERR, "Found a node with an unassigned AML opcode\n"); return; case AML_INT_RESERVEDFIELD_OP: /* Special opcodes for within a field definition */ Aml.Opcode = AML_FIELD_OFFSET_OP; break; case AML_INT_ACCESSFIELD_OP: Aml.Opcode = AML_FIELD_ACCESS_OP; break; case AML_INT_CONNECTION_OP: Aml.Opcode = AML_FIELD_CONNECTION_OP; break; default: Aml.Opcode = Op->Asl.AmlOpcode; break; } switch (Aml.Opcode) { case AML_PACKAGE_LENGTH: /* Value is the length to be encoded (Used in field definitions) */ PkgLen.Len = (UINT32) Op->Asl.Value.Integer; break; default: /* Check for two-byte opcode */ if (Aml.Opcode > 0x00FF) { /* Write the high byte first */ CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[1], 1); } CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[0], 1); /* Subtreelength doesn't include length of package length bytes */ PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes; break; } /* Does this opcode have an associated "PackageLength" field? */ if (Op->Asl.CompileFlags & OP_AML_PACKAGE) { if (Op->Asl.AmlPkgLenBytes == 1) { /* Simplest case -- no bytes to follow, just write the count */ CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1); } else if (Op->Asl.AmlPkgLenBytes != 0) { /* * Encode the "bytes to follow" in the first byte, top two bits. * The low-order nybble of the length is in the bottom 4 bits */ PkgLenFirstByte = (UINT8) (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) | (PkgLen.LenBytes[0] & 0x0F)); CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1); /* * Shift the length over by the 4 bits we just stuffed * in the first byte */ PkgLen.Len >>= 4; /* * Now we can write the remaining bytes - * either 1, 2, or 3 bytes */ for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++) { CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1); } } } switch (Aml.Opcode) { case AML_BYTE_OP: CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1); break; case AML_WORD_OP: CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2); break; case AML_DWORD_OP: CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4); break; case AML_QWORD_OP: CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 8); break; case AML_STRING_OP: CgLocalWriteAmlData (Op, Op->Asl.Value.String, Op->Asl.AmlLength); break; default: /* All data opcodes must appear above */ break; } } /******************************************************************************* * * FUNCTION: CgWriteTableHeader * * PARAMETERS: Op - The DEFINITIONBLOCK node * * RETURN: None * * DESCRIPTION: Write a table header corresponding to the DEFINITIONBLOCK * * NOTE: Input strings should be validated before this function is invoked. * ******************************************************************************/ static void CgWriteTableHeader ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *Child; UINT32 CommentLength; ACPI_COMMENT_NODE *Current; memset (&AslGbl_TableHeader, 0, sizeof (ACPI_TABLE_HEADER)); /* AML filename */ Child = Op->Asl.Child; /* Signature */ Child = Child->Asl.Next; /* * For ASL-/ASL+ converter: replace the table signature with * "XXXX" and save the original table signature. This results in an AML * file with the signature "XXXX". The converter should remove this AML * file. In the event where this AML file does not get deleted, the * "XXXX" table signature prevents this AML file from running on the AML * interpreter. */ if (AcpiGbl_CaptureComments) { ACPI_COPY_NAMESEG (AcpiGbl_TableSig, Child->Asl.Value.String); Child->Asl.Value.String = ACPI_SIG_XXXX; } ACPI_COPY_NAMESEG (AslGbl_TableHeader.Signature, Child->Asl.Value.String); /* Revision */ Child = Child->Asl.Next; AslGbl_TableHeader.Revision = (UINT8) Child->Asl.Value.Integer; /* Command-line Revision override */ if (AslGbl_RevisionOverride) { AslGbl_TableHeader.Revision = AslGbl_RevisionOverride; } /* OEMID */ Child = Child->Asl.Next; memcpy (AslGbl_TableHeader.OemId, Child->Asl.Value.String, strlen (Child->Asl.Value.String)); /* OEM TableID */ Child = Child->Asl.Next; memcpy (AslGbl_TableHeader.OemTableId, Child->Asl.Value.String, strlen (Child->Asl.Value.String)); /* OEM Revision */ Child = Child->Asl.Next; AslGbl_TableHeader.OemRevision = (UINT32) Child->Asl.Value.Integer; /* Compiler ID */ ACPI_COPY_NAMESEG (AslGbl_TableHeader.AslCompilerId, ASL_CREATOR_ID); /* Compiler version */ AslGbl_TableHeader.AslCompilerRevision = ACPI_CA_VERSION; /* Table length. Checksum zero for now, will rewrite later */ AslGbl_TableHeader.Length = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength; /* Calculate the comment lengths for this definition block parseOp */ if (AcpiGbl_CaptureComments) { CvDbgPrint ("Calculating comment lengths for %s in write header\n", Op->Asl.ParseOpName); /* * Take the filename without extensions, add 3 for the new extension * and another 3 for the a908 bytecode and null terminator. */ AslGbl_TableHeader.Length += strrchr (AslGbl_ParseTreeRoot->Asl.Filename, '.') - AslGbl_ParseTreeRoot->Asl.Filename + 1 + 3 + 3; Op->Asl.AmlSubtreeLength += strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3; CvDbgPrint (" Length: %u\n", (UINT32) strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3); if (Op->Asl.CommentList) { Current = Op->Asl.CommentList; while (Current) { CommentLength = strlen (Current->Comment)+3; CvDbgPrint ("Length of standard comment): %d\n", CommentLength); CvDbgPrint (" Comment string: %s\n\n", Current->Comment); AslGbl_TableHeader.Length += CommentLength; Op->Asl.AmlSubtreeLength += CommentLength; Current = Current->Next; CvDbgPrint (" Length: %u\n", CommentLength); } } if (Op->Asl.CloseBraceComment) { CommentLength = strlen (Op->Asl.CloseBraceComment)+3; CvDbgPrint ("Length of inline comment +3: %d\n", CommentLength); CvDbgPrint (" Comment string: %s\n\n", Op->Asl.CloseBraceComment); AslGbl_TableHeader.Length += CommentLength; Op->Asl.AmlSubtreeLength += CommentLength; CvDbgPrint (" Length: %u\n", CommentLength); } } AslGbl_TableHeader.Checksum = 0; Op->Asl.FinalAmlOffset = ftell (AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle); /* Write entire header and clear the table header global */ CgLocalWriteAmlData (Op, &AslGbl_TableHeader, sizeof (ACPI_TABLE_HEADER)); memset (&AslGbl_TableHeader, 0, sizeof (ACPI_TABLE_HEADER)); } +/******************************************************************************* + * + * FUNCTION: CgUpdateCdatHeader + * + * PARAMETERS: Op - Op for the Definition Block + * + * RETURN: None. + * + * DESCRIPTION: Complete the ACPI table by calculating the checksum and + * re-writing the header for the input definition block + * + ******************************************************************************/ + +static void +CgUpdateCdatHeader ( + ACPI_PARSE_OBJECT *Op) +{ + signed char Sum; + UINT32 i; + UINT32 Length; + UINT8 FileByte; + UINT8 Checksum; + + + /* Calculate the checksum over the entire definition block */ + + Sum = 0; + Length = sizeof (ACPI_TABLE_CDAT) + Op->Asl.AmlSubtreeLength; + FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset); + + for (i = 0; i < Length; i++) + { + if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) + { + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, + "Table length is greater than size of the input file"); + return; + } + + Sum = (signed char) (Sum + FileByte); + } + + Checksum = (UINT8) (0 - Sum); + + DbgPrint (ASL_DEBUG_OUTPUT, "Computed checksum = %X\n", Checksum); + + /* Re-write the checksum byte */ + + FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + + ACPI_CDAT_OFFSET (Checksum)); + + FlWriteFile (ASL_FILE_AML_OUTPUT, &Checksum, 1); + + /* + * Seek to the end of the file. This is done to support multiple file + * compilation. Doing this simplifies other parts of the codebase because + * it eliminates the need to seek for a different starting place. + */ + FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + Length); +} + /******************************************************************************* * * FUNCTION: CgUpdateHeader * * PARAMETERS: Op - Op for the Definition Block * * RETURN: None. * * DESCRIPTION: Complete the ACPI table by calculating the checksum and * re-writing the header for the input definition block * ******************************************************************************/ static void CgUpdateHeader ( ACPI_PARSE_OBJECT *Op) { signed char Sum; UINT32 i; UINT32 Length; UINT8 FileByte; UINT8 Checksum; /* Calculate the checksum over the entire definition block */ Sum = 0; Length = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength; FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset); for (i = 0; i < Length; i++) { if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "Table length is greater than size of the input file"); return; } Sum = (signed char) (Sum + FileByte); } Checksum = (UINT8) (0 - Sum); /* Re-write the checksum byte */ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + ACPI_OFFSET (ACPI_TABLE_HEADER, Checksum)); FlWriteFile (ASL_FILE_AML_OUTPUT, &Checksum, 1); /* * Seek to the end of the file. This is done to support multiple file * compilation. Doing this simplifies other parts of the codebase because * it eliminates the need to seek for a different starting place. */ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + Length); } /******************************************************************************* * * FUNCTION: CgWriteNode * * PARAMETERS: Op - Parse node to write. * * RETURN: None. * * DESCRIPTION: Write the AML that corresponds to a parse node. * ******************************************************************************/ static void CgWriteNode ( ACPI_PARSE_OBJECT *Op) { ASL_RESOURCE_NODE *Rnode; /* Write all comments here. */ if (AcpiGbl_CaptureComments) { CgWriteAmlComment(Op); } /* Always check for DEFAULT_ARG and other "Noop" nodes */ /* TBD: this may not be the best place for this check */ if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) || (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END)) { return; } Op->Asl.FinalAmlLength = 0; switch (Op->Asl.AmlOpcode) { case AML_RAW_DATA_BYTE: case AML_RAW_DATA_WORD: case AML_RAW_DATA_DWORD: case AML_RAW_DATA_QWORD: CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength); return; case AML_RAW_DATA_BUFFER: CgLocalWriteAmlData (Op, Op->Asl.Value.Buffer, Op->Asl.AmlLength); return; case AML_RAW_DATA_CHAIN: Rnode = ACPI_CAST_PTR (ASL_RESOURCE_NODE, Op->Asl.Value.Buffer); while (Rnode) { CgLocalWriteAmlData (Op, Rnode->Buffer, Rnode->BufferLength); Rnode = Rnode->Next; } return; default: /* Internal data opcodes must all appear above */ break; } switch (Op->Asl.ParseOpcode) { case PARSEOP_DEFAULT_ARG: break; case PARSEOP_DEFINITION_BLOCK: CgWriteTableHeader (Op); if (AcpiGbl_CaptureComments) { CgWriteAmlDefBlockComment (Op); } break; case PARSEOP_NAMESEG: case PARSEOP_NAMESTRING: case PARSEOP_METHODCALL: CgLocalWriteAmlData (Op, Op->Asl.Value.String, Op->Asl.AmlLength); break; default: CgWriteAmlOpcode (Op); break; } } diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c index 5c1b40a1bc69..5ec778f07e57 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompile.c +++ b/sys/contrib/dev/acpica/compiler/aslcompile.c @@ -1,1063 +1,1069 @@ /****************************************************************************** * * Module Name: aslcompile - top level compile module * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") /* * Main parser entry * External is here in case the parser emits the same external in the * generated header. (Newer versions of Bison) */ int AslCompilerparse( void); /* Local prototypes */ static void CmFlushSourceCode ( void); static void CmDumpAllEvents ( void); static void CmFinishFiles( BOOLEAN DeleteAmlFile); /******************************************************************************* * * FUNCTION: CmDoCompile * * PARAMETERS: None * * RETURN: Status (0 = OK) * * DESCRIPTION: This procedure performs the entire compile * ******************************************************************************/ ACPI_STATUS CmDoCompile ( void) { UINT8 FullCompile; UINT8 Event; ASL_GLOBAL_FILE_NODE *FileNode; FullCompile = UtBeginEvent ("*** Total Compile time ***"); Event = UtBeginEvent ("Open input and output files"); UtEndEvent (Event); Event = UtBeginEvent ("Preprocess input file"); if (AslGbl_PreprocessFlag) { /* Enter compiler name as a #define */ PrAddDefine (ASL_DEFINE, "", FALSE); /* Preprocessor */ PrDoPreprocess (); AslGbl_CurrentLineNumber = 1; AslGbl_LogicalLineNumber = 1; AslGbl_CurrentLineOffset = 0; if (AslGbl_PreprocessOnly) { UtEndEvent (Event); return (AE_OK); } } UtEndEvent (Event); /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); AslCompilerparse(); UtEndEvent (Event); /* Check for parser-detected syntax errors */ if (AslGbl_SyntaxError) { - fprintf (stderr, + AslError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Compiler aborting due to parser-detected syntax error(s)\n"); /* Flag this error in the FileNode for compilation summary */ FileNode = FlGetCurrentFileNode (); FileNode->ParserErrorDetected = TRUE; AslGbl_ParserErrorDetected = TRUE; LsDumpParseTree (); + AePrintErrorLog(ASL_FILE_STDERR); + goto ErrorExit; } /* Did the parse tree get successfully constructed? */ if (!AslGbl_ParseTreeRoot) { /* * If there are no errors, then we have some sort of * internal problem. */ AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "- Could not resolve parse tree root node"); goto ErrorExit; } + AePrintErrorLog(ASL_FILE_STDERR); + /* Flush out any remaining source after parse tree is complete */ Event = UtBeginEvent ("Flush source input"); CmFlushSourceCode (); /* Prune the parse tree if requested (debug purposes only) */ if (AslGbl_PruneParseTree) { AslPruneParseTree (AslGbl_PruneDepth, AslGbl_PruneType); } /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); + AslGbl_ParserErrorDetected = FALSE; + AslGbl_SyntaxError = FALSE; UtEndEvent (Event); UtEndEvent (FullCompile); - return (AE_OK); + AslGbl_ParserErrorDetected = FALSE; + AslGbl_SyntaxError = FALSE; ErrorExit: UtEndEvent (FullCompile); return (AE_ERROR); } /******************************************************************************* * * FUNCTION: CmDoAslMiddleAndBackEnd * * PARAMETERS: None * * RETURN: Status of middle-end and back-end * * DESCRIPTION: Perform compiler middle-end (type checking and semantic * analysis) and back-end (code generation) * ******************************************************************************/ int CmDoAslMiddleAndBackEnd ( void) { UINT8 Event; ACPI_STATUS Status; OpcGetIntegerWidth (AslGbl_ParseTreeRoot->Asl.Child); /* Pre-process parse tree for any operator transforms */ Event = UtBeginEvent ("Parse tree transforms"); DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); UtEndEvent (Event); /* Generate AML opcodes corresponding to the parse tokens */ Event = UtBeginEvent ("Generate AML opcodes"); DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeWalk, NULL); UtEndEvent (Event); /* Interpret and generate all compile-time constants */ Event = UtBeginEvent ("Constant folding via AML interpreter"); DbgPrint (ASL_DEBUG_OUTPUT, "Interpreting compile-time constant expressions\n\n"); if (AslGbl_FoldConstants) { TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlConstantWalk, NULL); } else { DbgPrint (ASL_PARSE_OUTPUT, " Optional folding disabled\n"); } UtEndEvent (Event); /* Update AML opcodes if necessary, after constant folding */ Event = UtBeginEvent ("Updating AML opcodes after constant folding"); DbgPrint (ASL_DEBUG_OUTPUT, "Updating AML opcodes after constant folding\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, OpcAmlOpcodeUpdateWalk, NULL); UtEndEvent (Event); /* Calculate all AML package lengths */ Event = UtBeginEvent ("Generate AML package lengths"); DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); if (AslGbl_ParseOnlyFlag) { AePrintErrorLog (ASL_FILE_STDERR); UtDisplaySummary (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { /* Print error summary to the stdout also */ AePrintErrorLog (ASL_FILE_STDOUT); UtDisplaySummary (ASL_FILE_STDOUT); } return (0); } /* * Create an internal namespace and use it as a symbol table */ /* Namespace loading */ Event = UtBeginEvent ("Create ACPI Namespace"); DbgPrint (ASL_DEBUG_OUTPUT, "Creating ACPI Namespace\n\n"); Status = LdLoadNamespace (AslGbl_ParseTreeRoot); UtEndEvent (Event); if (ACPI_FAILURE (Status)) { return (-1); } /* Namespace cross-reference */ AslGbl_NamespaceEvent = UtBeginEvent ( "Cross reference parse tree and Namespace"); DbgPrint (ASL_DEBUG_OUTPUT, "Cross referencing namespace\n\n"); Status = XfCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { return (-1); } /* Namespace - Check for non-referenced objects */ LkFindUnreferencedObjects (); UtEndEvent (AslGbl_NamespaceEvent); /* Resolve External Declarations */ Event = UtBeginEvent ("Resolve all Externals"); DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); if (AslGbl_DoExternalsInPlace) { TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, ExAmlExternalWalkBegin, NULL, NULL); } else { TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); } UtEndEvent (Event); /* * Semantic analysis. This can happen only after the * namespace has been loaded and cross-referenced. * * part one - check control methods */ Event = UtBeginEvent ("Analyze control method return types"); AslGbl_AnalysisWalkInfo.MethodStack = NULL; DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method analysis\n\n"); if (AslGbl_CrossReferenceOutput) { OtPrintHeaders ("Part 1: Object Reference Map " "(Object references from within each control method)"); } TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, MtMethodAnalysisWalkBegin, MtMethodAnalysisWalkEnd, &AslGbl_AnalysisWalkInfo); UtEndEvent (Event); /* Generate the object cross-reference file if requested */ Event = UtBeginEvent ("Generate cross-reference file"); OtCreateXrefFile (); UtEndEvent (Event); /* Semantic error checking part two - typing of method returns */ Event = UtBeginEvent ("Determine object types returned by methods"); DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method typing\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnMethodTypingWalkEnd, NULL); UtEndEvent (Event); /* Semantic error checking part three - operand type checking */ Event = UtBeginEvent ("Analyze AML operand types"); DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Operand type checking\n\n"); if (AslGbl_DoTypechecking) { TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, AnOperandTypecheckWalkEnd, &AslGbl_AnalysisWalkInfo); } UtEndEvent (Event); /* Semantic error checking part four - other miscellaneous checks */ Event = UtBeginEvent ("Miscellaneous analysis"); DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - miscellaneous\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, AnOtherSemanticAnalysisWalkBegin, NULL, &AslGbl_AnalysisWalkInfo); UtEndEvent (Event); /* * ASL-/ASL+ converter: Gbl_ParseTreeRoot->CommentList contains the * very last comment of a given ASL file because it's the last constructed * node during compilation. We take the very last comment and save it in a * global for it to be used by the disassembler. */ if (AcpiGbl_CaptureComments) { AcpiGbl_LastListHead = AslGbl_ParseTreeRoot->Asl.CommentList; AslGbl_ParseTreeRoot->Asl.CommentList = NULL; } /* Calculate all AML package lengths */ Event = UtBeginEvent ("Finish AML package length generation"); DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnInitLengthsWalk, NULL); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, LnPackageLengthWalk, NULL); UtEndEvent (Event); /* Code generation - emit the AML */ Event = UtBeginEvent ("Generate AML code and write output files"); DbgPrint (ASL_DEBUG_OUTPUT, "Writing AML byte code\n\n"); AslGbl_CurrentDB = AslGbl_ParseTreeRoot->Asl.Child; while (AslGbl_CurrentDB) { switch (FlSwitchFileSet(AslGbl_CurrentDB->Asl.Filename)) { case SWITCH_TO_DIFFERENT_FILE: /* * Reset these parameters when definition blocks belong in * different files. If they belong in the same file, there is * no need to reset these parameters */ FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0); AslGbl_SourceLine = 0; AslGbl_NextError = AslGbl_ErrorLog; /* fall-through */ case SWITCH_TO_SAME_FILE: CgGenerateAmlOutput (); CmDoOutputFiles (); AslGbl_CurrentDB = AslGbl_CurrentDB->Asl.Next; break; default: /* FILE_NOT_FOUND */ /* The requested file could not be found. Get out of here */ AslGbl_CurrentDB = NULL; break; } } UtEndEvent (Event); Event = UtBeginEvent ("Write optional output files"); UtEndEvent (Event); return (0); } /******************************************************************************* * * FUNCTION: AslCompilerSignon * * PARAMETERS: FileId - ID of the output file * * RETURN: None * * DESCRIPTION: Display compiler signon * ******************************************************************************/ void AslCompilerSignon ( UINT32 FileId) { char *Prefix = ""; char *UtilityName; /* Set line prefix depending on the destination file type */ switch (FileId) { case ASL_FILE_ASM_SOURCE_OUTPUT: case ASL_FILE_ASM_INCLUDE_OUTPUT: Prefix = "; "; break; case ASL_FILE_HEX_OUTPUT: if (AslGbl_HexOutputFlag == HEX_OUTPUT_ASM) { Prefix = "; "; } else if ((AslGbl_HexOutputFlag == HEX_OUTPUT_C) || (AslGbl_HexOutputFlag == HEX_OUTPUT_ASL)) { FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n"); Prefix = " * "; } break; case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_OFFSET_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: Prefix = " * "; break; default: /* No other output types supported */ break; } /* Running compiler or disassembler? */ if (AcpiGbl_DisasmFlag) { UtilityName = AML_DISASSEMBLER_NAME; } else { UtilityName = ASL_COMPILER_NAME; } /* Compiler signon with copyright */ FlPrintFile (FileId, "%s\n", Prefix); FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix)); } /******************************************************************************* * * FUNCTION: AslCompilerFileHeader * * PARAMETERS: FileId - ID of the output file * * RETURN: None * * DESCRIPTION: Header used at the beginning of output files * ******************************************************************************/ void AslCompilerFileHeader ( UINT32 FileId) { char *NewTime; time_t Aclock; char *Prefix = ""; /* Set line prefix depending on the destination file type */ switch (FileId) { case ASL_FILE_ASM_SOURCE_OUTPUT: case ASL_FILE_ASM_INCLUDE_OUTPUT: Prefix = "; "; break; case ASL_FILE_HEX_OUTPUT: if (AslGbl_HexOutputFlag == HEX_OUTPUT_ASM) { Prefix = "; "; } else if ((AslGbl_HexOutputFlag == HEX_OUTPUT_C) || (AslGbl_HexOutputFlag == HEX_OUTPUT_ASL)) { Prefix = " * "; } break; case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_OFFSET_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: Prefix = " * "; break; default: /* No other output types supported */ break; } /* Compilation header with timestamp */ Aclock = time (NULL); NewTime = ctime (&Aclock); FlPrintFile (FileId, "%sCompilation of \"%s\" -", Prefix, AslGbl_Files[ASL_FILE_INPUT].Filename); if (NewTime) { FlPrintFile (FileId, " %s%s\n", NewTime, Prefix); } switch (FileId) { case ASL_FILE_C_SOURCE_OUTPUT: case ASL_FILE_C_OFFSET_OUTPUT: case ASL_FILE_C_INCLUDE_OUTPUT: FlPrintFile (FileId, " */\n"); break; default: /* Nothing to do for other output types */ break; } } /******************************************************************************* * * FUNCTION: CmFlushSourceCode * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Read in any remaining source code after the parse tree * has been constructed. * ******************************************************************************/ static void CmFlushSourceCode ( void) { char Buffer; while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR) { AslInsertLineBuffer ((int) Buffer); } AslResetCurrentLineBuffer (); } /******************************************************************************* * * FUNCTION: CmDoOutputFiles * * PARAMETERS: None * * RETURN: None. * * DESCRIPTION: Create all "listing" type files * ******************************************************************************/ void CmDoOutputFiles ( void) { /* Create listings and hex files */ LsDoListings (); HxDoHexOutput (); /* Dump the namespace to the .nsp file if requested */ (void) NsDisplayNamespace (); /* Dump the device mapping file */ MpEmitMappingInfo (); } /******************************************************************************* * * FUNCTION: CmDumpAllEvents * * PARAMETERS: None * * RETURN: None. * * DESCRIPTION: Dump all compiler events * ******************************************************************************/ static void CmDumpAllEvents ( void) { ASL_EVENT_INFO *Event; UINT32 Delta; UINT32 MicroSeconds; UINT32 MilliSeconds; UINT32 i; Event = AslGbl_Events; DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n"); if (AslGbl_CompileTimesFlag) { printf ("\nElapsed time for major events\n\n"); } for (i = 0; i < AslGbl_NextEvent; i++) { if (Event->Valid) { /* Delta will be in 100-nanosecond units */ Delta = (UINT32) (Event->EndTime - Event->StartTime); MicroSeconds = Delta / ACPI_100NSEC_PER_USEC; MilliSeconds = Delta / ACPI_100NSEC_PER_MSEC; /* Round milliseconds up */ if ((MicroSeconds - (MilliSeconds * ACPI_USEC_PER_MSEC)) >= 500) { MilliSeconds++; } DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n", MicroSeconds, MilliSeconds, Event->EventName); if (AslGbl_CompileTimesFlag) { printf ("%8u usec %8u msec - %s\n", MicroSeconds, MilliSeconds, Event->EventName); } } Event++; } } /******************************************************************************* * * FUNCTION: CmCleanupAndExit * * PARAMETERS: None * * RETURN: None. * * DESCRIPTION: Close all open files and exit the compiler * ******************************************************************************/ int CmCleanupAndExit ( void) { int Status = 0; BOOLEAN DeleteAmlFile = FALSE; ASL_GLOBAL_FILE_NODE *CurrentFileNode = AslGbl_FilesList; /* Check if any errors occurred during compile */ (void) AslCheckForErrorExit (); AePrintErrorLog (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { /* Print error summary to stdout also */ AePrintErrorLog (ASL_FILE_STDOUT); } /* Emit compile times if enabled */ CmDumpAllEvents (); if (AslGbl_CompileTimesFlag) { printf ("\nMiscellaneous compile statistics\n\n"); printf ("%11u : %s\n", AslGbl_TotalParseNodes, "Parse nodes"); printf ("%11u : %s\n", AslGbl_NsLookupCount, "Namespace searches"); printf ("%11u : %s\n", AslGbl_TotalNamedObjects, "Named objects"); printf ("%11u : %s\n", AslGbl_TotalMethods, "Control methods"); printf ("%11u : %s\n", AslGbl_TotalAllocations, "Memory Allocations"); printf ("%11u : %s\n", AslGbl_TotalAllocated, "Total allocated memory"); printf ("%11u : %s\n", AslGbl_TotalFolds, "Constant subtrees folded"); printf ("\n"); } if (AslGbl_NsLookupCount) { DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n"); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %u\n", "Total Namespace searches", AslGbl_NsLookupCount); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %u usec\n", "Time per search", ((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime - AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) / AslGbl_NsLookupCount); } if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%d) exceeded (aslcompile.c)\n", ASL_MAX_ERROR_COUNT); } - AslGbl_ExceptionCount[ASL_ERROR] = 0; UtDisplaySummary (ASL_FILE_STDOUT); /* * Delete the AML file if there are errors and the force AML output option * (-f) has not been used. * * Return -1 as a status of the compiler if no AML files are generated. If * the AML file is generated in the presence of errors, return 0. In the * latter case, the errors were ignored by the user so the compilation is * considered successful. */ if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && (!AslGbl_IgnoreErrors) && AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle)) { DeleteAmlFile = TRUE; Status = -1; } /* Close all open files */ while (CurrentFileNode) { /* * Set the program return status based on file errors. If there are any * errors and during compilation, the command is not considered * successful. */ if (Status != -1 && !AslGbl_IgnoreErrors && CurrentFileNode->ParserErrorDetected) { Status = -1; } switch (FlSwitchFileSet (CurrentFileNode->Files[ASL_FILE_INPUT].Filename)) { case SWITCH_TO_SAME_FILE: case SWITCH_TO_DIFFERENT_FILE: CmFinishFiles (DeleteAmlFile); CurrentFileNode = CurrentFileNode->Next; break; case FILE_NOT_FOUND: default: CurrentFileNode = NULL; break; } } /* Final cleanup after compiling one file */ if (!AslGbl_DoAslConversion) { UtDeleteLocalCaches (); } return (Status); } /******************************************************************************* * * FUNCTION: CmFinishFiles * * PARAMETERS: DeleteAmlFile * * RETURN: None. * * DESCRIPTION: Close all open files, delete AML files depending on the * function parameter is true. * ******************************************************************************/ static void CmFinishFiles( BOOLEAN DeleteAmlFile) { UINT32 i; /* * Take care with the preprocessor file (.pre), it might be the same * as the "input" file, depending on where the compiler has terminated * or aborted. Prevent attempt to close the same file twice in * loop below. */ if (AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle == AslGbl_Files[ASL_FILE_INPUT].Handle) { AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; } /* Close the standard I/O files */ for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { /* * Some files such as debug output files could be pointing to * stderr or stdout. Leave these alone. */ if (AslGbl_Files[i].Handle != stderr && AslGbl_Files[i].Handle != stdout) { FlCloseFile (i); } } /* Delete AML file if there are errors */ if (DeleteAmlFile) { FlDeleteFile (ASL_FILE_AML_OUTPUT); } /* Delete the preprocessor temp file unless full debug was specified */ if (AslGbl_PreprocessFlag && !AslGbl_KeepPreprocessorTempFile) { FlDeleteFile (ASL_FILE_PREPROCESSOR); } /* * Delete intermediate ("combined") source file (if -ls flag not set) * This file is created during normal ASL/AML compiles. It is not * created by the data table compiler. * * If the -ls flag is set, then the .SRC file should not be deleted. * In this case, Gbl_SourceOutputFlag is set to TRUE. * * Note: Handles are cleared by FlCloseFile above, so we look at the * filename instead, to determine if the .SRC file was actually * created. */ if (!AslGbl_SourceOutputFlag) { FlDeleteFile (ASL_FILE_SOURCE_OUTPUT); } } diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c index 2e0d15e8cb76..c11cdd8f195f 100644 --- a/sys/contrib/dev/acpica/compiler/aslerror.c +++ b/sys/contrib/dev/acpica/compiler/aslerror.c @@ -1,1659 +1,1658 @@ /****************************************************************************** * * Module Name: aslerror - Error handling and statistics * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslerror") /* Local prototypes */ static void AeAddToErrorLog ( ASL_ERROR_MSG *Enode); static BOOLEAN AslIsExceptionExpected ( char *Filename, UINT32 LineNumber, UINT8 Level, UINT16 MessageId); static BOOLEAN AslIsExceptionDisabled ( UINT8 Level, UINT16 MessageId); static void AslInitEnode ( ASL_ERROR_MSG **Enode, UINT8 Level, UINT16 MessageId, UINT32 LineNumber, UINT32 LogicalLineNumber, UINT32 LogicalByteOffset, UINT32 Column, char *Filename, char *Message, char *SourceLine, ASL_ERROR_MSG *SubError); static void AslLogNewError ( UINT8 Level, UINT16 MessageId, UINT32 LineNumber, UINT32 LogicalLineNumber, UINT32 LogicalByteOffset, UINT32 Column, char *Filename, char *Message, char *SourceLine, ASL_ERROR_MSG *SubError); static void AePrintSubError ( FILE *OutputFile, ASL_ERROR_MSG *Enode); static UINT8 GetModifiedLevel ( UINT8 Level, UINT16 MessageId); /******************************************************************************* * * FUNCTION: AslAbort * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Dump the error log and abort the compiler. Used for serious * I/O errors. * ******************************************************************************/ void AslAbort ( void) { AePrintErrorLog (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { /* Print error summary to stdout also */ AePrintErrorLog (ASL_FILE_STDOUT); } exit (1); } /******************************************************************************* * * FUNCTION: AeClearErrorLog * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Empty the error list * ******************************************************************************/ void AeClearErrorLog ( void) { ASL_ERROR_MSG *Enode = AslGbl_ErrorLog; ASL_ERROR_MSG *Next; /* Walk the error node list */ while (Enode) { Next = Enode->Next; ACPI_FREE (Enode); Enode = Next; } AslGbl_ErrorLog = NULL; } /******************************************************************************* * * FUNCTION: AeAddToErrorLog * * PARAMETERS: Enode - An error node to add to the log * * RETURN: None * * DESCRIPTION: Add a new error node to the error log. The error log is * ordered by the "logical" line number (cumulative line number * including all include files.) * ******************************************************************************/ static void AeAddToErrorLog ( ASL_ERROR_MSG *Enode) { ASL_ERROR_MSG *Next; ASL_ERROR_MSG *Prev; /* If Gbl_ErrorLog is null, this is the first error node */ if (!AslGbl_ErrorLog) { AslGbl_ErrorLog = Enode; return; } /* * Walk error list until we find a line number greater than ours. * List is sorted according to line number. */ Prev = NULL; Next = AslGbl_ErrorLog; while ((Next) && (Next->LogicalLineNumber <= Enode->LogicalLineNumber)) { Prev = Next; Next = Next->Next; } /* Found our place in the list */ Enode->Next = Next; if (Prev) { Prev->Next = Enode; } else { AslGbl_ErrorLog = Enode; } } /******************************************************************************* * * FUNCTION: AeDecodeErrorMessageId * * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached * Total - Total length of line * * RETURN: None * * DESCRIPTION: Print the source line of an error. * ******************************************************************************/ static void AeDecodeErrorMessageId ( FILE *OutputFile, ASL_ERROR_MSG *Enode, BOOLEAN PrematureEOF, UINT32 Total) { UINT32 MsgLength; const char *MainMessage; char *ExtraMessage; UINT32 SourceColumn; UINT32 ErrorColumn; fprintf (OutputFile, "%s %4.4d -", AeDecodeExceptionLevel (Enode->Level), AeBuildFullExceptionCode (Enode->Level, Enode->MessageId)); MainMessage = AeDecodeMessageId (Enode->MessageId); ExtraMessage = Enode->Message; /* If a NULL line number, just print the decoded message */ if (!Enode->LineNumber) { fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage); return; } MsgLength = strlen (MainMessage); if (MsgLength == 0) { /* Use the secondary/extra message as main message */ MainMessage = Enode->Message; if (!MainMessage) { MainMessage = ""; } MsgLength = strlen (MainMessage); ExtraMessage = NULL; } if (AslGbl_VerboseErrors && !PrematureEOF) { if (Total >= 256) { fprintf (OutputFile, " %s", MainMessage); } else { SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; if ((MsgLength + ErrorColumn) < (SourceColumn - 1)) { fprintf (OutputFile, "%*s%s", (int) ((SourceColumn - 1) - ErrorColumn), MainMessage, " ^ "); } else { fprintf (OutputFile, "%*s %s", (int) ((SourceColumn - ErrorColumn) + 1), "^", MainMessage); } } } else { fprintf (OutputFile, " %s", MainMessage); } /* Print the extra info message if present */ if (ExtraMessage) { fprintf (OutputFile, " (%s)", ExtraMessage); } if (PrematureEOF) { fprintf (OutputFile, " and premature End-Of-File"); } fprintf (OutputFile, "\n"); if (AslGbl_VerboseErrors && !Enode->SubError) { fprintf (OutputFile, "\n"); } } /******************************************************************************* * * FUNCTION: AePrintErrorSourceLine * * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached * Total - Number of characters printed so far * * * RETURN: Status * * DESCRIPTION: Print the source line of an error. * ******************************************************************************/ static ACPI_STATUS AePrintErrorSourceLine ( FILE *OutputFile, ASL_ERROR_MSG *Enode, BOOLEAN *PrematureEOF, UINT32 *Total) { UINT8 SourceByte; int Actual; size_t RActual; FILE *SourceFile = NULL; long FileSize; if (!Enode->SourceLine) { /* * Use the merged header/source file if present, otherwise * use input file */ SourceFile = FlGetFileHandle (ASL_FILE_SOURCE_OUTPUT, ASL_FILE_SOURCE_OUTPUT, Enode->SourceFilename); if (!SourceFile) { SourceFile = FlGetFileHandle (ASL_FILE_INPUT, ASL_FILE_INPUT, Enode->Filename); } if (SourceFile) { /* Determine if the error occurred at source file EOF */ fseek (SourceFile, 0, SEEK_END); FileSize = ftell (SourceFile); if ((long) Enode->LogicalByteOffset >= FileSize) { *PrematureEOF = TRUE; } } else { fprintf (OutputFile, "[*** iASL: Source File Does not exist ***]\n"); return AE_IO_ERROR; } } /* Print filename and line number if present and valid */ if (AslGbl_VerboseErrors) { fprintf (OutputFile, "%-8s", Enode->Filename); if (Enode->SourceLine && Enode->LineNumber) { fprintf (OutputFile, " %6u: %s", Enode->LineNumber, Enode->SourceLine); } else if (Enode->LineNumber) { fprintf (OutputFile, " %6u: ", Enode->LineNumber); /* * If not at EOF, get the corresponding source code line * and display it. Don't attempt this if we have a * premature EOF condition. */ if (*PrematureEOF) { fprintf (OutputFile, "\n"); return AE_OK; } /* * Seek to the offset in the combined source file, * read the source line, and write it to the output. */ Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, (int) SEEK_SET); if (Actual) { fprintf (OutputFile, "[*** iASL: Seek error on source code temp file %s ***]", AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); fprintf (OutputFile, "\n"); return AE_OK; } RActual = fread (&SourceByte, 1, 1, SourceFile); if (RActual != 1) { fprintf (OutputFile, "[*** iASL: Read error on source code temp file %s ***]", AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); return AE_IO_ERROR; } /* Read/write the source line, up to the maximum line length */ while (RActual && SourceByte && (SourceByte != '\n')) { if (*Total < 256) { /* After the max line length, we will just read the line, no write */ if (fwrite (&SourceByte, 1, 1, OutputFile) != 1) { printf ("[*** iASL: Write error on output file ***]\n"); return AE_IO_ERROR; } } else if (*Total == 256) { fprintf (OutputFile, "\n[*** iASL: Very long input line, message below refers to column %u ***]", Enode->Column); } RActual = fread (&SourceByte, 1, 1, SourceFile); if (RActual != 1) { fprintf (OutputFile, "[*** iASL: Read error on source code temp file %s ***]", AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); return AE_IO_ERROR; } *Total += 1; } fprintf (OutputFile, "\n"); } } else { /* * Less verbose version of the error message, enabled via the * -vi switch. The format is compatible with MS Visual Studio. */ fprintf (OutputFile, "%s", Enode->Filename); if (Enode->LineNumber) { fprintf (OutputFile, "(%u) : ", Enode->LineNumber); } } return AE_OK; } /******************************************************************************* * * FUNCTION: AePrintException * * PARAMETERS: FileId - ID of output file * Enode - Error node to print * Header - Additional text before each message * * RETURN: None * * DESCRIPTION: Print the contents of an error node. * * NOTE: We don't use the FlxxxFile I/O functions here because on error * they abort the compiler and call this function! Since we * are reporting errors here, we ignore most output errors and * just try to get out as much as we can. * ******************************************************************************/ void AePrintException ( UINT32 FileId, ASL_ERROR_MSG *Enode, char *Header) { FILE *OutputFile; BOOLEAN PrematureEOF = FALSE; UINT32 Total = 0; ACPI_STATUS Status; ASL_ERROR_MSG *Child = Enode->SubError; if (AslGbl_NoErrors) { return; } /* * Only listing files have a header, and remarks/optimizations * are always output */ if (!Header) { /* Ignore remarks if requested */ switch (Enode->Level) { case ASL_WARNING: case ASL_WARNING2: case ASL_WARNING3: if (!AslGbl_DisplayWarnings) { return; } break; case ASL_REMARK: if (!AslGbl_DisplayRemarks) { return; } break; case ASL_OPTIMIZATION: if (!AslGbl_DisplayOptimizations) { return; } break; default: break; } } /* Get the various required file handles */ OutputFile = AslGbl_Files[FileId].Handle; if (Header) { fprintf (OutputFile, "%s", Header); } if (!Enode->Filename) { AeDecodeErrorMessageId (OutputFile, Enode, PrematureEOF, Total); return; } Status = AePrintErrorSourceLine (OutputFile, Enode, &PrematureEOF, &Total); if (ACPI_FAILURE (Status)) { return; } /* If a NULL message ID, just print the raw message */ if (Enode->MessageId == 0) { fprintf (OutputFile, "%s\n", Enode->Message); return; } AeDecodeErrorMessageId (OutputFile, Enode, PrematureEOF, Total); while (Child) { fprintf (OutputFile, "\n"); AePrintSubError (OutputFile, Child); Child = Child->SubError; } } /******************************************************************************* * * FUNCTION: AePrintSubError * * PARAMETERS: OutputFile - Output file * Enode - Error node to print * * RETURN: None * * DESCRIPTION: Print the contents of an error node. This function is tailored * to print error nodes that are SubErrors within ASL_ERROR_MSG * ******************************************************************************/ static void AePrintSubError ( FILE *OutputFile, ASL_ERROR_MSG *Enode) { UINT32 Total = 0; BOOLEAN PrematureEOF = FALSE; const char *MainMessage; MainMessage = AeDecodeMessageId (Enode->MessageId); fprintf (OutputFile, " %s", MainMessage); if (Enode->Message) { fprintf (OutputFile, "(%s)", Enode->Message); } fprintf (OutputFile, "\n "); (void) AePrintErrorSourceLine (OutputFile, Enode, &PrematureEOF, &Total); fprintf (OutputFile, "\n"); } /******************************************************************************* * * FUNCTION: AePrintErrorLog * * PARAMETERS: FileId - Where to output the error log * * RETURN: None * * DESCRIPTION: Print the entire contents of the error log * ******************************************************************************/ void AePrintErrorLog ( UINT32 FileId) { ASL_ERROR_MSG *Enode = AslGbl_ErrorLog; /* Walk the error node list */ while (Enode) { AePrintException (FileId, Enode, NULL); Enode = Enode->Next; } } /******************************************************************************* * * FUNCTION: AslInitEnode * * PARAMETERS: InputEnode - Input Error node to initialize * Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * CurrentLineNumber - Actual file line number * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line * Filename - Source filename * ExtraMessage - Additional error message * SourceLine - Line of error source code * SubError - SubError of this InputEnode * * RETURN: None * * DESCRIPTION: Initialize an Error node * ******************************************************************************/ static void AslInitEnode ( ASL_ERROR_MSG **InputEnode, UINT8 Level, UINT16 MessageId, UINT32 LineNumber, UINT32 LogicalLineNumber, UINT32 LogicalByteOffset, UINT32 Column, char *Filename, char *ExtraMessage, char *SourceLine, ASL_ERROR_MSG *SubError) { ASL_ERROR_MSG *Enode; ASL_GLOBAL_FILE_NODE *FileNode; *InputEnode = UtLocalCalloc (sizeof (ASL_ERROR_MSG)); Enode = *InputEnode; Enode->Level = Level; Enode->MessageId = MessageId; Enode->LineNumber = LineNumber; Enode->LogicalLineNumber = LogicalLineNumber; Enode->LogicalByteOffset = LogicalByteOffset; Enode->Column = Column; Enode->SubError = SubError; Enode->Message = NULL; Enode->SourceLine = NULL; Enode->Filename = NULL; if (ExtraMessage) { /* Allocate a buffer for the message and a new error node */ Enode->Message = UtLocalCacheCalloc (strlen (ExtraMessage) + 1); /* Keep a copy of the extra message */ strcpy (Enode->Message, ExtraMessage); } if (SourceLine) { Enode->SourceLine = UtLocalCalloc (strlen (SourceLine) + 1); strcpy (Enode->SourceLine, SourceLine); } if (Filename) { Enode->Filename = Filename; Enode->FilenameLength = strlen (Filename); if (Enode->FilenameLength < 6) { Enode->FilenameLength = 6; } /* * Attempt to get the file node of the filename listed in the parse * node. If the name doesn't exist in the global file node, it is * because the file is included by #include or ASL include. In this * case, get the current file node. The source output of the current * file will contain the contents of the file listed in the parse node. */ FileNode = FlGetFileNode (ASL_FILE_INPUT, Filename); if (!FileNode) { FileNode = FlGetCurrentFileNode (); } Enode->SourceFilename = FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; } } /******************************************************************************* * * FUNCTION: AslCommonError2 * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * LineNumber - Actual file line number * Column - Column in current line * SourceLine - Actual source code line * Filename - Source filename * ExtraMessage - Additional error message * * RETURN: None * * DESCRIPTION: Create a new error node and add it to the error log * ******************************************************************************/ void AslCommonError2 ( UINT8 Level, UINT16 MessageId, UINT32 LineNumber, UINT32 Column, char *SourceLine, char *Filename, char *ExtraMessage) { AslLogNewError (Level, MessageId, LineNumber, LineNumber, 0, Column, Filename, ExtraMessage, SourceLine, NULL); } /******************************************************************************* * * FUNCTION: AslCommonError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * CurrentLineNumber - Actual file line number * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line * Filename - Source filename * ExtraMessage - Additional error message * * RETURN: None * * DESCRIPTION: Create a new error node and add it to the error log * ******************************************************************************/ void AslCommonError ( UINT8 Level, UINT16 MessageId, UINT32 CurrentLineNumber, UINT32 LogicalLineNumber, UINT32 LogicalByteOffset, UINT32 Column, char *Filename, char *ExtraMessage) { /* Check if user wants to ignore this exception */ if (AslIsExceptionIgnored (Filename, LogicalLineNumber, Level, MessageId)) { return; } AslLogNewError (Level, MessageId, CurrentLineNumber, LogicalLineNumber, LogicalByteOffset, Column, Filename, ExtraMessage, NULL, NULL); } /******************************************************************************* * * FUNCTION: AslLogNewError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * CurrentLineNumber - Actual file line number * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line * Filename - Source filename * Message - Additional error message * SourceLine - Actual line of source code * SubError - Sub-error associated with this error * * RETURN: None * * DESCRIPTION: Create a new error node and add it to the error log * ******************************************************************************/ static void AslLogNewError ( UINT8 Level, UINT16 MessageId, UINT32 LineNumber, UINT32 LogicalLineNumber, UINT32 LogicalByteOffset, UINT32 Column, char *Filename, char *Message, char *SourceLine, ASL_ERROR_MSG *SubError) { ASL_ERROR_MSG *Enode = NULL; UINT8 ModifiedLevel = GetModifiedLevel (Level, MessageId); AslInitEnode (&Enode, ModifiedLevel, MessageId, LineNumber, LogicalLineNumber, LogicalByteOffset, Column, Filename, Message, SourceLine, SubError); /* Add the new node to the error node list */ AeAddToErrorLog (Enode); if (AslGbl_DebugFlag) { /* stderr is a file, send error to it immediately */ AePrintException (ASL_FILE_STDERR, Enode, NULL); } AslGbl_ExceptionCount[ModifiedLevel]++; if (!AslGbl_IgnoreErrors && AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%u) exceeded (aslerror.c)\n", ASL_MAX_ERROR_COUNT); AslGbl_SourceLine = 0; AslGbl_NextError = AslGbl_ErrorLog; CmCleanupAndExit (); exit(1); } - AslGbl_ExceptionCount[ASL_ERROR] = 0; return; } /******************************************************************************* * * FUNCTION: GetModifiedLevel * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * * RETURN: UINT8 - Modified level * * DESCRIPTION: Get the modified level of exception codes that are reported as * errors from the -ww option. * ******************************************************************************/ static UINT8 GetModifiedLevel ( UINT8 Level, UINT16 MessageId) { UINT32 i; UINT16 ExceptionCode; ExceptionCode = AeBuildFullExceptionCode (Level, MessageId); for (i = 0; i < AslGbl_ElevatedMessagesIndex; i++) { if (ExceptionCode == AslGbl_ElevatedMessages[i]) { return (ASL_ERROR); } } return (Level); } /******************************************************************************* * * FUNCTION: AslIsExceptionIgnored * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * * RETURN: BOOLEAN * * DESCRIPTION: Check if a particular exception is ignored. In this case it * means that the exception is (expected or disabled. * ******************************************************************************/ BOOLEAN AslIsExceptionIgnored ( char *Filename, UINT32 LineNumber, UINT8 Level, UINT16 MessageId) { BOOLEAN ExceptionIgnored; /* Note: this allows exception to be disabled and expected */ ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId); ExceptionIgnored |= AslIsExceptionExpected (Filename, LineNumber, Level, MessageId); return (AslGbl_AllExceptionsDisabled || ExceptionIgnored); } /******************************************************************************* * * FUNCTION: AslCheckExpectedException * * PARAMETERS: none * * RETURN: none * * DESCRIPTION: Check the global expected messages table and raise an error * for each message that has not been received. * ******************************************************************************/ void AslCheckExpectedExceptions ( void) { UINT32 i; ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; ASL_LOCATION_NODE *LocationNode; for (i = 0; i < AslGbl_ExpectedMessagesIndex; ++i) { if (!AslGbl_ExpectedMessages[i].MessageReceived) { AslError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, NULL, AslGbl_ExpectedMessages[i].MessageIdStr); } } while (Current) { LocationNode = Current->LocationList; while (LocationNode) { if (!LocationNode->MessageReceived) { AslCommonError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, LocationNode->LineNumber, LocationNode->LineNumber, LocationNode->LogicalByteOffset, LocationNode->Column, LocationNode->Filename, Current->MessageIdStr); } LocationNode = LocationNode->Next; } Current = Current->Next; } } /******************************************************************************* * * FUNCTION: AslLogExpectedException * * PARAMETERS: MessageIdString - ID of excepted exception during compile * * RETURN: Status * * DESCRIPTION: Enter a message ID into the global expected messages table * If these messages are not raised during the compilation, throw * an error. * ******************************************************************************/ ACPI_STATUS AslLogExpectedException ( char *MessageIdString) { UINT32 MessageId; /* Convert argument to an integer and validate it */ MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); if (MessageId > 6999) { printf ("\"%s\" is not a valid warning/remark/error ID\n", MessageIdString); return (AE_BAD_PARAMETER); } /* Insert value into the global expected message array */ if (AslGbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES) { printf ("Too many messages have been registered as expected (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } AslGbl_ExpectedMessages[AslGbl_ExpectedMessagesIndex].MessageId = MessageId; AslGbl_ExpectedMessages[AslGbl_ExpectedMessagesIndex].MessageIdStr = MessageIdString; AslGbl_ExpectedMessages[AslGbl_ExpectedMessagesIndex].MessageReceived = FALSE; AslGbl_ExpectedMessagesIndex++; return (AE_OK); } /******************************************************************************* * * FUNCTION: AslLogExpectedExceptionByLine * * PARAMETERS: MessageIdString - ID of excepted exception during compile * * RETURN: Status * * DESCRIPTION: Enter a message ID into the global expected messages table * based on file and line number. If these messages are not raised * during the compilation, throw an error. * ******************************************************************************/ void AslLogExpectedExceptionByLine ( char *MessageIdString) { ASL_LOCATION_NODE *NewErrorLocationNode; ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; UINT32 MessageId; NewErrorLocationNode = UtLocalCalloc (sizeof (ASL_LOCATION_NODE)); NewErrorLocationNode->LineNumber = AslGbl_CurrentLineNumber; NewErrorLocationNode->Filename = AslGbl_Files[ASL_FILE_INPUT].Filename; NewErrorLocationNode->LogicalByteOffset = AslGbl_CurrentLineOffset; NewErrorLocationNode->Column = AslGbl_CurrentColumn; MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); /* search the existing list for a matching message ID */ while (Current && Current->MessageId != MessageId ) { Current = Current->Next; } if (!Current) { /* ID was not found, create a new node for this message ID */ Current = UtLocalCalloc (sizeof (ASL_EXPECTED_MSG_NODE)); Current->Next = AslGbl_ExpectedErrorCodeList; Current->MessageIdStr = MessageIdString; Current->MessageId = MessageId; AslGbl_ExpectedErrorCodeList = Current; } NewErrorLocationNode->Next = Current->LocationList; Current->LocationList = NewErrorLocationNode; } /******************************************************************************* * * FUNCTION: AslDisableException * * PARAMETERS: MessageIdString - ID to be disabled * * RETURN: Status * * DESCRIPTION: Enter a message ID into the global disabled messages table * ******************************************************************************/ ACPI_STATUS AslDisableException ( char *MessageIdString) { UINT32 MessageId; /* Convert argument to an integer and validate it */ MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); if ((MessageId < 2000) || (MessageId > 6999)) { printf ("\"%s\" is not a valid warning/remark/error ID\n", MessageIdString); return (AE_BAD_PARAMETER); } /* Insert value into the global disabled message array */ if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) { printf ("Too many messages have been disabled (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } AslGbl_DisabledMessages[AslGbl_DisabledMessagesIndex] = MessageId; AslGbl_DisabledMessagesIndex++; return (AE_OK); } /******************************************************************************* * * FUNCTION: AslElevateException * * PARAMETERS: MessageIdString - ID of excepted exception during compile * * RETURN: Status * * DESCRIPTION: Enter a message ID into the global elevated exceptions table. * These messages will be considered as compilation errors. * ******************************************************************************/ ACPI_STATUS AslElevateException ( char *MessageIdString) { UINT32 MessageId; /* Convert argument to an integer and validate it */ MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); if (MessageId > 6999) { printf ("\"%s\" is not a valid warning/remark/error ID\n", MessageIdString); return (AE_BAD_PARAMETER); } /* Insert value into the global expected message array */ if (AslGbl_ElevatedMessagesIndex >= ASL_MAX_ELEVATED_MESSAGES) { printf ("Too many messages have been registered as elevated (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } AslGbl_ElevatedMessages[AslGbl_ElevatedMessagesIndex] = MessageId; AslGbl_ElevatedMessagesIndex++; return (AE_OK); } /******************************************************************************* * * FUNCTION: AslIsExceptionDisabled * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * * RETURN: TRUE if exception/message should be ignored * * DESCRIPTION: Check if the user has specified options such that this * exception should be ignored * ******************************************************************************/ static BOOLEAN AslIsExceptionExpected ( char *Filename, UINT32 LineNumber, UINT8 Level, UINT16 MessageId) { ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; ASL_LOCATION_NODE *CurrentErrorLocation; UINT32 EncodedMessageId; UINT32 i; /* Mark this exception as received */ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId); for (i = 0; i < AslGbl_ExpectedMessagesIndex; i++) { /* Simple implementation via fixed array */ if (EncodedMessageId == AslGbl_ExpectedMessages[i].MessageId) { return (AslGbl_ExpectedMessages[i].MessageReceived = TRUE); } } while (Current && Current->MessageId != EncodedMessageId) { Current = Current->Next; } if (!Current) { return (FALSE); } CurrentErrorLocation = Current->LocationList; while (CurrentErrorLocation) { if (!strcmp (CurrentErrorLocation->Filename, Filename) && CurrentErrorLocation->LineNumber == LineNumber) { return (CurrentErrorLocation->MessageReceived = TRUE); } CurrentErrorLocation = CurrentErrorLocation->Next; } return (FALSE); } /******************************************************************************* * * FUNCTION: AslIsExceptionDisabled * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * * RETURN: TRUE if exception/message should be ignored * * DESCRIPTION: Check if the user has specified options such that this * exception should be ignored * ******************************************************************************/ static BOOLEAN AslIsExceptionDisabled ( UINT8 Level, UINT16 MessageId) { UINT32 EncodedMessageId; UINT32 i; switch (Level) { case ASL_WARNING2: case ASL_WARNING3: /* Check for global disable via -w1/-w2/-w3 options */ if (Level > AslGbl_WarningLevel) { return (TRUE); } ACPI_FALLTHROUGH; case ASL_WARNING: case ASL_REMARK: case ASL_ERROR: /* * Ignore this error/warning/remark if it has been disabled by * the user (-vw option) */ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId); for (i = 0; i < AslGbl_DisabledMessagesIndex; i++) { /* Simple implementation via fixed array */ if (EncodedMessageId == AslGbl_DisabledMessages[i]) { return (TRUE); } } break; default: break; } return (FALSE); } /******************************************************************************* * * FUNCTION: AslDualParseOpError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MainMsgId - Index into global message buffer * MainOp - Parse node where error happened * MainMsg - Message pertaining to the MainOp * SubMsgId - Index into global message buffer * SubOp - Additional parse node for better message * SubMsg - Message pertaining to SubOp * * * RETURN: None * * DESCRIPTION: Main error reporting routine for the ASL compiler for error * messages that point to multiple parse objects. * ******************************************************************************/ void AslDualParseOpError ( UINT8 Level, UINT16 MainMsgId, ACPI_PARSE_OBJECT *MainOp, char *MainMsg, UINT16 SubMsgId, ACPI_PARSE_OBJECT *SubOp, char *SubMsg) { ASL_ERROR_MSG *SubEnode = NULL; /* Check if user wants to ignore this exception */ if (!MainOp || AslIsExceptionIgnored (MainOp->Asl.Filename, MainOp->Asl.LogicalLineNumber, Level, MainMsgId)) { return; } if (SubOp) { AslInitEnode (&SubEnode, Level, SubMsgId, SubOp->Asl.LineNumber, SubOp->Asl.LogicalLineNumber, SubOp->Asl.LogicalByteOffset, SubOp->Asl.Column, SubOp->Asl.Filename, SubMsg, NULL, NULL); } AslLogNewError (Level, MainMsgId, MainOp->Asl.LineNumber, MainOp->Asl.LogicalLineNumber, MainOp->Asl.LogicalByteOffset, MainOp->Asl.Column, MainOp->Asl.Filename, MainMsg, NULL, SubEnode); } /******************************************************************************* * * FUNCTION: AslError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * Op - Parse node where error happened * ExtraMessage - Additional error message * * RETURN: None * * DESCRIPTION: Main error reporting routine for the ASL compiler (all code * except the parser.) * ******************************************************************************/ void AslError ( UINT8 Level, UINT16 MessageId, ACPI_PARSE_OBJECT *Op, char *ExtraMessage) { if (Op) { AslCommonError (Level, MessageId, Op->Asl.LineNumber, Op->Asl.LogicalLineNumber, Op->Asl.LogicalByteOffset, Op->Asl.Column, Op->Asl.Filename, ExtraMessage); } else { AslCommonError (Level, MessageId, 0, 0, 0, 0, NULL, ExtraMessage); } } /******************************************************************************* * * FUNCTION: AslCoreSubsystemError * * PARAMETERS: Op - Parse node where error happened * Status - The ACPICA Exception * ExtraMessage - Additional error message * Abort - TRUE -> Abort compilation * * RETURN: None * * DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA * core subsystem. * ******************************************************************************/ void AslCoreSubsystemError ( ACPI_PARSE_OBJECT *Op, ACPI_STATUS Status, char *ExtraMessage, BOOLEAN Abort) { sprintf (AslGbl_MsgBuffer, "%s %s", AcpiFormatException (Status), ExtraMessage); if (Op) { AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, Op->Asl.LineNumber, Op->Asl.LogicalLineNumber, Op->Asl.LogicalByteOffset, Op->Asl.Column, Op->Asl.Filename, AslGbl_MsgBuffer); } else { AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, 0, 0, 0, 0, NULL, AslGbl_MsgBuffer); } if (Abort) { AslAbort (); } } /******************************************************************************* * * FUNCTION: AslCompilererror * * PARAMETERS: CompilerMessage - Error message from the parser * * RETURN: Status (0 for now) * * DESCRIPTION: Report an error situation discovered in a production * NOTE: don't change the name of this function, it is called * from the auto-generated parser. * ******************************************************************************/ int AslCompilererror ( const char *CompilerMessage) { AslGbl_SyntaxError++; AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, AslGbl_CurrentLineNumber, AslGbl_LogicalLineNumber, AslGbl_CurrentLineOffset, AslGbl_CurrentColumn, AslGbl_Files[ASL_FILE_INPUT].Filename, ACPI_CAST_PTR (char, CompilerMessage)); return (0); } diff --git a/sys/contrib/dev/acpica/compiler/aslhelp.c b/sys/contrib/dev/acpica/compiler/aslhelp.c index 4b995101310e..d0980b962b83 100644 --- a/sys/contrib/dev/acpica/compiler/aslhelp.c +++ b/sys/contrib/dev/acpica/compiler/aslhelp.c @@ -1,336 +1,337 @@ /****************************************************************************** * * Module Name: aslhelp - iASL help screens * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslhelp") /******************************************************************************* * * FUNCTION: Usage * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display option help message. * Optional items in square brackets. * ******************************************************************************/ void Usage ( void) { printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); printf ("%s\n\n", ASL_COMPLIANCE); ACPI_USAGE_HEADER ("iasl [Options] [Files]"); printf ("\nGeneral:\n"); ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); ACPI_OPTION ("-p ", "Specify path/filename prefix for all output files"); ACPI_OPTION ("-v", "Display compiler version"); ACPI_OPTION ("-vo", "Enable optimization comments"); ACPI_OPTION ("-vs", "Disable signon"); printf ("\nHelp:\n"); ACPI_OPTION ("-h", "This message"); ACPI_OPTION ("-hc", "Display operators allowed in constant expressions"); ACPI_OPTION ("-hd", "Info for obtaining and disassembling binary ACPI tables"); ACPI_OPTION ("-hf", "Display help for output filename generation"); ACPI_OPTION ("-hr", "Display ACPI reserved method names"); ACPI_OPTION ("-ht", "Display currently supported ACPI table names"); printf ("\nPreprocessor:\n"); ACPI_OPTION ("-D ", "Define symbol for preprocessor use"); ACPI_OPTION ("-li", "Create preprocessed output file (*.i)"); ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)"); ACPI_OPTION ("-Pn", "Disable preprocessor"); printf ("\nErrors, Warnings, and Remarks:\n"); ACPI_OPTION ("-va", "Disable all errors/warnings/remarks"); ACPI_OPTION ("-ve", "Report only errors (ignore warnings and remarks)"); ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs"); ACPI_OPTION ("-vr", "Disable remarks"); ACPI_OPTION ("-vw ", "Ignore specific error, warning or remark"); ACPI_OPTION ("-vx ", "Expect a specific warning, remark, or error"); ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); ACPI_OPTION ("-ww ", "Report specific warning or remark as error"); printf ("\nAML Bytecode Generation (*.aml):\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); ACPI_OPTION ("-of", "Disable constant folding"); ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones"); ACPI_OPTION ("-on", "Disable named reference string optimization"); ACPI_OPTION ("-ot", "Disable typechecking"); ACPI_OPTION ("-cr", "Disable Resource Descriptor error checking"); ACPI_OPTION ("-in", "Ignore NoOp operators"); ACPI_OPTION ("-r ", "Override table header Revision (1-255)"); printf ("\nListings:\n"); ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)"); ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)"); ACPI_OPTION ("-ln", "Create namespace file (*.nsp)"); ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)"); ACPI_OPTION ("-lx", "Create cross-reference file (*.xrf)"); printf ("\nFirmware Support - C Text Output:\n"); ACPI_OPTION ("-tc", "Create hex AML table in C (*.hex)"); ACPI_OPTION ("-sc", "Create named hex AML arrays in C (*.c)"); ACPI_OPTION ("-ic", "Create include file in C for -sc symbols (*.h)"); ACPI_OPTION ("-so", "Create namespace AML offset table in C (*.offset.h)"); printf ("\nFirmware Support - Assembler Text Output:\n"); ACPI_OPTION ("-ta", "Create hex AML table in assembler (*.hex)"); ACPI_OPTION ("-sa", "Create named hex AML arrays in assembler (*.asm)"); ACPI_OPTION ("-ia", "Create include file in assembler for -sa symbols (*.inc)"); printf ("\nFirmware Support - ASL Text Output:\n"); ACPI_OPTION ("-ts", "Create hex AML table in ASL (Buffer object) (*.hex)"); printf ("\nLegacy-ASL to ASL+ Converter:\n"); ACPI_OPTION ("-ca ", "Convert legacy-ASL source file to new ASL+ file"); ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)"); printf ("\nData Table Compiler:\n"); ACPI_OPTION ("-tp", "Compile tables with flex/bison prototype"); ACPI_OPTION ("-G", "Compile custom table that contains generic operators"); ACPI_OPTION ("-T |ALL", "Create ACPI table template/example files"); ACPI_OPTION ("-T ", "Emit DSDT and SSDTs to same file"); ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)"); printf ("\nAML Disassembler:\n"); ACPI_OPTION ("-d ", "Disassemble or decode binary ACPI tables to file (*.dsl)"); ACPI_OPTION ("", " (Optional, file type is automatically detected)"); ACPI_OPTION ("-da ", "Disassemble multiple tables from single namespace"); ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-dc ", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-df", "Force disassembler to assume table contains valid AML"); ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)"); + ACPI_OPTION ("-ds ", "Specify a table signature(4) (CDAT table only)"); ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-l", "Disassemble to mixed ASL and AML code"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); printf ("\nDebug Options:\n"); ACPI_OPTION ("-bc", "Create converter debug file (*.cdb)"); ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)"); ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)"); ACPI_OPTION ("-bp ", "Prune ASL parse tree"); ACPI_OPTION ("-bt ", "Object type to be pruned from the parse tree"); ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); ACPI_OPTION ("-m ", "Set internal line buffer size (in Kbytes)"); ACPI_OPTION ("-n", "Parse only, no output generation"); ACPI_OPTION ("-oc", "Display compile times and statistics"); ACPI_OPTION ("-x ", "Set debug level for trace output"); ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); } /******************************************************************************* * * FUNCTION: FilenameHelp * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display help message for output filename generation * ******************************************************************************/ void AslFilenameHelp ( void) { printf ("\nAML output filename generation:\n"); printf (" Output filenames are generated by appending an extension to a common\n"); printf (" filename prefix. The filename prefix is obtained via one of the\n"); printf (" following methods (in priority order):\n"); printf (" 1) The -p option specifies the prefix\n"); printf (" 2) The prefix of the AMLFileName in the ASL Definition Block\n"); printf (" 3) The prefix of the input filename\n"); printf ("\n"); } /******************************************************************************* * * FUNCTION: AslDisassemblyHelp * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display help message for obtaining and disassembling AML/ASL * files. * ******************************************************************************/ void AslDisassemblyHelp ( void) { printf ("\nObtaining binary ACPI tables and disassembling to ASL source code.\n\n"); printf ("Use the following ACPICA toolchain:\n"); printf (" AcpiDump: Dump all ACPI tables to a hex ascii file\n"); printf (" AcpiXtract: Extract one or more binary ACPI tables from AcpiDump output\n"); printf (" iASL -d : Disassemble a binary ACPI table to ASL source code\n"); printf ("\n"); } diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c index 27308a1dc36c..a19e9a5f6af4 100644 --- a/sys/contrib/dev/acpica/compiler/asloptions.c +++ b/sys/contrib/dev/acpica/compiler/asloptions.c @@ -1,1125 +1,1147 @@ /****************************************************************************** * * Module Name: asloptions - compiler command line processing * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("asloption") /* Local prototypes */ static int AslDoOptions ( int argc, char **argv, BOOLEAN IsResponseFile); static void AslMergeOptionTokens ( char *InBuffer, char *OutBuffer); static int AslDoResponseFile ( char *Filename); #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|t|T+G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|:t|T+G^v^w|x:z" /******************************************************************************* * * FUNCTION: AslCommandLine * * PARAMETERS: argc/argv * * RETURN: Last argv index * * DESCRIPTION: Command line processing * ******************************************************************************/ int AslCommandLine ( int argc, char **argv) { int BadCommandLine = 0; ACPI_STATUS Status; /* Minimum command line contains at least the command and an input file */ if (argc < 2) { Usage (); exit (1); } /* Process all command line options */ BadCommandLine = AslDoOptions (argc, argv, FALSE); if (AslGbl_DoTemplates) { Status = DtCreateTemplates (argv); if (ACPI_FAILURE (Status)) { exit (-1); } exit (0); } /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && !AcpiGbl_DisasmFlag) { printf ("Missing input filename\n"); BadCommandLine = TRUE; } if (AslGbl_DoSignon) { printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); if (AslGbl_IgnoreErrors) { printf ("Ignoring all errors, forcing AML file generation\n\n"); } } if (BadCommandLine) { printf ("Use -h option for help information\n"); exit (1); } return (AcpiGbl_Optind); } /******************************************************************************* * * FUNCTION: AslDoOptions * * PARAMETERS: argc/argv - Standard argc/argv * IsResponseFile - TRUE if executing a response file. * * RETURN: Status * * DESCRIPTION: Command line option processing * ******************************************************************************/ static int AslDoOptions ( int argc, char **argv, BOOLEAN IsResponseFile) { ACPI_STATUS Status; - UINT32 j; + INT32 j; /* Get the command line options */ while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j) { case '@': /* Begin a response file */ if (IsResponseFile) { printf ("Nested command files are not supported\n"); return (-1); } if (AslDoResponseFile (AcpiGbl_Optarg)) { return (-1); } break; case 'a': /* Debug options */ switch (AcpiGbl_Optarg[0]) { case 'r': AslGbl_EnableReferenceTypechecking = TRUE; break; default: printf ("Unknown option: -a%s\n", AcpiGbl_Optarg); return (-1); } break; case 'b': /* Debug options */ switch (AcpiGbl_Optarg[0]) { case 'c': printf ("Debug ASL to ASL+ conversion\n"); AslGbl_DoAslConversion = TRUE; AslGbl_FoldConstants = FALSE; AslGbl_IntegerOptimizationFlag = FALSE; AslGbl_ReferenceOptimizationFlag = FALSE; AslGbl_OptimizeTrivialParseNodes = FALSE; AcpiGbl_CaptureComments = TRUE; AcpiGbl_DoDisassemblerOptimizations = FALSE; AcpiGbl_DebugAslConversion = TRUE; AcpiGbl_DmEmitExternalOpcodes = TRUE; AslGbl_DoExternalsInPlace = TRUE; return (0); case 'f': AslCompilerdebug = 1; /* same as yydebug */ DtParserdebug = 1; PrParserdebug = 1; AslGbl_DebugFlag = TRUE; AslGbl_KeepPreprocessorTempFile = TRUE; break; case 'p': /* Prune ASL parse tree */ /* Get the required argument */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } AslGbl_PruneParseTree = TRUE; AslGbl_PruneDepth = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0); break; case 's': AslGbl_DebugFlag = TRUE; break; case 't': /* Get the required argument */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } - AslGbl_PruneType = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0); break; default: printf ("Unknown option: -b%s\n", AcpiGbl_Optarg); return (-1); } break; case 'c': switch (AcpiGbl_Optarg[0]) { case 'a': printf ("Convert ASL to ASL+ with comments\n"); AslGbl_DoAslConversion = TRUE; AslGbl_FoldConstants = FALSE; AslGbl_IntegerOptimizationFlag = FALSE; AslGbl_ReferenceOptimizationFlag = FALSE; AslGbl_OptimizeTrivialParseNodes = FALSE; AcpiGbl_CaptureComments = TRUE; AcpiGbl_DoDisassemblerOptimizations = FALSE; AcpiGbl_DmEmitExternalOpcodes = TRUE; AslGbl_DoExternalsInPlace = TRUE; return (0); case 'r': AslGbl_NoResourceChecking = TRUE; break; default: printf ("Unknown option: -c%s\n", AcpiGbl_Optarg); return (-1); } break; case 'd': /* Disassembler */ switch (AcpiGbl_Optarg[0]) { case '^': AslGbl_DoCompile = FALSE; break; case 'a': AslGbl_DoCompile = FALSE; AslGbl_DisassembleAll = TRUE; break; case 'b': /* Do not convert buffers to resource descriptors */ AcpiGbl_NoResourceDisassembly = TRUE; break; case 'c': break; case 'f': AcpiGbl_ForceAmlDisassembly = TRUE; break; case 'l': /* Use legacy ASL code (not ASL+) for disassembly */ AslGbl_DoCompile = FALSE; AcpiGbl_CstyleDisassembly = FALSE; break; + case 's': /* Specify table signature (Only supported for CDAT table) */ + + /* Get the required argument */ + + if (AcpiGetoptArgument (argc, argv)) + { + return (-1); + } + + /* Check for exact string "CDAT" (upper or lower case) */ + + AcpiGbl_CDAT = ACPI_CAST_PTR (char, &AcpiGbl_Optarg); + if (AcpiUtStricmp (AcpiGbl_Optarg, ACPI_SIG_CDAT)) + { + printf ("\nUnknown table signature: %s\n", AcpiGbl_Optarg); + return (-1); + } + + AcpiGbl_CDAT = malloc (5); + AcpiUtSafeStrncpy ((char *) AcpiGbl_CDAT, ACPI_SIG_CDAT, 5); + break; + default: printf ("Unknown option: -d%s\n", AcpiGbl_Optarg); return (-1); } AcpiGbl_DisasmFlag = TRUE; break; case 'D': /* Define a symbol */ PrAddDefine (AcpiGbl_Optarg, NULL, TRUE); break; case 'e': /* External files for disassembler */ /* Get entire list of external files */ AcpiGbl_Optind--; argv[AcpiGbl_Optind] = AcpiGbl_Optarg; while (argv[AcpiGbl_Optind] && (argv[AcpiGbl_Optind][0] != '-')) { Status = AcpiDmAddToExternalFileList (argv[AcpiGbl_Optind]); if (ACPI_FAILURE (Status)) { printf ("Could not add %s to external list\n", argv[AcpiGbl_Optind]); return (-1); } AcpiGbl_Optind++; } break; case 'f': switch (AcpiGbl_Optarg[0]) { case '^': /* Ignore errors and force creation of aml file */ AslGbl_IgnoreErrors = TRUE; break; case 'e': /* Disassembler: Get external declaration file */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } AslGbl_ExternalRefFilename = AcpiGbl_Optarg; break; default: printf ("Unknown option: -f%s\n", AcpiGbl_Optarg); return (-1); } break; case 'G': AslGbl_CompileGeneric = TRUE; break; case 'g': /* Get all ACPI tables */ printf ("-g option is deprecated, use acpidump utility instead\n"); exit (1); case 'h': switch (AcpiGbl_Optarg[0]) { case '^': Usage (); exit (0); case 'c': UtDisplayConstantOpcodes (); exit (0); case 'd': AslDisassemblyHelp (); exit (0); case 'f': AslFilenameHelp (); exit (0); case 'r': /* reserved names */ ApDisplayReservedNames (); exit (0); case 't': UtDisplaySupportedTables (); exit (0); default: printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); return (-1); } case 'I': /* Add an include file search directory */ FlAddIncludeDirectory (AcpiGbl_Optarg); break; case 'i': /* Output AML as an include file */ switch (AcpiGbl_Optarg[0]) { case 'a': /* Produce assembly code include file */ AslGbl_AsmIncludeOutputFlag = TRUE; break; case 'c': /* Produce C include file */ AslGbl_C_IncludeOutputFlag = TRUE; break; case 'n': /* Compiler/Disassembler: Ignore the NOOP operator */ AcpiGbl_IgnoreNoopOperator = TRUE; break; default: printf ("Unknown option: -i%s\n", AcpiGbl_Optarg); return (-1); } break; case 'l': /* Listing files */ switch (AcpiGbl_Optarg[0]) { case '^': /* Produce listing file (Mixed source/aml) */ AslGbl_ListingFlag = TRUE; AcpiGbl_DmOpt_Listing = TRUE; break; case 'i': /* Produce preprocessor output file */ AslGbl_PreprocessorOutputFlag = TRUE; break; case 'm': /* Produce hardware map summary file */ AslGbl_MapfileFlag = TRUE; break; case 'n': /* Produce namespace file */ AslGbl_NsOutputFlag = TRUE; break; case 's': /* Produce combined source file */ AslGbl_SourceOutputFlag = TRUE; break; case 'x': /* Produce cross-reference file */ AslGbl_CrossReferenceOutput = TRUE; break; default: printf ("Unknown option: -l%s\n", AcpiGbl_Optarg); return (-1); } break; case 'm': /* Set line buffer size */ AslGbl_LineBufferSize = (UINT32) strtoul (AcpiGbl_Optarg, NULL, 0) * 1024; if (AslGbl_LineBufferSize < ASL_DEFAULT_LINE_BUFFER_SIZE) { AslGbl_LineBufferSize = ASL_DEFAULT_LINE_BUFFER_SIZE; } printf ("Line Buffer Size: %u\n", AslGbl_LineBufferSize); break; case 'n': /* Parse only */ AslGbl_ParseOnlyFlag = TRUE; break; case 'o': /* Control compiler AML optimizations */ switch (AcpiGbl_Optarg[0]) { case 'a': /* Disable all optimizations */ AslGbl_FoldConstants = FALSE; AslGbl_IntegerOptimizationFlag = FALSE; AslGbl_ReferenceOptimizationFlag = FALSE; AslGbl_OptimizeTrivialParseNodes = FALSE; break; case 'c': /* Display compile time(s) */ AslGbl_CompileTimesFlag = TRUE; break; case 'd': /* Disable disassembler code optimizations */ AcpiGbl_DoDisassemblerOptimizations = FALSE; break; case 'e': /* Disassembler: Emit embedded external operators */ AcpiGbl_DmEmitExternalOpcodes = TRUE; break; case 'E': /* * iASL: keep External opcodes in place. * No affect if Gbl_DoExternals is false. */ AslGbl_DoExternalsInPlace = TRUE; break; case 'f': /* Disable folding on "normal" expressions */ AslGbl_FoldConstants = FALSE; break; case 'i': /* Disable integer optimization to constants */ AslGbl_IntegerOptimizationFlag = FALSE; break; case 'n': /* Disable named reference optimization */ AslGbl_ReferenceOptimizationFlag = FALSE; break; case 't': /* Disable heavy typechecking */ AslGbl_DoTypechecking = FALSE; break; default: printf ("Unknown option: -c%s\n", AcpiGbl_Optarg); return (-1); } break; case 'P': /* Preprocessor options */ switch (AcpiGbl_Optarg[0]) { case '^': /* Proprocess only, emit (.i) file */ AslGbl_PreprocessOnly = TRUE; AslGbl_PreprocessorOutputFlag = TRUE; break; case 'n': /* Disable preprocessor */ AslGbl_PreprocessFlag = FALSE; break; default: printf ("Unknown option: -P%s\n", AcpiGbl_Optarg); return (-1); } break; case 'p': /* Override default AML output filename */ AslGbl_OutputFilenamePrefix = AcpiGbl_Optarg; UtConvertBackslashes (AslGbl_OutputFilenamePrefix); AslGbl_UseDefaultAmlFilename = FALSE; break; case 'q': /* ASL/ASl+ converter: compile only and leave badaml. */ printf ("Convert ASL to ASL+ with comments\n"); AslGbl_FoldConstants = FALSE; AslGbl_IntegerOptimizationFlag = FALSE; AslGbl_ReferenceOptimizationFlag = FALSE; AslGbl_OptimizeTrivialParseNodes = FALSE; AslGbl_DoExternalsInPlace = TRUE; AcpiGbl_CaptureComments = TRUE; return (0); case 'r': /* Override revision found in table header */ AslGbl_RevisionOverride = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0); break; case 's': /* Create AML in a source code file */ switch (AcpiGbl_Optarg[0]) { case 'a': /* Produce assembly code output file */ AslGbl_AsmOutputFlag = TRUE; break; case 'c': /* Produce C hex output file */ AslGbl_C_OutputFlag = TRUE; break; case 'o': /* Produce AML offset table in C */ AslGbl_C_OffsetTableFlag = TRUE; break; default: printf ("Unknown option: -s%s\n", AcpiGbl_Optarg); return (-1); } break; case 't': /* Produce hex table output file */ switch (AcpiGbl_Optarg[0]) { case 'a': AslGbl_HexOutputFlag = HEX_OUTPUT_ASM; break; case 'c': AslGbl_HexOutputFlag = HEX_OUTPUT_C; break; - case 'p': /* data table flex/bison prototype */ + case 'p': /* data table flex/bison prototype */ AslGbl_DtLexBisonPrototype = TRUE; break; case 's': AslGbl_HexOutputFlag = HEX_OUTPUT_ASL; break; default: printf ("Unknown option: -t%s\n", AcpiGbl_Optarg); return (-1); } break; case 'T': /* Create a ACPI table template file */ AslGbl_DoTemplates = TRUE; break; case 'v': /* Version and verbosity settings */ switch (AcpiGbl_Optarg[0]) { case '^': printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); exit (0); case 'a': /* Disable all error/warning/remark messages */ AslGbl_NoErrors = TRUE; break; case 'e': /* Disable all warning/remark messages (errors only) */ AslGbl_DisplayRemarks = FALSE; AslGbl_DisplayWarnings = FALSE; break; case 'i': /* * Support for integrated development environment(s). * * 1) No compiler signon * 2) Send stderr messages to stdout * 3) Less verbose error messages (single line only for each) * 4) Error/warning messages are formatted appropriately to * be recognized by MS Visual Studio */ AslGbl_VerboseErrors = FALSE; AslGbl_DoSignon = FALSE; break; case 'o': AslGbl_DisplayOptimizations = TRUE; break; case 'r': AslGbl_DisplayRemarks = FALSE; break; case 's': AslGbl_DoSignon = FALSE; break; case 't': AslGbl_VerboseTemplates = TRUE; break; case 'w': /* Get the required argument */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } Status = AslDisableException (AcpiGbl_Optarg); if (ACPI_FAILURE (Status)) { return (-1); } break; case 'x': /* Get the required argument */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } Status = AslLogExpectedException (AcpiGbl_Optarg); if (ACPI_FAILURE (Status)) { return (-1); } break; default: printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); return (-1); } break; case 'w': /* Set warning levels */ switch (AcpiGbl_Optarg[0]) { case '1': AslGbl_WarningLevel = ASL_WARNING; break; case '2': AslGbl_WarningLevel = ASL_WARNING2; break; case '3': AslGbl_WarningLevel = ASL_WARNING3; break; case 'e': AslGbl_WarningsAsErrors = TRUE; break; case 'w': /* Get the required argument */ if (AcpiGetoptArgument (argc, argv)) { return (-1); } Status = AslElevateException (AcpiGbl_Optarg); if (ACPI_FAILURE (Status)) { return (-1); } break; default: printf ("Unknown option: -w%s\n", AcpiGbl_Optarg); return (-1); } break; case 'x': /* Set debug print output level */ AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 16); break; case 'z': AslGbl_UseOriginalCompilerId = TRUE; break; default: return (-1); } return (0); } /******************************************************************************* * * FUNCTION: AslMergeOptionTokens * * PARAMETERS: InBuffer - Input containing an option string * OutBuffer - Merged output buffer * * RETURN: None * * DESCRIPTION: Remove all whitespace from an option string. * ******************************************************************************/ static void AslMergeOptionTokens ( char *InBuffer, char *OutBuffer) { char *Token; *OutBuffer = 0; Token = strtok (InBuffer, ASL_TOKEN_SEPARATORS); while (Token) { strcat (OutBuffer, Token); Token = strtok (NULL, ASL_TOKEN_SEPARATORS); } } /******************************************************************************* * * FUNCTION: AslDoResponseFile * * PARAMETERS: Filename - Name of the response file * * RETURN: Status * * DESCRIPTION: Open a response file and process all options within. * ******************************************************************************/ static int AslDoResponseFile ( char *Filename) { char *argv = AslGbl_StringBuffer2; FILE *ResponseFile; int OptStatus = 0; int Opterr; int Optind; ResponseFile = fopen (Filename, "r"); if (!ResponseFile) { printf ("Could not open command file %s, %s\n", Filename, strerror (errno)); return (-1); } /* Must save the current GetOpt globals */ Opterr = AcpiGbl_Opterr; Optind = AcpiGbl_Optind; /* * Process all lines in the response file. There must be one complete * option per line */ while (fgets (AslGbl_StringBuffer, ASL_STRING_BUFFER_SIZE, ResponseFile)) { /* Compress all tokens, allowing us to use a single argv entry */ AslMergeOptionTokens (AslGbl_StringBuffer, AslGbl_StringBuffer2); /* Process the option */ AcpiGbl_Opterr = 0; AcpiGbl_Optind = 0; OptStatus = AslDoOptions (1, &argv, TRUE); if (OptStatus) { printf ("Invalid option in command file %s: %s\n", Filename, AslGbl_StringBuffer); break; } } /* Restore the GetOpt globals */ AcpiGbl_Opterr = Opterr; AcpiGbl_Optind = Optind; fclose (ResponseFile); return (OptStatus); } diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c index cad967d4ffab..d0af2af2460f 100644 --- a/sys/contrib/dev/acpica/compiler/aslpredef.c +++ b/sys/contrib/dev/acpica/compiler/aslpredef.c @@ -1,896 +1,896 @@ /****************************************************************************** * * Module Name: aslpredef - support for ACPI predefined names * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #define ACPI_CREATE_PREDEFINED_TABLE #define ACPI_CREATE_RESOURCE_TABLE #include #include "aslcompiler.y.h" #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslpredef") /* Local prototypes */ static void ApCheckForUnexpectedReturnValue ( ACPI_PARSE_OBJECT *Op, ASL_METHOD_INFO *MethodInfo); static UINT32 ApCheckForSpecialName ( ACPI_PARSE_OBJECT *Op, char *Name); /******************************************************************************* * * FUNCTION: ApCheckForPredefinedMethod * * PARAMETERS: Op - A parse node of type "METHOD". * MethodInfo - Saved info about this method * * RETURN: None * * DESCRIPTION: If method is a predefined name, check that the number of * arguments and the return type (returns a value or not) * is correct. * ******************************************************************************/ BOOLEAN ApCheckForPredefinedMethod ( ACPI_PARSE_OBJECT *Op, ASL_METHOD_INFO *MethodInfo) { UINT32 Index; UINT32 RequiredArgCount; const ACPI_PREDEFINED_INFO *ThisName; /* Check for a match against the predefined name list */ Index = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); switch (Index) { case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ /* Just return, nothing to do */ return (FALSE); case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ AslGbl_ReservedMethods++; /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */ if (MethodInfo->NumArguments != 0) { sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); } break; default: /* * Matched a predefined method name - validate the ASL-defined * argument count against the ACPI specification. * * Some methods are allowed to have a "minimum" number of args * (_SCP) because their definition in ACPI has changed over time. */ AslGbl_ReservedMethods++; ThisName = &AcpiGbl_PredefinedMethods[Index]; RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList); if (MethodInfo->NumArguments != RequiredArgCount) { sprintf (AslGbl_MsgBuffer, "%4.4s requires %u", ThisName->Info.Name, RequiredArgCount); if (MethodInfo->NumArguments < RequiredArgCount) { AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, AslGbl_MsgBuffer); } else if ((MethodInfo->NumArguments > RequiredArgCount) && !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) { AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); } } /* * Check if method returns no value, but the predefined name is * required to return a value */ if (MethodInfo->NumReturnNoValue && ThisName->Info.ExpectedBtypes) { AcpiUtGetExpectedReturnTypes (AslGbl_StringBuffer, ThisName->Info.ExpectedBtypes); sprintf (AslGbl_MsgBuffer, "%s required for %4.4s", AslGbl_StringBuffer, ThisName->Info.Name); AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, AslGbl_MsgBuffer); } break; } return (TRUE); } /******************************************************************************* * * FUNCTION: ApCheckForUnexpectedReturnValue * * PARAMETERS: Op - A parse node of type "RETURN". * MethodInfo - Saved info about this method * * RETURN: None * * DESCRIPTION: Check for an unexpected return value from a predefined method. * Invoked for predefined methods that are defined to not return * any value. If there is a return value, issue a remark, since * the ASL writer may be confused as to the method definition * and/or functionality. * * Note: We ignore all return values of "Zero", since this is what a standalone * Return() statement will always generate -- so we ignore it here -- * i.e., there is no difference between Return() and Return(Zero). * Also, a null Return() will be disassembled to return(Zero) -- so, we * don't want to generate extraneous remarks/warnings for a disassembled * ASL file. * ******************************************************************************/ static void ApCheckForUnexpectedReturnValue ( ACPI_PARSE_OBJECT *Op, ASL_METHOD_INFO *MethodInfo) { ACPI_PARSE_OBJECT *ReturnValueOp; /* Ignore Return() and Return(Zero) (they are the same) */ ReturnValueOp = Op->Asl.Child; if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_ZERO) { return; } /* We have a valid return value, but the reserved name did not expect it */ AslError (ASL_WARNING, ASL_MSG_RESERVED_NO_RETURN_VAL, Op, MethodInfo->Op->Asl.ExternalName); } /******************************************************************************* * * FUNCTION: ApCheckPredefinedReturnValue * * PARAMETERS: Op - A parse node of type "RETURN". * MethodInfo - Saved info about this method * * RETURN: None * * DESCRIPTION: If method is a predefined name, attempt to validate the return * value. Only "static" types can be validated - a simple return * of an integer/string/buffer/package or a named reference to * a static object. Values such as a Localx or Argx or a control * method invocation are not checked. Issue a warning if there is * a valid return value, but the reserved method defines no * return value. * ******************************************************************************/ void ApCheckPredefinedReturnValue ( ACPI_PARSE_OBJECT *Op, ASL_METHOD_INFO *MethodInfo) { UINT32 Index; ACPI_PARSE_OBJECT *ReturnValueOp; const ACPI_PREDEFINED_INFO *ThisName; /* * Check parent method for a match against the predefined name list. * * Note: Disable compiler errors/warnings because any errors will be * caught when analyzing the parent method. Eliminates duplicate errors. */ AslGbl_AllExceptionsDisabled = TRUE; Index = ApCheckForPredefinedName (MethodInfo->Op, MethodInfo->Op->Asl.NameSeg); AslGbl_AllExceptionsDisabled = FALSE; switch (Index) { case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ /* No return value expected, warn if there is one */ ApCheckForUnexpectedReturnValue (Op, MethodInfo); return; case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ /* Just return, nothing to do */ return; default: /* A standard predefined ACPI name */ ThisName = &AcpiGbl_PredefinedMethods[Index]; if (!ThisName->Info.ExpectedBtypes) { /* No return value expected, warn if there is one */ ApCheckForUnexpectedReturnValue (Op, MethodInfo); return; } /* Get the object returned, it is the next argument */ ReturnValueOp = Op->Asl.Child; switch (ReturnValueOp->Asl.ParseOpcode) { case PARSEOP_ZERO: case PARSEOP_ONE: case PARSEOP_ONES: case PARSEOP_INTEGER: case PARSEOP_STRING_LITERAL: case PARSEOP_BUFFER: case PARSEOP_PACKAGE: /* Static data return object - check against expected type */ ApCheckObjectType (ThisName->Info.Name, ReturnValueOp, ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); /* For packages, check the individual package elements */ if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE) { ApCheckPackage (ReturnValueOp, ThisName); } break; default: /* * All other ops are very difficult or impossible to typecheck at * compile time. These include all Localx, Argx, and method * invocations. Also, NAMESEG and NAMESTRING because the type of * any named object can be changed at runtime (for example, * CopyObject will change the type of the target object.) */ break; } } } /******************************************************************************* * * FUNCTION: ApCheckForPredefinedObject * * PARAMETERS: Op - A parse node * Name - The ACPI name to be checked * * RETURN: None * * DESCRIPTION: Check for a predefined name for a static object (created via * the ASL Name operator). If it is a predefined ACPI name, ensure * that the name does not require any arguments (which would * require a control method implementation of the name), and that * the type of the object is one of the expected types for the * predefined name. * ******************************************************************************/ void ApCheckForPredefinedObject ( ACPI_PARSE_OBJECT *Op, char *Name) { UINT32 Index; ACPI_PARSE_OBJECT *ObjectOp; const ACPI_PREDEFINED_INFO *ThisName; /* * Check for a real predefined name -- not a resource descriptor name * or a predefined scope name */ Index = ApCheckForPredefinedName (Op, Name); switch (Index) { case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ /* Nothing to do */ return; case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ /* * These names must be control methods, by definition in ACPI spec. * Also because they are defined to return no value. None of them * require any arguments. */ AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, "with zero arguments"); return; default: break; } /* A standard predefined ACPI name */ /* * If this predefined name requires input arguments, then * it must be implemented as a control method */ ThisName = &AcpiGbl_PredefinedMethods[Index]; if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0) { AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, "with arguments"); return; } /* * If no return value is expected from this predefined name, then * it follows that it must be implemented as a control method * (with zero args, because the args > 0 case was handled above) * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx */ if (!ThisName->Info.ExpectedBtypes) { AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, "with zero arguments"); return; } /* Typecheck the actual object, it is the next argument */ ObjectOp = Op->Asl.Child->Asl.Next; ApCheckObjectType (ThisName->Info.Name, Op->Asl.Child->Asl.Next, ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); /* For packages, check the individual package elements */ if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE) { ApCheckPackage (ObjectOp, ThisName); } } /******************************************************************************* * * FUNCTION: ApCheckForPredefinedName * * PARAMETERS: Op - A parse node * Name - NameSeg to check * * RETURN: None * * DESCRIPTION: Check a NameSeg against the reserved list. * ******************************************************************************/ UINT32 ApCheckForPredefinedName ( ACPI_PARSE_OBJECT *Op, char *Name) { UINT32 i; const ACPI_PREDEFINED_INFO *ThisName; if (Name[0] == 0) { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op, - "zero length name found"); + "Zero length name found"); } /* All reserved names are prefixed with a single underscore */ if (Name[0] != '_') { return (ACPI_NOT_RESERVED_NAME); } /* Check for a standard predefined method name */ ThisName = AcpiGbl_PredefinedMethods; for (i = 0; ThisName->Info.Name[0]; i++) { if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { /* Return index into predefined array */ return (i); } ThisName++; /* Does not account for extra package data, but is OK */ } /* Check for resource names and predefined scope names */ ThisName = AcpiGbl_ResourceNames; while (ThisName->Info.Name[0]) { if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { return (ACPI_PREDEFINED_NAME); } ThisName++; } ThisName = AcpiGbl_ScopeNames; while (ThisName->Info.Name[0]) { if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { return (ACPI_PREDEFINED_NAME); } ThisName++; } /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */ return (ApCheckForSpecialName (Op, Name)); } /******************************************************************************* * * FUNCTION: ApCheckForSpecialName * * PARAMETERS: Op - A parse node * Name - NameSeg to check * * RETURN: None * * DESCRIPTION: Check for the "special" predefined names - * _Lxx, _Exx, _Qxx, _Wxx, and _T_x * ******************************************************************************/ static UINT32 ApCheckForSpecialName ( ACPI_PARSE_OBJECT *Op, char *Name) { /* * Check for the "special" predefined names. We already know that the * first character is an underscore. * GPE: _Lxx * GPE: _Exx * GPE: _Wxx * EC: _Qxx */ if ((Name[1] == 'L') || (Name[1] == 'E') || (Name[1] == 'W') || (Name[1] == 'Q')) { /* The next two characters must be hex digits */ if ((isxdigit ((int) Name[2])) && (isxdigit ((int) Name[3]))) { return (ACPI_EVENT_RESERVED_NAME); } } /* Check for the names reserved for the compiler itself: _T_x */ else if ((Op->Asl.ExternalName[1] == 'T') && (Op->Asl.ExternalName[2] == '_')) { /* Ignore if actually emitted by the compiler */ if (Op->Asl.CompileFlags & OP_COMPILER_EMITTED) { return (ACPI_NOT_RESERVED_NAME); } /* * Was not actually emitted by the compiler. This is a special case, * however. If the ASL code being compiled was the result of a * disassembly, it may possibly contain valid compiler-emitted names * of the form "_T_x". We don't want to issue an error or even a * warning and force the user to manually change the names. So, we * will issue a remark instead. */ AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); return (ACPI_COMPILER_RESERVED_NAME); } /* * The name didn't match any of the known predefined names. Flag it as a * warning, since the entire namespace starting with an underscore is * reserved by the ACPI spec. */ AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op, Op->Asl.ExternalName); return (ACPI_NOT_RESERVED_NAME); } /******************************************************************************* * * FUNCTION: ApCheckObjectType * * PARAMETERS: PredefinedName - Name of the predefined object we are checking * Op - Current parse node * ExpectedBtypes - Bitmap of expected return type(s) * PackageIndex - Index of object within parent package (if * applicable - ACPI_NOT_PACKAGE_ELEMENT * otherwise) * * RETURN: None * * DESCRIPTION: Check if the object type is one of the types that is expected * by the predefined name. Only a limited number of object types * can be returned by the predefined names. * ******************************************************************************/ ACPI_STATUS ApCheckObjectType ( const char *PredefinedName, ACPI_PARSE_OBJECT *Op, UINT32 ExpectedBtypes, UINT32 PackageIndex) { UINT32 ReturnBtype; char *TypeName; if (!Op) { return (AE_TYPE); } /* Map the parse opcode to a bitmapped return type (RTYPE) */ switch (Op->Asl.ParseOpcode) { case PARSEOP_ZERO: case PARSEOP_ONE: case PARSEOP_ONES: case PARSEOP_INTEGER: ReturnBtype = ACPI_RTYPE_INTEGER; TypeName = "Integer"; break; case PARSEOP_STRING_LITERAL: ReturnBtype = ACPI_RTYPE_STRING; TypeName = "String"; break; case PARSEOP_BUFFER: ReturnBtype = ACPI_RTYPE_BUFFER; TypeName = "Buffer"; break; case PARSEOP_PACKAGE: case PARSEOP_VAR_PACKAGE: ReturnBtype = ACPI_RTYPE_PACKAGE; TypeName = "Package"; break; case PARSEOP_NAMESEG: case PARSEOP_NAMESTRING: /* * Ignore any named references within a package object. * * For Package objects, references are allowed instead of any of the * standard data types (Integer/String/Buffer/Package). These * references are resolved at runtime. NAMESEG and NAMESTRING are * impossible to typecheck at compile time because the type of * any named object can be changed at runtime (for example, * CopyObject will change the type of the target object). */ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) { return (AE_OK); } ReturnBtype = ACPI_RTYPE_REFERENCE; TypeName = "Reference"; break; default: /* Not one of the supported object types */ TypeName = UtGetOpName (Op->Asl.ParseOpcode); goto TypeErrorExit; } /* Exit if the object is one of the expected types */ if (ReturnBtype & ExpectedBtypes) { return (AE_OK); } TypeErrorExit: /* Format the expected types and emit an error message */ AcpiUtGetExpectedReturnTypes (AslGbl_StringBuffer, ExpectedBtypes); if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { sprintf (AslGbl_MsgBuffer, "%4.4s: found %s, %s required", PredefinedName, TypeName, AslGbl_StringBuffer); } else { sprintf (AslGbl_MsgBuffer, "%4.4s: found %s at index %u, %s required", PredefinedName, TypeName, PackageIndex, AslGbl_StringBuffer); } AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, AslGbl_MsgBuffer); return (AE_TYPE); } /******************************************************************************* * * FUNCTION: ApDisplayReservedNames * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Dump information about the ACPI predefined names and predefined * resource descriptor names. * ******************************************************************************/ void ApDisplayReservedNames ( void) { const ACPI_PREDEFINED_INFO *ThisName; UINT32 Count; UINT32 NumTypes; /* * Predefined names/methods */ printf ("\nPredefined Name Information\n\n"); Count = 0; ThisName = AcpiGbl_PredefinedMethods; while (ThisName->Info.Name[0]) { AcpiUtDisplayPredefinedMethod (AslGbl_MsgBuffer, ThisName, FALSE); Count++; ThisName = AcpiUtGetNextPredefinedMethod (ThisName); } printf ("%u Predefined Names are recognized\n", Count); /* * Resource Descriptor names */ printf ("\nPredefined Names for Resource Descriptor Fields\n\n"); Count = 0; ThisName = AcpiGbl_ResourceNames; while (ThisName->Info.Name[0]) { NumTypes = AcpiUtGetResourceBitWidth (AslGbl_MsgBuffer, ThisName->Info.ArgumentList); printf ("%4.4s Field is %s bits wide%s\n", ThisName->Info.Name, AslGbl_MsgBuffer, (NumTypes > 1) ? " (depending on descriptor type)" : ""); Count++; ThisName++; } printf ("%u Resource Descriptor Field Names are recognized\n", Count); /* * Predefined scope names */ printf ("\nPredefined Scope/Device Names (automatically created at root)\n\n"); ThisName = AcpiGbl_ScopeNames; while (ThisName->Info.Name[0]) { printf ("%4.4s Scope/Device\n", ThisName->Info.Name); ThisName++; } } diff --git a/sys/contrib/dev/acpica/compiler/aslprune.c b/sys/contrib/dev/acpica/compiler/aslprune.c index 646aab2918e5..a4e817e9ceb5 100644 --- a/sys/contrib/dev/acpica/compiler/aslprune.c +++ b/sys/contrib/dev/acpica/compiler/aslprune.c @@ -1,349 +1,357 @@ /****************************************************************************** * * Module Name: aslprune - Parse tree prune utility * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include "aslcompiler.y.h" #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslprune") /* Local prototypes */ static ACPI_STATUS PrTreePruneWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); static void +<<<<<<< HEAD:sys/contrib/dev/acpica/compiler/aslprune.c PrPrintObjectAtLevel ( UINT32 Level, const char *ObjectName); +======= +AhDisplayUsage ( + void); + +#define AH_UTILITY_NAME "ACPI Help Utility" +#define AH_SUPPORTED_OPTIONS "adeghikmopstuv^x" +>>>>>>> a799bdd9d50e (Import ACPICA 20221020):source/tools/acpihelp/ahmain.c /* Structure used for the pruning parse tree walk */ typedef struct acpi_prune_info { UINT32 PruneLevel; UINT16 ParseOpcode; UINT16 Count; } ACPI_PRUNE_INFO; /******************************************************************************* * * FUNCTION: AslPruneParseTree * * PARAMETERS: PruneDepth - Number of levels to prune * Type - Prune type (Device, Method, etc.) * * RETURN: None * * DESCRIPTION: Prune off one or more levels of the ASL parse tree * ******************************************************************************/ void AslPruneParseTree ( UINT32 PruneDepth, UINT32 Type) { ACPI_PRUNE_INFO PruneObj; PruneObj.PruneLevel = PruneDepth; PruneObj.Count = 0; switch (Type) { case 0: PruneObj.ParseOpcode = (UINT16) PARSEOP_DEVICE; break; case 1: PruneObj.ParseOpcode = (UINT16) PARSEOP_METHOD; break; case 2: PruneObj.ParseOpcode = (UINT16) PARSEOP_IF; break; default: AcpiOsPrintf ("Unsupported type: %u\n", Type); return; } AcpiOsPrintf ("Pruning parse tree, from depth %u\n", PruneDepth); AcpiOsPrintf ("\nRemoving Objects:\n"); TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj)); AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count); } /******************************************************************************* * * FUNCTION: PrPrintObjectAtLevel * * PARAMETERS: Level - Current nesting level * ObjectName - ACPI name for the object * * RETURN: None * * DESCRIPTION: Print object name with indent * ******************************************************************************/ static void PrPrintObjectAtLevel ( UINT32 Level, const char *ObjectName) { UINT32 i; for (i = 0; i < Level; i++) { AcpiOsPrintf (" "); } AcpiOsPrintf ("[%s] at Level [%u]\n", ObjectName, Level); } /******************************************************************************* * * FUNCTION: PrTreePruneWalk * * PARAMETERS: Parse tree walk callback * * RETURN: Status * * DESCRIPTION: Prune off one or more levels of the ASL parse tree * * Current objects that can be pruned are: Devices, Methods, and If/Else * blocks. * ******************************************************************************/ static ACPI_STATUS PrTreePruneWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) { ACPI_PRUNE_INFO *PruneObj = (ACPI_PRUNE_INFO *) Context; /* We only care about objects below the Prune Level threshold */ if (Level <= PruneObj->PruneLevel) { return (AE_OK); } if ((Op->Asl.ParseOpcode != PruneObj->ParseOpcode) && !(Op->Asl.ParseOpcode == PARSEOP_ELSE && PruneObj->ParseOpcode == PARSEOP_IF)) { return (AE_OK); } switch (Op->Asl.ParseOpcode) { case PARSEOP_METHOD: AcpiOsPrintf ("Method"); PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name); Op->Asl.Child->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next = NULL; PruneObj->Count++; break; case PARSEOP_DEVICE: AcpiOsPrintf ("Device"); PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name); Op->Asl.Child->Asl.Next = NULL; PruneObj->Count++; break; case PARSEOP_IF: case PARSEOP_ELSE: if (Op->Asl.ParseOpcode == PARSEOP_ELSE) { PrPrintObjectAtLevel(Level, "Else"); Op->Asl.Child = NULL; } else { PrPrintObjectAtLevel(Level, "If"); Op->Asl.Child->Asl.Next = NULL; } PruneObj->Count++; break; default: break; } return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c index ea3075bc309a..c7eac4d92be1 100644 --- a/sys/contrib/dev/acpica/compiler/aslstartup.c +++ b/sys/contrib/dev/acpica/compiler/aslstartup.c @@ -1,642 +1,642 @@ /****************************************************************************** * * Module Name: aslstartup - Compiler startup routines, called from main * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslstartup") /* Local prototypes */ static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info); /* Globals */ static BOOLEAN AslToFile = TRUE; /******************************************************************************* * * FUNCTION: AslInitializeGlobals * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Re-initialize globals needed to restart the compiler. This * allows multiple files to be disassembled and/or compiled. * ******************************************************************************/ void AslInitializeGlobals ( void) { UINT32 i; /* Init compiler globals */ AslGbl_SyntaxError = 0; AslGbl_CurrentColumn = 0; AslGbl_CurrentLineNumber = 1; AslGbl_LogicalLineNumber = 1; AslGbl_CurrentLineOffset = 0; AslGbl_InputFieldCount = 0; AslGbl_InputByteCount = 0; AslGbl_NsLookupCount = 0; AslGbl_LineBufPtr = AslGbl_CurrentLineBuffer; AslGbl_ErrorLog = NULL; AslGbl_NextError = NULL; AslGbl_Signature = NULL; AslGbl_FileType = 0; AslGbl_TotalExecutableOpcodes = 0; AslGbl_TotalNamedObjects = 0; AslGbl_TotalKeywords = 0; AslGbl_TotalParseNodes = 0; AslGbl_TotalMethods = 0; AslGbl_TotalAllocations = 0; AslGbl_TotalAllocated = 0; AslGbl_TotalFolds = 0; AslGbl_NextEvent = 0; for (i = 0; i < ASL_NUM_REPORT_LEVELS; i++) { AslGbl_ExceptionCount[i] = 0; } if (AcpiGbl_CaptureComments) { AslGbl_CommentState.SpacesBefore = 0; AslGbl_CommentState.CommentType = 1; AslGbl_CommentState.LatestParseOp = NULL; AslGbl_CommentState.ParsingParenBraceNode = NULL; AslGbl_CommentState.CaptureComments = TRUE; } } /******************************************************************************* * * FUNCTION: AslDetectSourceFileType * * PARAMETERS: Info - Name/Handle for the file (must be open) * * RETURN: File Type * * DESCRIPTION: Determine the type of the input file. Either binary (contains * non-ASCII characters), ASL file, or an ACPI Data Table file. * ******************************************************************************/ static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info) { char *FileChar; UINT8 Type = ASL_INPUT_TYPE_ASCII_DATA; /* default */ ACPI_STATUS Status; /* Check for 100% ASCII source file (comments are ignored) */ Status = FlIsFileAsciiSource (Info->Filename, FALSE); if (ACPI_SUCCESS (Status)) { /* * File contains ASCII source code. Determine if this is an ASL * file or an ACPI data table file. */ while (fgets (AslGbl_CurrentLineBuffer, AslGbl_LineBufferSize, Info->Handle)) { /* Uppercase the buffer for caseless compare */ FileChar = AslGbl_CurrentLineBuffer; while (*FileChar) { *FileChar = (char) toupper ((int) *FileChar); FileChar++; } /* Presence of "DefinitionBlock" indicates actual ASL code */ if (strstr (AslGbl_CurrentLineBuffer, "DEFINITIONBLOCK")) { /* Appears to be an ASL file */ Type = ASL_INPUT_TYPE_ASCII_ASL; goto Cleanup; } } /* Appears to be an ASCII data table source file */ Type = ASL_INPUT_TYPE_ASCII_DATA; goto Cleanup; } /* * We have some sort of binary table; reopen in binary mode, then * check for valid ACPI table */ fclose (Info->Handle); Info->Handle = fopen (Info->Filename, "rb"); if (!Info->Handle) { fprintf (stderr, "Could not open input file %s\n", Info->Filename); } Status = AcValidateTableHeader (Info->Handle, 0); if (ACPI_SUCCESS (Status)) { fprintf (stderr, "Binary file appears to be a valid ACPI table, disassembling\n"); Type = ASL_INPUT_TYPE_BINARY_ACPI_TABLE; goto Cleanup; } else { fprintf (stderr, - "Binary file does not contain a valid ACPI table\n"); + "Binary file does not contain a valid standard ACPI table\n"); } Type = ASL_INPUT_TYPE_BINARY; Cleanup: /* Must seek back to the start of the file */ fseek (Info->Handle, 0, SEEK_SET); return (Type); } /******************************************************************************* * * FUNCTION: AslDoDisassembly * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Initiate AML file disassembly. Uses ACPICA subsystem to build * namespace. This function assumes that the ACPI subsystem has * been initialized. The caller of the initialization will also * terminate the ACPI subsystem. * ******************************************************************************/ ACPI_STATUS AslDoDisassembly ( void) { ACPI_STATUS Status; Status = AcpiAllocateRootTable (4); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n", AcpiFormatException (Status)); return (Status); } /* This is where the disassembly happens */ AcpiGbl_DmOpt_Disasm = TRUE; Status = AdAmlDisassemble (AslToFile, AslGbl_Files[ASL_FILE_INPUT].Filename, AslGbl_OutputFilenamePrefix, &AslGbl_Files[ASL_FILE_INPUT].Filename); if (ACPI_FAILURE (Status)) { return (Status); } /* Check if any control methods were unresolved */ AcpiDmUnresolvedWarning (0); /* Clear Error log */ AeClearErrorLog (); /* * AslGbl_Files[ASL_FILE_INPUT].Filename was replaced with the * .DSL disassembly file, which can now be compiled if requested */ if (AslGbl_DoCompile) { AcpiOsPrintf ("\nCompiling \"%s\"\n", AslGbl_Files[ASL_FILE_INPUT].Filename); return (AE_CTRL_CONTINUE); } return (AE_OK); } /******************************************************************************* * * FUNCTION: AslDoOneFile * * PARAMETERS: Filename - Name of the file * * RETURN: Status * * DESCRIPTION: Process a single file - either disassemble, compile, or both * ******************************************************************************/ ACPI_STATUS AslDoOneFile ( char *Filename) { ACPI_STATUS Status; UINT8 Event; ASL_GLOBAL_FILE_NODE *FileNode; /* Re-initialize "some" compiler/preprocessor globals */ AslInitializeGlobals (); PrInitializeGlobals (); /* * Extract the directory path. This path is used for possible include * files and the optional AML filename embedded in the input file * DefinitionBlock declaration. */ Status = FlSplitInputPathname (Filename, &AslGbl_DirectoryPath, NULL); if (ACPI_FAILURE (Status)) { return (Status); } /* * There was an input file detected at this point. Each input ASL file is * associated with one global file node consisting of the input file and * all output files associated with it. This is useful when compiling * multiple files in one command. */ Status = FlInitOneFile(Filename); if (ACPI_FAILURE (Status)) { return (AE_ERROR); } /* Take a copy of the input filename, convert any backslashes */ AslGbl_Files[ASL_FILE_INPUT].Filename = UtLocalCacheCalloc (strlen (Filename) + 1); strcpy (AslGbl_Files[ASL_FILE_INPUT].Filename, Filename); UtConvertBackslashes (AslGbl_Files[ASL_FILE_INPUT].Filename); /* * Open the input file. Here, this could be an ASCII source file, * either an ASL file or a Data Table file, or a binary AML file * or binary data table file (For disassembly). */ Status = FlOpenInputFile (AslGbl_Files[ASL_FILE_INPUT].Filename); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return (AE_ERROR); } FileNode = FlGetCurrentFileNode(); /* Determine input file type */ AslGbl_FileType = AslDetectSourceFileType (&AslGbl_Files[ASL_FILE_INPUT]); FileNode->FileType = AslGbl_FileType; if (AslGbl_FileType == ASL_INPUT_TYPE_BINARY) { return (AE_ERROR); } FileNode->OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT); /* * If -p not specified, we will use the input filename as the * output filename prefix */ if (AslGbl_UseDefaultAmlFilename) { AslGbl_OutputFilenamePrefix = AslGbl_Files[ASL_FILE_INPUT].Filename; } /* * Open the output file. Note: by default, the name of this file comes from * the table descriptor within the input file. */ if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_ASL) { Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (AslGbl_OutputFilenamePrefix); UtEndEvent (Event); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return (AE_ERROR); } } /* Open the optional output files (listings, etc.) */ Status = FlOpenMiscOutputFiles (AslGbl_OutputFilenamePrefix); if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); return (AE_ERROR); } /* * Compilation of ASL source versus DataTable source uses different * compiler subsystems */ switch (AslGbl_FileType) { /* * Data Table Compilation */ case ASL_INPUT_TYPE_ASCII_DATA: Status = DtDoCompile (); if (ACPI_FAILURE (Status)) { return (Status); } if (AslGbl_Signature) { AslGbl_Signature = NULL; } /* Check if any errors occurred during compile */ Status = AslCheckForErrorExit (); if (ACPI_FAILURE (Status)) { return (Status); } /* Cleanup (for next source file) and exit */ AeClearErrorLog (); PrTerminatePreprocessor (); return (Status); /* * ASL Compilation */ case ASL_INPUT_TYPE_ASCII_ASL: Status = CmDoCompile (); if (ACPI_FAILURE (Status)) { PrTerminatePreprocessor (); return (Status); } /* * At this point, we know how many lines are in the input file. Save it * to display for post-compilation summary. */ FileNode->TotalLineCount = AslGbl_CurrentLineNumber; return (AE_OK); /* * Binary ACPI table was auto-detected, disassemble it */ case ASL_INPUT_TYPE_BINARY_ACPI_TABLE: /* We have what appears to be an ACPI table, disassemble it */ FlCloseFile (ASL_FILE_INPUT); AslGbl_DoCompile = FALSE; AcpiGbl_DisasmFlag = TRUE; Status = AslDoDisassembly (); return (Status); /* Unknown binary table */ case ASL_INPUT_TYPE_BINARY: AePrintErrorLog (ASL_FILE_STDERR); return (AE_ERROR); default: printf ("Unknown file type %X\n", AslGbl_FileType); return (AE_ERROR); } } /******************************************************************************* * * FUNCTION: AslCheckForErrorExit * * PARAMETERS: None. Examines global exception count array * * RETURN: Status * * DESCRIPTION: Determine if compiler should abort with error status * ******************************************************************************/ ACPI_STATUS AslCheckForErrorExit ( void) { /* * Return non-zero exit code if there have been errors, unless the * global ignore error flag has been set */ if (!AslGbl_IgnoreErrors) { if (AslGbl_ExceptionCount[ASL_ERROR] > 0) { return (AE_ERROR); } /* Optionally treat warnings as errors */ if (AslGbl_WarningsAsErrors) { if ((AslGbl_ExceptionCount[ASL_WARNING] > 0) || (AslGbl_ExceptionCount[ASL_WARNING2] > 0) || (AslGbl_ExceptionCount[ASL_WARNING3] > 0)) { AslError (ASL_ERROR, ASL_MSG_WARNING_AS_ERROR, NULL, "(reporting warnings as errors)"); return (AE_ERROR); } } } return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c index 7899a54b1eb0..a20f688c5ce0 100644 --- a/sys/contrib/dev/acpica/compiler/dtcompile.c +++ b/sys/contrib/dev/acpica/compiler/dtcompile.c @@ -1,858 +1,900 @@ /****************************************************************************** * * Module Name: dtcompile.c - Front-end for data table compiler * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #define _DECLARE_DT_GLOBALS #include #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dtcompile") static char VersionString[9]; /* Local prototypes */ void DtInitialize ( void); static ACPI_STATUS DtCompileDataTable ( DT_FIELD **Field); static void DtInsertCompilerIds ( DT_FIELD *FieldList); /****************************************************************************** * * FUNCTION: DtDoCompile * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Main entry point for the data table compiler. * * Note: Assumes AslGbl_Files[ASL_FILE_INPUT] is initialized and the file is * open at seek offset zero. * *****************************************************************************/ ACPI_STATUS DtDoCompile ( void) { ACPI_STATUS Status; UINT8 Event; DT_FIELD *FieldList; ASL_GLOBAL_FILE_NODE *FileNode; /* Initialize globals */ DtInitialize (); /* Preprocessor */ if (AslGbl_PreprocessFlag) { /* Preprocessor */ Event = UtBeginEvent ("Preprocess input file"); PrDoPreprocess (); UtEndEvent (Event); if (AslGbl_PreprocessOnly) { return (AE_OK); } } /* Compile the parse tree */ if (AslGbl_DtLexBisonPrototype) { Event = UtBeginEvent ("Parse data table in prototype mode"); DtCompilerInitLexer (AslGbl_Files[ASL_FILE_INPUT].Handle); DtCompilerParserparse (); FieldList = AslGbl_FieldList; DtCompilerTerminateLexer (); UtEndEvent (Event); } else { /* * Scan the input file (file is already open) and * build the parse tree */ Event = UtBeginEvent ("Scan and parse input file"); FieldList = DtScanFile (AslGbl_Files[ASL_FILE_INPUT].Handle); UtEndEvent (Event); } /* Did the parse tree get successfully constructed? */ if (!FieldList) { /* TBD: temporary error message. Msgs should come from function above */ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Input file does not appear to be an ASL or data table source file"); return (AE_ERROR); } Event = UtBeginEvent ("Compile parse tree"); Status = DtCompileDataTable (&FieldList); UtEndEvent (Event); FileNode = FlGetCurrentFileNode (); FileNode->TotalLineCount = AslGbl_CurrentLineNumber; FileNode->OriginalInputFileSize = AslGbl_InputByteCount; DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n", FileNode->TotalLineCount, FileNode->OriginalInputFileSize); if (ACPI_FAILURE (Status)) { FileNode->ParserErrorDetected = TRUE; /* TBD: temporary error message. Msgs should come from function above */ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Could not compile input file"); return (Status); } /* Create/open the binary output file */ AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL; Status = FlOpenAmlOutputFile (AslGbl_OutputFilenamePrefix); if (ACPI_FAILURE (Status)) { return (Status); } /* Write the binary, then the optional hex file */ DtOutputBinary (AslGbl_RootTable); HxDoHexOutput (); DtWriteTableToListing (); /* Save the compile time statistics to the current file node */ FileNode->TotalFields = AslGbl_InputFieldCount; FileNode->OutputByteLength = AslGbl_TableLength; return (Status); } /****************************************************************************** * * FUNCTION: DtInitialize * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Initialize data table compiler globals. Enables multiple * compiles per invocation. * *****************************************************************************/ void DtInitialize ( void) { AcpiUtSetIntegerWidth (2); /* Set width to 64 bits */ AslGbl_FieldList = NULL; AslGbl_RootTable = NULL; AslGbl_SubtableStack = NULL; sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION); return; } /****************************************************************************** * * FUNCTION: DtInsertCompilerIds * * PARAMETERS: FieldList - Current field list pointer * * RETURN: None * * DESCRIPTION: Insert the IDs (Name, Version) of the current compiler into * the original ACPI table header. * *****************************************************************************/ static void DtInsertCompilerIds ( DT_FIELD *FieldList) { DT_FIELD *Next; UINT32 i; /* * Don't insert current compiler ID if requested. Used for compiler * debug/validation only. */ if (AslGbl_UseOriginalCompilerId) { return; } /* Walk to the Compiler fields at the end of the header */ Next = FieldList; for (i = 0; i < 7; i++) { Next = Next->Next; } Next->Value = ASL_CREATOR_ID; Next->Flags = DT_FIELD_NOT_ALLOCATED; Next = Next->Next; Next->Value = VersionString; Next->Flags = DT_FIELD_NOT_ALLOCATED; } /****************************************************************************** * * FUNCTION: DtCompileDataTable * * PARAMETERS: FieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Entry point to compile one data table * *****************************************************************************/ static ACPI_STATUS DtCompileDataTable ( DT_FIELD **FieldList) { const ACPI_DMTABLE_DATA *TableData; DT_SUBTABLE *Subtable; char *Signature; ACPI_TABLE_HEADER *AcpiTableHeader; ACPI_STATUS Status; DT_FIELD *RootField = *FieldList; /* Verify that we at least have a table signature and save it */ Signature = DtGetFieldValue (*FieldList); if (!Signature) { sprintf (AslGbl_MsgBuffer, "Expected \"%s\"", "Signature"); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, *FieldList, AslGbl_MsgBuffer); return (AE_ERROR); } AslGbl_Signature = UtLocalCacheCalloc (strlen (Signature) + 1); strcpy (AslGbl_Signature, Signature); /* * Handle tables that don't use the common ACPI table header structure. * Currently, these are the FACS and RSDP. Also check for an OEMx table, * these tables have user-defined contents. */ if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_FACS)) { Status = DtCompileFacs (FieldList); if (ACPI_FAILURE (Status)) { return (Status); } DtSetTableLength (); return (Status); } else if (ACPI_VALIDATE_RSDP_SIG (Signature)) { Status = DtCompileRsdp (FieldList); return (Status); } else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_S3PT)) { Status = DtCompileS3pt (FieldList); if (ACPI_FAILURE (Status)) { return (Status); } DtSetTableLength (); return (Status); } + /* + * If the first field is named "CDAT Table Length" (not "Signature"), + * assume that we have a CDAT table (whose table header does not have + * a signature). Instead, the TableLength field is where the + * signature would (normally) be. + */ + else if (!strcmp ((*FieldList)->Name, "CDAT Table Length")) + { + /* No longer true: (However, use this technique in the disassembler) + * We are assuming that there + * should be at least one non-ASCII byte in the 4-character + * Signature field, (At least the high-order byte should be zero). + */ + Status = DtCompileTable (FieldList, AcpiDmTableInfoCdatTableHdr, + &AslGbl_RootTable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Compile the CDAT */ + + DtPushSubtable (AslGbl_RootTable); + Status = DtCompileCdat ((void **) FieldList); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * Set the overall table length and the table checksum. + * The entire compiled table (including the CDAT table header with + * the table length and checksum) is in AslGbl_RootTable->Buffer. + */ + DtSetTableLength (); + DtSetTableChecksum (&ACPI_CAST_PTR (ACPI_TABLE_CDAT, AslGbl_RootTable->Buffer)->Checksum); + + DtDumpFieldList (RootField); + DtDumpSubtableList (); + return (AE_OK); + } + /* * All other tables must use the common ACPI table header. Insert the * current iASL IDs (name, version), and compile the header now. */ DtInsertCompilerIds (*FieldList); Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader, &AslGbl_RootTable); if (ACPI_FAILURE (Status)) { return (Status); } DtPushSubtable (AslGbl_RootTable); /* Validate the signature via the ACPI table list */ TableData = AcpiDmGetTableData (Signature); if (!TableData || AslGbl_CompileGeneric) { /* Unknown table signature and/or force generic compile */ DtCompileGeneric ((void **) FieldList, NULL, NULL); goto FinishHeader; } /* Dispatch to per-table compile */ if (TableData->CmTableHandler) { /* Complex table, has a handler */ Status = TableData->CmTableHandler ((void **) FieldList); if (ACPI_FAILURE (Status)) { return (Status); } } else if (TableData->TableInfo) { /* Simple table, just walk the info table, unless its empty */ if (FieldList && *FieldList) { Subtable = NULL; Status = DtCompileTable (FieldList, TableData->TableInfo, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (AslGbl_RootTable, Subtable); DtPopSubtable (); } } else { DtFatal (ASL_MSG_COMPILER_INTERNAL, *FieldList, "Missing table dispatch info"); return (AE_ERROR); } FinishHeader: /* Set the final table length and then the checksum */ DtSetTableLength (); AcpiTableHeader = ACPI_CAST_PTR ( ACPI_TABLE_HEADER, AslGbl_RootTable->Buffer); DtSetTableChecksum (&AcpiTableHeader->Checksum); DtDumpFieldList (RootField); DtDumpSubtableList (); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileTable * * PARAMETERS: Field - Current field list pointer * Info - Info table for this ACPI table * RetSubtable - Compile result of table * * RETURN: Status * * DESCRIPTION: Compile a subtable * *****************************************************************************/ ACPI_STATUS DtCompileTable ( DT_FIELD **Field, ACPI_DMTABLE_INFO *Info, DT_SUBTABLE **RetSubtable) { DT_FIELD *LocalField; UINT32 Length; DT_SUBTABLE *Subtable; DT_SUBTABLE *InlineSubtable = NULL; UINT32 FieldLength = 0; UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; char *String; UINT32 CurrentFlagByteOffset = 0; ACPI_STATUS Status = AE_OK; if (!Field || !Info) { return (AE_BAD_PARAMETER); } if (!*Field) { /* * The field list is empty, this means that we are out of fields to * parse. In other words, we are at the end of the table. */ return (AE_END_OF_TABLE); } /* Ignore optional subtable if name does not match */ if ((Info->Flags & DT_OPTIONAL) && strcmp ((*Field)->Name, Info->Name)) { *RetSubtable = NULL; return (AE_OK); } Length = DtGetSubtableLength (*Field, Info); if (Length == ASL_EOF) { return (AE_ERROR); } Subtable = UtSubtableCacheCalloc (); if (Length > 0) { String = UtLocalCacheCalloc (Length); Subtable->Buffer = ACPI_CAST_PTR (UINT8, String); } Subtable->Length = Length; Subtable->TotalLength = Length; Buffer = Subtable->Buffer; LocalField = *Field; Subtable->Name = LocalField->Name; /* * Main loop walks the info table for this ACPI table or subtable */ for (; Info->Name; Info++) { if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) { continue; } if (!LocalField) { sprintf (AslGbl_MsgBuffer, "Found NULL field - Field name \"%s\" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, AslGbl_MsgBuffer); Status = AE_BAD_DATA; goto Error; } /* Maintain table offsets */ LocalField->TableOffset = AslGbl_CurrentTableOffset; FieldLength = DtGetFieldLength (LocalField, Info); AslGbl_CurrentTableOffset += FieldLength; FieldType = DtGetFieldType (Info); AslGbl_InputFieldCount++; if (FieldType != DT_FIELD_TYPE_INLINE_SUBTABLE && strcmp (Info->Name, LocalField->Name)) { sprintf (AslGbl_MsgBuffer, "found \"%s\" expected \"%s\"", LocalField->Name, Info->Name); DtError (ASL_ERROR, ASL_MSG_INVALID_LABEL, LocalField, AslGbl_MsgBuffer); } switch (FieldType) { case DT_FIELD_TYPE_FLAGS_INTEGER: /* * Start of the definition of a flags field. * This master flags integer starts at value zero, in preparation * to compile and insert the flag fields from the individual bits */ LocalField = LocalField->Next; *Field = LocalField; FlagBuffer = Buffer; CurrentFlagByteOffset = Info->Offset; break; case DT_FIELD_TYPE_FLAG: /* Individual Flag field, can be multiple bits */ if (FlagBuffer) { /* * We must increment the FlagBuffer when we have crossed * into the next flags byte within the flags field * of type DT_FIELD_TYPE_FLAGS_INTEGER. */ FlagBuffer += (Info->Offset - CurrentFlagByteOffset); CurrentFlagByteOffset = Info->Offset; DtCompileFlag (FlagBuffer, LocalField, Info); } else { /* TBD - this is an internal error */ } LocalField = LocalField->Next; *Field = LocalField; break; case DT_FIELD_TYPE_INLINE_SUBTABLE: /* * Recursion (one level max): compile GAS (Generic Address) * or Notify in-line subtable */ *Field = LocalField; switch (Info->Opcode) { case ACPI_DMT_GAS: Status = DtCompileTable (Field, AcpiDmTableInfoGas, &InlineSubtable); break; case ACPI_DMT_HESTNTFY: Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify, &InlineSubtable); break; case ACPI_DMT_IORTMEM: Status = DtCompileTable (Field, AcpiDmTableInfoIortAcc, &InlineSubtable); break; default: sprintf (AslGbl_MsgBuffer, "Invalid DMT opcode: 0x%.2X", Info->Opcode); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, AslGbl_MsgBuffer); Status = AE_BAD_DATA; break; } if (ACPI_FAILURE (Status)) { goto Error; } DtSetSubtableLength (InlineSubtable); memcpy (Buffer, InlineSubtable->Buffer, FieldLength); LocalField = *Field; break; case DT_FIELD_TYPE_LABEL: DtWriteFieldToListing (Buffer, LocalField, 0); LocalField = LocalField->Next; break; default: /* Normal case for most field types (Integer, String, etc.) */ DtCompileOneField (Buffer, LocalField, FieldLength, FieldType, Info->Flags); DtWriteFieldToListing (Buffer, LocalField, FieldLength); LocalField = LocalField->Next; if (Info->Flags & DT_LENGTH) { /* Field is an Integer that will contain a subtable length */ Subtable->LengthField = Buffer; Subtable->SizeOfLengthField = FieldLength; } break; } Buffer += FieldLength; } *Field = LocalField; *RetSubtable = Subtable; return (AE_OK); Error: ACPI_FREE (Subtable->Buffer); ACPI_FREE (Subtable); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileTwoSubtables * * PARAMETERS: List - Current field list pointer * TableInfo1 - Info table 1 * TableInfo1 - Info table 2 * * RETURN: Status * * DESCRIPTION: Compile tables with a header and one or more same subtables. * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT * *****************************************************************************/ ACPI_STATUS DtCompileTwoSubtables ( void **List, ACPI_DMTABLE_INFO *TableInfo1, ACPI_DMTABLE_INFO *TableInfo2) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; Status = DtCompileTable (PFieldList, TableInfo1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { Status = DtCompileTable (PFieldList, TableInfo2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompilePadding * * PARAMETERS: Length - Padding field size * RetSubtable - Compile result of table * * RETURN: Status * * DESCRIPTION: Compile a subtable for padding purpose * *****************************************************************************/ ACPI_STATUS DtCompilePadding ( UINT32 Length, DT_SUBTABLE **RetSubtable) { DT_SUBTABLE *Subtable; /* UINT8 *Buffer; */ char *String; Subtable = UtSubtableCacheCalloc (); if (Length > 0) { String = UtLocalCacheCalloc (Length); Subtable->Buffer = ACPI_CAST_PTR (UINT8, String); } Subtable->Length = Length; Subtable->TotalLength = Length; /* Buffer = Subtable->Buffer; */ *RetSubtable = Subtable; return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h index e99b5c71b00b..cff0cfc19dad 100644 --- a/sys/contrib/dev/acpica/compiler/dtcompiler.h +++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h @@ -1,837 +1,847 @@ /****************************************************************************** * * Module Name: dtcompiler.h - header for data table compiler * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #define __DTCOMPILER_H__ #ifndef _DTCOMPILER #define _DTCOMPILER #include #define ASL_FIELD_CACHE_SIZE 512 #define ASL_SUBTABLE_CACHE_SIZE 128 #undef DT_EXTERN #ifdef _DECLARE_DT_GLOBALS #define DT_EXTERN #define DT_INIT_GLOBAL(a,b) (a)=(b) #else #define DT_EXTERN extern #define DT_INIT_GLOBAL(a,b) (a) #endif /* Types for individual fields (one per input line) */ #define DT_FIELD_TYPE_STRING 0 #define DT_FIELD_TYPE_INTEGER 1 #define DT_FIELD_TYPE_BUFFER 2 #define DT_FIELD_TYPE_PCI_PATH 3 #define DT_FIELD_TYPE_FLAG 4 #define DT_FIELD_TYPE_FLAGS_INTEGER 5 #define DT_FIELD_TYPE_INLINE_SUBTABLE 6 #define DT_FIELD_TYPE_UUID 7 #define DT_FIELD_TYPE_UNICODE 8 #define DT_FIELD_TYPE_DEVICE_PATH 9 #define DT_FIELD_TYPE_LABEL 10 /* * Structure used for each individual field within an ACPI table */ typedef struct dt_field { char *Name; /* Field name (from name : value) */ char *Value; /* Field value (from name : value) */ UINT32 StringLength; /* Length of Value */ struct dt_field *Next; /* Next field */ struct dt_field *NextLabel; /* If field is a label, next label */ UINT32 Line; /* Line number for this field */ UINT32 ByteOffset; /* Offset in source file for field */ UINT32 NameColumn; /* Start column for field name */ UINT32 Column; /* Start column for field value */ UINT32 TableOffset; /* Binary offset within ACPI table */ UINT8 Flags; } DT_FIELD; /* Flags for above */ #define DT_FIELD_NOT_ALLOCATED 1 /* * Structure used for each individual key or value */ typedef struct dt_table_unit { char *Value; /* Field value (from name : value) */ UINT32 Line; /* Line number for this field */ UINT32 Column; /* Start column for field value */ } DT_TABLE_UNIT; /* * Structure used for individual subtables within an ACPI table */ typedef struct dt_subtable { struct dt_subtable *Parent; struct dt_subtable *Child; struct dt_subtable *Peer; struct dt_subtable *StackTop; UINT8 *Buffer; UINT8 *LengthField; char *Name; UINT32 Length; UINT32 TotalLength; UINT32 SizeOfLengthField; UINT16 Depth; UINT8 Flags; } DT_SUBTABLE; /* * Globals */ /* List of all field names and values from the input source */ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_FieldList, NULL); /* List of all compiled tables and subtables */ DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*AslGbl_RootTable, NULL); /* Stack for subtables */ DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*AslGbl_SubtableStack, NULL); /* List for defined labels */ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_LabelList, NULL); /* Current offset within the binary output table */ DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_CurrentTableOffset, 0); /* Data table compiler Flex/Bison prototype */ DT_EXTERN BOOLEAN DT_INIT_GLOBAL (AslGbl_DtLexBisonPrototype, FALSE); /* Local caches */ DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_SubtableCount, 0); DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*AslGbl_SubtableCacheList, NULL); DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*AslGbl_SubtableCacheNext, NULL); DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*AslGbl_SubtableCacheLast, NULL); DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_FieldCount, 0); DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*AslGbl_FieldCacheList, NULL); DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_FieldCacheNext, NULL); DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_FieldCacheLast, NULL); /* dtcompiler - main module */ ACPI_STATUS DtCompileTable ( DT_FIELD **Field, ACPI_DMTABLE_INFO *Info, DT_SUBTABLE **RetSubtable); ACPI_STATUS DtCompileTwoSubtables ( void **List, ACPI_DMTABLE_INFO *TableInfo1, ACPI_DMTABLE_INFO *TableInfo2); ACPI_STATUS DtCompilePadding ( UINT32 Length, DT_SUBTABLE **RetSubtable); /* dtio - binary and text input/output */ UINT32 DtGetNextLine ( FILE *Handle, UINT32 Flags); /* Flags for DtGetNextLine */ #define DT_ALLOW_MULTILINE_QUOTES 0x01 DT_FIELD * DtScanFile ( FILE *Handle); void DtOutputBinary ( DT_SUBTABLE *RootTable); void DtDumpSubtableList ( void); void DtDumpFieldList ( DT_FIELD *Field); void DtWriteFieldToListing ( UINT8 *Buffer, DT_FIELD *Field, UINT32 Length); void DtWriteTableToListing ( void); /* dtsubtable - compile subtables */ void DtCreateSubtable ( UINT8 *Buffer, UINT32 Length, DT_SUBTABLE **RetSubtable); UINT32 DtGetSubtableLength ( DT_FIELD *Field, ACPI_DMTABLE_INFO *Info); void DtSetSubtableLength ( DT_SUBTABLE *Subtable); void DtPushSubtable ( DT_SUBTABLE *Subtable); void DtPopSubtable ( void); DT_SUBTABLE * DtPeekSubtable ( void); void DtInsertSubtable ( DT_SUBTABLE *ParentTable, DT_SUBTABLE *Subtable); DT_SUBTABLE * DtGetNextSubtable ( DT_SUBTABLE *ParentTable, DT_SUBTABLE *ChildTable); DT_SUBTABLE * DtGetParentSubtable ( DT_SUBTABLE *Subtable); /* dtexpress - Integer expressions and labels */ ACPI_STATUS DtResolveIntegerExpression ( DT_FIELD *Field, UINT64 *ReturnValue); UINT64 DtDoOperator ( UINT64 LeftValue, UINT32 Operator, UINT64 RightValue); UINT64 DtResolveLabel ( char *LabelString); void DtDetectAllLabels ( DT_FIELD *FieldList); /* dtfield - Compile individual fields within a table */ void DtCompileOneField ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength, UINT8 Type, UINT8 Flags); void DtCompileInteger ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength, UINT8 Flags); UINT32 DtCompileBuffer ( UINT8 *Buffer, char *Value, DT_FIELD *Field, UINT32 ByteLength); void DtCompileFlag ( UINT8 *Buffer, DT_FIELD *Field, ACPI_DMTABLE_INFO *Info); /* dtfield - DT_FIELD operations */ void DtLinkField ( DT_FIELD *Field); void DtCreateField ( DT_TABLE_UNIT *FieldKey, DT_TABLE_UNIT *FieldValue, UINT32 Offset); DT_TABLE_UNIT * DtCreateTableUnit ( char *Data, UINT32 Line, UINT32 Column); /* dtparser - lex/yacc files */ int DtCompilerParserparse ( void); UINT64 DtEvaluateExpression ( char *ExprString); void DtCompilerInitLexer ( FILE *inFile); void DtCompilerTerminateLexer ( void); int DtInitLexer ( char *String); void DtTerminateLexer ( void); char * DtGetOpName ( UINT32 ParseOpcode); /* dtutils - Miscellaneous utilities */ typedef void (*DT_WALK_CALLBACK) ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue); void DtWalkTableTree ( DT_SUBTABLE *StartTable, DT_WALK_CALLBACK UserFunction, void *Context, void *ReturnValue); void DtError ( UINT8 Level, UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage); void DtNameError ( UINT8 Level, UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage); void DtFatal ( UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage); UINT64 DtDoConstant ( char *String); char* DtGetFieldValue ( DT_FIELD *Field); UINT8 DtGetFieldType ( ACPI_DMTABLE_INFO *Info); UINT32 DtGetBufferLength ( char *Buffer); UINT32 DtGetFieldLength ( DT_FIELD *Field, ACPI_DMTABLE_INFO *Info); void DtSetTableChecksum ( UINT8 *ChecksumPointer); void DtSetTableLength( void); /* dttable - individual table compilation */ ACPI_STATUS DtCompileFacs ( DT_FIELD **PFieldList); ACPI_STATUS DtCompileRsdp ( DT_FIELD **PFieldList); ACPI_STATUS DtCompileAest ( void **PFieldList); ACPI_STATUS DtCompileApmt ( void **PFieldList); ACPI_STATUS DtCompileAsf ( void **PFieldList); +ACPI_STATUS +DtCompileCdat ( + void **PFieldList); + +ACPI_STATUS +DtCompileCedt ( + void **PFieldList); + ACPI_STATUS DtCompileCpep ( void **PFieldList); ACPI_STATUS DtCompileCedt ( void **PFieldList); ACPI_STATUS DtCompileCsrt ( void **PFieldList); ACPI_STATUS DtCompileDbg2 ( void **PFieldList); ACPI_STATUS DtCompileDmar ( void **PFieldList); ACPI_STATUS DtCompileDrtm ( void **PFieldList); ACPI_STATUS DtCompileEinj ( void **PFieldList); ACPI_STATUS DtCompileErst ( void **PFieldList); ACPI_STATUS DtCompileFadt ( void **PFieldList); ACPI_STATUS DtCompileFpdt ( void **PFieldList); ACPI_STATUS DtCompileGtdt ( void **PFieldList); ACPI_STATUS DtCompileHest ( void **PFieldList); ACPI_STATUS DtCompileHmat ( void **PFieldList); ACPI_STATUS DtCompileIort ( void **PFieldList); ACPI_STATUS DtCompileIvrs ( void **PFieldList); ACPI_STATUS DtCompileLpit ( void **PFieldList); ACPI_STATUS DtCompileMadt ( void **PFieldList); ACPI_STATUS DtCompileMcfg ( void **PFieldList); ACPI_STATUS DtCompileMpst ( void **PFieldList); ACPI_STATUS DtCompileMsct ( void **PFieldList); ACPI_STATUS DtCompileNfit ( void **PFieldList); ACPI_STATUS DtCompileNhlt ( void **PFieldList); ACPI_STATUS DtCompilePcct ( void **PFieldList); ACPI_STATUS DtCompilePdtt ( void **PFieldList); ACPI_STATUS DtCompilePhat ( void **PFieldList); ACPI_STATUS DtCompilePmtt ( void **PFieldList); ACPI_STATUS DtCompilePptt ( void **PFieldList); ACPI_STATUS DtCompilePrmt ( void **PFieldList); ACPI_STATUS DtCompileRgrt ( void **PFieldList); ACPI_STATUS DtCompileRsdt ( void **PFieldList); ACPI_STATUS DtCompileS3pt ( DT_FIELD **PFieldList); ACPI_STATUS DtCompileSdev ( void **PFieldList); ACPI_STATUS DtCompileSlic ( void **PFieldList); ACPI_STATUS DtCompileSlit ( void **PFieldList); ACPI_STATUS DtCompileSrat ( void **PFieldList); ACPI_STATUS DtCompileStao ( void **PFieldList); ACPI_STATUS DtCompileSvkl ( void **PFieldList); ACPI_STATUS DtCompileTcpa ( void **PFieldList); ACPI_STATUS DtCompileTpm2 ( void **PFieldList); ACPI_STATUS DtCompileUefi ( void **PFieldList); ACPI_STATUS DtCompileViot ( void **PFieldList); ACPI_STATUS DtCompileWdat ( void **PFieldList); ACPI_STATUS DtCompileWpbt ( void **PFieldList); ACPI_STATUS DtCompileXsdt ( void **PFieldList); ACPI_STATUS DtCompileGeneric ( void **PFieldList, char *TermFieldName, UINT32 *PFieldLength); ACPI_DMTABLE_INFO * DtGetGenericTableInfo ( char *Name); /* ACPI Table templates */ extern const unsigned char TemplateAest[]; extern const unsigned char TemplateAgdi[]; extern const unsigned char TemplateApmt[]; extern const unsigned char TemplateAsf[]; extern const unsigned char TemplateBoot[]; extern const unsigned char TemplateBdat[]; extern const unsigned char TemplateBert[]; extern const unsigned char TemplateBgrt[]; +extern const unsigned char TemplateCcel[]; +extern const unsigned char TemplateCdat[]; extern const unsigned char TemplateCedt[]; extern const unsigned char TemplateCpep[]; extern const unsigned char TemplateCsrt[]; extern const unsigned char TemplateDbg2[]; extern const unsigned char TemplateDbgp[]; extern const unsigned char TemplateDmar[]; extern const unsigned char TemplateDrtm[]; extern const unsigned char TemplateEcdt[]; extern const unsigned char TemplateEinj[]; extern const unsigned char TemplateErst[]; extern const unsigned char TemplateFadt[]; extern const unsigned char TemplateFpdt[]; extern const unsigned char TemplateGtdt[]; extern const unsigned char TemplateHest[]; extern const unsigned char TemplateHmat[]; extern const unsigned char TemplateHpet[]; extern const unsigned char TemplateIort[]; extern const unsigned char TemplateIvrs[]; extern const unsigned char TemplateLpit[]; extern const unsigned char TemplateMadt[]; extern const unsigned char TemplateMcfg[]; extern const unsigned char TemplateMchi[]; extern const unsigned char TemplateMpst[]; extern const unsigned char TemplateMsct[]; extern const unsigned char TemplateMsdm[]; extern const unsigned char TemplateNfit[]; extern const unsigned char TemplateNhlt[]; extern const unsigned char TemplatePcct[]; extern const unsigned char TemplatePdtt[]; extern const unsigned char TemplatePhat[]; extern const unsigned char TemplatePmtt[]; extern const unsigned char TemplatePptt[]; extern const unsigned char TemplatePrmt[]; extern const unsigned char TemplateRasf[]; extern const unsigned char TemplateRgrt[]; extern const unsigned char TemplateRsdt[]; extern const unsigned char TemplateS3pt[]; extern const unsigned char TemplateSbst[]; extern const unsigned char TemplateSdei[]; extern const unsigned char TemplateSdev[]; extern const unsigned char TemplateSlic[]; extern const unsigned char TemplateSlit[]; extern const unsigned char TemplateSpcr[]; extern const unsigned char TemplateSpmi[]; extern const unsigned char TemplateSrat[]; extern const unsigned char TemplateStao[]; extern const unsigned char TemplateSvkl[]; extern const unsigned char TemplateTcpa[]; extern const unsigned char TemplateTdel[]; extern const unsigned char TemplateTpm2[]; extern const unsigned char TemplateUefi[]; extern const unsigned char TemplateViot[]; extern const unsigned char TemplateWaet[]; extern const unsigned char TemplateWdat[]; extern const unsigned char TemplateWddt[]; extern const unsigned char TemplateWdrt[]; extern const unsigned char TemplateWpbt[]; extern const unsigned char TemplateWsmt[]; extern const unsigned char TemplateXenv[]; extern const unsigned char TemplateXsdt[]; #endif diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c index d24001689a8a..2051b65488c2 100644 --- a/sys/contrib/dev/acpica/compiler/dtio.c +++ b/sys/contrib/dev/acpica/compiler/dtio.c @@ -1,1235 +1,1235 @@ /****************************************************************************** * * Module Name: dtio.c - File I/O support for data table compiler * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dtio") /* Local prototypes */ static char * DtTrim ( char *String); static ACPI_STATUS DtParseLine ( char *LineBuffer, UINT32 Line, UINT32 Offset); static void DtWriteBinary ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue); static void DtDumpBuffer ( UINT32 FileId, UINT8 *Buffer, UINT32 Offset, UINT32 Length); static void DtDumpSubtableInfo ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue); static void DtDumpSubtableTree ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue); /* States for DtGetNextLine */ #define DT_NORMAL_TEXT 0 #define DT_START_QUOTED_STRING 1 #define DT_START_COMMENT 2 #define DT_SLASH_ASTERISK_COMMENT 3 #define DT_SLASH_SLASH_COMMENT 4 #define DT_END_COMMENT 5 #define DT_MERGE_LINES 6 #define DT_ESCAPE_SEQUENCE 7 static UINT32 AslGbl_NextLineOffset; /****************************************************************************** * * FUNCTION: DtTrim * * PARAMETERS: String - Current source code line to trim * * RETURN: Trimmed line. Must be freed by caller. * * DESCRIPTION: Trim left and right spaces * *****************************************************************************/ static char * DtTrim ( char *String) { char *Start; char *End; char *ReturnString; ACPI_SIZE Length; /* Skip lines that start with a space */ if (*String == 0 || !strcmp (String, " ")) { ReturnString = UtLocalCacheCalloc (1); return (ReturnString); } /* Setup pointers to start and end of input string */ Start = String; End = String + strlen (String) - 1; /* Find first non-whitespace character */ while ((Start <= End) && ((*Start == ' ') || (*Start == '\t'))) { Start++; } /* Find last non-space character */ while (End >= Start) { if (*End == '\n') { End--; continue; } if (*End != ' ') { break; } End--; } /* Remove any quotes around the string */ if (*Start == '\"') { Start++; } if (*End == '\"') { End--; } /* Create the trimmed return string */ Length = ACPI_PTR_DIFF (End, Start) + 1; ReturnString = UtLocalCacheCalloc (Length + 1); if (strlen (Start)) { strncpy (ReturnString, Start, Length); } ReturnString[Length] = 0; return (ReturnString); } /****************************************************************************** * * FUNCTION: DtParseLine * * PARAMETERS: LineBuffer - Current source code line * Line - Current line number in the source * Offset - Current byte offset of the line * * RETURN: Status * * DESCRIPTION: Parse one source line * *****************************************************************************/ static ACPI_STATUS DtParseLine ( char *LineBuffer, UINT32 Line, UINT32 Offset) { char *Start; char *End; char *TmpName; char *TmpValue; char *Name; char *Value; char *Colon; UINT32 Length; DT_FIELD *Field; UINT32 Column; UINT32 NameColumn; BOOLEAN IsNullString = FALSE; if (!LineBuffer) { return (AE_OK); } /* All lines after "Raw Table Data" are ignored */ if (strstr (LineBuffer, ACPI_RAW_TABLE_DATA_HEADER)) { return (AE_NOT_FOUND); } Colon = strchr (LineBuffer, ':'); if (!Colon) { return (AE_OK); } Start = LineBuffer; End = Colon; while (Start < Colon) { if (*Start == '[') { /* Found left bracket, go to the right bracket */ while (Start < Colon && *Start != ']') { Start++; } } else if (*Start != ' ') { break; } Start++; } /* * There are two column values. One for the field name, * and one for the field value. */ Column = ACPI_PTR_DIFF (Colon, LineBuffer) + 3; NameColumn = ACPI_PTR_DIFF (Start, LineBuffer) + 1; Length = ACPI_PTR_DIFF (End, Start); TmpName = UtLocalCalloc (Length + 1); strncpy (TmpName, Start, Length); Name = DtTrim (TmpName); ACPI_FREE (TmpName); Start = End = (Colon + 1); while (*End) { /* Found left quotation, go to the right quotation and break */ if (*End == '"') { End++; /* Check for an explicit null string */ if (*End == '"') { IsNullString = TRUE; } while (*End && (*End != '"')) { End++; } End++; break; } /* * Special "comment" fields at line end, ignore them. * Note: normal slash-slash and slash-asterisk comments are * stripped already by the DtGetNextLine parser. * * TBD: Perhaps DtGetNextLine should parse the following type * of comments also. */ if (*End == '[') { End--; break; } End++; } Length = ACPI_PTR_DIFF (End, Start); TmpValue = UtLocalCalloc (Length + 1); strncpy (TmpValue, Start, Length); Value = DtTrim (TmpValue); ACPI_FREE (TmpValue); /* Create a new field object only if we have a valid value field */ if ((Value && *Value) || IsNullString) { Field = UtFieldCacheCalloc (); Field->Name = Name; Field->Value = Value; Field->Line = Line; Field->ByteOffset = Offset; Field->NameColumn = NameColumn; Field->Column = Column; Field->StringLength = Length; DtLinkField (Field); } /* Else -- Ignore this field, it has no valid data */ return (AE_OK); } /****************************************************************************** * * FUNCTION: DtGetNextLine * * PARAMETERS: Handle - Open file handle for the source file * * RETURN: Filled line buffer and offset of start-of-line (ASL_EOF on EOF) * * DESCRIPTION: Get the next valid source line. Removes all comments. * Ignores empty lines. * * Handles both slash-asterisk and slash-slash comments. * Also, quoted strings, but no escapes within. * * Line is returned in AslGbl_CurrentLineBuffer. * Line number in original file is returned in AslGbl_CurrentLineNumber. * *****************************************************************************/ UINT32 DtGetNextLine ( FILE *Handle, UINT32 Flags) { BOOLEAN LineNotAllBlanks = FALSE; UINT32 State = DT_NORMAL_TEXT; UINT32 CurrentLineOffset; UINT32 i; int c; int c1; memset (AslGbl_CurrentLineBuffer, 0, AslGbl_LineBufferSize); for (i = 0; ;) { /* * If line is too long, expand the line buffers. Also increases * AslGbl_LineBufferSize. */ if (i >= AslGbl_LineBufferSize) { UtExpandLineBuffers (); } c = getc (Handle); if (c == EOF) { switch (State) { case DT_START_QUOTED_STRING: case DT_SLASH_ASTERISK_COMMENT: AcpiOsPrintf ("**** EOF within comment/string %u\n", State); break; default: break; } /* Standalone EOF is OK */ if (i == 0) { return (ASL_EOF); } /* * Received an EOF in the middle of a line. Terminate the * line with a newline. The next call to this function will * return a standalone EOF. Thus, the upper parsing software * never has to deal with an EOF within a valid line (or * the last line does not get tossed on the floor.) */ c = '\n'; State = DT_NORMAL_TEXT; } else if (c == '\r') { c1 = getc (Handle); if (c1 == '\n') { /* * Skip the carriage return as if it didn't exist. This is * onlt meant for input files in DOS format in unix. fopen in * unix may not support "text mode" and leaves CRLF intact. */ c = '\n'; } else { /* This was not a CRLF. Only a CR */ ungetc(c1, Handle); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Carriage return without linefeed detected"); return (ASL_EOF); } } switch (State) { case DT_NORMAL_TEXT: /* Normal text, insert char into line buffer */ AslGbl_CurrentLineBuffer[i] = (char) c; switch (c) { case '/': State = DT_START_COMMENT; break; case '"': State = DT_START_QUOTED_STRING; LineNotAllBlanks = TRUE; i++; break; case '\\': /* * The continuation char MUST be last char on this line. * Otherwise, it will be assumed to be a valid ASL char. */ State = DT_MERGE_LINES; break; case '\n': CurrentLineOffset = AslGbl_NextLineOffset; AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; /* * Exit if line is complete. Ignore empty lines (only \n) * or lines that contain nothing but blanks. */ if ((i != 0) && LineNotAllBlanks) { if ((i + 1) >= AslGbl_LineBufferSize) { UtExpandLineBuffers (); } AslGbl_CurrentLineBuffer[i+1] = 0; /* Terminate string */ return (CurrentLineOffset); } /* Toss this line and start a new one */ i = 0; LineNotAllBlanks = FALSE; break; default: if (c != ' ') { LineNotAllBlanks = TRUE; } i++; break; } break; case DT_START_QUOTED_STRING: /* Insert raw chars until end of quoted string */ AslGbl_CurrentLineBuffer[i] = (char) c; i++; switch (c) { case '"': State = DT_NORMAL_TEXT; break; case '\\': State = DT_ESCAPE_SEQUENCE; break; case '\n': if (!(Flags & DT_ALLOW_MULTILINE_QUOTES)) { AcpiOsPrintf ( "ERROR at line %u: Unterminated quoted string\n", AslGbl_CurrentLineNumber++); State = DT_NORMAL_TEXT; } break; default: /* Get next character */ break; } break; case DT_ESCAPE_SEQUENCE: /* Just copy the escaped character. TBD: sufficient for table compiler? */ AslGbl_CurrentLineBuffer[i] = (char) c; i++; State = DT_START_QUOTED_STRING; break; case DT_START_COMMENT: /* Open comment if this character is an asterisk or slash */ switch (c) { case '*': State = DT_SLASH_ASTERISK_COMMENT; break; case '/': State = DT_SLASH_SLASH_COMMENT; break; default: /* Not a comment */ i++; /* Save the preceding slash */ if (i >= AslGbl_LineBufferSize) { UtExpandLineBuffers (); } AslGbl_CurrentLineBuffer[i] = (char) c; i++; State = DT_NORMAL_TEXT; break; } break; case DT_SLASH_ASTERISK_COMMENT: /* Ignore chars until an asterisk-slash is found */ switch (c) { case '\n': AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; break; case '*': State = DT_END_COMMENT; break; default: break; } break; case DT_SLASH_SLASH_COMMENT: /* Ignore chars until end-of-line */ if (c == '\n') { /* We will exit via the NORMAL_TEXT path */ ungetc (c, Handle); State = DT_NORMAL_TEXT; } break; case DT_END_COMMENT: /* End comment if this char is a slash */ switch (c) { case '/': State = DT_NORMAL_TEXT; break; case '\n': AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; break; case '*': /* Consume all adjacent asterisks */ break; default: State = DT_SLASH_ASTERISK_COMMENT; break; } break; case DT_MERGE_LINES: if (c != '\n') { /* * This is not a continuation backslash, it is a normal * normal ASL backslash - for example: Scope(\_SB_) */ i++; /* Keep the backslash that is already in the buffer */ ungetc (c, Handle); State = DT_NORMAL_TEXT; } else { /* * This is a continuation line -- a backlash followed * immediately by a newline. Insert a space between the * lines (overwrite the backslash) */ AslGbl_CurrentLineBuffer[i] = ' '; i++; /* Ignore newline, this will merge the lines */ AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; State = DT_NORMAL_TEXT; } break; default: DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state"); return (ASL_EOF); } } } /****************************************************************************** * * FUNCTION: DtScanFile * * PARAMETERS: Handle - Open file handle for the source file * * RETURN: Pointer to start of the constructed parse tree. * * DESCRIPTION: Scan source file, link all field names and values * to the global parse tree: AslGbl_FieldList * *****************************************************************************/ DT_FIELD * DtScanFile ( FILE *Handle) { ACPI_STATUS Status; UINT32 Offset; ACPI_FUNCTION_NAME (DtScanFile); /* Get the file size */ AslGbl_InputByteCount = CmGetFileSize (Handle); if (AslGbl_InputByteCount == ACPI_UINT32_MAX) { AslAbort (); } AslGbl_CurrentLineNumber = 0; AslGbl_CurrentLineOffset = 0; AslGbl_NextLineOffset = 0; /* Scan line-by-line */ while ((Offset = DtGetNextLine (Handle, 0)) != ASL_EOF) { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s", AslGbl_CurrentLineNumber, Offset, AslGbl_CurrentLineBuffer)); Status = DtParseLine (AslGbl_CurrentLineBuffer, AslGbl_CurrentLineNumber, Offset); if (Status == AE_NOT_FOUND) { break; } } /* Dump the parse tree if debug enabled */ DtDumpFieldList (AslGbl_FieldList); return (AslGbl_FieldList); } /* * Output functions */ /****************************************************************************** * * FUNCTION: DtWriteBinary * * PARAMETERS: DT_WALK_CALLBACK * * RETURN: Status * * DESCRIPTION: Write one subtable of a binary ACPI table * *****************************************************************************/ static void DtWriteBinary ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue) { FlWriteFile (ASL_FILE_AML_OUTPUT, Subtable->Buffer, Subtable->Length); } /****************************************************************************** * * FUNCTION: DtOutputBinary * * PARAMETERS: * * RETURN: Status * * DESCRIPTION: Write entire binary ACPI table (result of compilation) * *****************************************************************************/ void DtOutputBinary ( DT_SUBTABLE *RootTable) { if (!RootTable) { return; } /* Walk the entire parse tree, emitting the binary data */ DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL); AslGbl_TableLength = CmGetFileSize (AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle); if (AslGbl_TableLength == ACPI_UINT32_MAX) { AslAbort (); } } /* * Listing support */ /****************************************************************************** * * FUNCTION: DtDumpBuffer * * PARAMETERS: FileID - Where to write buffer data * Buffer - Buffer to dump * Offset - Offset in current table * Length - Buffer Length * * RETURN: None * * DESCRIPTION: Another copy of DumpBuffer routine (unfortunately). * * TBD: merge dump buffer routines * *****************************************************************************/ static void DtDumpBuffer ( UINT32 FileId, UINT8 *Buffer, UINT32 Offset, UINT32 Length) { UINT32 i; UINT32 j; UINT8 BufChar; - FlPrintFile (FileId, "Output: [%3.3Xh %4.4d %3d] ", + FlPrintFile (FileId, "Output: [%3.3Xh %4.4d %3.3Xh] ", Offset, Offset, Length); i = 0; while (i < Length) { if (i >= 16) { FlPrintFile (FileId, "%24s", ""); } /* Print 16 hex chars */ for (j = 0; j < 16;) { if (i + j >= Length) { /* Dump fill spaces */ FlPrintFile (FileId, " "); j++; continue; } FlPrintFile (FileId, "%02X ", Buffer[i+j]); j++; } FlPrintFile (FileId, " "); for (j = 0; j < 16; j++) { if (i + j >= Length) { FlPrintFile (FileId, "\n\n"); return; } BufChar = Buffer[(ACPI_SIZE) i + j]; if (isprint (BufChar)) { FlPrintFile (FileId, "%c", BufChar); } else { FlPrintFile (FileId, "."); } } /* Done with that line. */ FlPrintFile (FileId, "\n"); i += 16; } FlPrintFile (FileId, "\n\n"); } /****************************************************************************** * * FUNCTION: DtDumpFieldList * * PARAMETERS: Field - Root field * * RETURN: None * * DESCRIPTION: Dump the entire field list * *****************************************************************************/ void DtDumpFieldList ( DT_FIELD *Field) { if (!AslGbl_DebugFlag || !Field) { return; } DbgPrint (ASL_DEBUG_OUTPUT, "\nField List:\n" "LineNo ByteOff NameCol Column TableOff " "Flags %32s : %s\n\n", "Name", "Value"); while (Field) { DbgPrint (ASL_DEBUG_OUTPUT, "%.08X %.08X %.08X %.08X %.08X %2.2X %32s : %s\n", Field->Line, Field->ByteOffset, Field->NameColumn, Field->Column, Field->TableOffset, Field->Flags, Field->Name, Field->Value); Field = Field->Next; } DbgPrint (ASL_DEBUG_OUTPUT, "\n\n"); } /****************************************************************************** * * FUNCTION: DtDumpSubtableInfo, DtDumpSubtableTree * * PARAMETERS: DT_WALK_CALLBACK * * RETURN: None * * DESCRIPTION: Info - dump a subtable tree entry with extra information. * Tree - dump a subtable tree formatted by depth indentation. * *****************************************************************************/ static void DtDumpSubtableInfo ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue) { DbgPrint (ASL_DEBUG_OUTPUT, "[%.04X] %24s %.08X %.08X %.08X %.08X %p %p %p %p\n", Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength, Subtable->SizeOfLengthField, Subtable->Flags, Subtable, Subtable->Parent, Subtable->Child, Subtable->Peer); } static void DtDumpSubtableTree ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue) { DbgPrint (ASL_DEBUG_OUTPUT, "[%.04X] %24s %*s%p (%.02X) - (%.02X) %.02X\n", Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ", Subtable, Subtable->Length, Subtable->TotalLength, *Subtable->Buffer); } /****************************************************************************** * * FUNCTION: DtDumpSubtableList * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Dump the raw list of subtables with information, and also * dump the subtable list in formatted tree format. Assists with * the development of new table code. * *****************************************************************************/ void DtDumpSubtableList ( void) { if (!AslGbl_DebugFlag || !AslGbl_RootTable) { return; } DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Info:\n" "Depth Name Length TotalLen LenSize Flags " "This Parent Child Peer\n\n"); DtWalkTableTree (AslGbl_RootTable, DtDumpSubtableInfo, NULL, NULL); DbgPrint (ASL_DEBUG_OUTPUT, "\nSubtable Tree: (Depth, Name, Subtable, Length, TotalLength, Integer Value)\n\n"); DtWalkTableTree (AslGbl_RootTable, DtDumpSubtableTree, NULL, NULL); DbgPrint (ASL_DEBUG_OUTPUT, "\n"); } /****************************************************************************** * * FUNCTION: DtWriteFieldToListing * * PARAMETERS: Buffer - Contains the compiled data * Field - Field node for the input line * Length - Length of the output data * * RETURN: None * * DESCRIPTION: Write one field to the listing file (if listing is enabled). * *****************************************************************************/ void DtWriteFieldToListing ( UINT8 *Buffer, DT_FIELD *Field, UINT32 Length) { UINT8 FileByte; if (!AslGbl_ListingFlag || !Field) { return; } /* Dump the original source line */ FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Input: "); FlSeekFile (ASL_FILE_INPUT, Field->ByteOffset); while (FlReadFile (ASL_FILE_INPUT, &FileByte, 1) == AE_OK) { FlWriteFile (ASL_FILE_LISTING_OUTPUT, &FileByte, 1); if (FileByte == '\n') { break; } } /* Dump the line as parsed and represented internally */ FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Parsed: %*s : %.64s", Field->Column-4, Field->Name, Field->Value); if (strlen (Field->Value) > 64) { FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n", (UINT32) strlen (Field->Value)); } FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n"); /* Dump the hex data that will be output for this field */ DtDumpBuffer (ASL_FILE_LISTING_OUTPUT, Buffer, Field->TableOffset, Length); } /****************************************************************************** * * FUNCTION: DtWriteTableToListing * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Write the entire compiled table to the listing file * in hex format * *****************************************************************************/ void DtWriteTableToListing ( void) { UINT8 *Buffer; if (!AslGbl_ListingFlag) { return; } /* Read the entire table from the output file */ Buffer = UtLocalCalloc (AslGbl_TableLength); FlSeekFile (ASL_FILE_AML_OUTPUT, 0); FlReadFile (ASL_FILE_AML_OUTPUT, Buffer, AslGbl_TableLength); /* Dump the raw table data */ AcpiOsRedirectOutput (AslGbl_Files[ASL_FILE_LISTING_OUTPUT].Handle); AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, AslGbl_TableLength, AslGbl_TableLength); AcpiUtDumpBuffer (Buffer, AslGbl_TableLength, DB_BYTE_DISPLAY, 0); AcpiOsRedirectOutput (stdout); ACPI_FREE (Buffer); } diff --git a/sys/contrib/dev/acpica/compiler/dttable1.c b/sys/contrib/dev/acpica/compiler/dttable1.c index 0fab7d880724..d0b3707a57b8 100644 --- a/sys/contrib/dev/acpica/compiler/dttable1.c +++ b/sys/contrib/dev/acpica/compiler/dttable1.c @@ -1,2731 +1,2857 @@ /****************************************************************************** * * Module Name: dttable1.c - handling for specific ACPI tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ /* Compile all complex data tables, signatures starting with A-I */ #include #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dttable1") static ACPI_DMTABLE_INFO TableInfoAsfAddress[] = { {ACPI_DMT_BUFFER, 0, "Addresses", 0}, {ACPI_DMT_EXIT, 0, NULL, 0} }; static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] = { {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0}, {ACPI_DMT_EXIT, 0, NULL, 0} }; /****************************************************************************** * * FUNCTION: DtCompileAest * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile AEST. * * NOTE: Assumes the following table structure: * For all AEST Error Nodes: * 1) An AEST Error Node, followed immediately by: * 2) Any node-specific data * 3) An Interface Structure (one) * 4) A list (array) of Interrupt Structures, the count as specified * in the NodeInterruptCount field of the Error Node header. * * AEST - ARM Error Source table. Conforms to: * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020 * *****************************************************************************/ ACPI_STATUS DtCompileAest ( void **List) { ACPI_AEST_HEADER *ErrorNodeHeader; ACPI_AEST_PROCESSOR *AestProcessor; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; ACPI_STATUS Status; UINT32 i; UINT32 Offset; DT_FIELD **PFieldList = (DT_FIELD **) List; while (*PFieldList) { /* Compile the common error node header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Everything past the error node header will be a subtable */ DtPushSubtable (Subtable); /* * Compile the node-specific structure (Based on the error * node header Type field) */ ErrorNodeHeader = ACPI_CAST_PTR (ACPI_AEST_HEADER, Subtable->Buffer); /* Point past the common error node header */ Offset = sizeof (ACPI_AEST_HEADER); ErrorNodeHeader->NodeSpecificOffset = Offset; /* Decode the error node type */ switch (ErrorNodeHeader->Type) { case ACPI_AEST_PROCESSOR_ERROR_NODE: InfoTable = AcpiDmTableInfoAestProcError; break; case ACPI_AEST_MEMORY_ERROR_NODE: InfoTable = AcpiDmTableInfoAestMemError; break; case ACPI_AEST_SMMU_ERROR_NODE: InfoTable = AcpiDmTableInfoAestSmmuError; break; case ACPI_AEST_VENDOR_ERROR_NODE: InfoTable = AcpiDmTableInfoAestVendorError; break; case ACPI_AEST_GIC_ERROR_NODE: InfoTable = AcpiDmTableInfoAestGicError; break; /* Error case below */ default: AcpiOsPrintf ("Unknown AEST Subtable Type: %X\n", ErrorNodeHeader->Type); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Point past the node-specific structure */ Offset += Subtable->Length; ErrorNodeHeader->NodeInterfaceOffset = Offset; ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile any additional node-specific substructures */ if (ErrorNodeHeader->Type == ACPI_AEST_PROCESSOR_ERROR_NODE) { /* * Special handling for PROCESSOR_ERROR_NODE subtables * (to handle the Resource Substructure via the ResourceType * field). */ AestProcessor = ACPI_CAST_PTR (ACPI_AEST_PROCESSOR, Subtable->Buffer); switch (AestProcessor->ResourceType) { case ACPI_AEST_CACHE_RESOURCE: InfoTable = AcpiDmTableInfoAestCacheRsrc; break; case ACPI_AEST_TLB_RESOURCE: InfoTable = AcpiDmTableInfoAestTlbRsrc; break; case ACPI_AEST_GENERIC_RESOURCE: InfoTable = AcpiDmTableInfoAestGenRsrc; AcpiOsPrintf ("Generic Resource Type (%X) is not supported at this time\n", AestProcessor->ResourceType); return (AE_ERROR); /* Error case below */ default: AcpiOsPrintf ("Unknown AEST Processor Resource Type: %X\n", AestProcessor->ResourceType); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Point past the resource substructure subtable */ Offset += Subtable->Length; ErrorNodeHeader->NodeInterfaceOffset = Offset; ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } /* Compile the (required) node interface structure */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestXface, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ErrorNodeHeader->NodeInterruptOffset = 0; ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile each of the node interrupt structures */ if (ErrorNodeHeader->NodeInterruptCount) { /* Point to the first interrupt structure */ Offset += Subtable->Length; ErrorNodeHeader->NodeInterruptOffset = Offset; } /* Compile each of the interrupt structures */ for (i = 0; i < ErrorNodeHeader->NodeInterruptCount; i++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestXrupt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } /* Prepare for the next AEST Error node */ DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileApmt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile APMT. * *****************************************************************************/ ACPI_STATUS DtCompileApmt ( void **List) { ACPI_STATUS Status; ACPI_TABLE_HEADER *Header; ACPI_APMT_NODE *ApmtNode; ACPI_APMT_NODE *PeerApmtNode; DT_SUBTABLE *Subtable; DT_SUBTABLE *PeerSubtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD**)List; DT_FIELD *SubtableStart; UINT32 CurLength; char MsgBuffer[64] = ""; ParentTable = DtPeekSubtable(); Header = ACPI_CAST_PTR(ACPI_TABLE_HEADER, ParentTable->Buffer); CurLength = sizeof(ACPI_TABLE_HEADER); /* Walk the parse tree */ while (*PFieldList) { /* APMT Node Subtable */ SubtableStart = *PFieldList; Status = DtCompileTable(PFieldList, AcpiDmTableInfoApmtNode, &Subtable); if (ACPI_FAILURE(Status)) { return (Status); } ApmtNode = ACPI_CAST_PTR(ACPI_APMT_NODE, Subtable->Buffer); if (ApmtNode->Length != sizeof(ACPI_APMT_NODE)) { DtFatal(ASL_MSG_INVALID_LENGTH, SubtableStart, "APMT"); return (AE_ERROR); } if (ApmtNode->Type >= ACPI_APMT_NODE_TYPE_COUNT) { snprintf(MsgBuffer, 64, "Node Type : 0x%X", ApmtNode->Type); DtFatal(ASL_MSG_INVALID_TYPE, SubtableStart, MsgBuffer); return (AE_ERROR); } PeerSubtable = DtGetNextSubtable(ParentTable, NULL); /* Validate the node id needs to be unique. */ while(PeerSubtable) { PeerApmtNode = ACPI_CAST_PTR(ACPI_APMT_NODE, PeerSubtable->Buffer); if (PeerApmtNode->Id == ApmtNode->Id) { snprintf(MsgBuffer, 64, "Node Id : 0x%X existed", ApmtNode->Id); DtFatal(ASL_MSG_DUPLICATE_ITEM, SubtableStart, MsgBuffer); return (AE_ERROR); } PeerSubtable = DtGetNextSubtable(ParentTable, PeerSubtable); } CurLength += ApmtNode->Length; DtInsertSubtable(ParentTable, Subtable); } if (Header->Length != CurLength) { snprintf(MsgBuffer, 64, " - APMT Length : %u (expected: %u)", Header->Length, CurLength); DtFatal(ASL_MSG_INVALID_LENGTH, NULL, MsgBuffer); return (AE_ERROR); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileAsf * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile ASF!. * *****************************************************************************/ ACPI_STATUS DtCompileAsf ( void **List) { ACPI_ASF_INFO *AsfTable; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT32 DataCount = 0; ACPI_STATUS Status; UINT32 i; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer); switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ { case ACPI_ASF_TYPE_INFO: InfoTable = AcpiDmTableInfoAsf0; break; case ACPI_ASF_TYPE_ALERT: InfoTable = AcpiDmTableInfoAsf1; break; case ACPI_ASF_TYPE_CONTROL: InfoTable = AcpiDmTableInfoAsf2; break; case ACPI_ASF_TYPE_BOOT: InfoTable = AcpiDmTableInfoAsf3; break; case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ { case ACPI_ASF_TYPE_INFO: DataInfoTable = NULL; break; case ACPI_ASF_TYPE_ALERT: DataInfoTable = AcpiDmTableInfoAsf1a; DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, ACPI_SUB_PTR (UINT8, Subtable->Buffer, sizeof (ACPI_ASF_HEADER)))->Alerts; break; case ACPI_ASF_TYPE_CONTROL: DataInfoTable = AcpiDmTableInfoAsf2a; DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, ACPI_SUB_PTR (UINT8, Subtable->Buffer, sizeof (ACPI_ASF_HEADER)))->Controls; break; case ACPI_ASF_TYPE_BOOT: DataInfoTable = NULL; break; case ACPI_ASF_TYPE_ADDRESS: DataInfoTable = TableInfoAsfAddress; DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, ACPI_SUB_PTR (UINT8, Subtable->Buffer, sizeof (ACPI_ASF_HEADER)))->Devices; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); return (AE_ERROR); } if (DataInfoTable) { switch (AsfTable->Header.Type & 0x7F) { case ACPI_ASF_TYPE_ADDRESS: while (DataCount > 0) { Status = DtCompileTable (PFieldList, DataInfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); DataCount = DataCount - Subtable->Length; } break; default: for (i = 0; i < DataCount; i++) { Status = DtCompileTable (PFieldList, DataInfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); } break; } } DtPopSubtable (); } return (AE_OK); } +/****************************************************************************** + * + * FUNCTION: DtCompileCdat + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile CDAT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileCdat ( + void **List) +{ + ACPI_STATUS Status = AE_OK; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + ACPI_CDAT_HEADER *CdatHeader; + ACPI_DMTABLE_INFO *InfoTable = NULL; + DT_FIELD *SubtableStart; + + + /* Walk the parse tree. + * + * Note: Main table consists of only the CDAT table header + * (This is not the standard ACPI table header, however)-- + * Followed by some number of subtables. + */ + while (*PFieldList) + { + SubtableStart = *PFieldList; + + /* Compile the expected CDAT Subtable header */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCdatHeader, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + CdatHeader = ACPI_CAST_PTR (ACPI_CDAT_HEADER, Subtable->Buffer); + + /* Decode the subtable by type */ + + switch (CdatHeader->Type) + { + case ACPI_CDAT_TYPE_DSMAS: + InfoTable = AcpiDmTableInfoCdat0; + break; + + case ACPI_CDAT_TYPE_DSLBIS: + InfoTable = AcpiDmTableInfoCdat1; + break; + + case ACPI_CDAT_TYPE_DSMSCIS: + InfoTable = AcpiDmTableInfoCdat2; + break; + + case ACPI_CDAT_TYPE_DSIS: + InfoTable = AcpiDmTableInfoCdat3; + break; + + case ACPI_CDAT_TYPE_DSEMTS: + InfoTable = AcpiDmTableInfoCdat4; + break; + + case ACPI_CDAT_TYPE_SSLBIS: + InfoTable = AcpiDmTableInfoCdat5; + break; + + default: + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CDAT"); + } + + /* Compile the CDAT subtable */ + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + switch (CdatHeader->Type) + { + /* Multiple entries supported for this type */ + + case ACPI_CDAT_TYPE_SSLBIS: + + /* + * Check for multiple SSLBEs + */ + while (*PFieldList && !AcpiUtStricmp ((*PFieldList)->Name, "Port X ID")) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCdatEntries, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + } + break; + + default: + break; + } + + /* Pop off the CDAT Subtable header subtree */ + + DtPopSubtable (); + } + + return (AE_OK); +} + + /****************************************************************************** * * FUNCTION: DtCompileCedt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile CEDT. * *****************************************************************************/ ACPI_STATUS DtCompileCedt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_CEDT_HEADER *CedtHeader; DT_FIELD *SubtableStart; /* Walk the parse tree */ while (*PFieldList) { /* if CFMWS and has more than one target, then set to zero later */ int InsertFlag = 1; SubtableStart = *PFieldList; /* CEDT Header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedtHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); CedtHeader = ACPI_CAST_PTR (ACPI_CEDT_HEADER, Subtable->Buffer); switch (CedtHeader->Type) { case ACPI_CEDT_TYPE_CHBS: Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } break; case ACPI_CEDT_TYPE_CFMWS: { unsigned char *dump; unsigned int idx, offset, max = 0; /* Compile table with first "Interleave target" */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Look in buffer for the number of targets */ offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); dump = (unsigned char *) Subtable->Buffer - 4; /* place at beginning of cedt1 */ max = 0x01 << dump[offset]; /* 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX */ if (max > 8) max=1; /* Error in encoding Interleaving Ways. */ if (max == 1) /* if only one target, then break here. */ break; /* break if only one target. */ /* We need to add more interleave targets, so write the current Subtable. */ ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Insert AcpiDmTableInfoCedt1 table so we can put in */ DtPushSubtable (Subtable); /* the targets > the first. */ /* Now, find out all interleave targets beyond the first. */ for (idx = 1; idx < max; idx++) { ParentTable = DtPeekSubtable (); if (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1_te, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { DtInsertSubtable (ParentTable, Subtable); /* got a target, so insert table. */ InsertFlag = 0; } } } DtPopSubtable (); ParentTable = DtPeekSubtable (); break; } default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); return (AE_ERROR); } ParentTable = DtPeekSubtable (); if (InsertFlag == 1) { DtInsertSubtable (ParentTable, Subtable); } DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileCpep * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile CPEP. * *****************************************************************************/ ACPI_STATUS DtCompileCpep ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileCsrt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile CSRT. * *****************************************************************************/ ACPI_STATUS DtCompileCsrt ( void **List) { ACPI_STATUS Status = AE_OK; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 DescriptorCount; UINT32 GroupLength; /* Subtables (Resource Groups) */ ParentTable = DtPeekSubtable (); while (*PFieldList) { /* Resource group subtable */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Compute the number of resource descriptors */ GroupLength = (ACPI_CAST_PTR (ACPI_CSRT_GROUP, Subtable->Buffer))->Length - (ACPI_CAST_PTR (ACPI_CSRT_GROUP, Subtable->Buffer))->SharedInfoLength - sizeof (ACPI_CSRT_GROUP); DescriptorCount = (GroupLength / sizeof (ACPI_CSRT_DESCRIPTOR)); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); /* Shared info subtable (One per resource group) */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); /* Sub-Subtables (Resource Descriptors) */ while (*PFieldList && DescriptorCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); if (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { DtInsertSubtable (ParentTable, Subtable); } } DtPopSubtable (); ParentTable = DtPeekSubtable (); DescriptorCount--; } DtPopSubtable (); ParentTable = DtPeekSubtable (); } return (Status); } /****************************************************************************** * * FUNCTION: DtCompileDbg2 * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile DBG2. * *****************************************************************************/ ACPI_STATUS DtCompileDbg2 ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 SubtableCount; ACPI_DBG2_HEADER *Dbg2Header; ACPI_DBG2_DEVICE *DeviceInfo; UINT16 CurrentOffset; UINT32 i; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Main table fields */ Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer); Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF ( ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header); SubtableCount = Dbg2Header->InfoCount; DtPushSubtable (Subtable); /* Process all Device Information subtables (Count = InfoCount) */ while (*PFieldList && SubtableCount) { /* Subtable: Debug Device Information */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer); CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE); ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); /* BaseAddressRegister GAS array (Required, size is RegisterCount) */ DeviceInfo->BaseAddressOffset = CurrentOffset; for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS); DtInsertSubtable (ParentTable, Subtable); } /* AddressSize array (Required, size = RegisterCount) */ DeviceInfo->AddressSizeOffset = CurrentOffset; for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } CurrentOffset += (UINT16) sizeof (UINT32); DtInsertSubtable (ParentTable, Subtable); } /* NamespaceString device identifier (Required, size = NamePathLength) */ DeviceInfo->NamepathOffset = CurrentOffset; Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Update the device info header */ DeviceInfo->NamepathLength = (UINT16) Subtable->Length; CurrentOffset += (UINT16) DeviceInfo->NamepathLength; DtInsertSubtable (ParentTable, Subtable); /* OemData - Variable-length data (Optional, size = OemDataLength) */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData, &Subtable); if (Status == AE_END_OF_TABLE) { /* optional field was not found and we're at the end of the file */ goto subtableDone; } else if (ACPI_FAILURE (Status)) { return (Status); } /* Update the device info header (zeros if no OEM data present) */ DeviceInfo->OemDataOffset = 0; DeviceInfo->OemDataLength = 0; /* Optional subtable (OemData) */ if (Subtable && Subtable->Length) { DeviceInfo->OemDataOffset = CurrentOffset; DeviceInfo->OemDataLength = (UINT16) Subtable->Length; DtInsertSubtable (ParentTable, Subtable); } subtableDone: SubtableCount--; DtPopSubtable (); /* Get next Device Information subtable */ } DtPopSubtable (); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileDmar * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile DMAR. * *****************************************************************************/ ACPI_STATUS DtCompileDmar ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMAR_HEADER *DmarHeader; ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope; UINT32 DeviceScopeLength; UINT32 PciPathLength; Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); while (*PFieldList) { /* DMAR Header */ SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer); switch (DmarHeader->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: InfoTable = AcpiDmTableInfoDmar0; break; case ACPI_DMAR_TYPE_RESERVED_MEMORY: InfoTable = AcpiDmTableInfoDmar1; break; case ACPI_DMAR_TYPE_ROOT_ATS: InfoTable = AcpiDmTableInfoDmar2; break; case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: InfoTable = AcpiDmTableInfoDmar3; break; case ACPI_DMAR_TYPE_NAMESPACE: InfoTable = AcpiDmTableInfoDmar4; break; case ACPI_DMAR_TYPE_SATC: InfoTable = AcpiDmTableInfoDmar5; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR"); return (AE_ERROR); } /* DMAR Subtable */ Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* * Optional Device Scope subtables */ if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE)) { /* These types do not support device scopes */ DtPopSubtable (); continue; } DtPushSubtable (Subtable); DeviceScopeLength = DmarHeader->Length - Subtable->Length - ParentTable->Length; while (DeviceScopeLength) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope, &Subtable); if (Status == AE_NOT_FOUND) { break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer); /* Optional PCI Paths */ PciPathLength = DmarDeviceScope->Length - Subtable->Length; while (PciPathLength) { Status = DtCompileTable (PFieldList, TableInfoDmarPciPath, &Subtable); if (Status == AE_NOT_FOUND) { DtPopSubtable (); break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); PciPathLength -= Subtable->Length; } DtPopSubtable (); DeviceScopeLength -= DmarDeviceScope->Length; } DtPopSubtable (); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileDrtm * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile DRTM. * *****************************************************************************/ ACPI_STATUS DtCompileDrtm ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 Count; /* ACPI_TABLE_DRTM *Drtm; */ ACPI_DRTM_VTABLE_LIST *DrtmVtl; ACPI_DRTM_RESOURCE_LIST *DrtmRl; /* ACPI_DRTM_DPS_ID *DrtmDps; */ ParentTable = DtPeekSubtable (); /* Compile DRTM header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); /* * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HADER fields. */ #if 0 Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM, Subtable->Buffer, sizeof (ACPI_TABLE_HEADER)); #endif /* Compile VTL */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); Count = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); Count++; } DrtmVtl->ValidatedTableCount = Count; DtPopSubtable (); ParentTable = DtPeekSubtable (); /* Compile RL */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); Count = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); Count++; } DrtmRl->ResourceCount = Count; DtPopSubtable (); ParentTable = DtPeekSubtable (); /* Compile DPS */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/ return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileEinj * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile EINJ. * *****************************************************************************/ ACPI_STATUS DtCompileEinj ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileErst * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile ERST. * *****************************************************************************/ ACPI_STATUS DtCompileErst ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoErst, AcpiDmTableInfoEinj0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileGtdt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile GTDT. * *****************************************************************************/ ACPI_STATUS DtCompileGtdt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_SUBTABLE_HEADER *GtdtHeader; ACPI_DMTABLE_INFO *InfoTable; UINT32 GtCount; ACPI_TABLE_HEADER *Header; ParentTable = DtPeekSubtable (); Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* GTDT revision 3 later contains 2 extra fields before subtables */ if (Header->Revision > 2) { ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtEl2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); switch (GtdtHeader->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: InfoTable = AcpiDmTableInfoGtdt0; break; case ACPI_GTDT_TYPE_WATCHDOG: InfoTable = AcpiDmTableInfoGtdt1; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* * Additional GT block subtable data */ switch (GtdtHeader->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount; while (GtCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); GtCount--; } DtPopSubtable (); break; default: break; } DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileFpdt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile FPDT. * *****************************************************************************/ ACPI_STATUS DtCompileFpdt ( void **List) { ACPI_STATUS Status; ACPI_FPDT_HEADER *FpdtHeader; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer); switch (FpdtHeader->Type) { case ACPI_FPDT_TYPE_BOOT: InfoTable = AcpiDmTableInfoFpdt0; break; case ACPI_FPDT_TYPE_S3PERF: InfoTable = AcpiDmTableInfoFpdt1; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT"); return (AE_ERROR); break; } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileHest * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile HEST. * *****************************************************************************/ ACPI_STATUS DtCompileHest ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable; UINT16 Type; UINT32 BankCount; Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { /* Get subtable type */ SubtableStart = *PFieldList; DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0); switch (Type) { case ACPI_HEST_TYPE_IA32_CHECK: InfoTable = AcpiDmTableInfoHest0; break; case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: InfoTable = AcpiDmTableInfoHest1; break; case ACPI_HEST_TYPE_IA32_NMI: InfoTable = AcpiDmTableInfoHest2; break; case ACPI_HEST_TYPE_AER_ROOT_PORT: InfoTable = AcpiDmTableInfoHest6; break; case ACPI_HEST_TYPE_AER_ENDPOINT: InfoTable = AcpiDmTableInfoHest7; break; case ACPI_HEST_TYPE_AER_BRIDGE: InfoTable = AcpiDmTableInfoHest8; break; case ACPI_HEST_TYPE_GENERIC_ERROR: InfoTable = AcpiDmTableInfoHest9; break; case ACPI_HEST_TYPE_GENERIC_ERROR_V2: InfoTable = AcpiDmTableInfoHest10; break; case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: InfoTable = AcpiDmTableInfoHest11; break; default: /* Cannot continue on unknown type */ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); /* * Additional subtable data - IA32 Error Bank(s) */ BankCount = 0; switch (Type) { case ACPI_HEST_TYPE_IA32_CHECK: BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, Subtable->Buffer))->NumHardwareBanks; break; case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, Subtable->Buffer))->NumHardwareBanks; break; case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK, Subtable->Buffer))->NumHardwareBanks; break; default: break; } while (BankCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); BankCount--; } } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileHmat * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile HMAT. * *****************************************************************************/ ACPI_STATUS DtCompileHmat ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; DT_FIELD *EntryStart; ACPI_HMAT_STRUCTURE *HmatStruct; ACPI_HMAT_LOCALITY *HmatLocality; ACPI_HMAT_CACHE *HmatCache; ACPI_DMTABLE_INFO *InfoTable; UINT32 IntPDNumber; UINT32 TgtPDNumber; UINT64 EntryNumber; UINT16 SMBIOSHandleNumber; ParentTable = DtPeekSubtable (); Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { /* Compile HMAT structure header */ SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmatHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); HmatStruct = ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE, Subtable->Buffer); HmatStruct->Length = Subtable->Length; /* Compile HMAT structure body */ switch (HmatStruct->Type) { case ACPI_HMAT_TYPE_ADDRESS_RANGE: InfoTable = AcpiDmTableInfoHmat0; break; case ACPI_HMAT_TYPE_LOCALITY: InfoTable = AcpiDmTableInfoHmat1; break; case ACPI_HMAT_TYPE_CACHE: InfoTable = AcpiDmTableInfoHmat2; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HMAT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); HmatStruct->Length += Subtable->Length; /* Compile HMAT structure additionals */ switch (HmatStruct->Type) { case ACPI_HMAT_TYPE_LOCALITY: HmatLocality = ACPI_SUB_PTR (ACPI_HMAT_LOCALITY, Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE)); /* Compile initiator proximity domain list */ IntPDNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat1a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); HmatStruct->Length += Subtable->Length; IntPDNumber++; } HmatLocality->NumberOfInitiatorPDs = IntPDNumber; /* Compile target proximity domain list */ TgtPDNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat1b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); HmatStruct->Length += Subtable->Length; TgtPDNumber++; } HmatLocality->NumberOfTargetPDs = TgtPDNumber; /* Save start of the entries for reporting errors */ EntryStart = *PFieldList; /* Compile latency/bandwidth entries */ EntryNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat1c, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); HmatStruct->Length += Subtable->Length; EntryNumber++; } /* Validate number of entries */ if (EntryNumber != ((UINT64)IntPDNumber * (UINT64)TgtPDNumber)) { DtFatal (ASL_MSG_INVALID_EXPRESSION, EntryStart, "HMAT"); return (AE_ERROR); } break; case ACPI_HMAT_TYPE_CACHE: /* Compile SMBIOS handles */ HmatCache = ACPI_SUB_PTR (ACPI_HMAT_CACHE, Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE)); SMBIOSHandleNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat2a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); HmatStruct->Length += Subtable->Length; SMBIOSHandleNumber++; } HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber; break; default: break; } } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileIort * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile IORT. * *****************************************************************************/ ACPI_STATUS DtCompileIort ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_TABLE_HEADER *Table; ACPI_TABLE_IORT *Iort; ACPI_IORT_NODE *IortNode; ACPI_IORT_ITS_GROUP *IortItsGroup; ACPI_IORT_SMMU *IortSmmu; ACPI_IORT_RMR *IortRmr; UINT32 NodeNumber; UINT32 NodeLength; UINT32 IdMappingNumber; UINT32 ItsNumber; UINT32 ContextIrptNumber; UINT32 PmuIrptNumber; UINT32 PaddingLength; UINT8 Revision; UINT32 RmrCount; ParentTable = DtPeekSubtable (); Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); Revision = Table->Revision; /* IORT Revisions E, E.a & E.c have known issues and are not supported */ if (Revision == 1 || Revision == 2 || Revision == 4) { DtError (ASL_ERROR, ASL_MSG_UNSUPPORTED, NULL, "IORT table revision"); return (AE_ERROR); } /* * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HEADER fields. */ Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT, Subtable->Buffer, sizeof (ACPI_TABLE_HEADER)); /* * OptionalPadding - Variable-length data * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT)) * Optionally allows the generic data types to be used for filling * this field. */ Iort->NodeOffset = sizeof (ACPI_TABLE_IORT); Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { DtInsertSubtable (ParentTable, Subtable); Iort->NodeOffset += Subtable->Length; } else { Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList), AcpiDmTableInfoIortHdr[0].Name, &PaddingLength); if (ACPI_FAILURE (Status)) { return (Status); } Iort->NodeOffset += PaddingLength; } NodeNumber = 0; while (*PFieldList) { SubtableStart = *PFieldList; if (Revision == 0) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr, &Subtable); } else if (Revision >= 3) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr3, &Subtable); } if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer); NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData); DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); switch (IortNode->Type) { case ACPI_IORT_NODE_ITS_GROUP: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer); NodeLength += Subtable->Length; ItsNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; ItsNumber++; } IortItsGroup->ItsCount = ItsNumber; break; case ACPI_IORT_NODE_NAMED_COMPONENT: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; /* * Padding - Variable-length data * Optionally allows the offset of the ID mappings to be used * for filling this field. */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; } else { if (NodeLength > IortNode->MappingOffset) { return (AE_BAD_DATA); } if (NodeLength < IortNode->MappingOffset) { Status = DtCompilePadding ( IortNode->MappingOffset - NodeLength, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength = IortNode->MappingOffset; } } break; case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; break; case ACPI_IORT_NODE_SMMU: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer); NodeLength += Subtable->Length; /* Compile global interrupt array */ IortSmmu->GlobalInterruptOffset = NodeLength; Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; /* Compile context interrupt array */ ContextIrptNumber = 0; IortSmmu->ContextInterruptOffset = NodeLength; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; ContextIrptNumber++; } IortSmmu->ContextInterruptCount = ContextIrptNumber; /* Compile PMU interrupt array */ PmuIrptNumber = 0; IortSmmu->PmuInterruptOffset = NodeLength; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; PmuIrptNumber++; } IortSmmu->PmuInterruptCount = PmuIrptNumber; break; case ACPI_IORT_NODE_SMMU_V3: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort4, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; break; case ACPI_IORT_NODE_PMCG: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort5, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); NodeLength += Subtable->Length; break; case ACPI_IORT_NODE_RMR: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort6, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); IortRmr = ACPI_CAST_PTR (ACPI_IORT_RMR, Subtable->Buffer); NodeLength += Subtable->Length; /* Compile RMR Descriptors */ RmrCount = 0; IortRmr->RmrOffset = NodeLength; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort6a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); NodeLength += sizeof (ACPI_IORT_RMR_DESC); RmrCount++; } IortRmr->RmrCount = RmrCount; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT"); return (AE_ERROR); } /* Compile Array of ID mappings */ IortNode->MappingOffset = NodeLength; IdMappingNumber = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); NodeLength += sizeof (ACPI_IORT_ID_MAPPING); IdMappingNumber++; } IortNode->MappingCount = IdMappingNumber; if (!IdMappingNumber) { IortNode->MappingOffset = 0; } /* * Node length can be determined by DT_LENGTH option * IortNode->Length = NodeLength; */ DtPopSubtable (); ParentTable = DtPeekSubtable (); NodeNumber++; } Iort->NodeCount = NodeNumber; return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileIvrs * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile IVRS. Notes: * The IVRS is essentially a flat table, with the following * structure: *
*
* * * ... * * * * ... * *****************************************************************************/ ACPI_STATUS DtCompileIvrs ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_SUBTABLE *MainSubtable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable = NULL; UINT8 SubtableType; UINT8 Temp64[16]; UINT8 Temp8; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); /* Save a pointer to the main subtable */ MainSubtable = Subtable; while (*PFieldList) { SubtableStart = *PFieldList; /* Compile the SubtableType integer */ DtCompileInteger (&SubtableType, *PFieldList, 1, 0); switch (SubtableType) { /* Type 10h, IVHD (I/O Virtualization Hardware Definition) */ case ACPI_IVRS_TYPE_HARDWARE1: InfoTable = AcpiDmTableInfoIvrsHware1; break; /* Types 11h, 40h, IVHD (I/O Virtualization Hardware Definition) */ case ACPI_IVRS_TYPE_HARDWARE2: case ACPI_IVRS_TYPE_HARDWARE3: InfoTable = AcpiDmTableInfoIvrsHware23; break; /* Types 20h, 21h, 22h, IVMD (I/O Virtualization Memory Definition Block) */ case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: InfoTable = AcpiDmTableInfoIvrsMemory; break; /* 4-byte device entries */ case ACPI_IVRS_TYPE_PAD4: case ACPI_IVRS_TYPE_ALL: case ACPI_IVRS_TYPE_SELECT: case ACPI_IVRS_TYPE_START: case ACPI_IVRS_TYPE_END: InfoTable = AcpiDmTableInfoIvrs4; break; /* 8-byte device entries, type A */ case ACPI_IVRS_TYPE_ALIAS_SELECT: case ACPI_IVRS_TYPE_ALIAS_START: InfoTable = AcpiDmTableInfoIvrs8a; break; /* 8-byte device entries, type B */ case ACPI_IVRS_TYPE_EXT_SELECT: case ACPI_IVRS_TYPE_EXT_START: InfoTable = AcpiDmTableInfoIvrs8b; break; /* 8-byte device entries, type C */ case ACPI_IVRS_TYPE_SPECIAL: InfoTable = AcpiDmTableInfoIvrs8c; break; /* Variable device entries, type F0h */ case ACPI_IVRS_TYPE_HID: InfoTable = AcpiDmTableInfoIvrsHid; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS Device Entry"); return (AE_ERROR); } /* Compile the InfoTable from above */ Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); if (SubtableType != ACPI_IVRS_TYPE_HARDWARE1 && SubtableType != ACPI_IVRS_TYPE_HARDWARE2 && SubtableType != ACPI_IVRS_TYPE_HARDWARE3 && SubtableType != ACPI_IVRS_TYPE_HID && SubtableType != ACPI_IVRS_TYPE_MEMORY1 && SubtableType != ACPI_IVRS_TYPE_MEMORY2 && SubtableType != ACPI_IVRS_TYPE_MEMORY3) { if (ParentTable) DtInsertSubtable (ParentTable, Subtable); } switch (SubtableType) { case ACPI_IVRS_TYPE_HARDWARE1: case ACPI_IVRS_TYPE_HARDWARE2: case ACPI_IVRS_TYPE_HARDWARE3: case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: /* Insert these IVHDs/IVMDs at the root subtable */ DtInsertSubtable (MainSubtable, Subtable); DtPushSubtable (Subtable); - ParentTable = MainSubtable; break; case ACPI_IVRS_TYPE_HID: /* Special handling for the HID named device entry (0xF0) */ if (ParentTable) { DtInsertSubtable (ParentTable, Subtable); } /* * Process the HID value. First, get the HID value as a string. */ DtCompileOneField ((UINT8 *) &Temp64, *PFieldList, 16, DT_FIELD_TYPE_STRING, 0); /* * Determine if the HID is an integer or a string. * An integer is defined to be 32 bits, with the upper 32 bits * set to zero. (from the ACPI Spec): "The HID can be a 32-bit * integer or a character string. If an integer, the lower * 4 bytes of the field contain the integer and the upper * 4 bytes are padded with 0". */ if (UtIsIdInteger ((UINT8 *) &Temp64)) { /* Compile the HID value as an integer */ DtCompileOneField ((UINT8 *) &Temp64, *PFieldList, 8, DT_FIELD_TYPE_INTEGER, 0); Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHidInteger, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } } else { /* Compile the HID value as a string */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHidString, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } } DtInsertSubtable (ParentTable, Subtable); /* * Process the CID value. First, get the CID value as a string. */ DtCompileOneField ((UINT8 *) &Temp64, *PFieldList, 16, DT_FIELD_TYPE_STRING, 0); if (UtIsIdInteger ((UINT8 *) &Temp64)) { /* Compile the CID value as an integer */ DtCompileOneField ((UINT8 *) &Temp64, *PFieldList, 8, DT_FIELD_TYPE_INTEGER, 0); Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsCidInteger, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } } else { /* Compile the CID value as a string */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsCidString, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } } DtInsertSubtable (ParentTable, Subtable); /* * Process the UID value. First, get and decode the "UID Format" field (Integer). */ if (!*PFieldList) { return (AE_OK); } DtCompileOneField (&Temp8, *PFieldList, 1, DT_FIELD_TYPE_INTEGER, 0); switch (Temp8) { case ACPI_IVRS_UID_NOT_PRESENT: break; case ACPI_IVRS_UID_IS_INTEGER: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsUidInteger, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); break; case ACPI_IVRS_UID_IS_STRING: Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsUidString, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); break; default: DtFatal (ASL_MSG_UNKNOWN_FORMAT, SubtableStart, "IVRS Device Entry"); return (AE_ERROR); } default: /* All other subtable types come through here */ break; } } return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c index 73c369c12948..d1972a503a2d 100644 --- a/sys/contrib/dev/acpica/compiler/dttable2.c +++ b/sys/contrib/dev/acpica/compiler/dttable2.c @@ -1,3250 +1,3375 @@ /****************************************************************************** * * Module Name: dttable2.c - handling for specific ACPI tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ /* Compile all complex data tables, signatures starting with L-Z */ #include #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dttable2") /****************************************************************************** * * FUNCTION: DtCompileLpit * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile LPIT. * *****************************************************************************/ ACPI_STATUS DtCompileLpit ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable; ACPI_LPIT_HEADER *LpitHeader; /* Note: Main table consists only of the standard ACPI table header */ while (*PFieldList) { SubtableStart = *PFieldList; /* LPIT Subtable header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer); switch (LpitHeader->Type) { case ACPI_LPIT_TYPE_NATIVE_CSTATE: InfoTable = AcpiDmTableInfoLpit0; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT"); return (AE_ERROR); } /* LPIT Subtable */ Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileMadt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile MADT. * *****************************************************************************/ ACPI_STATUS DtCompileMadt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_SUBTABLE_HEADER *MadtHeader; ACPI_DMTABLE_INFO *InfoTable; Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); switch (MadtHeader->Type) { case ACPI_MADT_TYPE_LOCAL_APIC: InfoTable = AcpiDmTableInfoMadt0; break; case ACPI_MADT_TYPE_IO_APIC: InfoTable = AcpiDmTableInfoMadt1; break; case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: InfoTable = AcpiDmTableInfoMadt2; break; case ACPI_MADT_TYPE_NMI_SOURCE: InfoTable = AcpiDmTableInfoMadt3; break; case ACPI_MADT_TYPE_LOCAL_APIC_NMI: InfoTable = AcpiDmTableInfoMadt4; break; case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: InfoTable = AcpiDmTableInfoMadt5; break; case ACPI_MADT_TYPE_IO_SAPIC: InfoTable = AcpiDmTableInfoMadt6; break; case ACPI_MADT_TYPE_LOCAL_SAPIC: InfoTable = AcpiDmTableInfoMadt7; break; case ACPI_MADT_TYPE_INTERRUPT_SOURCE: InfoTable = AcpiDmTableInfoMadt8; break; case ACPI_MADT_TYPE_LOCAL_X2APIC: InfoTable = AcpiDmTableInfoMadt9; break; case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: InfoTable = AcpiDmTableInfoMadt10; break; case ACPI_MADT_TYPE_GENERIC_INTERRUPT: InfoTable = AcpiDmTableInfoMadt11; break; case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: InfoTable = AcpiDmTableInfoMadt12; break; case ACPI_MADT_TYPE_GENERIC_MSI_FRAME: InfoTable = AcpiDmTableInfoMadt13; break; case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: InfoTable = AcpiDmTableInfoMadt14; break; case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: InfoTable = AcpiDmTableInfoMadt15; break; case ACPI_MADT_TYPE_MULTIPROC_WAKEUP: InfoTable = AcpiDmTableInfoMadt16; break; default: if (MadtHeader->Type >= ACPI_MADT_TYPE_OEM_RESERVED) { InfoTable = AcpiDmTableInfoMadt17; } else { DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT"); return (AE_ERROR); } break; } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileMcfg * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile MCFG. * *****************************************************************************/ ACPI_STATUS DtCompileMcfg ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileMpst * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile MPST. * *****************************************************************************/ ACPI_STATUS DtCompileMpst ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_MPST_CHANNEL *MpstChannelInfo; ACPI_MPST_POWER_NODE *MpstPowerNode; ACPI_MPST_DATA_HDR *MpstDataHeader; UINT16 SubtableCount; UINT32 PowerStateCount; UINT32 ComponentCount; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer); SubtableCount = MpstChannelInfo->PowerNodeCount; while (*PFieldList && SubtableCount) { /* Subtable: Memory Power Node(s) */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer); PowerStateCount = MpstPowerNode->NumPowerStates; ComponentCount = MpstPowerNode->NumPhysicalComponents; ParentTable = DtPeekSubtable (); /* Sub-subtables - Memory Power State Structure(s) */ while (*PFieldList && PowerStateCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); PowerStateCount--; } /* Sub-subtables - Physical Component ID Structure(s) */ while (*PFieldList && ComponentCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); ComponentCount--; } SubtableCount--; DtPopSubtable (); } /* Subtable: Count of Memory Power State Characteristic structures */ DtPopSubtable (); Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer); SubtableCount = MpstDataHeader->CharacteristicsCount; ParentTable = DtPeekSubtable (); /* Subtable: Memory Power State Characteristics structure(s) */ while (*PFieldList && SubtableCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); SubtableCount--; } DtPopSubtable (); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileMsct * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile MSCT. * *****************************************************************************/ ACPI_STATUS DtCompileMsct ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileNfit * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile NFIT. * *****************************************************************************/ ACPI_STATUS DtCompileNfit ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_NFIT_HEADER *NfitHeader; ACPI_DMTABLE_INFO *InfoTable; UINT32 Count; ACPI_NFIT_INTERLEAVE *Interleave = NULL; ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); /* Subtables */ while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer); switch (NfitHeader->Type) { case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: InfoTable = AcpiDmTableInfoNfit0; break; case ACPI_NFIT_TYPE_MEMORY_MAP: InfoTable = AcpiDmTableInfoNfit1; break; case ACPI_NFIT_TYPE_INTERLEAVE: Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer); InfoTable = AcpiDmTableInfoNfit2; break; case ACPI_NFIT_TYPE_SMBIOS: InfoTable = AcpiDmTableInfoNfit3; break; case ACPI_NFIT_TYPE_CONTROL_REGION: InfoTable = AcpiDmTableInfoNfit4; break; case ACPI_NFIT_TYPE_DATA_REGION: InfoTable = AcpiDmTableInfoNfit5; break; case ACPI_NFIT_TYPE_FLUSH_ADDRESS: Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer); InfoTable = AcpiDmTableInfoNfit6; break; case ACPI_NFIT_TYPE_CAPABILITIES: InfoTable = AcpiDmTableInfoNfit7; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); switch (NfitHeader->Type) { case ACPI_NFIT_TYPE_INTERLEAVE: Count = 0; DtPushSubtable (Subtable); while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit2a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { DtPopSubtable (); break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Count++; } Interleave->LineCount = Count; break; case ACPI_NFIT_TYPE_SMBIOS: if (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { DtInsertSubtable (ParentTable, Subtable); } } break; case ACPI_NFIT_TYPE_FLUSH_ADDRESS: Count = 0; DtPushSubtable (Subtable); while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit6a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { DtPopSubtable (); break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Count++; } Hint->HintCount = (UINT16) Count; break; default: break; } } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileNhlt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile NHLT. * *****************************************************************************/ ACPI_STATUS DtCompileNhlt ( void **List) { ACPI_STATUS Status; UINT32 EndpointCount; UINT32 MicrophoneCount; UINT32 FormatsCount; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 CapabilitiesSize; UINT8 ArrayType; UINT8 ConfigType; UINT8 DeviceInfoCount; UINT32 i; UINT32 j; ACPI_TABLE_NHLT_ENDPOINT_COUNT *MainTable; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A *DevSpecific; ACPI_NHLT_VENDOR_MIC_COUNT *MicCount; ACPI_NHLT_FORMATS_CONFIG *FormatsConfig; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D *ConfigSpecific; ACPI_NHLT_DEVICE_INFO_COUNT *DeviceInfo; + ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B *Terminator; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Get the Endpoint Descriptor count */ ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); MainTable = ACPI_CAST_PTR (ACPI_TABLE_NHLT_ENDPOINT_COUNT, Subtable->Buffer); EndpointCount = MainTable->EndpointCount; /* Subtables */ while (*PFieldList) { /* Variable number of Endpoint descriptors */ for (i = 0; i < EndpointCount; i++) { /* Do the Endpoint Descriptor */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); /* Do the Device Specific table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); DevSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A, Subtable->Buffer); CapabilitiesSize = DevSpecific->CapabilitiesSize; ArrayType = 0; ConfigType = 0; switch (CapabilitiesSize) { case 0: break; case 1: Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5c, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); break; case 2: Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); break; case 3: Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); ConfigSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D, Subtable->Buffer); ArrayType = ConfigSpecific->ArrayType; ConfigType = ConfigSpecific->ConfigType; break; case 7: Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt6b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); ConfigSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D, Subtable->Buffer); ArrayType = ConfigSpecific->ArrayType; ConfigType = ConfigSpecific->ConfigType; break; default: Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); ConfigSpecific = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D, Subtable->Buffer); ArrayType = ConfigSpecific->ArrayType; ConfigType = ConfigSpecific->ConfigType; break; } /* switch (CapabilitiesSize) */ if (CapabilitiesSize >= 3) { /* Check for a vendor-defined mic array */ if (ConfigType == ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY) { if ((ArrayType & ACPI_NHLT_ARRAY_TYPE_MASK) == ACPI_NHLT_VENDOR_DEFINED) { /* Get the microphone count */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt6a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } MicCount = ACPI_CAST_PTR (ACPI_NHLT_VENDOR_MIC_COUNT, Subtable->Buffer); MicrophoneCount = MicCount->MicrophoneCount; ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Variable number of microphones */ for (j = 0; j < MicrophoneCount; j++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt6, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } /* Do the MIC_SNR_SENSITIVITY_EXTENSION, if present */ if (ArrayType & ACPI_NHLT_ARRAY_TYPE_EXT_MASK) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt9, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } } } } /* Get the formats count */ DtPopSubtable (); Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt4, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); FormatsConfig = ACPI_CAST_PTR (ACPI_NHLT_FORMATS_CONFIG, Subtable->Buffer); FormatsCount = FormatsConfig->FormatsCount; /* Variable number of wave_format_extensible structs */ for (j = 0; j < FormatsCount; j++) { /* Do the main wave_format_extensible structure */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); /* Do the capabilities list */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtPopSubtable (); ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } /* for (j = 0; j < FormatsCount; j++) */ /* * If we are not done with the current Endpoint yet, then there must be * some non documeneted structure(s) yet to be processed. First, get * the count of such structure(s). */ - if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Device Info struct count"))) { /* Get the count of non documented structures */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DeviceInfo = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_INFO_COUNT, Subtable->Buffer); DeviceInfoCount = DeviceInfo->StructureCount; for (j = 0; j < DeviceInfoCount; j++) { /* * Compile the following Device Info fields: * 1) Device ID * 2) Device Instance ID * 3) Device Port ID */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } /* for (j = 0; j < LinuxSpecificCount; j++) */ - /* Undocumented data at the end of endpoint */ - if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Bytes"))) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } } DtPopSubtable (); } /* for (i = 0; i < EndpointCount; i++) */ /* * All Endpoint Descriptors are completed. * Do the table terminator specific config (not in NHLT spec, optional) */ - if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Capabilities Size"))) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); - Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, - &Subtable); - if (ACPI_FAILURE (Status)) + Terminator = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B, Subtable->Buffer); + + if (Terminator->CapabilitiesSize) { - return (Status); - } + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - ParentTable = DtPeekSubtable (); - DtInsertSubtable (ParentTable, Subtable); + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + } } return (AE_OK); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompilePcct * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile PCCT. * *****************************************************************************/ ACPI_STATUS DtCompilePcct ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_SUBTABLE_HEADER *PcctHeader; ACPI_DMTABLE_INFO *InfoTable; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Subtables */ while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); switch (PcctHeader->Type) { case ACPI_PCCT_TYPE_GENERIC_SUBSPACE: InfoTable = AcpiDmTableInfoPcct0; break; case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE: InfoTable = AcpiDmTableInfoPcct1; break; case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: InfoTable = AcpiDmTableInfoPcct2; break; case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE: InfoTable = AcpiDmTableInfoPcct3; break; case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE: InfoTable = AcpiDmTableInfoPcct4; break; case ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE: InfoTable = AcpiDmTableInfoPcct5; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompilePdtt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile PDTT. * *****************************************************************************/ ACPI_STATUS DtCompilePdtt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_TABLE_PDTT *PdttHeader; UINT32 Count = 0; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPdtt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); PdttHeader = ACPI_CAST_PTR (ACPI_TABLE_PDTT, ParentTable->Buffer); PdttHeader->ArrayOffset = sizeof (ACPI_TABLE_PDTT); /* There is only one type of subtable at this time, no need to decode */ while (*PFieldList) { /* List of subchannel IDs, each 2 bytes */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPdtt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); Count++; } PdttHeader->TriggerCount = (UINT8) Count; return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompilePhat * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile Phat. * *****************************************************************************/ ACPI_STATUS DtCompilePhat ( void **List) { ACPI_STATUS Status = AE_OK; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_PHAT_HEADER *PhatHeader; ACPI_DMTABLE_INFO *Info; ACPI_PHAT_VERSION_DATA *VersionData; + UINT32 DeviceDataLength; UINT32 RecordCount; + DT_FIELD *DataOffsetField; + DT_FIELD *DevicePathField; + UINT32 TableOffset = 0; + UINT32 DataOffsetValue; + UINT32 i; - /* The table consist of subtables */ + /* The table consists of subtables */ while (*PFieldList) { + /* Compile the common subtable header */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhatHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } + TableOffset += Subtable->Length; + DbgPrint (ASL_DEBUG_OUTPUT, "0 Subtable->Length: %X\n", Subtable->Length); + ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); PhatHeader = ACPI_CAST_PTR (ACPI_PHAT_HEADER, Subtable->Buffer); switch (PhatHeader->Type) { case ACPI_PHAT_TYPE_FW_VERSION_DATA: + /* Compile the middle portion of the Firmware Version Data */ + Info = AcpiDmTableInfoPhat0; PhatHeader->Length = sizeof (ACPI_PHAT_VERSION_DATA); + DataOffsetField = NULL; break; case ACPI_PHAT_TYPE_FW_HEALTH_DATA: + DbgPrint (ASL_DEBUG_OUTPUT, "1 Offset: %X, Name: \"%s\" Length: %X\n", + (*PFieldList)->TableOffset, (*PFieldList)->Name, Subtable->Length); + + DataOffsetField = *PFieldList; + + /* Walk the field list to get to the "Device-specific data Offset" field */ + + TableOffset = sizeof (ACPI_PHAT_HEALTH_DATA); + for (i = 0; i < 3; i++) + { + DataOffsetField = DataOffsetField->Next; + DbgPrint (ASL_DEBUG_OUTPUT, "2 Offset: %X, Name: \"%s\" Length: %X Value: %s:\n", + TableOffset, DataOffsetField->Name, DataOffsetField->StringLength, DataOffsetField->Value); + } + + /* Convert DataOffsetField->Value (a char * string) to an integer value */ + + sscanf (DataOffsetField->Value, "%X", &DataOffsetValue); + + /* + * Get the next field (Device Path): + * DataOffsetField points to "Device-Specific Offset", next field is + * "Device Path". + */ + DevicePathField = DataOffsetField->Next; + + /* Compute the size of the input ASCII string as a unicode string (*2 + 2) */ + + DevicePathField->StringLength = (strlen ((const char *) DevicePathField->Value) * 2) + 2; + TableOffset += DevicePathField->StringLength; + + DbgPrint (ASL_DEBUG_OUTPUT, "3 Offset: %X, Length: %X devicepathLength: %X\n", + TableOffset, Subtable->Length, DevicePathField->StringLength); + + /* Set the DataOffsetField to the current TableOffset */ + /* Must set the DataOffsetField here (not later) */ + + if (DataOffsetValue != 0) + { + snprintf (DataOffsetField->Value, Subtable->Length, "%X", TableOffset); + } + + DbgPrint (ASL_DEBUG_OUTPUT, "4 Offset: %X, Length: %X\n", TableOffset, Subtable->Length); + + DbgPrint (ASL_DEBUG_OUTPUT, "5 TableOffset: %X, DataOffsetField->StringLength: " + "%X DevicePathField Length: %X DevicePathField->Value: %s, DataOffsetField->Value: %s DataOffsetField->ByteOffset %X\n", + TableOffset, DataOffsetField->StringLength, DevicePathField->StringLength, + DevicePathField->Value, DataOffsetField->Value, DataOffsetField->ByteOffset); + + /* Compile the middle portion of the Health Data Record */ + Info = AcpiDmTableInfoPhat1; PhatHeader->Length = sizeof (ACPI_PHAT_HEALTH_DATA); break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, *PFieldList, "PHAT"); return (AE_ERROR); - - break; } + /* Compile either the Version Data or the Health Data */ + Status = DtCompileTable (PFieldList, Info, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } + DbgPrint (ASL_DEBUG_OUTPUT, "6 Offset: %X, Name: \"%s\" SubtableLength: %X\n", + TableOffset /* - StartTableOffset*/, (*PFieldList)->Name, Subtable->Length); + ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); switch (PhatHeader->Type) { case ACPI_PHAT_TYPE_FW_VERSION_DATA: VersionData = ACPI_CAST_PTR (ACPI_PHAT_VERSION_DATA, (Subtable->Buffer - sizeof (ACPI_PHAT_HEADER))); RecordCount = VersionData->ElementCount; + /* Compile all of the Version Elements */ + while (RecordCount) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } + ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + TableOffset += Subtable->Length; RecordCount--; PhatHeader->Length += sizeof (ACPI_PHAT_VERSION_ELEMENT); } + + DtPopSubtable (); break; case ACPI_PHAT_TYPE_FW_HEALTH_DATA: - /* Compile device path */ + /* Compile the Device Path */ + + DeviceDataLength = Subtable->Length; + TableOffset += Subtable->Length; + + DbgPrint (ASL_DEBUG_OUTPUT, "7 Device Path Length: %X FieldName: \"%s\" FieldLength: " + "%s FieldValue: %s SubtableLength: %X TableOffset: %X\n", DeviceDataLength, + (*PFieldList)->Name, DataOffsetField->Value, (*PFieldList)->Value, + Subtable->Length, TableOffset); Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + /* *PFieldList will be null if previous field was at the end-of-ParseTree (EOF) */ + + if (!*PFieldList) + { + DbgPrint (ASL_DEBUG_OUTPUT, "8 Exit on end-of-ParseTree\n"); + return (AE_OK); + } + + DbgPrint (ASL_DEBUG_OUTPUT, "9 Device Data Length: %X FieldName: \"%s" + " TableOffset: %X FieldLength: %X Field Value: %s SubtableLength: %X\n", + DeviceDataLength, (*PFieldList)->Name, TableOffset, + (*PFieldList)->StringLength, (*PFieldList)->Value, Subtable->Length); + PhatHeader->Length += (UINT16) Subtable->Length; - /* Compile vendor specific data */ + /* Convert DataOffsetField->Value (a hex char * string) to an integer value */ - Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1b, &Subtable); - if (ACPI_FAILURE (Status)) + sscanf (DataOffsetField->Value, "%X", &DataOffsetValue); + + DbgPrint (ASL_DEBUG_OUTPUT, "10 Device-Specific Offset: %X Table Offset: %X\n", + DataOffsetValue, TableOffset); + if (DataOffsetValue != 0) { - return (Status); + /* Compile Device-Specific Data - only if the Data Offset is non-zero */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1b, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DbgPrint (ASL_DEBUG_OUTPUT, "11 Subtable: %p Table Offset: %X\n", + Subtable, TableOffset); + if (Subtable) + { + DbgPrint (ASL_DEBUG_OUTPUT, "12 Device Specific Offset: " + "%X FieldName \"%s\" SubtableLength %X\n", + DeviceDataLength, DataOffsetField->Name, Subtable->Length); + + DeviceDataLength += Subtable->Length; + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + PhatHeader->Length += (UINT16) Subtable->Length; + } } - ParentTable = DtPeekSubtable (); - DtInsertSubtable (ParentTable, Subtable); - PhatHeader->Length += (UINT16) Subtable->Length; + DtPopSubtable (); + DbgPrint (ASL_DEBUG_OUTPUT, "13 FieldName: \"%s\" FieldLength: %X Field Value: %s\n", + DataOffsetField->Name, DataOffsetField->StringLength, DataOffsetField->Value); break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, *PFieldList, "PHAT"); return (AE_ERROR); } } return (Status); } /****************************************************************************** * * FUNCTION: DtCompilePmtt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile PMTT. * *****************************************************************************/ ACPI_STATUS DtCompilePmtt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; UINT16 Type; /* Main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); /* Subtables */ while (*PFieldList) { SubtableStart = *PFieldList; DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0); switch (Type) { case ACPI_PMTT_TYPE_SOCKET: /* Subtable: Socket Structure */ DbgPrint (ASL_DEBUG_OUTPUT, "Compile PMTT_TYPE_SOCKET (0)\n"); Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } break; case ACPI_PMTT_TYPE_CONTROLLER: /* Subtable: Memory Controller Structure */ DbgPrint (ASL_DEBUG_OUTPUT, "Compile PMTT_TYPE_CONTROLLER (1)\n"); Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } break; case ACPI_PMTT_TYPE_DIMM: /* Subtable: Physical Component (DIMM) Structure */ DbgPrint (ASL_DEBUG_OUTPUT, "Compile PMTT_TYPE_DIMM (2)\n"); Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } break; case ACPI_PMTT_TYPE_VENDOR: /* Subtable: Vendor-specific Structure */ DbgPrint (ASL_DEBUG_OUTPUT, "Compile PMTT_TYPE_VENDOR(FF)\n"); Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttVendor, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT"); return (AE_ERROR); } DtInsertSubtable (ParentTable, Subtable); } return (Status); } /****************************************************************************** * * FUNCTION: DtCompilePptt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile PPTT. * *****************************************************************************/ ACPI_STATUS DtCompilePptt ( void **List) { ACPI_STATUS Status; ACPI_SUBTABLE_HEADER *PpttHeader; ACPI_PPTT_PROCESSOR *PpttProcessor = NULL; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_TABLE_HEADER *PpttAcpiHeader; ParentTable = DtPeekSubtable (); while (*PFieldList) { SubtableStart = *PFieldList; /* Compile PPTT subtable header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPpttHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); PpttHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); PpttHeader->Length = (UINT8)(Subtable->Length); switch (PpttHeader->Type) { case ACPI_PPTT_TYPE_PROCESSOR: InfoTable = AcpiDmTableInfoPptt0; break; case ACPI_PPTT_TYPE_CACHE: InfoTable = AcpiDmTableInfoPptt1; break; case ACPI_PPTT_TYPE_ID: InfoTable = AcpiDmTableInfoPptt2; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PPTT"); return (AE_ERROR); } /* Compile PPTT subtable body */ Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); PpttHeader->Length += (UINT8)(Subtable->Length); /* Compile PPTT subtable additionals */ switch (PpttHeader->Type) { case ACPI_PPTT_TYPE_PROCESSOR: PpttProcessor = ACPI_SUB_PTR (ACPI_PPTT_PROCESSOR, Subtable->Buffer, sizeof (ACPI_SUBTABLE_HEADER)); if (PpttProcessor) { /* Compile initiator proximity domain list */ PpttProcessor->NumberOfPrivResources = 0; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoPptt0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } DtInsertSubtable (ParentTable, Subtable); PpttHeader->Length += (UINT8)(Subtable->Length); PpttProcessor->NumberOfPrivResources++; } } break; case ACPI_PPTT_TYPE_CACHE: PpttAcpiHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, AslGbl_RootTable->Buffer); if (PpttAcpiHeader->Revision < 3) { break; } Status = DtCompileTable (PFieldList, AcpiDmTableInfoPptt1a, &Subtable); DtInsertSubtable (ParentTable, Subtable); PpttHeader->Length += (UINT8)(Subtable->Length); break; default: break; } } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompilePrmt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile PRMT. * *****************************************************************************/ ACPI_STATUS DtCompilePrmt ( void **List) { ACPI_STATUS Status; ACPI_TABLE_PRMT_HEADER *PrmtHeader; ACPI_PRMT_MODULE_INFO *PrmtModuleInfo; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 i, j; ParentTable = DtPeekSubtable (); /* Compile PRMT subtable header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); PrmtHeader = ACPI_CAST_PTR (ACPI_TABLE_PRMT_HEADER, Subtable->Buffer); for (i = 0; i < PrmtHeader->ModuleInfoCount; i++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtModule, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); PrmtModuleInfo = ACPI_CAST_PTR (ACPI_PRMT_MODULE_INFO, Subtable->Buffer); for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; j++) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtHandler, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); } } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileRgrt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile RGRT. * *****************************************************************************/ ACPI_STATUS DtCompileRgrt ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRgrt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile the "Subtable" -- actually just the binary (PNG) image */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRgrt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileRsdt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile RSDT. * *****************************************************************************/ ACPI_STATUS DtCompileRsdt ( void **List) { DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD *FieldList = *(DT_FIELD **) List; UINT32 Address; ParentTable = DtPeekSubtable (); while (FieldList) { DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO); DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable); DtInsertSubtable (ParentTable, Subtable); FieldList = FieldList->Next; } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileS3pt * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile S3PT (Pointed to by FPDT) * *****************************************************************************/ ACPI_STATUS DtCompileS3pt ( DT_FIELD **PFieldList) { ACPI_STATUS Status; ACPI_FPDT_HEADER *S3ptHeader; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; DT_FIELD *SubtableStart; Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt, &AslGbl_RootTable); if (ACPI_FAILURE (Status)) { return (Status); } DtPushSubtable (AslGbl_RootTable); while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer); switch (S3ptHeader->Type) { case ACPI_S3PT_TYPE_RESUME: InfoTable = AcpiDmTableInfoS3pt0; break; case ACPI_S3PT_TYPE_SUSPEND: InfoTable = AcpiDmTableInfoS3pt1; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileSdev * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile SDEV. * *****************************************************************************/ ACPI_STATUS DtCompileSdev ( void **List) { ACPI_STATUS Status; ACPI_SDEV_HEADER *SdevHeader; ACPI_SDEV_HEADER *SecureComponentHeader; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *SecureComponentInfoTable = NULL; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_SDEV_PCIE *Pcie = NULL; ACPI_SDEV_NAMESPACE *Namesp = NULL; UINT32 EntryCount; ACPI_SDEV_SECURE_COMPONENT *SecureComponent = NULL; UINT16 ComponentLength = 0; /* Subtables */ while (*PFieldList) { /* Compile common SDEV subtable header */ SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdevHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); SdevHeader = ACPI_CAST_PTR (ACPI_SDEV_HEADER, Subtable->Buffer); SdevHeader->Length = (UINT8)(sizeof (ACPI_SDEV_HEADER)); switch (SdevHeader->Type) { case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: InfoTable = AcpiDmTableInfoSdev0; Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable->Buffer); SecureComponent = ACPI_CAST_PTR (ACPI_SDEV_SECURE_COMPONENT, ACPI_ADD_PTR (UINT8, Subtable->Buffer, sizeof(ACPI_SDEV_NAMESPACE))); break; case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: InfoTable = AcpiDmTableInfoSdev1; Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable->Buffer); break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SDEV"); return (AE_ERROR); } /* Compile SDEV subtable body */ Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Optional data fields are appended to the main subtable body */ switch (SdevHeader->Type) { case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: /* * Device Id Offset will be be calculated differently depending on * the presence of secure access components. */ Namesp->DeviceIdOffset = 0; ComponentLength = 0; /* If the secure access component exists, get the structures */ if (SdevHeader->Flags & ACPI_SDEV_SECURE_COMPONENTS_PRESENT) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev0b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Namesp->DeviceIdOffset += sizeof (ACPI_SDEV_SECURE_COMPONENT); /* Compile a secure access component header */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdevSecCompHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile the secure access component */ SecureComponentHeader = ACPI_CAST_PTR (ACPI_SDEV_HEADER, Subtable->Buffer); switch (SecureComponentHeader->Type) { case ACPI_SDEV_TYPE_ID_COMPONENT: SecureComponentInfoTable = AcpiDmTableInfoSdevSecCompId; Namesp->DeviceIdOffset += sizeof (ACPI_SDEV_ID_COMPONENT); ComponentLength = sizeof (ACPI_SDEV_ID_COMPONENT); break; case ACPI_SDEV_TYPE_MEM_COMPONENT: SecureComponentInfoTable = AcpiDmTableInfoSdevSecCompMem; Namesp->DeviceIdOffset += sizeof (ACPI_SDEV_MEM_COMPONENT); ComponentLength = sizeof (ACPI_SDEV_MEM_COMPONENT); break; default: /* Any other secure component types are undefined */ return (AE_ERROR); } Status = DtCompileTable (PFieldList, SecureComponentInfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); SecureComponent->SecureComponentOffset = sizeof (ACPI_SDEV_NAMESPACE) + sizeof (ACPI_SDEV_SECURE_COMPONENT); SecureComponent->SecureComponentLength = ComponentLength; /* * Add the secure component to the subtable to be added for the * the namespace subtable's length */ ComponentLength += sizeof (ACPI_SDEV_SECURE_COMPONENT); } /* Append DeviceId namespace string */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev0a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Namesp->DeviceIdOffset += sizeof (ACPI_SDEV_NAMESPACE); Namesp->DeviceIdLength = (UINT16) Subtable->Length; /* Append Vendor data */ Namesp->VendorDataLength = 0; Namesp->VendorDataOffset = 0; if (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Namesp->VendorDataOffset = Namesp->DeviceIdOffset + Namesp->DeviceIdLength; Namesp->VendorDataLength = (UINT16) Subtable->Length; /* Final size of entire namespace structure */ SdevHeader->Length = (UINT16)(sizeof(ACPI_SDEV_NAMESPACE) + Subtable->Length + Namesp->DeviceIdLength) + ComponentLength; } } break; case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: /* Append the PCIe path info first */ EntryCount = 0; while (*PFieldList && !strcmp ((*PFieldList)->Name, "Device")) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (!Subtable) { DtPopSubtable (); break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); EntryCount++; } /* Path offset will point immediately after the main subtable */ Pcie->PathOffset = sizeof (ACPI_SDEV_PCIE); Pcie->PathLength = (UINT16) (EntryCount * sizeof (ACPI_SDEV_PCIE_PATH)); /* Append the Vendor Data last */ Pcie->VendorDataLength = 0; Pcie->VendorDataOffset = 0; if (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1b, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } if (Subtable) { ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Pcie->VendorDataOffset = Pcie->PathOffset + Pcie->PathLength; Pcie->VendorDataLength = (UINT16) Subtable->Length; } } SdevHeader->Length = sizeof (ACPI_SDEV_PCIE) + Pcie->PathLength + Pcie->VendorDataLength; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SDEV"); return (AE_ERROR); } DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileSlic * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile SLIC. * *****************************************************************************/ ACPI_STATUS DtCompileSlic ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileSlit * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile SLIT. * *****************************************************************************/ ACPI_STATUS DtCompileSlit ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *FieldList; DT_FIELD *EndOfFieldList = NULL; UINT32 Localities; UINT32 LocalityListLength; UINT8 *LocalityBuffer; Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer); LocalityBuffer = UtLocalCalloc (Localities); LocalityListLength = 0; /* Compile each locality buffer */ FieldList = *PFieldList; while (FieldList) { DtCompileBuffer (LocalityBuffer, FieldList->Value, FieldList, Localities); LocalityListLength++; DtCreateSubtable (LocalityBuffer, Localities, &Subtable); DtInsertSubtable (ParentTable, Subtable); EndOfFieldList = FieldList; FieldList = FieldList->Next; } if (LocalityListLength != Localities) { sprintf(AslGbl_MsgBuffer, "Found %u entries, must match LocalityCount: %u", LocalityListLength, Localities); DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); ACPI_FREE (LocalityBuffer); return (AE_LIMIT); } ACPI_FREE (LocalityBuffer); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileSrat * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile SRAT. * *****************************************************************************/ ACPI_STATUS DtCompileSrat ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_SUBTABLE_HEADER *SratHeader; ACPI_DMTABLE_INFO *InfoTable; Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); switch (SratHeader->Type) { case ACPI_SRAT_TYPE_CPU_AFFINITY: InfoTable = AcpiDmTableInfoSrat0; break; case ACPI_SRAT_TYPE_MEMORY_AFFINITY: InfoTable = AcpiDmTableInfoSrat1; break; case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: InfoTable = AcpiDmTableInfoSrat2; break; case ACPI_SRAT_TYPE_GICC_AFFINITY: InfoTable = AcpiDmTableInfoSrat3; break; case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY: InfoTable = AcpiDmTableInfoSrat4; break; case ACPI_SRAT_TYPE_GENERIC_AFFINITY: InfoTable = AcpiDmTableInfoSrat5; break; case ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY: InfoTable = AcpiDmTableInfoSrat6; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileStao * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile STAO. * *****************************************************************************/ ACPI_STATUS DtCompileStao ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_STATUS Status; /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoStao, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile each ASCII namestring as a subtable */ while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoStaoStr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileSvkl * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile SVKL. * * NOTES: SVKL is essentially a flat table, with a small main table and * a variable number of a single type of subtable. * *****************************************************************************/ ACPI_STATUS DtCompileSvkl ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_STATUS Status; /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSvkl, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Compile each subtable */ while (*PFieldList) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoSvkl0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileTcpa * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile TCPA. * *****************************************************************************/ ACPI_STATUS DtCompileTcpa ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; ACPI_TABLE_TCPA_HDR *TcpaHeader; DT_SUBTABLE *ParentTable; ACPI_STATUS Status; /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* * Examine the PlatformClass field to determine the table type. * Either a client or server table. Only one. */ TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer); switch (TcpaHeader->PlatformClass) { case ACPI_TCPA_CLIENT_TABLE: Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient, &Subtable); break; case ACPI_TCPA_SERVER_TABLE: Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer, &Subtable); break; default: AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n", TcpaHeader->PlatformClass); Status = AE_ERROR; break; } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileTpm2Rev3 * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile TPM2 revision 3 * *****************************************************************************/ static ACPI_STATUS DtCompileTpm2Rev3 ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; ACPI_TABLE_TPM23 *Tpm23Header; DT_SUBTABLE *ParentTable; ACPI_STATUS Status = AE_OK; Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23, &Subtable); ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Tpm23Header = ACPI_CAST_PTR (ACPI_TABLE_TPM23, ParentTable->Buffer); /* Subtable type depends on the StartMethod */ switch (Tpm23Header->StartMethod) { case ACPI_TPM23_ACPI_START_METHOD: /* Subtable specific to to ARM_SMC */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); break; default: break; } return (Status); } /****************************************************************************** * * FUNCTION: DtCompileTpm2 * * PARAMETERS: PFieldList - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile TPM2. * *****************************************************************************/ ACPI_STATUS DtCompileTpm2 ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; ACPI_TABLE_TPM2 *Tpm2Header; DT_SUBTABLE *ParentTable; ACPI_STATUS Status = AE_OK; ACPI_TABLE_HEADER *Header; ParentTable = DtPeekSubtable (); Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); if (Header->Revision == 3) { return (DtCompileTpm2Rev3 (List)); } /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Tpm2Header = ACPI_CAST_PTR (ACPI_TABLE_TPM2, ParentTable->Buffer); /* Method parameters */ /* Optional: Log area minimum length */ /* Optional: Log area start address */ /* TBD: Optional fields above not fully implemented (not optional at this time) */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm2a, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Subtable type depends on the StartMethod */ switch (Tpm2Header->StartMethod) { case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC: /* Subtable specific to to ARM_SMC */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm211, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); break; case ACPI_TPM2_START_METHOD: case ACPI_TPM2_MEMORY_MAPPED: case ACPI_TPM2_COMMAND_BUFFER: case ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD: break; case ACPI_TPM2_RESERVED1: case ACPI_TPM2_RESERVED3: case ACPI_TPM2_RESERVED4: case ACPI_TPM2_RESERVED5: case ACPI_TPM2_RESERVED9: case ACPI_TPM2_RESERVED10: AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n", Tpm2Header->StartMethod); Status = AE_ERROR; break; case ACPI_TPM2_NOT_ALLOWED: default: AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n", Tpm2Header->StartMethod); Status = AE_ERROR; break; } return (Status); } /****************************************************************************** * * FUNCTION: DtGetGenericTableInfo * * PARAMETERS: Name - Generic type name * * RETURN: Info entry * * DESCRIPTION: Obtain table info for a generic name entry * *****************************************************************************/ ACPI_DMTABLE_INFO * DtGetGenericTableInfo ( char *Name) { ACPI_DMTABLE_INFO *Info; UINT32 i; if (!Name) { return (NULL); } /* Search info table for name match */ for (i = 0; ; i++) { Info = AcpiDmTableInfoGeneric[i]; if (Info->Opcode == ACPI_DMT_EXIT) { Info = NULL; break; } /* Use caseless compare for generic keywords */ if (!AcpiUtStricmp (Name, Info->Name)) { break; } } return (Info); } /****************************************************************************** * * FUNCTION: DtCompileUefi * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile UEFI. * *****************************************************************************/ ACPI_STATUS DtCompileUefi ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; UINT16 *DataOffset; /* Compile the predefined portion of the UEFI table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DataOffset = (UINT16 *) (Subtable->Buffer + 16); *DataOffset = sizeof (ACPI_TABLE_UEFI); ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* * Compile the "generic" portion of the UEFI table. This * part of the table is not predefined and any of the generic * operators may be used. */ DtCompileGeneric ((void **) PFieldList, NULL, NULL); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileViot * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile VIOT. * *****************************************************************************/ ACPI_STATUS DtCompileViot ( void **List) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_TABLE_VIOT *Viot; ACPI_VIOT_HEADER *ViotHeader; ACPI_DMTABLE_INFO *InfoTable; UINT16 NodeCount; ParentTable = DtPeekSubtable (); Status = DtCompileTable (PFieldList, AcpiDmTableInfoViot, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } DtInsertSubtable (ParentTable, Subtable); /* * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HEADER fields. */ Viot = ACPI_SUB_PTR (ACPI_TABLE_VIOT, Subtable->Buffer, sizeof (ACPI_TABLE_HEADER)); Viot->NodeOffset = sizeof (ACPI_TABLE_VIOT); NodeCount = 0; while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoViotHeader, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); ViotHeader = ACPI_CAST_PTR (ACPI_VIOT_HEADER, Subtable->Buffer); switch (ViotHeader->Type) { case ACPI_VIOT_NODE_PCI_RANGE: InfoTable = AcpiDmTableInfoViot1; break; case ACPI_VIOT_NODE_MMIO: InfoTable = AcpiDmTableInfoViot2; break; case ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI: InfoTable = AcpiDmTableInfoViot3; break; case ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO: InfoTable = AcpiDmTableInfoViot4; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "VIOT"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPopSubtable (); NodeCount++; } Viot->NodeCount = NodeCount; return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileWdat * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile WDAT. * *****************************************************************************/ ACPI_STATUS DtCompileWdat ( void **List) { ACPI_STATUS Status; Status = DtCompileTwoSubtables (List, AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0); return (Status); } /****************************************************************************** * * FUNCTION: DtCompileWpbt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile WPBT. * *****************************************************************************/ ACPI_STATUS DtCompileWpbt ( void **List) { DT_FIELD **PFieldList = (DT_FIELD **) List; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; ACPI_TABLE_WPBT *Table; ACPI_STATUS Status; /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer); /* * Exit now if there are no arguments specified. This is indicated by: * The "Command-line Arguments" field has not been specified (if specified, * it will be the last field in the field list -- after the main table). * Set the Argument Length in the main table to zero. */ if (!*PFieldList) { Table->ArgumentsLength = 0; return (AE_OK); } /* Compile the argument list subtable */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); } /* Extract the length of the Arguments buffer, insert into main table */ Table->ArgumentsLength = (UINT16) Subtable->TotalLength; DtInsertSubtable (ParentTable, Subtable); return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileXsdt * * PARAMETERS: List - Current field list pointer * * RETURN: Status * * DESCRIPTION: Compile XSDT. * *****************************************************************************/ ACPI_STATUS DtCompileXsdt ( void **List) { DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD *FieldList = *(DT_FIELD **) List; UINT64 Address; ParentTable = DtPeekSubtable (); while (FieldList) { DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO); DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable); DtInsertSubtable (ParentTable, Subtable); FieldList = FieldList->Next; } return (AE_OK); } /****************************************************************************** * * FUNCTION: DtCompileGeneric * * PARAMETERS: List - Current field list pointer * Name - Field name to end generic compiling * Length - Compiled table length to return * * RETURN: Status * * DESCRIPTION: Compile generic unknown table. * *****************************************************************************/ ACPI_STATUS DtCompileGeneric ( void **List, char *Name, UINT32 *Length) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; ACPI_DMTABLE_INFO *Info; ParentTable = DtPeekSubtable (); /* * Compile the "generic" portion of the table. This * part of the table is not predefined and any of the generic * operators may be used. */ /* Find any and all labels in the entire generic portion */ DtDetectAllLabels (*PFieldList); /* Now we can actually compile the parse tree */ if (Length && *Length) { *Length = 0; } while (*PFieldList) { if (Name && !strcmp ((*PFieldList)->Name, Name)) { break; } Info = DtGetGenericTableInfo ((*PFieldList)->Name); if (!Info) { sprintf (AslGbl_MsgBuffer, "Generic data type \"%s\" not found", (*PFieldList)->Name); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, (*PFieldList), AslGbl_MsgBuffer); *PFieldList = (*PFieldList)->Next; continue; } Status = DtCompileTable (PFieldList, Info, &Subtable); if (ACPI_SUCCESS (Status)) { DtInsertSubtable (ParentTable, Subtable); if (Length) { *Length += Subtable->Length; } } else { *PFieldList = (*PFieldList)->Next; if (Status == AE_NOT_FOUND) { sprintf (AslGbl_MsgBuffer, "Generic data type \"%s\" not found", (*PFieldList)->Name); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, (*PFieldList), AslGbl_MsgBuffer); } } } return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h index ad5af70748dc..3ab99978ab07 100644 --- a/sys/contrib/dev/acpica/compiler/dttemplate.h +++ b/sys/contrib/dev/acpica/compiler/dttemplate.h @@ -1,2068 +1,2119 @@ /****************************************************************************** * * Module Name: dttemplate.h - ACPI table template definitions * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __DTTEMPLATE_H #define __DTTEMPLATE_H /* Templates for ACPI data tables */ const unsigned char TemplateAest[] = { 0x41,0x45,0x53,0x54,0xCC,0x02,0x00,0x00, /* 00000000 "AEST...." */ 0x01,0x2A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".*INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x04,0x06,0x21,0x20,0x00,0x80,0x00,0x00, /* 00000020 "..! ...." */ 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000028 ",...D..." */ 0x74,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "t......." */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000038 "....gE#." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0xCD,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000058 "....gE#." */ 0x33,0x33,0x22,0x22,0x00,0x00,0x00,0x00, /* 00000060 "33""...." */ 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000068 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000070 "....gE#." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 00000098 ".......x" */ 0x56,0x00,0x00,0x00,0x00,0x74,0x00,0x00, /* 000000A0 "V....t.." */ 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 000000A8 ",...D..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000B8 "....gE#." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x11,0x11,0x00,0x00,0x01,0x00,0x01,0x00, /* 000000D0 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000D8 "....gE#." */ 0x67,0x67,0x67,0x67,0x00,0x00,0x00,0x00, /* 000000E0 "gggg...." */ 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000E8 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000F0 "....gE#." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x01,0x60,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000118 ".`..,..." */ 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "0......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000138 "........" */ 0x67,0x45,0x23,0x01,0xAA,0xAA,0x00,0x00, /* 00000140 "gE#....." */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000148 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000150 "....gE#." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000170 "........" */ 0x02,0x64,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000178 ".d..,..." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "4......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000190 "........" */ 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000198 "........" */ 0x67,0x45,0x23,0x01,0x55,0x55,0x55,0x55, /* 000001A0 "gE#.UUUU" */ 0x66,0x66,0x66,0x66,0x01,0x00,0x00,0x00, /* 000001A8 "ffff...." */ 0x03,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 000001B0 "........" */ 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 000001B8 "gE#....." */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 000001D0 "........" */ 0x00,0x00,0x00,0x00,0x03,0x74,0x00,0x00, /* 000001D8 ".....t.." */ 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 000001E0 ",...D..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000200 "....gE#." */ 0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000208 "3333DDDD" */ 0x12,0x23,0x34,0x45,0x56,0x67,0x78,0x89, /* 00000210 ".#4EVgx." */ 0x9A,0xAB,0xBC,0xCD,0xDE,0xEF,0xFF,0x55, /* 00000218 ".......U" */ 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000220 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000228 "....gE#." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000230 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000238 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000248 "........" */ 0x04,0x7C,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000250 ".|..,..." */ 0x34,0x00,0x00,0x00,0x64,0x00,0x00,0x00, /* 00000258 "4...d..." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000268 "........" */ 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000270 "........" */ 0x67,0x45,0x23,0x01,0x03,0x00,0x00,0x00, /* 00000278 "gE#....." */ 0x88,0x88,0x77,0x77,0x00,0x00,0x00,0x00, /* 00000280 "..ww...." */ 0x03,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000288 "........" */ 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 00000290 "gE#....." */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000298 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002A0 "........" */ 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 000002A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002B0 "........" */ 0xBB,0xBB,0xAA,0xAA,0xCC,0x00,0x00,0x00, /* 000002B8 "........" */ 0x01,0x00,0x00,0x01,0xEF,0xCD,0xAB,0x78, /* 000002C0 ".......x" */ 0x56,0x00,0x00,0x00 /* 000002C8 "V..." */ }; const unsigned char TemplateAgdi[] = { 0x41,0x47,0x44,0x49,0x30,0x00,0x00,0x00, /* 00000000 "AGDI0..." */ 0x01,0xE4,0x41,0x4D,0x50,0x45,0x52,0x45, /* 00000008 "..AMPERE" */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x05,0x01,0x21,0x20,0x00,0x00,0x00,0x00, /* 00000020 "..! ...." */ 0x01,0x00,0x00,0x40,0x00,0x00,0x00,0x00 /* 00000028 "...@...." */ }; const unsigned char TemplateApmt[] = { 0x41,0x50,0x4D,0x54,0x94,0x00,0x00,0x00, /* 00000000 "APMT...." */ 0x00,0x79,0x4E,0x56,0x49,0x44,0x49,0x41, /* 00000008 ".yNVIDIA" */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x17,0x12,0x21,0x20,0x38,0x00,0x04,0x03, /* 00000020 "..! 8..." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 ". ......" */ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 ". ......" */ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x6B,0x03,0x00,0x00,0x38,0x00,0x06,0x03, /* 00000058 "k...8..." */ 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 ".0......" */ 0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 ".0......" */ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */ 0x6B,0x03,0x00,0x00 /* 00000090 "k..." */ }; const unsigned char TemplateAsf[] = { 0x41,0x53,0x46,0x21,0x72,0x00,0x00,0x00, /* 00000000 "ASF!r..." */ 0x10,0x0B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x10,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x00, /* 00000030 "........" */ 0x00,0x00,0x01,0x0C,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x02,0x00,0x0C,0x00,0x01,0x04,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x84,0x00,0x07,0x00,0x00, /* 00000068 "........" */ 0x01,0x00 /* 00000070 ".." */ }; const unsigned char TemplateBdat[] = { 0x42,0x44,0x41,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BDAT0..." */ 0x01,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x31,0x03,0x21,0x20,0x01,0x08,0x00,0x01, /* 00000020 "1.! ...." */ 0xF0,0xDE,0xBC,0x9A,0x78,0x56,0x34,0x12 /* 00000028 "....xV4." */ }; const unsigned char TemplateBgrt[] = { 0x42,0x47,0x52,0x54,0x38,0x00,0x00,0x00, /* 00000000 "BGRT8..." */ 0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x23,0x06,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */ }; const unsigned char TemplateBert[] = { 0x42,0x45,0x52,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BERT0..." */ 0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */ }; const unsigned char TemplateBoot[] = { 0x42,0x4F,0x4F,0x54,0x28,0x00,0x00,0x00, /* 00000000 "BOOT(..." */ 0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x04,0x06,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ }; +const unsigned char TemplateCcel[] = +{ + 0x43,0x43,0x45,0x4C,0x38,0x00,0x00,0x00, /* 00000000 "CCEL8..." */ + 0x04,0x1C,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ + 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x30,0x09,0x21,0x20,0x00,0x00,0x00,0x00, /* 00000020 "0.! ...." */ + 0xEF,0xCD,0xAB,0x78,0x56,0x34,0x12,0x00, /* 00000028 "...xV4.." */ + 0x78,0x56,0x34,0x12,0xEF,0xCD,0xAB,0x00 /* 00000030 "xV4....." */ +}; + const unsigned char TemplateCedt[] = { 0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */ 0x01,0x87,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ 0x17,0x12,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ 0x00,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000028 ".^......" */ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000038 "..... .." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ 0x01,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".^......" */ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000050 "..... .." */ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000058 "..... .." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ 0x02,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".^......" */ 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, /* 00000070 ".....0.." */ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000078 "..... .." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000080 "...... ." */ 0x03,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000088 ".^......" */ 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 00000090 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000098 "..... .." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x00, /* 000000a0 "......(." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000c0 "........" */ 0x00,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000c8 ".^....(." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000e8 "........" */ 0x01,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000f0 ".^....(." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000110 "........" */ 0x02,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 00000118 ".^....(." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000138 "........" */ 0x03,0x5e,0xba,0x00,0x01,0x00,0x2c,0x00, /* 00000140 ".^....,." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000160 "........" */ 0x00,0x5e,0xba,0x00,0x01,0x5e,0xba,0x00, /* 00000160 ".^...^.." */ 0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x00, /* 00000170 "..,....." */ 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000180 "........" */ 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000188 "........" */ 0x0a,0x00,0x01,0x00,0x02,0x5e,0xba,0x00, /* 00000190 ".....^.." */ 0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */ }; +const unsigned char TemplateCdat[] = +{ + 0xE4,0x00,0x00,0x00,0x01,0x0C,0x00,0x00, /* 00000000 "........" */ + 0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, /* 00000008 "........" */ + 0x03,0x00,0x08,0x00,0x04,0x56,0x00,0x00, /* 00000010 ".....V.." */ + 0x00,0x00,0x18,0x00,0xEF,0x01,0x00,0x00, /* 00000018 "........" */ + 0x89,0x67,0x45,0x23,0x01,0x00,0x00,0x00, /* 00000020 ".gE#...." */ + 0xAB,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x03,0x00,0x08,0x00,0x04,0x56,0x00,0x00, /* 00000030 ".....V.." */ + 0x01,0x00,0x18,0x00,0x44,0x04,0x64,0x00, /* 00000038 "....D.d." */ + 0xCD,0xAB,0x89,0x67,0x45,0x23,0x01,0x00, /* 00000040 "...gE#.." */ + 0x33,0x22,0x44,0x33,0x55,0x44,0x00,0x00, /* 00000048 "3"D3UD.." */ + 0x02,0x00,0x14,0x00,0x99,0x00,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x78,0x56,0x34,0x12, /* 00000058 "....xV4." */ + 0x55,0x55,0x44,0x44,0x04,0x00,0x18,0x00, /* 00000060 "UUDD...." */ + 0x88,0x32,0x00,0x00,0x77,0x77,0x77,0x77, /* 00000068 ".2..wwww" */ + 0x11,0x11,0x11,0x11,0x88,0x88,0x88,0x88, /* 00000070 "........" */ + 0x22,0x22,0x22,0x22,0x05,0x00,0x20,0x00, /* 00000078 """"".. ." */ + 0x04,0x00,0x00,0x00,0x44,0x44,0x44,0x44, /* 00000080 "....DDDD" */ + 0x33,0x33,0x33,0x33,0x44,0x44,0x55,0x55, /* 00000088 "3333DDUU" */ + 0x66,0x66,0x00,0x00,0x77,0x77,0x88,0x88, /* 00000090 "ff..ww.." */ + 0x99,0x99,0x00,0x00,0x05,0x00,0x18,0x00, /* 00000098 "........" */ + 0x04,0x00,0x00,0x00,0x22,0x22,0x22,0x22, /* 000000A0 "....""""" */ + 0x11,0x11,0x11,0x11,0x34,0x12,0x56,0x78, /* 000000A8 "....4.Vx" */ + 0x11,0x11,0x00,0x00,0x05,0x00,0x30,0x00, /* 000000B0 "......0." */ + 0x08,0x00,0x00,0x00,0x66,0x66,0x66,0x66, /* 000000B8 "....ffff" */ + 0x55,0x55,0x55,0x55,0x44,0x44,0x55,0x55, /* 000000C0 "UUUUDDUU" */ + 0x66,0x66,0x00,0x00,0x77,0x77,0x88,0x88, /* 000000C8 "ff..ww.." */ + 0x99,0x99,0x00,0x00,0xAA,0xAA,0xBB,0xBB, /* 000000D0 "........" */ + 0xCC,0xCC,0x00,0x00,0x55,0x55,0x44,0x44, /* 000000D8 "....UUDD" */ + 0x33,0x33,0x00,0x00 /* 000000E0 "33.." */ +}; + const unsigned char TemplateCpep[] = { 0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */ 0x01,0x0F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00 /* 00000030 "...." */ }; const unsigned char TemplateCsrt[] = { 0x43,0x53,0x52,0x54,0x4C,0x01,0x00,0x00, /* 00000000 "CSRTL..." */ 0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x14,0x11,0x12,0x20,0x88,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x49,0x4E,0x54,0x4C,0x00,0x00,0x00,0x00, /* 00000028 "INTL...." */ 0x60,0x9C,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000030 "`......." */ 0x1C,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0xA0,0xB3,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x2A,0x00,0x00,0x00,0x02,0x00,0x06,0x20, /* 00000048 "*...... " */ 0x00,0x00,0x10,0x00,0xFF,0x0F,0x00,0x00, /* 00000050 "........" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x01,0x00, /* 00000058 "........" */ 0x53,0x50,0x49,0x20,0x0C,0x00,0x00,0x00, /* 00000060 "SPI ...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x30, /* 00000068 "....CHA0" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000070 "........" */ 0x43,0x48,0x41,0x31,0x0C,0x00,0x00,0x00, /* 00000078 "CHA1...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x32, /* 00000080 "....CHA2" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000088 "........" */ 0x43,0x48,0x41,0x33,0x0C,0x00,0x00,0x00, /* 00000090 "CHA3...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x34, /* 00000098 "....CHA4" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000A0 "........" */ 0x43,0x48,0x41,0x35,0xA0,0x00,0x00,0x00, /* 000000A8 "CHA5...." */ 0x49,0x4E,0x54,0x4C,0x00,0x00,0x00,0x00, /* 000000B0 "INTL...." */ 0x60,0x9C,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000B8 "`......." */ 0x1C,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x2B,0x00,0x00,0x00,0x02,0x00,0x08,0x20, /* 000000D0 "+...... " */ 0x10,0x00,0x10,0x00,0xFF,0x0F,0x00,0x00, /* 000000D8 "........" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x01,0x00, /* 000000E0 "........" */ 0x49,0x32,0x43,0x20,0x0C,0x00,0x00,0x00, /* 000000E8 "I2C ...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x30, /* 000000F0 "....CHA0" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000F8 "........" */ 0x43,0x48,0x41,0x31,0x0C,0x00,0x00,0x00, /* 00000100 "CHA1...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x32, /* 00000108 "....CHA2" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000110 "........" */ 0x43,0x48,0x41,0x33,0x0C,0x00,0x00,0x00, /* 00000118 "CHA3...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x34, /* 00000120 "....CHA4" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000128 "........" */ 0x43,0x48,0x41,0x35,0x0C,0x00,0x00,0x00, /* 00000130 "CHA5...." */ 0x03,0x00,0x00,0x00,0x43,0x48,0x41,0x36, /* 00000138 "....CHA6" */ 0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000140 "........" */ 0x43,0x48,0x41,0x37 /* 00000148 "CHA7" */ }; const unsigned char TemplateDbg2[] = { 0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00, /* 00000000 "DBG2...." */ 0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00, /* 00000020 "... ,..." */ 0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02, /* 00000028 ".....?.." */ 0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..6....." */ 0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00, /* 00000038 "........" */ 0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77, /* 00000040 "...2...w" */ 0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64, /* 00000048 "fUD3"..d" */ 0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC, /* 00000050 "........" */ 0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA, /* 00000058 "...2Tv.." */ 0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69, /* 00000060 "..MyDevi" */ 0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11, /* 00000068 "ce..G..." */ 0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00, /* 00000070 ".&...7.." */ 0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22, /* 00000078 "......."" */ 0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF, /* 00000080 "..d....." */ 0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC, /* 00000088 "........" */ 0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E, /* 00000090 ".\\_SB_." */ 0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47, /* 00000098 "PCI0.DBG" */ 0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46, /* 000000A0 "P.ABCDEF" */ 0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, /* 000000A8 "GHIPQRST" */ 0x55,0x56 /* 000000B0 "UV" */ }; const unsigned char TemplateDbgp[] = { 0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */ 0x01,0x1A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00 /* 00000030 "...." */ }; const unsigned char TemplateDmar[] = { 0x44,0x4D,0x41,0x52,0x9C,0x00,0x00,0x00, /* 00000000 "DMAR...." */ 0x01,0xB8,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x17,0x12,0x21,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "..! /..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x03,0x08,0x00,0x00,0x08,0x00,0x00,0x01, /* 00000040 "........" */ 0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".. ....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x02, /* 00000060 "........" */ 0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x02,0x08,0x00,0x00,0x00,0x00,0x00,0x03, /* 00000070 "........" */ 0x03,0x00,0x14,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x05,0x00,0x10,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x00,0x02 /* 00000098 "...." */ }; const unsigned char TemplateDrtm[] = { 0x44,0x52,0x54,0x4D,0x94,0x00,0x00,0x00, /* 00000000 "DRTM...." */ 0x01,0xB9,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00 /* 00000090 "...." */ }; const unsigned char TemplateEcdt[] = { 0x45,0x43,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "ECDTB..." */ 0x01,0x2D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".-INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x01,0x08,0x00,0x00, /* 00000020 "(.. ...." */ 0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "f......." */ 0x01,0x08,0x00,0x00,0x62,0x00,0x00,0x00, /* 00000030 "....b..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x09,0x00 /* 00000040 ".." */ }; const unsigned char TemplateEinj[] = { 0x45,0x49,0x4E,0x4A,0x30,0x01,0x00,0x00, /* 00000000 "EINJ0..." */ 0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */ 0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */ 0x01,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */ 0x02,0x02,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */ 0x03,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */ 0x04,0x03,0x01,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */ 0x05,0x03,0x01,0x00,0x01,0x10,0x00,0x02, /* 000000D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */ 0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */ 0x07,0x00,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000128 "........" */ }; const unsigned char TemplateErst[] = { 0x45,0x52,0x53,0x54,0x30,0x02,0x00,0x00, /* 00000000 "ERST0..." */ 0x01,0xAB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */ 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */ 0x01,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */ 0x02,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */ 0x03,0x04,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */ 0x04,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */ 0x05,0x03,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */ 0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */ 0x07,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000128 "........" */ 0x08,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000130 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000148 "........" */ 0x09,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000150 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000168 "........" */ 0x0A,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000170 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000188 "........" */ 0x0B,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000190 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001A8 "........" */ 0x0C,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001B0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001C8 "........" */ 0x0D,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001D0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001E8 "........" */ 0x0E,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001F0 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000208 "........" */ 0x0F,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000228 "........" */ }; const unsigned char TemplateFacs[] = { 0x46,0x41,0x43,0x53,0x40,0x00,0x00,0x00, /* 00000000 "FACS@..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000008 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000020 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */ }; /* Version 5 FADT */ const unsigned char TemplateFadt[] = { 0x46,0x41,0x43,0x50,0x14,0x01,0x00,0x00, /* 00000000 "FACP...." */ 0x06,0x8A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x04,0x02,0x01,0x04,0x08,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 000000A8 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */ 0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01, /* 000000D8 ".....@.." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x01,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x00,0x00,0x00,0x00 /* 00000110 "...." */ }; const unsigned char TemplateFpdt[] = { 0x46,0x50,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "FPDTd..." */ 0x01,0xBD,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x04,0x08,0x11,0x20,0x00,0x00,0x30,0x01, /* 00000020 "... ..0." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x01, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00 /* 00000060 "...." */ }; const unsigned char TemplateGtdt[] = { 0x47,0x54,0x44,0x54,0xE8,0x00,0x00,0x00, /* 00000000 "GTDT...." */ 0x03,0x5D,0x4C,0x49,0x4E,0x41,0x52,0x4F, /* 00000008 ".]LINARO" */ 0x52,0x54,0x53,0x4D,0x56,0x45,0x56,0x38, /* 00000010 "RTSMVEV8" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x08,0x01,0x19,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x1D,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x1E,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */ 0x1B,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ 0x1A,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000058 "....`..." */ 0x43,0x00,0x00,0x00,0x21,0x00,0x00,0x00, /* 00000060 "C...!..." */ 0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".d......" */ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000070 "........" */ 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x01,0x1C,0x00,0x00, /* 000000C8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00 /* 000000E0 "........" */ }; const unsigned char TemplateHest[] = { 0x48,0x45,0x53,0x54,0x7C,0x02,0x00,0x00, /* 00000000 "HEST|..." */ 0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x03,0x03,0x17,0x20,0x04,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 000000F0 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000120 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x09,0x00,0x02,0x00, /* 00000150 "........" */ 0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000158 "........" */ 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000160 "........" */ 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000168 ".@......" */ 0x00,0x00,0x00,0x00,0x03,0x1C,0x00,0x00, /* 00000170 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ 0x00,0x10,0x00,0x00,0x09,0x00,0x03,0x00, /* 00000190 "........" */ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000198 "........" */ 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001A0 "........" */ 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001A8 ".@......" */ 0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ 0x00,0x10,0x00,0x00,0x0A,0x00,0x03,0x00, /* 000001D0 "........" */ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 000001D8 "........" */ 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001E0 "........" */ 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001E8 ".@......" */ 0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */ 0x00,0x10,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */ 0x0B,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000230 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000238 "........" */ 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000248 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000258 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000268 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000270 "........" */ 0x00,0x00,0x00,0x00 /* 00000278 "...." */ }; const unsigned char TemplateHmat[] = { 0x48,0x4D,0x41,0x54,0x9C,0x00,0x00,0x00, /* 00000000 "HMAT...." */ 0x02,0x4D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".MINTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x08,0x01,0x19,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00, /* 00000028 "....(..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x01,0x00,0x00,0x00,0x2A,0x00,0x00,0x00, /* 00000050 "....*..." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x02,0x00,0x00,0x00,0x22,0x00, /* 00000078 "......"." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x01,0x00,0x00,0x00 /* 00000098 "...." */ }; const unsigned char TemplateHpet[] = { 0x48,0x50,0x45,0x54,0x38,0x00,0x00,0x00, /* 00000000 "HPET8..." */ 0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */ }; const unsigned char TemplateIort[] = { 0x49,0x4F,0x52,0x54,0x3C,0x02,0x00,0x00, /* 00000000 "IORT<..." */ 0x05,0xCB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x17,0x12,0x21,0x20,0x07,0x00,0x00,0x00, /* 00000020 "..! ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ 0x49,0x4F,0x52,0x54,0x00,0x18,0x00,0x01, /* 00000030 "IORT...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x04, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ 0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "l......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x5C,0x5F,0x53,0x42,0x2E,0x50,0x43, /* 00000068 ".\_SB.PC" */ 0x49,0x30,0x2E,0x44,0x45,0x56,0x30,0x00, /* 00000070 "I0.DEV0." */ 0x49,0x4F,0x52,0x54,0x3C,0x02,0x00,0x00, /* 00000078 "IORT<..." */ 0x03,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000080 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000088 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000090 "....INTL" */ 0x05,0x01,0x21,0x20,0x07,0x00,0x00,0x00, /* 00000098 "..! ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "4......." */ 0x49,0x4F,0x52,0x54,0x00,0x18,0x00,0x01, /* 000000A8 "IORT...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x02,0x38,0x00,0x04, /* 000000C8 ".....8.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D0 "........" */ 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "$......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x03, /* 00000100 ".....`.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000108 "........" */ 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "L......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /* 00000128 "....<..." */ 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 00000130 "....L..." */ 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 00000138 "....L..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x04,0x58,0x00,0x04, /* 00000160 ".....X.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000168 "........" */ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "D......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000190 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B0 "........" */ 0x00,0x00,0x00,0x00,0x05,0x3C,0x00,0x02, /* 000001B8 ".....<.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001C0 "........" */ 0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "(......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001F0 "........" */ 0x06,0x44,0x00,0x03,0x00,0x00,0x00,0x00, /* 000001F8 ".D......" */ 0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000200 "....0..." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000208 "........" */ 0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000210 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000230 "........" */ 0x00,0x00,0x00,0x00 /* 00000238 "...." */ }; const unsigned char TemplateIvrs[] = { 0x49,0x56,0x52,0x53,0x10,0x02,0x00,0x00, /* 00000000 "IVRS...." */ 0x02,0x6C,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".lINTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x31,0x03,0x21,0x20,0x41,0x30,0x20,0x00, /* 00000020 "1.! A0 ." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x10,0xB0,0x64,0x00,0x02,0x00,0x40,0x00, /* 00000030 "..d...@." */ 0x00,0x00,0xF0,0xFD,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x6F,0x8F,0x04,0x80, /* 00000040 "....o..." */ 0x03,0x08,0x00,0x00,0x01,0x08,0x00,0x00, /* 00000048 "........" */ 0x02,0x08,0x00,0x00,0x04,0xFE,0xFF,0x00, /* 00000050 "........" */ 0x42,0x00,0xFF,0x00,0x00,0xA5,0x00,0x00, /* 00000058 "B......." */ 0x43,0x00,0xFF,0x00,0x00,0xA5,0x00,0x00, /* 00000060 "C......." */ 0x46,0x00,0xFF,0x00,0x44,0x33,0x22,0x11, /* 00000068 "F...D3"." */ 0x47,0x00,0xFF,0x00,0x44,0x33,0x22,0x11, /* 00000070 "G...D3"." */ 0x04,0xFF,0xFF,0x00,0x48,0x00,0x00,0x00, /* 00000078 "....H..." */ 0x00,0xA0,0x00,0x02,0x48,0x00,0x00,0xD7, /* 00000080 "....H..." */ 0x21,0xA0,0x00,0x01,0x48,0x00,0x00,0x00, /* 00000088 "!...H..." */ 0x22,0x01,0x00,0x01,0x11,0xB0,0x48,0x00, /* 00000090 "".....H." */ 0x02,0x00,0x40,0x00,0x00,0x00,0xF0,0xFD, /* 00000098 "..@....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x02,0x04,0x00,0xDE,0x4A,0x25,0x22, /* 000000A8 ".....J%"" */ 0xEF,0x73,0x6D,0x20,0x00,0x00,0x00,0x00, /* 000000B0 ".sm ...." */ 0x00,0x00,0x00,0x00,0x03,0x08,0x00,0x00, /* 000000B8 "........" */ 0x04,0xFE,0xFF,0x00,0x43,0x00,0xFF,0x00, /* 000000C0 "....C..." */ 0x00,0xA5,0x00,0x00,0x04,0xFF,0xFF,0x00, /* 000000C8 "........" */ 0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 000000D0 "....H..." */ 0x00,0xA0,0x00,0x02,0x40,0xB0,0xD4,0x00, /* 000000D8 "....@..." */ 0x02,0x00,0x40,0x00,0x00,0x00,0xF0,0xFD, /* 000000E0 "..@....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x02,0x04,0x00,0xDE,0x4A,0x25,0x22, /* 000000F0 ".....J%"" */ 0xEF,0x73,0x6D,0x20,0x00,0x00,0x00,0x00, /* 000000F8 ".sm ...." */ 0x00,0x00,0x00,0x00,0x03,0x08,0x00,0x00, /* 00000100 "........" */ 0x04,0xFE,0xFF,0x00,0x43,0x00,0xFF,0x00, /* 00000108 "....C..." */ 0x00,0xA5,0x00,0x00,0x04,0xFF,0xFF,0x00, /* 00000110 "........" */ 0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 00000118 "....H..." */ 0x00,0xA0,0x00,0x02,0x48,0x00,0x00,0xD7, /* 00000120 "....H..." */ 0x21,0xA0,0x00,0x01,0x48,0x00,0x00,0x00, /* 00000128 "!...H..." */ 0x22,0x01,0x00,0x01,0xF0,0xA5,0x00,0x40, /* 00000130 ""......@" */ 0x49,0x4E,0x54,0x43,0x30,0x30,0x32,0x30, /* 00000138 "INTC0020" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0x02,0x09,0x5C,0x5F,0x53,0x42,0x2E,0x44, /* 00000148 "..\_SB.D" */ 0x45,0x56,0x30,0xF0,0xA5,0x00,0x40,0x49, /* 00000150 "EV0...@I" */ 0x4E,0x54,0x43,0x30,0x30,0x32,0x30,0x00, /* 00000158 "NTC0020." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, /* 00000160 "........" */ 0x09,0x5C,0x5F,0x53,0x42,0x2E,0x44,0x45, /* 00000168 ".\_SB.DE" */ 0x56,0x31,0xF0,0xA5,0x00,0x40,0x49,0x4E, /* 00000170 "V1...@IN" */ 0x54,0x43,0x30,0x30,0x32,0x30,0x00,0x00, /* 00000178 "TC0020.." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x09, /* 00000180 "........" */ 0x5C,0x5F,0x53,0x42,0x2E,0x44,0x45,0x56, /* 00000188 "\_SB.DEV" */ 0x32,0xF0,0xA5,0x00,0x40,0x49,0x4E,0x54, /* 00000190 "2...@INT" */ 0x43,0x30,0x30,0x32,0x30,0x00,0x00,0x00, /* 00000198 "C0020..." */ 0x00,0x00,0x00,0x00,0x00,0x02,0x09,0x5C, /* 000001A0 ".......\" */ 0x5F,0x53,0x42,0x2E,0x44,0x45,0x56,0x33, /* 000001A8 "_SB.DEV3" */ 0x20,0x0D,0x20,0x00,0x22,0x11,0x00,0x00, /* 000001B0 " . ."..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ 0xCD,0xAB,0x78,0x56,0x34,0x12,0x00,0x00, /* 000001C0 "..xV4..." */ 0xDC,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ 0x21,0x0D,0x20,0x00,0x22,0x11,0x00,0x00, /* 000001D0 "!. ."..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ 0xCD,0xAB,0x78,0x56,0x34,0x12,0x00,0x00, /* 000001E0 "..xV4..." */ 0xDC,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ 0x22,0x0D,0x20,0x00,0x22,0x11,0x00,0x00, /* 000001F0 "". ."..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ 0xCD,0xAB,0x78,0x56,0x34,0x12,0x00,0x00, /* 00000200 "..xV4..." */ 0xDC,0xFE,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000208 "........" */ }; const unsigned char TemplateLpit[] = { 0x4C,0x50,0x49,0x54,0x94,0x00,0x00,0x00, /* 00000000 "LPIT...." */ 0x00,0xD8,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".@......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "8......." */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 ".@......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00 /* 00000090 "...." */ }; /* MADT with ACPI 6.0 subtables */ const unsigned char TemplateMadt[] = { 0x41,0x50,0x49,0x43,0x6A,0x01,0x00,0x00, /* 00000000 "APICj..." */ 0x05,0x9D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x13,0x11,0x20,0x20,0x00,0x00,0x00,0x00, /* 00000020 ".. ...." */ 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */ 0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */ 0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */ 0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */ 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */ 0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x50, /* 000000B0 ".......P" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 00000100 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x0D,0x18, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000128 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x10, /* 00000130 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x14, /* 00000140 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00 /* 00000168 ".." */ }; const unsigned char TemplateMcfg[] = { 0x4D,0x43,0x46,0x47,0x3C,0x00,0x00,0x00, /* 00000000 "MCFG<..." */ 0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00 /* 00000038 "...." */ }; const unsigned char TemplateMchi[] = { 0x4D,0x43,0x48,0x49,0x45,0x00,0x00,0x00, /* 00000000 "MCHIE..." */ 0x01,0xE4,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x15,0x07,0x00,0x02,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */ }; const unsigned char TemplateMsdm[] = { 0x4D,0x53,0x44,0x4D,0x64,0x00,0x00,0x00, /* 00000000 "MSDMd..." */ 0x01,0x34,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".4Intel." */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x04,0x02,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000028 "........" */ 0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23, /* 00000030 ".... !"#" */ 0x24,0x25,0x26,0x27,0x10,0x0A,0x15,0x16, /* 00000038 "$%&'...." */ 0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E, /* 00000040 "........" */ 0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26, /* 00000048 ". !"#$%&" */ 0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 00000050 "........" */ 0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21, /* 00000058 "...... !" */ 0x22,0x23,0x24,0x25 /* 00000060 ""#$%" */ }; const unsigned char TemplateMpst[] = { 0x4D,0x50,0x53,0x54,0xB6,0x00,0x00,0x00, /* 00000000 "MPST...." */ 0x01,0x77,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".wINTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x13,0x09,0x12,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000040 "........" */ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000068 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */ }; const unsigned char TemplateMsct[] = { 0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */ 0x01,0xB7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x38,0x00,0x00,0x00, /* 00000020 "(.. 8..." */ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00, /* 00000030 "........" */ 0x01,0x16,0x00,0x00,0x00,0x00,0x03,0x00, /* 00000038 "........" */ 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x16, /* 00000048 "..@....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x01,0x16,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x01,0x16,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */ }; const unsigned char TemplateNfit[] = { 0x4E,0x46,0x49,0x54,0x88,0x01,0x00,0x00, /* 00000000 "NFIT...." */ 0x01,0x81,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x13,0x11,0x20,0x20,0x00,0x00,0x00,0x00, /* 00000020 ".. ...." */ 0x00,0x00,0x40,0x00,0x01,0x00,0x00,0x00, /* 00000028 "..@....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000038 "0....].G" */ 0xA6,0xB0,0x0A,0x2D,0xB9,0x40,0x82,0x49, /* 00000040 "...-.@.I" */ 0x00,0x00,0x00,0x7C,0x03,0x00,0x00,0x00, /* 00000048 "...|...." */ 0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0xEF,0xCD,0xAB,0x78,0x56,0x34,0x12, /* 00000060 "....xV4." */ 0x01,0x00,0x30,0x00,0x01,0x00,0x00,0x00, /* 00000068 "..0....." */ 0x04,0x00,0x00,0x00,0x01,0x00,0x01,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x01,0x00,0x03,0x00,0x2A,0x00,0x00,0x00, /* 00000090 "....*..." */ 0x02,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000098 ".. ....." */ 0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000A8 "........" */ 0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00, /* 000000B0 "........" */ 0x03,0x00,0x28,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "..(....." */ 0xB4,0x13,0x5D,0x40,0x91,0x0B,0x29,0x93, /* 000000C0 "..]@..)." */ 0x67,0xE8,0x23,0x4C,0x00,0x00,0x00,0x88, /* 000000C8 "g.#L...." */ 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77, /* 000000D0 ".."3DUfw" */ 0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF, /* 000000D8 "........" */ 0x04,0x00,0x50,0x00,0x01,0x00,0x86,0x80, /* 000000E0 "..P....." */ 0x17,0x20,0x01,0x00,0x86,0x80,0x17,0x20, /* 000000E8 ". ..... " */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ 0x89,0x00,0x54,0x76,0x01,0x03,0x00,0x01, /* 000000F8 "..Tv...." */ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 ". ......" */ 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0x05,0x00,0x28,0x00,0x01,0x00,0x00,0x01, /* 00000130 "..(....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 ". ......" */ 0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000158 ".. ....." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00, /* 00000168 "........" */ 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00, /* 00000170 "........" */ 0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000180 "........" */ }; const unsigned char TemplateNhlt[] = { 0x4E,0x48,0x4C,0x54,0x1E,0x02,0x00,0x00, /* 00000000 "NHLT...." */ 0x01,0xF7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x30,0x09,0x21,0x20,0x04,0xAD,0x00,0x00, /* 00000020 "0.! ...." */ 0x00,0x02,0x06,0x07,0x00,0x30,0xAE,0x09, /* 00000028 ".....0.." */ 0x00,0x0A,0x00,0x00,0x00,0x02,0x03,0x0D, /* 00000030 "........" */ 0x38,0x00,0x00,0x00,0xCC,0x01,0x1F,0x02, /* 00000038 "8......." */ 0x04,0x00,0x13,0x00,0x09,0x00,0x11,0x00, /* 00000040 "........" */ 0x04,0x20,0x07,0x00,0x09,0x00,0x18,0x00, /* 00000048 ". ......" */ 0x22,0x00,0x11,0x00,0x15,0x00,0x05,0x03, /* 00000050 ""......." */ 0x13,0x00,0x09,0x00,0x11,0x00,0x04,0x20, /* 00000058 "....... " */ 0x07,0x00,0x09,0x00,0x18,0x00,0x22,0x00, /* 00000060 "......"." */ 0x11,0x00,0x15,0x00,0xAA,0xAA,0x99,0x99, /* 00000068 "........" */ 0x78,0x56,0x34,0x12,0x02,0xFE,0xFF,0x78, /* 00000070 "xV4....x" */ 0x56,0x44,0x33,0x00,0x00,0x66,0x55,0x00, /* 00000078 "VD3..fU." */ 0x00,0x00,0x80,0x16,0x00,0x32,0x00,0x04, /* 00000080 ".....2.." */ 0x00,0x99,0x99,0x88,0x88,0x6E,0x88,0x9F, /* 00000088 ".....n.." */ 0xA6,0xEB,0x6C,0x94,0x45,0xA4,0x1F,0x7B, /* 00000090 "..l.E..{" */ 0x5D,0xCE,0x24,0xC5,0x53,0x02,0x00,0x00, /* 00000098 "].$.S..." */ 0x00,0x30,0x40,0xFE,0xFF,0x78,0x56,0x44, /* 000000A0 ".0@..xVD" */ 0x33,0x00,0x00,0x66,0x55,0x00,0x00,0x00, /* 000000A8 "3..fU..." */ 0x80,0x16,0x00,0x32,0x00,0x04,0x00,0x99, /* 000000B0 "...2...." */ 0x99,0x88,0x88,0x6E,0x88,0x9F,0xA6,0xEB, /* 000000B8 "...n...." */ 0x6C,0x94,0x45,0xA4,0x1F,0x7B,0x5D,0xCE, /* 000000C0 "l.E..{]." */ 0x24,0xC5,0x53,0x03,0x00,0x00,0x00,0x50, /* 000000C8 "$.S....P" */ 0x60,0x70,0x48,0x00,0x00,0x00,0x05,0x06, /* 000000D0 "`pH....." */ 0x07,0x00,0x34,0xAE,0x09,0x00,0x0A,0x00, /* 000000D8 "..4....." */ 0x00,0x00,0x02,0x00,0x0D,0x02,0x00,0x00, /* 000000E0 "........" */ 0x00,0xCC,0x00,0x01,0xFE,0xFF,0x78,0x56, /* 000000E8 "......xV" */ 0x44,0x33,0x00,0x00,0x66,0x55,0x00,0x00, /* 000000F0 "D3..fU.." */ 0x00,0x80,0x16,0x00,0x32,0x00,0x04,0x00, /* 000000F8 "....2..." */ 0x99,0x99,0x88,0x88,0x6E,0x88,0x9F,0xA6, /* 00000100 "....n..." */ 0xEB,0x6C,0x94,0x45,0xA4,0x1F,0x7B,0x5D, /* 00000108 ".l.E..{]" */ 0xCE,0x24,0xC5,0x53,0x02,0x00,0x00,0x00, /* 00000110 ".$.S...." */ 0x70,0x80,0x80,0x00,0x00,0x00,0x02,0x06, /* 00000118 "p......." */ 0x07,0x00,0x30,0xAE,0x09,0x00,0x0A,0x00, /* 00000120 "..0....." */ 0x00,0x00,0x02,0x03,0x0D,0x07,0x00,0x00, /* 00000128 "........" */ 0x00,0xCC,0x03,0x09,0x34,0x12,0x28,0x01, /* 00000130 "....4.(." */ 0x02,0xFE,0xFF,0x78,0x56,0x44,0x33,0x00, /* 00000138 "...xVD3." */ 0x00,0x66,0x55,0x00,0x00,0x00,0x80,0x16, /* 00000140 ".fU....." */ 0x00,0x32,0x00,0x04,0x00,0x99,0x99,0x88, /* 00000148 ".2......" */ 0x88,0x6E,0x88,0x9F,0xA6,0xEB,0x6C,0x94, /* 00000150 ".n....l." */ 0x45,0xA4,0x1F,0x7B,0x5D,0xCE,0x24,0xC5, /* 00000158 "E..{].$." */ 0x53,0x04,0x00,0x00,0x00,0x70,0x80,0x90, /* 00000160 "S....p.." */ 0xA0,0xFE,0xFF,0x78,0x56,0x44,0x33,0x00, /* 00000168 "...xVD3." */ 0x00,0x66,0x55,0x00,0x00,0x00,0x80,0x16, /* 00000170 ".fU....." */ 0x00,0x32,0x00,0x04,0x00,0x99,0x99,0x88, /* 00000178 ".2......" */ 0x88,0x6E,0x88,0x9F,0xA6,0xEB,0x6C,0x94, /* 00000180 ".n....l." */ 0x45,0xA4,0x1F,0x7B,0x5D,0xCE,0x24,0xC5, /* 00000188 "E..{].$." */ 0x53,0x05,0x00,0x00,0x00,0x70,0x80,0x90, /* 00000190 "S....p.." */ 0xA0,0xB0,0x7C,0x00,0x00,0x00,0x05,0x06, /* 00000198 "..|....." */ 0x07,0x00,0x34,0xAE,0x09,0x00,0x0A,0x00, /* 000001A0 "..4....." */ 0x00,0x00,0x02,0x00,0x0D,0x02,0x00,0x00, /* 000001A8 "........" */ 0x00,0xCC,0x00,0x01,0xFE,0xFF,0x78,0x56, /* 000001B0 "......xV" */ 0x44,0x33,0x00,0x00,0x66,0x55,0x00,0x00, /* 000001B8 "D3..fU.." */ 0x00,0x80,0x16,0x00,0x32,0x00,0x04,0x00, /* 000001C0 "....2..." */ 0x99,0x99,0x88,0x88,0x6E,0x88,0x9F,0xA6, /* 000001C8 "....n..." */ 0xEB,0x6C,0x94,0x45,0xA4,0x1F,0x7B,0x5D, /* 000001D0 ".l.E..{]" */ 0xCE,0x24,0xC5,0x53,0x11,0x00,0x00,0x00, /* 000001D8 ".$.S...." */ 0x00,0x01,0x32,0x03,0x04,0x05,0x06,0x37, /* 000001E0 "..2....7" */ 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x3F, /* 000001E8 ".......?" */ 0x0A,0x01,0x00,0x01,0x32,0x03,0x04,0x05, /* 000001F0 "....2..." */ 0x06,0x37,0x08,0x09,0x0A,0x0B,0x0C,0x0D, /* 000001F8 ".7......" */ 0x0E,0x3F,0x44,0x9A,0x00,0x01,0x32,0x03, /* 00000200 ".?D...2." */ 0x04,0x05,0x06,0x37,0x08,0x09,0x0A,0x0B, /* 00000208 "...7...." */ 0x0C,0x0D,0x0E,0x3F,0x0A,0x0B,0x04,0x00, /* 00000210 "...?...." */ 0x00,0x00,0xEF,0xBE,0xAD,0xDE /* 00000218 "......" */ }; const unsigned char TemplatePcct[] = { 0x50,0x43,0x43,0x54,0xAE,0x02,0x00,0x00, /* 00000000 "PCCT...." */ 0x01,0xE6,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x25,0x09,0x20,0x20,0x01,0x00,0x00,0x00, /* 00000020 "%. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */ 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, /* 00000038 "........" */ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000040 """""""""" */ 0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33, /* 00000048 ".2..3333" */ 0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000050 "3333DDDD" */ 0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55, /* 00000058 "DDDDUUUU" */ 0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66, /* 00000060 "UUUUffff" */ 0x77,0x77,0x77,0x77,0x88,0x88,0x01,0x3E, /* 00000068 "wwww...>" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */ 0x00,0x03,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000088 "..DDDDDD" */ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000090 "DDDDDDDD" */ 0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 00000098 "DDUUUUUU" */ 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000000A0 "UUffffww" */ 0x77,0x77,0x88,0x88,0x02,0x5A,0x01,0x00, /* 000000A8 "ww...Z.." */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x32,0x00,0x03, /* 000000C0 ".....2.." */ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000C8 "DDDDDDDD" */ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000D0 "DDDDDDDD" */ 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, /* 000000D8 "UUUUUUUU" */ 0x66,0x66,0x66,0x66,0x77,0x77,0x77,0x77, /* 000000E0 "ffffwwww" */ 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 000000E8 "...2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 000000F0 "333333DD" */ 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 000000F8 "DDDDDDUU" */ 0x55,0x55,0x55,0x55,0x55,0x55,0x03,0xA4, /* 00000100 "UUUUUU.." */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000108 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000118 "...2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000120 "333333DD" */ 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 00000128 "DDDDDDUU" */ 0x55,0x55,0x55,0x55,0x55,0x55,0x66,0x66, /* 00000130 "UUUUUUff" */ 0x66,0x66,0x77,0x77,0x77,0x77,0x88,0x88, /* 00000138 "ffwwww.." */ 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000140 "...2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x99,0x99, /* 00000148 "333333.." */ 0x99,0x99,0x99,0x99,0x99,0x99,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000160 ".......2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000168 "..333333" */ 0x33,0x33,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000170 "33""""""" */ 0x22,0x22,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000178 """.2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000180 "33333333" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000188 "333333DD" */ 0x44,0x44,0x44,0x44,0x44,0x44,0x01,0x32, /* 00000190 "DDDDDD.2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000198 "..333333" */ 0x33,0x33,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001A0 "33UUUUUU" */ 0x55,0x55,0x04,0xA4,0x01,0x00,0x00,0x00, /* 000001A8 "UU......" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 000001B8 ".......2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001C0 "..333333" */ 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 000001C8 "33DDDDDD" */ 0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001D0 "DDUUUUUU" */ 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000001D8 "UUffffww" */ 0x77,0x77,0x88,0x88,0x88,0x88,0x01,0x32, /* 000001E0 "ww.....2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001E8 "..333333" */ 0x33,0x33,0x99,0x99,0x99,0x99,0x99,0x99, /* 000001F0 "33......" */ 0x99,0x99,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000208 "...2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x22,0x22, /* 00000210 "333333""" */ 0x22,0x22,0x22,0x22,0x22,0x22,0x01,0x32, /* 00000218 """"""".2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000220 "..333333" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000228 "33333333" */ 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000230 "33DDDDDD" */ 0x44,0x44,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000238 "DD.2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x55,0x55, /* 00000240 "333333UU" */ 0x55,0x55,0x55,0x55,0x55,0x55,0x05,0x60, /* 00000248 "UUUUUU.`" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000258 "........" */ 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000260 "...2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000268 "33333333" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000270 "33333333" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x01,0x32, /* 00000278 "333333.2" */ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000280 "..333333" */ 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000288 "33DDDDDD" */ 0x44,0x44,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000290 "DD.2..33" */ 0x33,0x33,0x33,0x33,0x33,0x33,0x55,0x55, /* 00000298 "333333UU" */ 0x55,0x55,0x55,0x55,0x55,0x55,0x03,0x00, /* 000002A0 "UUUUUU.." */ 0x00,0x00,0x05,0x00,0x00,0x00 /* 000002A8 "......" */ }; const unsigned char TemplatePdtt[] = { 0x50,0x44,0x54,0x54,0x34,0x00,0x00,0x00, /* 00000000 "PDTT4..." */ 0x01,0xCB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x31,0x08,0x17,0x20,0x04,0x00,0x00,0x00, /* 00000020 "1.. ...." */ 0x2C,0x00,0x00,0x00,0xAA,0x03,0xBB,0x02, /* 00000028 ",......." */ 0xCC,0x01,0xDD,0x00 /* 00000030 "...." */ }; const unsigned char TemplatePhat [] = { - 0x50,0x48,0x41,0x54,0x6F,0x00,0x00,0x00, /* 00000000 "PHATo..." */ - 0x01,0xC7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x50,0x48,0x41,0x54,0xA2,0x00,0x00,0x00, /* 00000000 "PHAT...." */ + 0x01,0xCA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x05,0x01,0x21,0x20,0x00,0x00,0x28,0x00, /* 00000020 "..! ..(." */ + 0x31,0x03,0x22,0x20,0x00,0x00,0x28,0x00, /* 00000020 "1." ..(." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ 0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000030 "0....].G" */ 0xA6,0xB0,0x0A,0x2D,0xB9,0x40,0x82,0x49, /* 00000038 "...-.@.I" */ 0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01, /* 00000040 "........" */ - 0x0C,0x0B,0x0A,0x09,0x01,0x00,0x23,0x00, /* 00000048 "......#." */ + 0x0C,0x0B,0x0A,0x09,0x01,0x00,0x2E,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x30,0x05,0xAF,0x91, /* 00000050 "....0..." */ 0x86,0x5D,0x0E,0x47,0xA6,0xB0,0x0A,0x2D, /* 00000058 ".].G...-" */ - 0xB9,0x40,0x82,0x49,0x00,0x00,0x00,0x00, /* 00000060 ".@.I...." */ - 0x61,0x73,0x64,0x66,0x00,0xFF,0x11 /* 00000068 "asdf..." */ + 0xB9,0x40,0x82,0x49,0x2A,0x00,0x00,0x00, /* 00000060 ".@.I*..." */ + 0x41,0x00,0x42,0x00,0x43,0x00,0x44,0x00, /* 00000068 "A.B.C.D." */ + 0x45,0x00,0x46,0x00,0x00,0x00,0x01,0x02, /* 00000070 "E.F....." */ + 0x03,0x04,0x00,0x00,0x28,0x00,0x00,0x00, /* 00000078 "....(..." */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x05, /* 00000080 "......0." */ + 0xAF,0x91,0x86,0x5D,0x0E,0x47,0xA6,0xB0, /* 00000088 "...].G.." */ + 0x0A,0x2D,0xB9,0x40,0x82,0x49,0x08,0x07, /* 00000090 ".-.@.I.." */ + 0x06,0x05,0x04,0x03,0x02,0x01,0x0C,0x0B, /* 00000098 "........" */ + 0x0A,0x09 /* 000000A0 ".." */ }; const unsigned char TemplatePmtt[] = { 0x50,0x4D,0x54,0x54,0xBB,0x00,0x00,0x00, /* 00000000 "PMTT...." */ 0x02,0x2E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x05,0x01,0x21,0x20,0x08,0x00,0x00,0x00, /* 00000020 "..! ...." */ 0x00,0x00,0x10,0x00,0x0D,0x00,0x00,0x00, /* 00000028 "........" */ 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x01,0x00,0x10,0x00,0x04,0x00,0x00,0x00, /* 00000038 "........" */ 0x02,0x00,0x00,0x00,0x44,0x44,0x00,0x00, /* 00000040 "....DD.." */ 0x02,0x00,0x10,0x00,0x04,0x00,0x00,0x00, /* 00000048 "........" */ 0x01,0x00,0x00,0x00,0x78,0x56,0x34,0x12, /* 00000050 "....xV4." */ 0xFF,0x00,0x23,0x00,0x0D,0x00,0x00,0x00, /* 00000058 "..#....." */ 0x03,0x00,0x00,0x00,0x03,0x02,0x01,0x00, /* 00000060 "........" */ 0x08,0x04,0x07,0x06,0x08,0x09,0x0A,0x0B, /* 00000068 "........" */ 0x0C,0x0D,0x0E,0x0F,0x55,0x66,0x77,0x88, /* 00000070 "....Ufw." */ 0x11,0xAA,0xBB,0x00,0x00,0x10,0x00,0x0D, /* 00000078 "........" */ 0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01, /* 00000080 "........" */ 0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x00,0x02,0x00,0x10,0x00,0x04, /* 00000098 "........" */ 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x78, /* 000000A0 ".......x" */ 0x56,0x34,0x12,0x02,0x00,0x10,0x00,0x04, /* 000000A8 "V4......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78, /* 000000B0 ".......x" */ 0x56,0x34,0x12 /* 000000B8 "V4." */ }; const unsigned char TemplatePptt[] = { 0x50,0x50,0x54,0x54,0x72,0x00,0x00,0x00, /* 00000000 "PPTTr..." */ 0x01,0x86,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x03,0x03,0x17,0x20,0x00,0x18,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x01,0x18,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x02,0x1E,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00 /* 00000070 ".." */ }; const unsigned char TemplatePrmt[] = { 0x50,0x52,0x4D,0x54,0xB8,0x02,0x00,0x00, /* 00000000 "PRMT...." */ 0x00,0x13,0x4F,0x45,0x4D,0x43,0x41,0x20, /* 00000008 "..OEMCA " */ 0x4F,0x45,0x4D,0x43,0x41,0x20,0x20,0x20, /* 00000010 "OEMCA " */ 0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x17,0x07,0x20,0x20,0xA5,0x61,0x6B,0xB6, /* 00000020 ".. .ak." */ 0x01,0xA1,0x46,0xED,0xA6,0xA3,0xCA,0xC1, /* 00000028 "..F....." */ 0xC4,0xD1,0x30,0x1E,0x3C,0x00,0x00,0x00, /* 00000030 "..0.<..." */ 0x04,0x00,0x00,0x00,0x00,0x00,0xAA,0x00, /* 00000038 "........" */ 0xC2,0xB3,0x52,0x16,0xA1,0xA7,0xAC,0x46, /* 00000040 "..R....F" */ 0xAF,0x93,0xDD,0x6D,0xEE,0x44,0x66,0x69, /* 00000048 "...m.Dfi" */ 0x01,0x00,0x00,0x00,0x03,0x00,0x26,0x00, /* 00000050 "......&." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x2C,0x00,0x5F,0xAD, /* 00000060 "....,._." */ 0xF2,0xD5,0x47,0xA3,0x3E,0x4D,0x87,0xBC, /* 00000068 "..G.>M.." */ 0xC2,0xCE,0x63,0x02,0x9C,0xC8,0x90,0xC2, /* 00000070 "..c....." */ 0x5E,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "^......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x2C,0x00,0xC3,0xAD,0xE7,0xA9,0xD0,0x8C, /* 00000090 ",......." */ 0x9A,0x42,0x89,0x15,0x10,0x94,0x6E,0xBD, /* 00000098 ".B....n." */ 0xE3,0x18,0xC0,0xC2,0x5E,0x8A,0x00,0x00, /* 000000A0 "....^..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x2C,0x00,0x14,0xC2, /* 000000B8 "....,..." */ 0x88,0xB6,0x81,0x40,0xEB,0x4E,0x8D,0x26, /* 000000C0 "...@.N.&" */ 0x1E,0xB5,0xA3,0xBC,0xF1,0x1A,0xF0,0xC2, /* 000000C8 "........" */ 0x5E,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "^......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x52,0x00,0xA6,0x58,0x2A,0xDC,0x27,0x59, /* 000000E8 "R..X*.'Y" */ 0x76,0x47,0xB9,0x95,0xD1,0x18,0xA2,0x73, /* 000000F0 "vG.....s" */ 0x35,0xA2,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000F8 "5......." */ 0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "&......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00, /* 00000108 "......,." */ 0x13,0x2D,0x4F,0x2E,0x40,0x62,0xD0,0x4E, /* 00000110 ".-O.@b.N" */ 0xA4,0x01,0xC7,0x23,0xFB,0xDC,0x34,0xE8, /* 00000118 "...#..4." */ 0x90,0x32,0x5E,0x8A,0x00,0x00,0x00,0x00, /* 00000120 ".2^....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0xF8,0x7F,0x71,0x8A,0x00,0x00,0x00,0x00, /* 00000130 "..q....." */ 0x00,0x00,0x2E,0x01,0xD7,0x3E,0xF9,0x0E, /* 00000138 ".....>.." */ 0xAE,0x14,0x5B,0x42,0x92,0x8F,0xB8,0x5A, /* 00000140 "..[B...Z" */ 0x62,0x13,0xB5,0x7E,0x01,0x00,0x00,0x00, /* 00000148 "b..~...." */ 0x06,0x00,0x26,0x00,0x00,0x00,0xE0,0x3F, /* 00000150 "..&....?" */ 0x71,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "q......." */ 0x2C,0x00,0x3C,0xCD,0x20,0x21,0x8B,0x84, /* 00000160 ",.<. !.." */ 0x8F,0x4D,0xAB,0xBB,0x4B,0x74,0xCE,0x64, /* 00000168 ".M..Kt.d" */ 0xAC,0x89,0x4C,0xA6,0x5D,0x8A,0x00,0x00, /* 00000170 "..L.]..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ 0x00,0x00,0x00,0x00,0x2C,0x00,0xA7,0x35, /* 00000188 "....,..5" */ 0x09,0xEA,0x6B,0x50,0x59,0x41,0xBB,0xBB, /* 00000190 "..kPYA.." */ 0x48,0xDE,0xEE,0xCB,0x6F,0x58,0x34,0xA7, /* 00000198 "H...oX4." */ 0x5D,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "]......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B0 "........" */ 0x2C,0x00,0xA9,0xBD,0xD1,0x1B,0x9A,0x90, /* 000001B8 ",......." */ 0x14,0x46,0x96,0x99,0x25,0xEC,0x0C,0x27, /* 000001C0 ".F..%..'" */ 0x83,0xF7,0x94,0xA7,0x5D,0x8A,0x00,0x00, /* 000001C8 "....]..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ 0x00,0x00,0x00,0x00,0x2C,0x00,0xE7,0xB4, /* 000001E0 "....,..." */ 0x28,0x5D,0x67,0x38,0xEE,0x4A,0xAA,0x09, /* 000001E8 "(]g8.J.." */ 0x51,0xFC,0x28,0x2C,0x3B,0x22,0x9C,0xA6, /* 000001F0 "Q.(,;".." */ 0x5D,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "]......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */ 0x2C,0x00,0x02,0xB7,0x64,0x4B,0x2B,0x4D, /* 00000210 ",...dK+M" */ 0xFE,0x4D,0xAC,0x5A,0x0B,0x41,0x10,0xA2, /* 00000218 ".M.Z.A.." */ 0xCA,0x47,0x48,0xA7,0x5D,0x8A,0x00,0x00, /* 00000220 ".GH.]..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000230 "........" */ 0x00,0x00,0x00,0x00,0x2C,0x00,0xDE,0xFD, /* 00000238 "....,..." */ 0x0E,0x8A,0xD0,0x78,0xF0,0x45,0xAE,0xA0, /* 00000240 "...x.E.." */ 0xC2,0x82,0x45,0xC7,0xE1,0xDB,0x98,0xA7, /* 00000248 "..E....." */ 0x5D,0x8A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "]......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000258 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */ 0x52,0x00,0x2B,0xF4,0x6C,0x5A,0xB4,0x8B, /* 00000268 "R.+.lZ.." */ 0x2C,0x47,0xA2,0x33,0x5C,0x4D,0xC4,0x03, /* 00000270 ",G.3\M.." */ 0x3D,0xC7,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000278 "=......." */ 0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000280 "&......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00, /* 00000288 "......,." */ 0x81,0x60,0x46,0xE1,0x62,0x75,0x0F,0x43, /* 00000290 ".`F.bu.C" */ 0x89,0x6B,0xB0,0xE5,0x23,0xDC,0x33,0x5A, /* 00000298 ".k..#.3Z" */ 0x90,0x12,0x5D,0x8A,0x00,0x00,0x00,0x00, /* 000002A0 "..]....." */ 0xE0,0x5F,0x71,0x8A,0x00,0x00,0x00,0x00, /* 000002A8 "._q....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 000002B0 "........" */ }; const unsigned char TemplateRasf[] = { 0x52,0x41,0x53,0x46,0x30,0x00,0x00,0x00, /* 00000000 "RASF0..." */ 0x01,0x31,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".1INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x27,0x05,0x16,0x20,0x00,0x00,0x00,0x00, /* 00000020 "'.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */ }; const unsigned char TemplateRgrt[] = { 0x52,0x47,0x52,0x54,0x50,0x00,0x00,0x00, /* 00000000 "RGRTP..." */ 0x01,0x33,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".3INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x31,0x03,0x21,0x20,0x01,0x00,0x01,0x00, /* 00000020 "1.! ...." */ 0xAA,0x01,0x02,0x03,0x04,0x05,0x06,0x07, /* 00000028 "........" */ 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, /* 00000030 "........" */ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, /* 00000038 "........" */ 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, /* 00000040 "........" */ 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 /* 00000048 " !"#$%&'" */ }; const unsigned char TemplateRsdp[] = { 0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */ 0x43,0x49,0x4E,0x54,0x45,0x4C,0x20,0x02, /* 00000008 "CINTEL ." */ 0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00, /* 00000010 "....$..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ 0xDC,0x00,0x00,0x00 /* 00000020 "...." */ }; const unsigned char TemplateRsdt[] = { 0x52,0x53,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "RSDTD..." */ 0x01,0xB1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x20,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000028 " ...0..." */ 0x40,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000030 "@...P..." */ 0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000038 "`...p..." */ 0x80,0x00,0x00,0x00 /* 00000040 "...." */ }; const unsigned char TemplateS3pt[] = { 0x53,0x33,0x50,0x54,0x34,0x00,0x00,0x00, /* 00000000 "S3PT4..." */ 0x00,0x00,0x18,0x01,0x00,0x00,0x00,0x00, /* 00000008 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ 0x01,0x00,0x14,0x01,0x00,0x00,0x00,0x00, /* 00000020 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00 /* 00000030 "...." */ }; const unsigned char TemplateSbst[] = { 0x53,0x42,0x53,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SBST0..." */ 0x01,0x06,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */ }; const unsigned char TemplateSdei[] = { 0x53,0x44,0x45,0x49,0x3e,0x00,0x00,0x00, /* 00000000 "SDEI>..." */ 0x01,0x59,0x41,0x52,0x4d,0x20,0x20,0x20, /* 00000008 ".mARM " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x30,0x09,0x16,0x20 /* 00000028 "0.. " */ }; const unsigned char TemplateSdev[] = { 0x53,0x44,0x45,0x56,0x89,0x00,0x00,0x00, /* 00000000 "SDEV...." */ 0x01,0x6E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".nINTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x05,0x01,0x21,0x20,0x00,0x03,0x41,0x00, /* 00000020 "..! ..A." */ 0x23,0x00,0x16,0x00,0x39,0x00,0x08,0x00, /* 00000028 "#...9..." */ 0x10,0x00,0x13,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x01,0x00,0x03,0x02,0x05,0x04,0x07,0x06, /* 00000038 "........" */ 0x09,0x08,0x0A,0x0B,0x0C,0x0D,0x0E,0x5C, /* 00000040 ".......\" */ 0x5C,0x5F,0x53,0x42,0x5F,0x2E,0x50,0x43, /* 00000048 "\_SB_.PC" */ 0x49,0x30,0x2E,0x55,0x53,0x42,0x31,0x2E, /* 00000050 "I0.USB1." */ 0x53,0x55,0x42,0x31,0x00,0x00,0x11,0x22, /* 00000058 "SUB1..."" */ 0x33,0x44,0x55,0x66,0x77,0x01,0x01,0x24, /* 00000060 "3DUfw..$" */ 0x00,0x10,0x00,0x20,0x00,0x10,0x00,0x04, /* 00000068 "... ...." */ 0x00,0x14,0x00,0x10,0x00,0x11,0x22,0x33, /* 00000070 "......"3" */ 0x44,0xEE,0xDD,0xCC,0xBB,0xAA,0x55,0x66, /* 00000078 "D.....Uf" */ 0x77,0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE, /* 00000080 "w......." */ 0xFF /* 00000088 "." */ }; const unsigned char TemplateSlic[] = { 0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */ 0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00, /* 00000028 "........" */ 0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31, /* 00000030 ".$..RSA1" */ 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00, /* 000000C0 "........" */ 0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45, /* 000000C8 "....INTE" */ 0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41, /* 000000D0 "L TEMPLA" */ 0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57, /* 000000D8 "TEWINDOW" */ 0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00, /* 000000E0 "S ......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00 /* 00000170 "......" */ }; const unsigned char TemplateSlit[] = { 0x53,0x4C,0x49,0x54,0xBC,0x01,0x00,0x00, /* 00000000 "SLIT...." */ 0x01,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x16,0x03,0x11,0x20,0x14,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x0A,0x10,0x16,0x17, /* 00000028 "........" */ 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, /* 00000030 "........" */ 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, /* 00000038 " !"#$%&'" */ 0x10,0x0A,0x15,0x16,0x17,0x18,0x19,0x1A, /* 00000040 "........" */ 0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22, /* 00000048 "..... !"" */ 0x23,0x24,0x25,0x26,0x16,0x15,0x0A,0x10, /* 00000050 "#$%&...." */ 0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, /* 00000058 "........" */ 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25, /* 00000060 ".. !"#$%" */ 0x17,0x16,0x10,0x0A,0x15,0x16,0x17,0x18, /* 00000068 "........" */ 0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20, /* 00000070 "....... " */ 0x21,0x22,0x23,0x24,0x18,0x17,0x16,0x15, /* 00000078 "!"#$...." */ 0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000080 "........" */ 0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23, /* 00000088 ".... !"#" */ 0x19,0x18,0x17,0x16,0x10,0x0A,0x15,0x16, /* 00000090 "........" */ 0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E, /* 00000098 "........" */ 0x1F,0x20,0x21,0x22,0x1A,0x19,0x18,0x17, /* 000000A0 ". !"...." */ 0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 000000A8 "........" */ 0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21, /* 000000B0 "...... !" */ 0x1B,0x1A,0x19,0x18,0x17,0x16,0x10,0x0A, /* 000000B8 "........" */ 0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C, /* 000000C0 "........" */ 0x1D,0x1E,0x1F,0x20,0x1C,0x1B,0x1A,0x19, /* 000000C8 "... ...." */ 0x18,0x17,0x16,0x15,0x0A,0x10,0x16,0x17, /* 000000D0 "........" */ 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, /* 000000D8 "........" */ 0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16, /* 000000E0 "........" */ 0x10,0x0A,0x15,0x16,0x17,0x18,0x19,0x1A, /* 000000E8 "........" */ 0x1B,0x1C,0x1D,0x1E,0x1E,0x1D,0x1C,0x1B, /* 000000F0 "........" */ 0x1A,0x19,0x18,0x17,0x16,0x15,0x0A,0x10, /* 000000F8 "........" */ 0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, /* 00000100 "........" */ 0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18, /* 00000108 "........" */ 0x17,0x16,0x10,0x0A,0x15,0x16,0x17,0x18, /* 00000110 "........" */ 0x19,0x1A,0x1B,0x1C,0x20,0x1F,0x1E,0x1D, /* 00000118 ".... ..." */ 0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15, /* 00000120 "........" */ 0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000128 "........" */ 0x21,0x20,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A, /* 00000130 "! ......" */ 0x19,0x18,0x17,0x16,0x10,0x0A,0x15,0x16, /* 00000138 "........" */ 0x17,0x18,0x19,0x1A,0x22,0x21,0x20,0x1F, /* 00000140 "...."! ." */ 0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17, /* 00000148 "........" */ 0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 00000150 "........" */ 0x23,0x22,0x21,0x20,0x1F,0x1E,0x1D,0x1C, /* 00000158 "#"! ...." */ 0x1B,0x1A,0x19,0x18,0x17,0x16,0x10,0x0A, /* 00000160 "........" */ 0x15,0x16,0x17,0x18,0x24,0x23,0x22,0x21, /* 00000168 "....$#"!" */ 0x20,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19, /* 00000170 " ......." */ 0x18,0x17,0x16,0x15,0x0A,0x10,0x16,0x17, /* 00000178 "........" */ 0x25,0x24,0x23,0x22,0x21,0x20,0x1F,0x1E, /* 00000180 "%$#"! .." */ 0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16, /* 00000188 "........" */ 0x10,0x0A,0x15,0x16,0x26,0x25,0x24,0x23, /* 00000190 "....&%$#" */ 0x22,0x21,0x20,0x1F,0x1E,0x1D,0x1C,0x1B, /* 00000198 ""! ....." */ 0x1A,0x19,0x18,0x17,0x16,0x15,0x0A,0x10, /* 000001A0 "........" */ 0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20, /* 000001A8 "'&%$#"! " */ 0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18, /* 000001B0 "........" */ 0x17,0x16,0x10,0x0A /* 000001B8 "...." */ }; const unsigned char TemplateSpcr[] = { 0x53,0x50,0x43,0x52,0x50,0x00,0x00,0x00, /* 00000000 "SPCRP..." */ 0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */ }; const unsigned char TemplateSpmi[] = { 0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */ 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00 /* 00000040 "." */ }; const unsigned char TemplateSrat[] = { 0x53,0x52,0x41,0x54,0xBE,0x00,0x00,0x00, /* 00000000 "SRAT...." */ 0x03,0xE6,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x29,0x06,0x18,0x20,0x01,0x00,0x00,0x00, /* 00000020 ").. ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x01,0x28,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 ".(......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0xFC,0x09,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x04,0x0C,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x20, /* 00000098 "....... " */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B8 "......" */ }; const unsigned char TemplateStao[] = { 0x53,0x54,0x41,0x4F,0x7E,0x00,0x00,0x00, /* 00000000 "STAO~..." */ 0x01,0x7F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x01,0x5C,0x5F,0x53, /* 00000020 "... .\_S" */ 0x42,0x30,0x2E,0x42,0x55,0x53,0x30,0x2E, /* 00000028 "B0.BUS0." */ 0x44,0x45,0x56,0x31,0x00,0x5C,0x5F,0x53, /* 00000030 "DEV1.\_S" */ 0x42,0x30,0x2E,0x42,0x55,0x53,0x30,0x2E, /* 00000038 "B0.BUS0." */ 0x44,0x45,0x56,0x32,0x00,0x5C,0x5F,0x53, /* 00000040 "DEV2.\_S" */ 0x42,0x30,0x2E,0x42,0x55,0x53,0x31,0x2E, /* 00000048 "B0.BUS1." */ 0x44,0x45,0x56,0x31,0x2E,0x44,0x45,0x56, /* 00000050 "DEV1.DEV" */ 0x32,0x00,0x5C,0x5F,0x53,0x42,0x30,0x2E, /* 00000058 "2.\_SB0." */ 0x42,0x55,0x53,0x31,0x2E,0x44,0x45,0x56, /* 00000060 "BUS1.DEV" */ 0x32,0x2E,0x44,0x45,0x56,0x32,0x00,0x5C, /* 00000068 "2.DEV2.\" */ 0x55,0x53,0x42,0x31,0x2E,0x48,0x55,0x42, /* 00000070 "USB1.HUB" */ 0x31,0x2E,0x50,0x54,0x31,0x00 /* 00000078 "1.PT1." */ }; const unsigned char TemplateSvkl[] = { 0x53,0x56,0x4B,0x4C,0x48,0x00,0x00,0x00, /* 00000000 "SVKLH..." */ 0x04,0xDB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x31,0x03,0x21,0x20,0x02,0x00,0x00,0x00, /* 00000020 "1.! ...." */ 0x00,0x00,0x00,0x00,0x21,0x43,0xAA,0xAA, /* 00000028 "....!C.." */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000030 "....gE#." */ 0x00,0x00,0x00,0x00,0x21,0x43,0xBB,0xBB, /* 00000038 "....!C.." */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01 /* 00000040 "....gE#." */ }; const unsigned char TemplateTcpa[] = { 0x54,0x43,0x50,0x41,0x64,0x00,0x00,0x00, /* 00000000 "TCPAd..." */ 0x02,0xFF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 ".1..INTL" */ 0x19,0x06,0x15,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x11,0x00,0xFF,0xEE,0xDD,0xCC,0xBB,0xAA, /* 00000030 "........" */ 0x02,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03, /* 00000040 "..... .." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03, /* 00000050 "..... .." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x01,0x01,0x01,0x01 /* 00000060 "...." */ }; const unsigned char TemplateTdel[] = { 0x54,0x44,0x45,0x4C,0x38,0x00,0x00,0x00, /* 00000000 "TDEL8..." */ 0x04,0x1C,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x30,0x09,0x21,0x20,0x00,0x00,0x00,0x00, /* 00000020 "0.! ...." */ 0xEF,0xCD,0xAB,0x78,0x56,0x34,0x12,0x00, /* 00000028 "...xV4.." */ 0x78,0x56,0x34,0x12,0xEF,0xCD,0xAB,0x00 /* 00000030 "xV4....." */ }; const unsigned char TemplateTpm2[] = { 0x54,0x50,0x4D,0x32,0x4C,0x00,0x00,0x00, /* 00000000 "TPM2L..." */ 0x04,0xCB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x13,0x12,0x18,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x08,0x00,0x00,0x00,0x01,0x02,0x03,0x04, /* 00000030 "........" */ 0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C, /* 00000038 "........" */ 0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00 /* 00000048 "...." */ }; const unsigned char TemplateUefi[] = { 0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */ 0x01,0x9B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x01,0x02,0x03, /* 00000020 "(.. ...." */ 0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */ 0x0C,0x0D,0x0E,0x0F,0x00,0x00 /* 00000030 "......" */ }; const unsigned char TemplateViot[] = { 0x56,0x49,0x4F,0x54,0x80,0x00,0x00,0x00, /* 00000000 "VIOT...." */ 0x00,0x52,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".RINTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x05,0x01,0x21,0x20,0x04,0x00,0x30,0x00, /* 00000020 "..! ..0." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x01,0x00,0x18,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, /* 00000038 "........" */ 0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "`......." */ 0x02,0x00,0x18,0x00,0x00,0x00,0x01,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00, /* 00000050 "........" */ 0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "p......." */ 0x03,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ 0x04,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ 0x00,0x00,0x00,0x1D,0x00,0x00,0x00,0x00 /* 00000078 "........" */ }; const unsigned char TemplateWaet[] = { 0x57,0x41,0x45,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WAET(..." */ 0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ }; const unsigned char TemplateWdat[] = { 0x57,0x44,0x41,0x54,0x5C,0x00,0x00,0x00, /* 00000000 "WDAT\..." */ 0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x20,0x00,0x00,0x00, /* 00000020 "(.. ..." */ 0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00, /* 00000028 "........" */ 0x58,0x02,0x00,0x00,0xFF,0x03,0x00,0x00, /* 00000030 "X......." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x0E,0x00,0x00,0x00,0x01,0x02,0x00,0x00, /* 00000040 "........" */ 0x01,0x10,0x00,0x02,0x60,0x04,0x00,0x00, /* 00000048 "....`..." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ 0x01,0x00,0x00,0x00 /* 00000058 "...." */ }; const unsigned char TemplateWddt[] = { 0x57,0x44,0x44,0x54,0x40,0x00,0x00,0x00, /* 00000000 "WDDT@..." */ 0x01,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */ }; const unsigned char TemplateWdrt[] = { 0x57,0x44,0x52,0x54,0x47,0x00,0x00,0x00, /* 00000000 "WDRTG..." */ 0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x20,0x00,0x00, /* 00000020 "(.. . .." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ". ......" */ 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0xFF,0xFF,0x00 /* 00000040 "......." */ }; const unsigned char TemplateWpbt[] = { 0x57,0x50,0x42,0x54,0x98,0x00,0x00,0x00, /* 00000000 "WPBT...." */ 0x01,0x83,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x78,0x56,0x34,0x12, /* 00000020 "... xV4." */ 0x00,0x00,0x00,0xBB,0x00,0x00,0x00,0xAA, /* 00000028 "........" */ 0x33,0x88,0x64,0x00,0x34,0x00,0x20,0x00, /* 00000030 "3.d.4. ." */ 0x73,0x00,0x63,0x00,0x6F,0x00,0x72,0x00, /* 00000038 "s.c.o.r." */ 0x65,0x00,0x20,0x00,0x61,0x00,0x6E,0x00, /* 00000040 "e. .a.n." */ 0x64,0x00,0x20,0x00,0x37,0x00,0x20,0x00, /* 00000048 "d. .7. ." */ 0x79,0x00,0x65,0x00,0x61,0x00,0x72,0x00, /* 00000050 "y.e.a.r." */ 0x73,0x00,0x20,0x00,0x61,0x00,0x67,0x00, /* 00000058 "s. .a.g." */ 0x6F,0x00,0x20,0x00,0x6F,0x00,0x75,0x00, /* 00000060 "o. .o.u." */ 0x72,0x00,0x20,0x00,0x66,0x00,0x61,0x00, /* 00000068 "r. .f.a." */ 0x74,0x00,0x68,0x00,0x65,0x00,0x72,0x00, /* 00000070 "t.h.e.r." */ 0x73,0x00,0x20,0x00,0x62,0x00,0x72,0x00, /* 00000078 "s. .b.r." */ 0x6F,0x00,0x75,0x00,0x67,0x00,0x68,0x00, /* 00000080 "o.u.g.h." */ 0x74,0x00,0x20,0x00,0x66,0x00,0x6F,0x00, /* 00000088 "t. .f.o." */ 0x72,0x00,0x74,0x00,0x68,0x00,0x00,0x00 /* 00000090 "r.t.h..." */ }; const unsigned char TemplateWsmt[] = { 0x57,0x53,0x4D,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WSMT(..." */ 0x00,0x08,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00 /* 00000020 "... ...." */ }; const unsigned char TemplateXenv[] = { 0x58,0x45,0x4E,0x56,0x39,0x00,0x00,0x00, /* 00000000 "XENV9..." */ 0x01,0x3A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".:INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x10, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x0A,0x00,0x20,0x00,0x00, /* 00000028 "..... .." */ 0x00,0x00,0x00,0x0B,0x25,0x00,0xBB,0xAA, /* 00000030 "....%..." */ 0x03 /* 00000038 "." */ }; const unsigned char TemplateXsdt[] = { 0x58,0x53,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "XSDTd..." */ 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */ 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000028 ".... ..." */ 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000030 "....0..." */ 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000038 "....@..." */ 0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000040 "....P..." */ 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000048 "....`..." */ 0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000050 "....p..." */ 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00 /* 00000060 "...." */ }; #endif diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c index 875e20e5df5a..b6efbc8511d5 100644 --- a/sys/contrib/dev/acpica/compiler/dtutils.c +++ b/sys/contrib/dev/acpica/compiler/dtutils.c @@ -1,980 +1,981 @@ /****************************************************************************** * * Module Name: dtutils.c - Utility routines for the data table compiler * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dtutils") /* Local prototypes */ static void DtSum ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue); /****************************************************************************** * * FUNCTION: DtError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * Op - Parse node where error happened * ExtraMessage - additional error message * * RETURN: None * * DESCRIPTION: Common error interface for data table compiler * *****************************************************************************/ void DtError ( UINT8 Level, UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage) { UINT32 Line = 0; /* Field object could be NULL */ if (FieldObject) { Line = FieldObject->Line; } /* Check if user wants to ignore this exception */ if (AslIsExceptionIgnored (AslGbl_Files[ASL_FILE_INPUT].Filename, Line, Level, MessageId)) { return; } if (FieldObject) { AslCommonError (Level, MessageId, FieldObject->Line, FieldObject->Line, FieldObject->ByteOffset, FieldObject->Column, AslGbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage); } else { AslCommonError (Level, MessageId, 0, 0, 0, 0, 0, ExtraMessage); } } /****************************************************************************** * * FUNCTION: DtNameError * * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * Op - Parse node where error happened * ExtraMessage - additional error message * * RETURN: None * * DESCRIPTION: Error interface for named objects * *****************************************************************************/ void DtNameError ( UINT8 Level, UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage) { switch (Level) { case ASL_WARNING2: case ASL_WARNING3: if (AslGbl_WarningLevel < Level) { return; } break; default: break; } if (FieldObject) { AslCommonError (Level, MessageId, FieldObject->Line, FieldObject->Line, FieldObject->ByteOffset, FieldObject->NameColumn, AslGbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage); } else { AslCommonError (Level, MessageId, 0, 0, 0, 0, 0, ExtraMessage); } } /******************************************************************************* * * FUNCTION: DtFatal * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Dump the error log and abort the compiler. Used for serious * compile or I/O errors * ******************************************************************************/ void DtFatal ( UINT16 MessageId, DT_FIELD *FieldObject, char *ExtraMessage) { DtError (ASL_ERROR, MessageId, FieldObject, ExtraMessage); /* * TBD: remove this entire function, DtFatal * * We cannot abort the compiler on error, because we may be compiling a * list of files. We must move on to the next file. */ #ifdef __OBSOLETE CmCleanupAndExit (); exit (1); #endif } /******************************************************************************* * * FUNCTION: DtDoConstant * * PARAMETERS: String - Only hex constants are supported, * regardless of whether the 0x prefix * is used * * RETURN: Converted Integer * * DESCRIPTION: Convert a string to an integer, with overflow/error checking. * ******************************************************************************/ UINT64 DtDoConstant ( char *String) { UINT64 ConvertedInteger; /* * TBD: The ImplicitStrtoul64 function does not report overflow * conditions. The input string is simply truncated. If it is * desired to report overflow to the table compiler, this should * somehow be added here. Note: integers that are prefixed with 0x * or not are both hex integers. */ ConvertedInteger = AcpiUtImplicitStrtoul64 (String); return (ConvertedInteger); } /****************************************************************************** * * FUNCTION: DtGetFieldValue * * PARAMETERS: Field - Current field list pointer * * RETURN: Field value * * DESCRIPTION: Get field value * *****************************************************************************/ char * DtGetFieldValue ( DT_FIELD *Field) { if (!Field) { return (NULL); } return (Field->Value); } /****************************************************************************** * * FUNCTION: DtGetFieldType * * PARAMETERS: Info - Data table info * * RETURN: Field type * * DESCRIPTION: Get field type * *****************************************************************************/ UINT8 DtGetFieldType ( ACPI_DMTABLE_INFO *Info) { UINT8 Type; /* DT_FLAG means that this is the start of a block of flag bits */ /* TBD - we can make these a separate opcode later */ if (Info->Flags & DT_FLAG) { return (DT_FIELD_TYPE_FLAGS_INTEGER); } /* Type is based upon the opcode for this field in the info table */ switch (Info->Opcode) { case ACPI_DMT_FLAG0: case ACPI_DMT_FLAG1: case ACPI_DMT_FLAG2: case ACPI_DMT_FLAG3: case ACPI_DMT_FLAG4: case ACPI_DMT_FLAG5: case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: case ACPI_DMT_FLAGS0: case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: case ACPI_DMT_FLAGS8_2: case ACPI_DMT_FLAGS4: case ACPI_DMT_FLAGS4_0: case ACPI_DMT_FLAGS4_4: case ACPI_DMT_FLAGS4_8: case ACPI_DMT_FLAGS4_12: case ACPI_DMT_FLAGS16_16: Type = DT_FIELD_TYPE_FLAG; break; case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_NAME6: case ACPI_DMT_NAME8: case ACPI_DMT_STRING: case ACPI_DMT_IVRS_UNTERMINATED_STRING: Type = DT_FIELD_TYPE_STRING; break; case ACPI_DMT_BUFFER: case ACPI_DMT_RAW_BUFFER: case ACPI_DMT_BUF7: case ACPI_DMT_BUF10: case ACPI_DMT_BUF12: case ACPI_DMT_BUF16: case ACPI_DMT_BUF18: case ACPI_DMT_BUF128: case ACPI_DMT_PCI_PATH: case ACPI_DMT_PMTT_VENDOR: Type = DT_FIELD_TYPE_BUFFER; break; case ACPI_DMT_GAS: case ACPI_DMT_HESTNTFY: case ACPI_DMT_IORTMEM: Type = DT_FIELD_TYPE_INLINE_SUBTABLE; break; case ACPI_DMT_UNICODE: case ACPI_DMT_WPBT_UNICODE: Type = DT_FIELD_TYPE_UNICODE; break; case ACPI_DMT_UUID: Type = DT_FIELD_TYPE_UUID; break; case ACPI_DMT_DEVICE_PATH: Type = DT_FIELD_TYPE_DEVICE_PATH; break; case ACPI_DMT_LABEL: Type = DT_FIELD_TYPE_LABEL; break; default: Type = DT_FIELD_TYPE_INTEGER; break; } return (Type); } /****************************************************************************** * * FUNCTION: DtGetBufferLength * * PARAMETERS: Buffer - List of integers, * for example "10 3A 4F 2E" * * RETURN: Count of integer * * DESCRIPTION: Get length of bytes needed to store the integers * *****************************************************************************/ UINT32 DtGetBufferLength ( char *Buffer) { UINT32 ByteLength = 0; while (*Buffer) { if (*Buffer == ' ') { ByteLength++; while (*Buffer == ' ') { Buffer++; } } Buffer++; } return (++ByteLength); } /****************************************************************************** * * FUNCTION: DtGetFieldLength * * PARAMETERS: Field - Current field * Info - Data table info * * RETURN: Field length * * DESCRIPTION: Get length of bytes needed to compile the field * * Note: This function must remain in sync with AcpiDmDumpTable. * *****************************************************************************/ UINT32 DtGetFieldLength ( DT_FIELD *Field, ACPI_DMTABLE_INFO *Info) { UINT32 ByteLength = 0; char *Value; /* Length is based upon the opcode for this field in the info table */ switch (Info->Opcode) { case ACPI_DMT_FLAG0: case ACPI_DMT_FLAG1: case ACPI_DMT_FLAG2: case ACPI_DMT_FLAG3: case ACPI_DMT_FLAG4: case ACPI_DMT_FLAG5: case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: case ACPI_DMT_FLAGS0: case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: case ACPI_DMT_FLAGS8_2: case ACPI_DMT_FLAGS4: case ACPI_DMT_FLAGS4_0: case ACPI_DMT_FLAGS4_4: case ACPI_DMT_FLAGS4_8: case ACPI_DMT_FLAGS4_12: case ACPI_DMT_FLAGS16_16: case ACPI_DMT_LABEL: case ACPI_DMT_EXTRA_TEXT: ByteLength = 0; break; case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: case ACPI_DMT_ACCWIDTH: case ACPI_DMT_CEDT: case ACPI_DMT_IVRS: case ACPI_DMT_IVRS_DE: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: case ACPI_DMT_NHLT1: case ACPI_DMT_NHLT1a: case ACPI_DMT_NHLT1b: case ACPI_DMT_NHLT1c: case ACPI_DMT_NHLT1d: case ACPI_DMT_NHLT1f: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: case ACPI_DMT_RGRT: case ACPI_DMT_SDEV: case ACPI_DMT_SRAT: case ACPI_DMT_AEST: case ACPI_DMT_AEST_RES: case ACPI_DMT_AEST_XFACE: case ACPI_DMT_AEST_XRUPT: case ACPI_DMT_ASF: + case ACPI_DMT_CDAT: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: case ACPI_DMT_EINJACT: case ACPI_DMT_EINJINST: case ACPI_DMT_ERSTACT: case ACPI_DMT_ERSTINST: case ACPI_DMT_DMAR_SCOPE: case ACPI_DMT_VIOT: ByteLength = 1; break; case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: case ACPI_DMT_HMAT: case ACPI_DMT_NFIT: case ACPI_DMT_NHLT1e: case ACPI_DMT_PCI_PATH: case ACPI_DMT_PHAT: ByteLength = 2; break; case ACPI_DMT_UINT24: ByteLength = 3; break; case ACPI_DMT_UINT32: case ACPI_DMT_AEST_CACHE: case ACPI_DMT_AEST_GIC: case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_LPIT: case ACPI_DMT_TPM2: ByteLength = 4; break; case ACPI_DMT_UINT40: ByteLength = 5; break; case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: ByteLength = 6; break; case ACPI_DMT_UINT56: case ACPI_DMT_BUF7: ByteLength = 7; break; case ACPI_DMT_UINT64: case ACPI_DMT_NAME8: ByteLength = 8; break; case ACPI_DMT_STRING: Value = DtGetFieldValue (Field); if (Value) { ByteLength = strlen (Value) + 1; } else { /* At this point, this is a fatal error */ sprintf (AslGbl_MsgBuffer, "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, AslGbl_MsgBuffer); return (0); } break; case ACPI_DMT_IVRS_UNTERMINATED_STRING: Value = DtGetFieldValue (Field); if (Value) { ByteLength = strlen (Value); } else { /* At this point, this is a fatal error */ sprintf (AslGbl_MsgBuffer, "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, AslGbl_MsgBuffer); return (0); } break; case ACPI_DMT_GAS: ByteLength = sizeof (ACPI_GENERIC_ADDRESS); break; case ACPI_DMT_HESTNTFY: ByteLength = sizeof (ACPI_HEST_NOTIFY); break; case ACPI_DMT_IORTMEM: ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS); break; case ACPI_DMT_BUFFER: case ACPI_DMT_RAW_BUFFER: case ACPI_DMT_PMTT_VENDOR: Value = DtGetFieldValue (Field); if (Value) { ByteLength = DtGetBufferLength (Value); } else { /* At this point, this is a fatal error */ sprintf (AslGbl_MsgBuffer, "Expected \"%s\"", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, AslGbl_MsgBuffer); return (0); } break; case ACPI_DMT_BUF10: ByteLength = 10; break; case ACPI_DMT_BUF12: ByteLength = 12; break; case ACPI_DMT_BUF16: case ACPI_DMT_UUID: ByteLength = 16; break; case ACPI_DMT_BUF18: ByteLength = 18; break; case ACPI_DMT_BUF128: ByteLength = 128; break; case ACPI_DMT_UNICODE: case ACPI_DMT_WPBT_UNICODE: Value = DtGetFieldValue (Field); /* TBD: error if Value is NULL? (as below?) */ ByteLength = (strlen (Value) + 1) * sizeof (UINT16); break; default: DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid table opcode"); return (0); } return (ByteLength); } /****************************************************************************** * * FUNCTION: DtSum * * PARAMETERS: DT_WALK_CALLBACK: * Subtable - Subtable * Context - Unused * ReturnValue - Store the checksum of subtable * * RETURN: Status * * DESCRIPTION: Get the checksum of subtable * *****************************************************************************/ static void DtSum ( DT_SUBTABLE *Subtable, void *Context, void *ReturnValue) { UINT8 Checksum; UINT8 *Sum = ReturnValue; - Checksum = AcpiTbChecksum (Subtable->Buffer, Subtable->Length); + Checksum = AcpiUtChecksum (Subtable->Buffer, Subtable->Length); *Sum = (UINT8) (*Sum + Checksum); } /****************************************************************************** * * FUNCTION: DtSetTableChecksum * * PARAMETERS: ChecksumPointer - Where to return the checksum * * RETURN: None * * DESCRIPTION: Set checksum of the whole data table into the checksum field * *****************************************************************************/ void DtSetTableChecksum ( UINT8 *ChecksumPointer) { UINT8 Checksum = 0; UINT8 OldSum; DtWalkTableTree (AslGbl_RootTable, DtSum, NULL, &Checksum); OldSum = *ChecksumPointer; Checksum = (UINT8) (Checksum - OldSum); /* Compute the final checksum */ Checksum = (UINT8) (0 - Checksum); *ChecksumPointer = Checksum; } /****************************************************************************** * * FUNCTION: DtSetTableLength * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Walk the subtables and set all the length fields * *****************************************************************************/ void DtSetTableLength ( void) { DT_SUBTABLE *ParentTable; DT_SUBTABLE *ChildTable; ParentTable = AslGbl_RootTable; ChildTable = NULL; if (!ParentTable) { return; } DtSetSubtableLength (ParentTable); while (1) { ChildTable = DtGetNextSubtable (ParentTable, ChildTable); if (ChildTable) { if (ChildTable->LengthField) { DtSetSubtableLength (ChildTable); } if (ChildTable->Child) { ParentTable = ChildTable; ChildTable = NULL; } else { ParentTable->TotalLength += ChildTable->TotalLength; if (ParentTable->LengthField) { DtSetSubtableLength (ParentTable); } } } else { ChildTable = ParentTable; if (ChildTable == AslGbl_RootTable) { break; } ParentTable = DtGetParentSubtable (ParentTable); ParentTable->TotalLength += ChildTable->TotalLength; if (ParentTable->LengthField) { DtSetSubtableLength (ParentTable); } } } } /****************************************************************************** * * FUNCTION: DtWalkTableTree * * PARAMETERS: StartTable - Subtable in the tree where walking begins * UserFunction - Called during the walk * Context - Passed to user function * ReturnValue - The return value of UserFunction * * RETURN: None * * DESCRIPTION: Performs a depth-first walk of the subtable tree * *****************************************************************************/ void DtWalkTableTree ( DT_SUBTABLE *StartTable, DT_WALK_CALLBACK UserFunction, void *Context, void *ReturnValue) { DT_SUBTABLE *ParentTable; DT_SUBTABLE *ChildTable; ParentTable = StartTable; ChildTable = NULL; if (!ParentTable) { return; } UserFunction (ParentTable, Context, ReturnValue); while (1) { ChildTable = DtGetNextSubtable (ParentTable, ChildTable); if (ChildTable) { UserFunction (ChildTable, Context, ReturnValue); if (ChildTable->Child) { ParentTable = ChildTable; ChildTable = NULL; } } else { ChildTable = ParentTable; if (ChildTable == AslGbl_RootTable) { break; } ParentTable = DtGetParentSubtable (ParentTable); if (ChildTable->Peer == StartTable) { break; } } } } diff --git a/sys/contrib/dev/acpica/components/debugger/dbutils.c b/sys/contrib/dev/acpica/components/debugger/dbutils.c index a98a3a61eeb9..6e3a2b107ad9 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbutils.c +++ b/sys/contrib/dev/acpica/components/debugger/dbutils.c @@ -1,621 +1,813 @@ /******************************************************************************* * * Module Name: dbutils - AML debugger utilities * ******************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbutils") /* Local prototypes */ #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS AcpiDbSecondPassParse ( ACPI_PARSE_OBJECT *Root); void AcpiDbDumpBuffer ( UINT32 Address); #endif /******************************************************************************* * * FUNCTION: AcpiDbMatchArgument * * PARAMETERS: UserArgument - User command line * Arguments - Array of commands to match against * * RETURN: Index into command array or ACPI_TYPE_NOT_FOUND if not found * * DESCRIPTION: Search command array for a command match * ******************************************************************************/ ACPI_OBJECT_TYPE AcpiDbMatchArgument ( char *UserArgument, ACPI_DB_ARGUMENT_INFO *Arguments) { +<<<<<<< HEAD:sys/contrib/dev/acpica/components/debugger/dbutils.c +======= + + if (!ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + /* Make sure signature is all ASCII and a valid ACPI name */ + + if (!AcpiUtValidNameseg (Table->Signature)) + { + fprintf (stderr, "Table signature (0x%8.8X) is invalid\n", + *(UINT32 *) Table->Signature); + return (FALSE); + } + + /* Check for minimum table length */ + + if (Table->Length < sizeof (ACPI_TABLE_HEADER)) + { + fprintf (stderr, "Table length (0x%8.8X) is invalid\n", + Table->Length); + return (FALSE); + } + } + + return (TRUE); +} + + +/****************************************************************************** + * + * FUNCTION: ApIsValidChecksum + * + * PARAMETERS: Table - Pointer to table to be validated + * + * RETURN: TRUE if the checksum appears to be valid. FALSE otherwise. + * + * DESCRIPTION: Check for a valid ACPI table checksum. + * + ******************************************************************************/ + +BOOLEAN +ApIsValidChecksum ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_TABLE_RSDP *Rsdp; + + + if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + /* + * Checksum for RSDP. + * Note: Other checksums are computed during the table dump. + */ + Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + Status = AcpiTbValidateRsdp (Rsdp); + } + else + { + /* We don't have to check for a CDAT here, since CDAT is not in the RSDT/XSDT */ + + Status = AcpiUtVerifyChecksum (Table, Table->Length); + } + + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "%4.4s: Warning: wrong checksum in table\n", + Table->Signature); + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: ApGetTableLength + * + * PARAMETERS: Table - Pointer to the table + * + * RETURN: Table length + * + * DESCRIPTION: Obtain table length according to table signature. + * + ******************************************************************************/ + +UINT32 +ApGetTableLength ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_TABLE_RSDP *Rsdp; + + + /* Check if table is valid */ + + if (!ApIsValidHeader (Table)) + { + return (0); + } + + if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + return (AcpiTbGetRsdpLength (Rsdp)); + } + + /* Normal ACPI table */ + + return (Table->Length); +} + + +/****************************************************************************** + * + * FUNCTION: ApDumpTableBuffer + * + * PARAMETERS: Table - ACPI table to be dumped + * Instance - ACPI table instance no. to be dumped + * Address - Physical address of the table + * + * RETURN: None + * + * DESCRIPTION: Dump an ACPI table in standard ASCII hex format, with a + * header that is compatible with the AcpiXtract utility. + * + ******************************************************************************/ + +static int +ApDumpTableBuffer ( + ACPI_TABLE_HEADER *Table, + UINT32 Instance, + ACPI_PHYSICAL_ADDRESS Address) +{ + UINT32 TableLength; + + + TableLength = ApGetTableLength (Table); + + /* Print only the header if requested */ + + if (Gbl_SummaryMode) + { + AcpiTbPrintTableHeader (Address, Table); + return (0); + } + + /* Dump to binary file if requested */ + + if (Gbl_BinaryMode) + { + return (ApWriteToBinaryFile (Table, Instance)); + } + + /* + * Dump the table with header for use with acpixtract utility. + * Note: simplest to just always emit a 64-bit address. AcpiXtract + * utility can handle this. + */ + fprintf (Gbl_OutputFile, "%4.4s @ 0x%8.8X%8.8X\n", + Table->Signature, ACPI_FORMAT_UINT64 (Address)); + + AcpiUtDumpBufferToFile (Gbl_OutputFile, + ACPI_CAST_PTR (UINT8, Table), TableLength, + DB_BYTE_DISPLAY, 0); + fprintf (Gbl_OutputFile, "\n"); + return (0); +} + + +/****************************************************************************** + * + * FUNCTION: ApDumpAllTables + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Get all tables from the RSDT/XSDT (or at least all of the + * tables that we can possibly get). + * + ******************************************************************************/ + +int +ApDumpAllTables ( + void) +{ + ACPI_TABLE_HEADER *Table; + UINT32 Instance = 0; + ACPI_PHYSICAL_ADDRESS Address; + ACPI_STATUS Status; + int TableStatus; +>>>>>>> a799bdd9d50e (Import ACPICA 20221020):source/tools/acpidump/apdump.c UINT32 i; if (!UserArgument || UserArgument[0] == 0) { return (ACPI_TYPE_NOT_FOUND); } for (i = 0; Arguments[i].Name; i++) { if (strstr ( ACPI_CAST_PTR (char, Arguments[i].Name), ACPI_CAST_PTR (char, UserArgument)) == Arguments[i].Name) { return (i); } } /* Argument not recognized */ return (ACPI_TYPE_NOT_FOUND); } /******************************************************************************* * * FUNCTION: AcpiDbSetOutputDestination * * PARAMETERS: OutputFlags - Current flags word * * RETURN: None * * DESCRIPTION: Set the current destination for debugger output. Also sets * the debug output level accordingly. * ******************************************************************************/ void AcpiDbSetOutputDestination ( UINT32 OutputFlags) { AcpiGbl_DbOutputFlags = (UINT8) OutputFlags; if ((OutputFlags & ACPI_DB_REDIRECTABLE_OUTPUT) && AcpiGbl_DbOutputToFile) { AcpiDbgLevel = AcpiGbl_DbDebugLevel; } else { AcpiDbgLevel = AcpiGbl_DbConsoleDebugLevel; } } /******************************************************************************* * * FUNCTION: AcpiDbDumpExternalObject * * PARAMETERS: ObjDesc - External ACPI object to dump * Level - Nesting level. * * RETURN: None * * DESCRIPTION: Dump the contents of an ACPI external object * ******************************************************************************/ void AcpiDbDumpExternalObject ( ACPI_OBJECT *ObjDesc, UINT32 Level) { UINT32 i; if (!ObjDesc) { AcpiOsPrintf ("[Null Object]\n"); return; } for (i = 0; i < Level; i++) { AcpiOsPrintf (" "); } switch (ObjDesc->Type) { case ACPI_TYPE_ANY: AcpiOsPrintf ("[Null Object] (Type=0)\n"); break; case ACPI_TYPE_INTEGER: AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; case ACPI_TYPE_STRING: AcpiOsPrintf ("[String] Length %.2X = ", ObjDesc->String.Length); AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); AcpiOsPrintf ("\n"); break; case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { if (ObjDesc->Buffer.Length > 16) { AcpiOsPrintf ("\n"); } AcpiUtDebugDumpBuffer ( ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT); } else { AcpiOsPrintf ("\n"); } break; case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Package] Contains %u Elements:\n", ObjDesc->Package.Count); for (i = 0; i < ObjDesc->Package.Count; i++) { AcpiDbDumpExternalObject ( &ObjDesc->Package.Elements[i], Level+1); } break; case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[Object Reference] = "); AcpiDbDisplayInternalObject (ObjDesc->Reference.Handle, NULL); break; case ACPI_TYPE_PROCESSOR: AcpiOsPrintf ("[Processor]\n"); break; case ACPI_TYPE_POWER: AcpiOsPrintf ("[Power Resource]\n"); break; default: AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Type); break; } } /******************************************************************************* * * FUNCTION: AcpiDbPrepNamestring * * PARAMETERS: Name - String to prepare * * RETURN: None * * DESCRIPTION: Translate all forward slashes and dots to backslashes. * ******************************************************************************/ void AcpiDbPrepNamestring ( char *Name) { if (!Name) { return; } AcpiUtStrupr (Name); /* Convert a leading forward slash to a backslash */ if (*Name == '/') { *Name = '\\'; } /* Ignore a leading backslash, this is the root prefix */ if (ACPI_IS_ROOT_PREFIX (*Name)) { Name++; } /* Convert all slash path separators to dots */ while (*Name) { if ((*Name == '/') || (*Name == '\\')) { *Name = '.'; } Name++; } } /******************************************************************************* * * FUNCTION: AcpiDbLocalNsLookup * * PARAMETERS: Name - Name to lookup * * RETURN: Pointer to a namespace node, null on failure * * DESCRIPTION: Lookup a name in the ACPI namespace * * Note: Currently begins search from the root. Could be enhanced to use * the current prefix (scope) node as the search beginning point. * ******************************************************************************/ ACPI_NAMESPACE_NODE * AcpiDbLocalNsLookup ( char *Name) { char *InternalPath; ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node = NULL; AcpiDbPrepNamestring (Name); /* Build an internal namestring */ Status = AcpiNsInternalizeName (Name, &InternalPath); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Invalid namestring: %s\n", Name); return (NULL); } /* * Lookup the name. * (Uses root node as the search starting point) */ Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not locate name: %s, %s\n", Name, AcpiFormatException (Status)); } ACPI_FREE (InternalPath); return (Node); } /******************************************************************************* * * FUNCTION: AcpiDbUint32ToHexString * * PARAMETERS: Value - The value to be converted to string * Buffer - Buffer for result (not less than 11 bytes) * * RETURN: None * * DESCRIPTION: Convert the unsigned 32-bit value to the hexadecimal image * * NOTE: It is the caller's responsibility to ensure that the length of buffer * is sufficient. * ******************************************************************************/ void AcpiDbUint32ToHexString ( UINT32 Value, char *Buffer) { int i; if (Value == 0) { strcpy (Buffer, "0"); return; } Buffer[8] = '\0'; for (i = 7; i >= 0; i--) { Buffer[i] = AcpiGbl_UpperHexDigits [Value & 0x0F]; Value = Value >> 4; } } #ifdef ACPI_OBSOLETE_FUNCTIONS /******************************************************************************* * * FUNCTION: AcpiDbSecondPassParse * * PARAMETERS: Root - Root of the parse tree * * RETURN: Status * * DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until * second pass to parse the control methods * ******************************************************************************/ ACPI_STATUS AcpiDbSecondPassParse ( ACPI_PARSE_OBJECT *Root) { ACPI_PARSE_OBJECT *Op = Root; ACPI_PARSE_OBJECT *Method; ACPI_PARSE_OBJECT *SearchOp; ACPI_PARSE_OBJECT *StartOp; ACPI_STATUS Status = AE_OK; UINT32 BaseAmlOffset; ACPI_WALK_STATE *WalkState; ACPI_FUNCTION_ENTRY (); AcpiOsPrintf ("Pass two parse ....\n"); while (Op) { if (Op->Common.AmlOpcode == AML_METHOD_OP) { Method = Op; /* Create a new walk state for the parse */ WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); if (!WalkState) { return (AE_NO_MEMORY); } /* Init the Walk State */ WalkState->ParserState.Aml = WalkState->ParserState.AmlStart = Method->Named.Data; WalkState->ParserState.AmlEnd = WalkState->ParserState.PkgEnd = Method->Named.Data + Method->Named.Length; WalkState->ParserState.StartScope = Op; WalkState->DescendingCallback = AcpiDsLoad1BeginOp; WalkState->AscendingCallback = AcpiDsLoad1EndOp; /* Perform the AML parse */ Status = AcpiPsParseAml (WalkState); BaseAmlOffset = (Method->Common.Value.Arg)->Common.AmlOffset + 1; StartOp = (Method->Common.Value.Arg)->Common.Next; SearchOp = StartOp; while (SearchOp) { SearchOp->Common.AmlOffset += BaseAmlOffset; SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp); } } if (Op->Common.AmlOpcode == AML_REGION_OP) { /* TBD: [Investigate] this isn't quite the right thing to do! */ /* * * Method = (ACPI_DEFERRED_OP *) Op; * Status = AcpiPsParseAml (Op, Method->Body, Method->BodyLength); */ } if (ACPI_FAILURE (Status)) { break; } Op = AcpiPsGetDepthNext (Root, Op); } return (Status); } /******************************************************************************* * * FUNCTION: AcpiDbDumpBuffer * * PARAMETERS: Address - Pointer to the buffer * * RETURN: None * * DESCRIPTION: Print a portion of a buffer * ******************************************************************************/ void AcpiDbDumpBuffer ( UINT32 Address) { AcpiOsPrintf ("\nLocation %X:\n", Address); AcpiDbgLevel |= ACPI_LV_TABLES; AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); } #endif diff --git a/sys/contrib/dev/acpica/components/events/evevent.c b/sys/contrib/dev/acpica/components/events/evevent.c index e230ceff01e1..07c06c7c7839 100644 --- a/sys/contrib/dev/acpica/components/events/evevent.c +++ b/sys/contrib/dev/acpica/components/events/evevent.c @@ -1,449 +1,456 @@ /****************************************************************************** * * Module Name: evevent - Fixed Event handling and dispatch * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") #if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* Local prototypes */ static ACPI_STATUS AcpiEvFixedEventInitialize ( void); static UINT32 AcpiEvFixedEventDispatch ( UINT32 Event); /******************************************************************************* * * FUNCTION: AcpiEvInitializeEvents * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Initialize global data structures for ACPI events (Fixed, GPE) * ******************************************************************************/ ACPI_STATUS AcpiEvInitializeEvents ( void) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvInitializeEvents); /* If Hardware Reduced flag is set, there are no fixed events */ if (AcpiGbl_ReducedHardware) { return_ACPI_STATUS (AE_OK); } /* * Initialize the Fixed and General Purpose Events. This is done prior to * enabling SCIs to prevent interrupts from occurring before the handlers * are installed. */ Status = AcpiEvFixedEventInitialize (); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Unable to initialize fixed events")); return_ACPI_STATUS (Status); } Status = AcpiEvGpeInitialize (); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Unable to initialize general purpose events")); return_ACPI_STATUS (Status); } return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiEvInstallXruptHandlers * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Install interrupt handlers for the SCI and Global Lock * ******************************************************************************/ ACPI_STATUS AcpiEvInstallXruptHandlers ( void) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvInstallXruptHandlers); /* If Hardware Reduced flag is set, there is no ACPI h/w */ if (AcpiGbl_ReducedHardware) { return_ACPI_STATUS (AE_OK); } /* Install the SCI handler */ Status = AcpiEvInstallSciHandler (); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Unable to install System Control Interrupt handler")); return_ACPI_STATUS (Status); } /* Install the handler for the Global Lock */ Status = AcpiEvInitGlobalLockHandler (); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Unable to initialize Global Lock handler")); return_ACPI_STATUS (Status); } AcpiGbl_EventsInitialized = TRUE; return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiEvFixedEventInitialize * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Install the fixed event handlers and disable all fixed events. * ******************************************************************************/ static ACPI_STATUS AcpiEvFixedEventInitialize ( void) { UINT32 i; ACPI_STATUS Status; /* * Initialize the structure that keeps track of fixed event handlers and * disable all of the fixed events. */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { AcpiGbl_FixedEventHandlers[i].Handler = NULL; AcpiGbl_FixedEventHandlers[i].Context = NULL; /* Disable the fixed event */ if (AcpiGbl_FixedEventInfo[i].EnableRegisterId != 0xFF) { Status = AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[i].EnableRegisterId, - ACPI_DISABLE_EVENT); + (i == ACPI_EVENT_PCIE_WAKE) ? + ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); if (ACPI_FAILURE (Status)) { return (Status); } } } return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiEvFixedEventDetect * * PARAMETERS: None * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * * DESCRIPTION: Checks the PM status register for active fixed events * ******************************************************************************/ UINT32 AcpiEvFixedEventDetect ( void) { UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; UINT32 FixedStatus; UINT32 FixedEnable; UINT32 i; ACPI_STATUS Status; ACPI_FUNCTION_NAME (EvFixedEventDetect); /* * Read the fixed feature status and enable registers, as all the cases * depend on their values. Ignore errors here. */ Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); if (ACPI_FAILURE (Status)) { return (IntStatus); } + if (FixedEnable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE) + FixedEnable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE; + else + FixedEnable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE; + ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Event Block: Enable %08X Status %08X\n", FixedEnable, FixedStatus)); /* * Check for all possible Fixed Events and dispatch those that are active */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { /* Both the status and enable bits must be on for this event */ if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) && (FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask)) { /* * Found an active (signalled) event. Invoke global event * handler if present. */ AcpiFixedEventCount[i]++; if (AcpiGbl_GlobalEventHandler) { AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL, i, AcpiGbl_GlobalEventHandlerContext); } IntStatus |= AcpiEvFixedEventDispatch (i); } } return (IntStatus); } /******************************************************************************* * * FUNCTION: AcpiEvFixedEventDispatch * * PARAMETERS: Event - Event type * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * * DESCRIPTION: Clears the status bit for the requested event, calls the * handler that previously registered for the event. * NOTE: If there is no handler for the event, the event is * disabled to prevent further interrupts. * ******************************************************************************/ static UINT32 AcpiEvFixedEventDispatch ( UINT32 Event) { ACPI_FUNCTION_ENTRY (); /* Clear the status bit */ (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[Event].StatusRegisterId, ACPI_CLEAR_STATUS); /* * Make sure that a handler exists. If not, report an error * and disable the event to prevent further interrupts. */ if (!AcpiGbl_FixedEventHandlers[Event].Handler) { (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[Event].EnableRegisterId, - ACPI_DISABLE_EVENT); + (Event == ACPI_EVENT_PCIE_WAKE) ? + ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); ACPI_ERROR ((AE_INFO, "No installed handler for fixed event - %s (%u), disabling", AcpiUtGetEventName (Event), Event)); return (ACPI_INTERRUPT_NOT_HANDLED); } /* Invoke the Fixed Event handler */ return ((AcpiGbl_FixedEventHandlers[Event].Handler)( AcpiGbl_FixedEventHandlers[Event].Context)); } #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c index 5ce29c95881a..537da1c24184 100644 --- a/sys/contrib/dev/acpica/components/events/evregion.c +++ b/sys/contrib/dev/acpica/components/events/evregion.c @@ -1,1076 +1,1084 @@ /****************************************************************************** * * Module Name: evregion - Operation Region support * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evregion") extern UINT8 AcpiGbl_DefaultAddressSpaces[]; /* Local prototypes */ static void AcpiEvExecuteOrphanRegMethod ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_ADR_SPACE_TYPE SpaceId); static ACPI_STATUS AcpiEvRegRun ( ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue); /******************************************************************************* * * FUNCTION: AcpiEvInitializeOpRegions * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Execute _REG methods for all Operation Regions that have * an installed default region handler. * ******************************************************************************/ ACPI_STATUS AcpiEvInitializeOpRegions ( void) { ACPI_STATUS Status; UINT32 i; ACPI_FUNCTION_TRACE (EvInitializeOpRegions); Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Run the _REG methods for OpRegions in each default address space */ for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) { /* * Make sure the installed handler is the DEFAULT handler. If not the * default, the _REG methods will have already been run (when the * handler was installed) */ if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode, AcpiGbl_DefaultAddressSpaces[i])) { AcpiEvExecuteRegMethods (AcpiGbl_RootNode, AcpiGbl_DefaultAddressSpaces[i], ACPI_REG_CONNECT); } } (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiEvAddressSpaceDispatch * * PARAMETERS: RegionObj - Internal region object * FieldObj - Corresponding field. Can be NULL. * Function - Read or Write operation * RegionOffset - Where in the region to read or write * BitWidth - Field width in bits (8, 16, 32, or 64) * Value - Pointer to in or out value, must be * a full 64-bit integer * * RETURN: Status * * DESCRIPTION: Dispatch an address space or operation region access to * a previously installed handler. * * NOTE: During early initialization, we always install the default region * handlers for Memory, I/O and PCI_Config. This ensures that these operation * region address spaces are always available as per the ACPI specification. * This is especially needed in order to support the execution of * module-level AML code during loading of the ACPI tables. * ******************************************************************************/ ACPI_STATUS AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value) { ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; ACPI_ADR_SPACE_SETUP RegionSetup; ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; ACPI_CONNECTION_INFO *Context; ACPI_MUTEX ContextMutex; BOOLEAN ContextLocked; ACPI_PHYSICAL_ADDRESS Address; ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch); RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_ACPI_STATUS (AE_NOT_EXIST); } /* Ensure that there is a handler associated with this region */ HandlerDesc = RegionObj->Region.Handler; if (!HandlerDesc) { ACPI_ERROR ((AE_INFO, "No handler for Region [%4.4s] (%p) [%s]", AcpiUtGetNodeName (RegionObj->Region.Node), RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } Context = HandlerDesc->AddressSpace.Context; ContextMutex = HandlerDesc->AddressSpace.ContextMutex; ContextLocked = FALSE; /* * It may be the case that the region has never been initialized. * Some types of regions require special init code */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { /* This region has not been initialized yet, do it */ RegionSetup = HandlerDesc->AddressSpace.Setup; if (!RegionSetup) { /* No initialization routine, exit with error */ ACPI_ERROR ((AE_INFO, "No init routine for region(%p) [%s]", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } if (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_COMM) { ACPI_PCC_INFO *Ctx = HandlerDesc->AddressSpace.Context; Ctx->InternalBuffer = FieldObj->Field.InternalPccBuffer; Ctx->Length = (UINT16) RegionObj->Region.Length; Ctx->SubspaceId = (UINT8) RegionObj->Region.Address; } + if (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE) + { + ACPI_FFH_INFO *Ctx = HandlerDesc->AddressSpace.Context; + + Ctx->Length = RegionObj->Region.Length; + Ctx->Offset = RegionObj->Region.Address; + } + /* * We must exit the interpreter because the region setup will * potentially execute control methods (for example, the _REG method * for this region) */ AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, Context, &RegionContext); /* Re-enter the interpreter */ AcpiExEnterInterpreter (); /* Check for failure of the Region Setup */ if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During region initialization: [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (Status); } /* Region initialization may have been completed by RegionSetup */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; /* * Save the returned context for use in all accesses to * the handler for this particular region */ if (!(RegionObj2->Extra.RegionContext)) { RegionObj2->Extra.RegionContext = RegionContext; } } } /* We have everything we need, we can invoke the address space handler */ Handler = HandlerDesc->AddressSpace.Handler; Address = (RegionObj->Region.Address + RegionOffset); ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", &RegionObj->Region.Handler->AddressSpace, Handler, ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); if (!(HandlerDesc->AddressSpace.HandlerFlags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { /* * For handlers other than the default (supplied) handlers, we must * exit the interpreter because the handler *might* block -- we don't * know what it will do, so we can't hold the lock on the interpreter. */ AcpiExExitInterpreter(); } /* * Special handling for GenericSerialBus and GeneralPurposeIo: * There are three extra parameters that must be passed to the * handler via the context: * 1) Connection buffer, a resource template from Connection() op * 2) Length of the above buffer * 3) Actual access length from the AccessAs() op * * Since we pass these extra parameters via the context, which is * shared between threads, we must lock the context to avoid these * parameters being changed from another thread before the handler * has completed running. * * In addition, for GeneralPurposeIo, the Address and BitWidth fields * are defined as follows: * 1) Address is the pin number index of the field (bit offset from * the previous Connection) * 2) BitWidth is the actual bit length of the field (number of pins) */ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) && Context && FieldObj) { Status = AcpiOsAcquireMutex (ContextMutex, ACPI_WAIT_FOREVER); if (ACPI_FAILURE (Status)) { goto ReEnterInterpreter; } ContextLocked = TRUE; /* Get the Connection (ResourceTemplate) buffer */ Context->Connection = FieldObj->Field.ResourceBuffer; Context->Length = FieldObj->Field.ResourceLength; Context->AccessLength = FieldObj->Field.AccessLength; if (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) { Address = FieldObj->Field.PinNumberIndex; BitWidth = FieldObj->Field.BitLength; } } /* Call the handler */ Status = Handler (Function, Address, BitWidth, Value, Context, RegionObj2->Extra.RegionContext); if (ContextLocked) { AcpiOsReleaseMutex (ContextMutex); } if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); /* * Special case for an EC timeout. These are seen so frequently * that an additional error message is helpful */ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && (Status == AE_TIME)) { ACPI_ERROR ((AE_INFO, "Timeout from EC hardware or EC device driver")); } } ReEnterInterpreter: if (!(HandlerDesc->AddressSpace.HandlerFlags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { /* * We just returned from a non-default handler, we must re-enter the * interpreter */ AcpiExEnterInterpreter (); } return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiEvDetachRegion * * PARAMETERS: RegionObj - Region Object * AcpiNsIsLocked - Namespace Region Already Locked? * * RETURN: None * * DESCRIPTION: Break the association between the handler and the region * this is a two way association. * ******************************************************************************/ void AcpiEvDetachRegion ( ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked) { ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_OPERAND_OBJECT *StartDesc; ACPI_OPERAND_OBJECT **LastObjPtr; ACPI_ADR_SPACE_SETUP RegionSetup; void **RegionContext; ACPI_OPERAND_OBJECT *RegionObj2; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvDetachRegion); RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_VOID; } RegionContext = &RegionObj2->Extra.RegionContext; /* Get the address handler from the region object */ HandlerObj = RegionObj->Region.Handler; if (!HandlerObj) { /* This region has no handler, all done */ return_VOID; } /* Find this region in the handler's list */ ObjDesc = HandlerObj->AddressSpace.RegionList; StartDesc = ObjDesc; LastObjPtr = &HandlerObj->AddressSpace.RegionList; while (ObjDesc) { /* Is this the correct Region? */ if (ObjDesc == RegionObj) { ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Removing Region %p from address handler %p\n", RegionObj, HandlerObj)); /* This is it, remove it from the handler's list */ *LastObjPtr = ObjDesc->Region.Next; ObjDesc->Region.Next = NULL; /* Must clear field */ if (AcpiNsIsLocked) { Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_VOID; } } /* Now stop region accesses by executing the _REG method */ Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_DISCONNECT); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "from region _REG, [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); } if (AcpiNsIsLocked) { Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_VOID; } } /* * If the region has been activated, call the setup handler with * the deactivate notification */ if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE) { RegionSetup = HandlerObj->AddressSpace.Setup; Status = RegionSetup (RegionObj, ACPI_REGION_DEACTIVATE, HandlerObj->AddressSpace.Context, RegionContext); /* * RegionContext should have been released by the deactivate * operation. We don't need access to it anymore here. */ if (RegionContext) { *RegionContext = NULL; } /* Init routine may fail, Just ignore errors */ if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "from region handler - deactivate, [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); } RegionObj->Region.Flags &= ~(AOPOBJ_SETUP_COMPLETE); } /* * Remove handler reference in the region * * NOTE: this doesn't mean that the region goes away, the region * is just inaccessible as indicated to the _REG method * * If the region is on the handler's list, this must be the * region's handler */ RegionObj->Region.Handler = NULL; AcpiUtRemoveReference (HandlerObj); return_VOID; } /* Walk the linked list of handlers */ LastObjPtr = &ObjDesc->Region.Next; ObjDesc = ObjDesc->Region.Next; /* Prevent infinite loop if list is corrupted */ if (ObjDesc == StartDesc) { ACPI_ERROR ((AE_INFO, "Circular handler list in region object %p", RegionObj)); return_VOID; } } /* If we get here, the region was not in the handler's region list */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Cannot remove region %p from address handler %p\n", RegionObj, HandlerObj)); return_VOID; } /******************************************************************************* * * FUNCTION: AcpiEvAttachRegion * * PARAMETERS: HandlerObj - Handler Object * RegionObj - Region Object * AcpiNsIsLocked - Namespace Region Already Locked? * * RETURN: None * * DESCRIPTION: Create the association between the handler and the region * this is a two way association. * ******************************************************************************/ ACPI_STATUS AcpiEvAttachRegion ( ACPI_OPERAND_OBJECT *HandlerObj, ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked) { ACPI_FUNCTION_TRACE (EvAttachRegion); /* Install the region's handler */ if (RegionObj->Region.Handler) { return_ACPI_STATUS (AE_ALREADY_EXISTS); } ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Adding Region [%4.4s] %p to address handler %p [%s]\n", AcpiUtGetNodeName (RegionObj->Region.Node), RegionObj, HandlerObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); /* Link this region to the front of the handler's list */ RegionObj->Region.Next = HandlerObj->AddressSpace.RegionList; HandlerObj->AddressSpace.RegionList = RegionObj; RegionObj->Region.Handler = HandlerObj; AcpiUtAddReference (HandlerObj); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiEvExecuteRegMethod * * PARAMETERS: RegionObj - Region object * Function - Passed to _REG: On (1) or Off (0) * * RETURN: Status * * DESCRIPTION: Execute _REG method for a region * ******************************************************************************/ ACPI_STATUS AcpiEvExecuteRegMethod ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function) { ACPI_EVALUATE_INFO *Info; ACPI_OPERAND_OBJECT *Args[3]; ACPI_OPERAND_OBJECT *RegionObj2; const ACPI_NAME *RegNamePtr = ACPI_CAST_PTR (ACPI_NAME, METHOD_NAME__REG); ACPI_NAMESPACE_NODE *MethodNode; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvExecuteRegMethod); if (!AcpiGbl_NamespaceInitialized || RegionObj->Region.Handler == NULL) { return_ACPI_STATUS (AE_OK); } RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_ACPI_STATUS (AE_NOT_EXIST); } /* * Find any "_REG" method associated with this region definition. * The method should always be updated as this function may be * invoked after a namespace change. */ Node = RegionObj->Region.Node->Parent; Status = AcpiNsSearchOneScope ( *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode); if (ACPI_SUCCESS (Status)) { /* * The _REG method is optional and there can be only one per * region definition. This will be executed when the handler is * attached or removed. */ RegionObj2->Extra.Method_REG = MethodNode; } if (RegionObj2->Extra.Method_REG == NULL) { return_ACPI_STATUS (AE_OK); } /* _REG(DISCONNECT) should be paired with _REG(CONNECT) */ if ((Function == ACPI_REG_CONNECT && RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED) || (Function == ACPI_REG_DISCONNECT && !(RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED))) { return_ACPI_STATUS (AE_OK); } /* Allocate and initialize the evaluation information block */ Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO)); if (!Info) { return_ACPI_STATUS (AE_NO_MEMORY); } Info->PrefixNode = RegionObj2->Extra.Method_REG; Info->RelativePathname = NULL; Info->Parameters = Args; Info->Flags = ACPI_IGNORE_RETURN_VALUE; /* * The _REG method has two arguments: * * Arg0 - Integer: * Operation region space ID Same value as RegionObj->Region.SpaceId * * Arg1 - Integer: * connection status 1 for connecting the handler, 0 for disconnecting * the handler (Passed as a parameter) */ Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId); if (!Args[0]) { Status = AE_NO_MEMORY; goto Cleanup1; } Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function); if (!Args[1]) { Status = AE_NO_MEMORY; goto Cleanup2; } Args[2] = NULL; /* Terminate list */ /* Execute the method, no return value */ ACPI_DEBUG_EXEC ( AcpiUtDisplayInitPathname (ACPI_TYPE_METHOD, Info->PrefixNode, NULL)); Status = AcpiNsEvaluate (Info); AcpiUtRemoveReference (Args[1]); if (ACPI_FAILURE (Status)) { goto Cleanup2; } if (Function == ACPI_REG_CONNECT) { RegionObj->Common.Flags |= AOPOBJ_REG_CONNECTED; } else { RegionObj->Common.Flags &= ~AOPOBJ_REG_CONNECTED; } Cleanup2: AcpiUtRemoveReference (Args[0]); Cleanup1: ACPI_FREE (Info); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiEvExecuteRegMethods * * PARAMETERS: Node - Namespace node for the device * SpaceId - The address space ID * Function - Passed to _REG: On (1) or Off (0) * * RETURN: None * * DESCRIPTION: Run all _REG methods for the input Space ID; * Note: assumes namespace is locked, or system init time. * ******************************************************************************/ void AcpiEvExecuteRegMethods ( ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, UINT32 Function) { ACPI_REG_WALK_INFO Info; ACPI_FUNCTION_TRACE (EvExecuteRegMethods); /* * These address spaces do not need a call to _REG, since the ACPI * specification defines them as: "must always be accessible". Since * they never change state (never become unavailable), no need to ever * call _REG on them. Also, a DataTable is not a "real" address space, * so do not call _REG. September 2018. */ if ((SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) || (SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) || (SpaceId == ACPI_ADR_SPACE_DATA_TABLE)) { return_VOID; } Info.SpaceId = SpaceId; Info.Function = Function; Info.RegRunCount = 0; ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, " Running _REG methods for SpaceId %s\n", AcpiUtGetRegionName (Info.SpaceId))); /* * Run all _REG methods for all Operation Regions for this space ID. This * is a separate walk in order to handle any interdependencies between * regions and _REG methods. (i.e. handlers must be installed for all * regions of this Space ID before we can run any _REG methods) */ (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL); /* * Special case for EC and GPIO: handle "orphan" _REG methods with * no region. */ if (SpaceId == ACPI_ADR_SPACE_EC || SpaceId == ACPI_ADR_SPACE_GPIO) { AcpiEvExecuteOrphanRegMethod (Node, SpaceId); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, " Executed %u _REG methods for SpaceId %s\n", Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId))); return_VOID; } /******************************************************************************* * * FUNCTION: AcpiEvRegRun * * PARAMETERS: WalkNamespace callback * * DESCRIPTION: Run _REG method for region objects of the requested spaceID * ******************************************************************************/ static ACPI_STATUS AcpiEvRegRun ( ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue) { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; ACPI_REG_WALK_INFO *Info; Info = ACPI_CAST_PTR (ACPI_REG_WALK_INFO, Context); /* Convert and validate the device handle */ Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); } /* * We only care about regions and objects that are allowed to have * address space handlers */ if ((Node->Type != ACPI_TYPE_REGION) && (Node != AcpiGbl_RootNode)) { return (AE_OK); } /* Check for an existing internal object */ ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { /* No object, just exit */ return (AE_OK); } /* Object is a Region */ if (ObjDesc->Region.SpaceId != Info->SpaceId) { /* This region is for a different address space, just ignore it */ return (AE_OK); } Info->RegRunCount++; Status = AcpiEvExecuteRegMethod (ObjDesc, Info->Function); return (Status); } /******************************************************************************* * * FUNCTION: AcpiEvExecuteOrphanRegMethod * * PARAMETERS: DeviceNode - Namespace node for an ACPI device * SpaceId - The address space ID * * RETURN: None * * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI * device. This is a _REG method that has no corresponding region * within the device's scope. ACPI tables depending on these * "orphan" _REG methods have been seen for both EC and GPIO * Operation Regions. Presumably the Windows ACPI implementation * always calls the _REG method independent of the presence of * an actual Operation Region with the correct address space ID. * * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void AcpiEvExecuteOrphanRegMethod ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_ADR_SPACE_TYPE SpaceId) { ACPI_HANDLE RegMethod; ACPI_NAMESPACE_NODE *NextNode; ACPI_STATUS Status; ACPI_OBJECT_LIST Args; ACPI_OBJECT Objects[2]; ACPI_FUNCTION_TRACE (EvExecuteOrphanRegMethod); if (!DeviceNode) { return_VOID; } /* Namespace is currently locked, must release */ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); /* Get a handle to a _REG method immediately under the EC device */ Status = AcpiGetHandle (DeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { goto Exit; /* There is no _REG method present */ } /* * Execute the _REG method only if there is no Operation Region in * this scope with the Embedded Controller space ID. Otherwise, it * will already have been executed. Note, this allows for Regions * with other space IDs to be present; but the code below will then * execute the _REG method with the EmbeddedControl SpaceID argument. */ NextNode = AcpiNsGetNextNode (DeviceNode, NULL); while (NextNode) { if ((NextNode->Type == ACPI_TYPE_REGION) && (NextNode->Object) && (NextNode->Object->Region.SpaceId == SpaceId)) { goto Exit; /* Do not execute the _REG */ } NextNode = AcpiNsGetNextNode (DeviceNode, NextNode); } /* Evaluate the _REG(SpaceId,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Objects[0].Type = ACPI_TYPE_INTEGER; Objects[0].Integer.Value = SpaceId; Objects[1].Type = ACPI_TYPE_INTEGER; Objects[1].Integer.Value = ACPI_REG_CONNECT; (void) AcpiEvaluateObject (RegMethod, NULL, &Args, NULL); Exit: /* We ignore all errors from above, don't care */ (void) AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); return_VOID; } diff --git a/sys/contrib/dev/acpica/components/executer/exfield.c b/sys/contrib/dev/acpica/components/executer/exfield.c index 6ed3d40b6035..0a7ce4b48e15 100644 --- a/sys/contrib/dev/acpica/components/executer/exfield.c +++ b/sys/contrib/dev/acpica/components/executer/exfield.c @@ -1,559 +1,561 @@ /****************************************************************************** * * Module Name: exfield - AML execution - FieldUnit read/write * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exfield") /* * This table maps the various Attrib protocols to the byte transfer * length. Used for the generic serial bus. */ #define ACPI_INVALID_PROTOCOL_ID 0x80 #define ACPI_MAX_PROTOCOL_ID 0x0F static const UINT8 AcpiProtocolLengths[] = { ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */ ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */ 0x00, /* 2 - ATTRIB_QUICK */ ACPI_INVALID_PROTOCOL_ID, /* 3 - reserved */ 0x01, /* 4 - ATTRIB_SEND_RECEIVE */ ACPI_INVALID_PROTOCOL_ID, /* 5 - reserved */ 0x01, /* 6 - ATTRIB_BYTE */ ACPI_INVALID_PROTOCOL_ID, /* 7 - reserved */ 0x02, /* 8 - ATTRIB_WORD */ ACPI_INVALID_PROTOCOL_ID, /* 9 - reserved */ 0xFF, /* A - ATTRIB_BLOCK */ 0xFF, /* B - ATTRIB_BYTES */ 0x02, /* C - ATTRIB_PROCESS_CALL */ 0xFF, /* D - ATTRIB_BLOCK_PROCESS_CALL */ 0xFF, /* E - ATTRIB_RAW_BYTES */ 0xFF /* F - ATTRIB_RAW_PROCESS_BYTES */ }; #define PCC_MASTER_SUBSPACE 3 /* * The following macros determine a given offset is a COMD field. * According to the specification, generic subspaces (types 0-2) contains a * 2-byte COMD field at offset 4 and master subspaces (type 3) contains a 4-byte * COMD field starting at offset 12. */ #define GENERIC_SUBSPACE_COMMAND(a) (4 == a || a == 5) #define MASTER_SUBSPACE_COMMAND(a) (12 <= a && a <= 15) /******************************************************************************* * * FUNCTION: AcpiExGetProtocolBufferLength * * PARAMETERS: ProtocolId - The type of the protocol indicated by region * field access attributes * ReturnLength - Where the protocol byte transfer length is * returned * * RETURN: Status and decoded byte transfer length * * DESCRIPTION: This routine returns the length of the GenericSerialBus * protocol bytes * ******************************************************************************/ ACPI_STATUS AcpiExGetProtocolBufferLength ( UINT32 ProtocolId, UINT32 *ReturnLength) { if ((ProtocolId > ACPI_MAX_PROTOCOL_ID) || (AcpiProtocolLengths[ProtocolId] == ACPI_INVALID_PROTOCOL_ID)) { ACPI_ERROR ((AE_INFO, "Invalid Field/AccessAs protocol ID: 0x%4.4X", ProtocolId)); return (AE_AML_PROTOCOL); } *ReturnLength = AcpiProtocolLengths[ProtocolId]; return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiExReadDataFromField * * PARAMETERS: WalkState - Current execution state * ObjDesc - The named field * RetBufferDesc - Where the return data object is stored * * RETURN: Status * * DESCRIPTION: Read from a named field. Returns either an Integer or a * Buffer, depending on the size of the field and whether if a * field is created by the CreateField() operator. * ******************************************************************************/ ACPI_STATUS AcpiExReadDataFromField ( ACPI_WALK_STATE *WalkState, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **RetBufferDesc) { ACPI_STATUS Status; ACPI_OPERAND_OBJECT *BufferDesc; void *Buffer; UINT32 BufferLength; ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc); /* Parameter validation */ if (!ObjDesc) { return_ACPI_STATUS (AE_AML_NO_OPERAND); } if (!RetBufferDesc) { return_ACPI_STATUS (AE_BAD_PARAMETER); } if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) { /* * If the BufferField arguments have not been previously evaluated, * evaluate them now and save the results. */ if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetBufferFieldArguments (ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI || - ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT)) + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)) { /* SMBus, GSBus, IPMI serial */ Status = AcpiExReadSerialBus (ObjDesc, RetBufferDesc); return_ACPI_STATUS (Status); } /* * Allocate a buffer for the contents of the field. * * If the field is larger than the current integer width, create * a BUFFER to hold it. Otherwise, use an INTEGER. This allows * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * * However, all buffer fields created by CreateField operator needs to * remain as a buffer to match other AML interpreter implementations. * * Note: Field.length is in bits. */ BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength); if (BufferLength > AcpiGbl_IntegerByteWidth || (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD && ObjDesc->BufferField.IsCreateField)) { /* Field is too large for an Integer, create a Buffer instead */ BufferDesc = AcpiUtCreateBufferObject (BufferLength); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } Buffer = BufferDesc->Buffer.Pointer; } else { /* Field will fit within an Integer (normal case) */ BufferDesc = AcpiUtCreateIntegerObject ((UINT64) 0); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } BufferLength = AcpiGbl_IntegerByteWidth; Buffer = &BufferDesc->Integer.Value; } if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) { /* General Purpose I/O */ Status = AcpiExReadGpio (ObjDesc, Buffer); goto Exit; } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_COMM)) { /* * Reading from a PCC field unit does not require the handler because * it only requires reading from the InternalPccBuffer. */ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "PCC FieldRead bits %u\n", ObjDesc->Field.BitLength)); memcpy (Buffer, ObjDesc->Field.RegionObj->Field.InternalPccBuffer + ObjDesc->Field.BaseByteOffset, (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength)); *RetBufferDesc = BufferDesc; return AE_OK; } ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", ObjDesc, ObjDesc->Common.Type, Buffer, BufferLength)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n", ObjDesc->CommonField.BitLength, ObjDesc->CommonField.StartFieldBitOffset, ObjDesc->CommonField.BaseByteOffset)); /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* Read from the field */ Status = AcpiExExtractFromField (ObjDesc, Buffer, BufferLength); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); Exit: if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (BufferDesc); } else { *RetBufferDesc = BufferDesc; } return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiExWriteDataToField * * PARAMETERS: SourceDesc - Contains data to write * ObjDesc - The named field * ResultDesc - Where the return value is returned, if any * * RETURN: Status * * DESCRIPTION: Write to a named field * ******************************************************************************/ ACPI_STATUS AcpiExWriteDataToField ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ResultDesc) { ACPI_STATUS Status; UINT32 BufferLength; UINT32 DataLength; void *Buffer; ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc); /* Parameter validation */ if (!SourceDesc || !ObjDesc) { return_ACPI_STATUS (AE_AML_NO_OPERAND); } if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) { /* * If the BufferField arguments have not been previously evaluated, * evaluate them now and save the results. */ if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetBufferFieldArguments (ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) { /* General Purpose I/O */ Status = AcpiExWriteGpio (SourceDesc, ObjDesc, ResultDesc); return_ACPI_STATUS (Status); } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI || - ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT)) + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)) { /* SMBus, GSBus, IPMI serial */ Status = AcpiExWriteSerialBus (SourceDesc, ObjDesc, ResultDesc); return_ACPI_STATUS (Status); } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_COMM)) { /* * According to the spec a write to the COMD field will invoke the * region handler. Otherwise, write to the PccInternal buffer. This * implementation will use the offsets specified rather than the name * of the field. This is considered safer because some firmware tools * are known to obfiscate named objects. */ DataLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength); memcpy (ObjDesc->Field.RegionObj->Field.InternalPccBuffer + ObjDesc->Field.BaseByteOffset, SourceDesc->Buffer.Pointer, DataLength); if (MASTER_SUBSPACE_COMMAND (ObjDesc->Field.BaseByteOffset)) { /* Perform the write */ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "PCC COMD field has been written. Invoking PCC handler now.\n")); Status = AcpiExAccessRegion ( ObjDesc, 0, (UINT64 *) ObjDesc->Field.RegionObj->Field.InternalPccBuffer, ACPI_WRITE); return_ACPI_STATUS (Status); } return (AE_OK); } /* Get a pointer to the data to be written */ switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: Buffer = &SourceDesc->Integer.Value; BufferLength = sizeof (SourceDesc->Integer.Value); break; case ACPI_TYPE_BUFFER: Buffer = SourceDesc->Buffer.Pointer; BufferLength = SourceDesc->Buffer.Length; break; case ACPI_TYPE_STRING: Buffer = SourceDesc->String.Pointer; BufferLength = SourceDesc->String.Length; break; default: return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n", SourceDesc, AcpiUtGetTypeName (SourceDesc->Common.Type), SourceDesc->Common.Type, Buffer, BufferLength)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n", ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type, ObjDesc->CommonField.BitLength, ObjDesc->CommonField.StartFieldBitOffset, ObjDesc->CommonField.BaseByteOffset)); /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* Write to the field */ Status = AcpiExInsertIntoField (ObjDesc, Buffer, BufferLength); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/components/executer/exserial.c b/sys/contrib/dev/acpica/components/executer/exserial.c index fd6dea206450..2ab01d80ff13 100644 --- a/sys/contrib/dev/acpica/components/executer/exserial.c +++ b/sys/contrib/dev/acpica/components/executer/exserial.c @@ -1,520 +1,526 @@ /****************************************************************************** * * Module Name: exserial - FieldUnit support for serial address spaces * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exserial") /******************************************************************************* * * FUNCTION: AcpiExReadGpio * * PARAMETERS: ObjDesc - The named field to read * Buffer - Where the return data is returned * * RETURN: Status * * DESCRIPTION: Read from a named field that references a Generic Serial Bus * field * ******************************************************************************/ ACPI_STATUS AcpiExReadGpio ( ACPI_OPERAND_OBJECT *ObjDesc, void *Buffer) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE_PTR (ExReadGpio, ObjDesc); /* * For GPIO (GeneralPurposeIo), the Address will be the bit offset * from the previous Connection() operator, making it effectively a * pin number index. The BitLength is the length of the field, which * is thus the number of pins. */ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "GPIO FieldRead [FROM]: Pin %u Bits %u\n", ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength)); /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* Perform the read */ Status = AcpiExAccessRegion ( ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiExWriteGpio * * PARAMETERS: SourceDesc - Contains data to write. Expect to be * an Integer object. * ObjDesc - The named field * ResultDesc - Where the return value is returned, if any * * RETURN: Status * * DESCRIPTION: Write to a named field that references a General Purpose I/O * field. * ******************************************************************************/ ACPI_STATUS AcpiExWriteGpio ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ReturnBuffer) { ACPI_STATUS Status; void *Buffer; ACPI_FUNCTION_TRACE_PTR (ExWriteGpio, ObjDesc); /* * For GPIO (GeneralPurposeIo), we will bypass the entire field * mechanism and handoff the bit address and bit width directly to * the handler. The Address will be the bit offset * from the previous Connection() operator, making it effectively a * pin number index. The BitLength is the length of the field, which * is thus the number of pins. */ if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "GPIO FieldWrite [FROM]: (%s:%X), Value %.8X [TO]: Pin %u Bits %u\n", AcpiUtGetTypeName (SourceDesc->Common.Type), SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value, ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength)); Buffer = &SourceDesc->Integer.Value; /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* Perform the write */ Status = AcpiExAccessRegion ( ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiExReadSerialBus * * PARAMETERS: ObjDesc - The named field to read * ReturnBuffer - Where the return value is returned, if any * * RETURN: Status * * DESCRIPTION: Read from a named field that references a serial bus * (SMBus, IPMI, or GSBus). * ******************************************************************************/ ACPI_STATUS AcpiExReadSerialBus ( ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ReturnBuffer) { ACPI_STATUS Status; UINT32 BufferLength; ACPI_OPERAND_OBJECT *BufferDesc; UINT32 Function; UINT16 AccessorType; ACPI_FUNCTION_TRACE_PTR (ExReadSerialBus, ObjDesc); /* * This is an SMBus, GSBus or IPMI read. We must create a buffer to * hold the data and then directly access the region handler. * * Note: SMBus and GSBus protocol value is passed in upper 16-bits * of Function * * Common buffer format: * Status; (Byte 0 of the data buffer) * Length; (Byte 1 of the data buffer) * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer) */ switch (ObjDesc->Field.RegionObj->Region.SpaceId) { case ACPI_ADR_SPACE_SMBUS: BufferLength = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); break; case ACPI_ADR_SPACE_IPMI: BufferLength = ACPI_IPMI_BUFFER_SIZE; Function = ACPI_READ; break; case ACPI_ADR_SPACE_GSBUS: AccessorType = ObjDesc->Field.Attribute; if (AccessorType == AML_FIELD_ATTRIB_RAW_PROCESS_BYTES) { ACPI_ERROR ((AE_INFO, "Invalid direct read using bidirectional write-then-read protocol")); return_ACPI_STATUS (AE_AML_PROTOCOL); } Status = AcpiExGetProtocolBufferLength (AccessorType, &BufferLength); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Invalid protocol ID for GSBus: 0x%4.4X", AccessorType)); return_ACPI_STATUS (Status); } /* Add header length to get the full size of the buffer */ BufferLength += ACPI_SERIAL_HEADER_SIZE; Function = ACPI_READ | (AccessorType << 16); break; case ACPI_ADR_SPACE_PLATFORM_RT: BufferLength = ACPI_PRM_INPUT_BUFFER_SIZE; Function = ACPI_READ; break; default: return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } /* Create the local transfer buffer that is returned to the caller */ BufferDesc = AcpiUtCreateBufferObject (BufferLength); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* Call the region handler for the write-then-read */ Status = AcpiExAccessRegion (ObjDesc, 0, ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); *ReturnBuffer = BufferDesc; return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiExWriteSerialBus * * PARAMETERS: SourceDesc - Contains data to write * ObjDesc - The named field * ReturnBuffer - Where the return value is returned, if any * * RETURN: Status * * DESCRIPTION: Write to a named field that references a serial bus * (SMBus, IPMI, GSBus). * ******************************************************************************/ ACPI_STATUS AcpiExWriteSerialBus ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ReturnBuffer) { ACPI_STATUS Status; UINT32 BufferLength; UINT32 DataLength; void *Buffer; ACPI_OPERAND_OBJECT *BufferDesc; UINT32 Function; UINT16 AccessorType; ACPI_FUNCTION_TRACE_PTR (ExWriteSerialBus, ObjDesc); /* * This is an SMBus, GSBus or IPMI write. We will bypass the entire * field mechanism and handoff the buffer directly to the handler. * For these address spaces, the buffer is bidirectional; on a * write, return data is returned in the same buffer. * * Source must be a buffer of sufficient size, these are fixed size: * ACPI_SMBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * * Note: SMBus and GSBus protocol type is passed in upper 16-bits * of Function * * Common buffer format: * Status; (Byte 0 of the data buffer) * Length; (Byte 1 of the data buffer) * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer) */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, "SMBus/IPMI/GenericSerialBus write requires " "Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } switch (ObjDesc->Field.RegionObj->Region.SpaceId) { case ACPI_ADR_SPACE_SMBUS: BufferLength = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); break; case ACPI_ADR_SPACE_IPMI: BufferLength = ACPI_IPMI_BUFFER_SIZE; Function = ACPI_WRITE; break; case ACPI_ADR_SPACE_GSBUS: AccessorType = ObjDesc->Field.Attribute; Status = AcpiExGetProtocolBufferLength (AccessorType, &BufferLength); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Invalid protocol ID for GSBus: 0x%4.4X", AccessorType)); return_ACPI_STATUS (Status); } /* Add header length to get the full size of the buffer */ BufferLength += ACPI_SERIAL_HEADER_SIZE; Function = ACPI_WRITE | (AccessorType << 16); break; case ACPI_ADR_SPACE_PLATFORM_RT: BufferLength = ACPI_PRM_INPUT_BUFFER_SIZE; Function = ACPI_WRITE; break; + case ACPI_ADR_SPACE_FIXED_HARDWARE: + + BufferLength = ACPI_FFH_INPUT_BUFFER_SIZE; + Function = ACPI_WRITE; + break; + default: return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } /* Create the transfer/bidirectional/return buffer */ BufferDesc = AcpiUtCreateBufferObject (BufferLength); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Copy the input buffer data to the transfer buffer */ Buffer = BufferDesc->Buffer.Pointer; DataLength = (BufferLength < SourceDesc->Buffer.Length ? BufferLength : SourceDesc->Buffer.Length); memcpy (Buffer, SourceDesc->Buffer.Pointer, DataLength); /* Lock entire transaction if requested */ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); /* * Perform the write (returns status and perhaps data in the * same buffer) */ Status = AcpiExAccessRegion ( ObjDesc, 0, (UINT64 *) Buffer, Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); *ReturnBuffer = BufferDesc; return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c index 3ca352cd5d26..c4d7baea056d 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c +++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c @@ -1,482 +1,492 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the * original/legacy sleep/PM registers. * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwsleep") #if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiHwLegacySleep * * PARAMETERS: SleepState - Which sleep state to enter * * RETURN: Status * * DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ ACPI_STATUS AcpiHwLegacySleep ( UINT8 SleepState) { ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; UINT32 Pm1aControl; UINT32 Pm1bControl; UINT32 InValue; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (HwLegacySleep); SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE); SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE); /* Clear wake status */ Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Disable all GPEs */ Status = AcpiHwDisableAllGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiHwClearAcpiStatus(); if (ACPI_FAILURE(Status)) { return_ACPI_STATUS(Status); } AcpiGbl_SystemAwakeAndRunning = FALSE; /* Enable all wakeup GPEs */ Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Get current value of PM1A control */ Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, &Pm1aControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Entering sleep state [S%u]\n", SleepState)); /* Clear the SLP_EN and SLP_TYP fields */ Pm1aControl &= ~(SleepTypeRegInfo->AccessBitMask | SleepEnableRegInfo->AccessBitMask); Pm1bControl = Pm1aControl; /* Insert the SLP_TYP bits */ Pm1aControl |= (AcpiGbl_SleepTypeA << SleepTypeRegInfo->BitPosition); Pm1bControl |= (AcpiGbl_SleepTypeB << SleepTypeRegInfo->BitPosition); /* * We split the writes of SLP_TYP and SLP_EN to workaround * poorly implemented hardware. */ /* Write #1: write the SLP_TYP data to the PM1 Control registers */ Status = AcpiHwWritePm1Control (Pm1aControl, Pm1bControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Insert the sleep enable (SLP_EN) bit */ Pm1aControl |= SleepEnableRegInfo->AccessBitMask; Pm1bControl |= SleepEnableRegInfo->AccessBitMask; /* Flush caches, as per ACPI specification */ if (SleepState < ACPI_STATE_S4) { ACPI_FLUSH_CPU_CACHE (); } Status = AcpiOsEnterSleep (SleepState, Pm1aControl, Pm1bControl); if (Status == AE_CTRL_TERMINATE) { return_ACPI_STATUS (AE_OK); } if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Write #2: Write both SLP_TYP + SLP_EN */ Status = AcpiHwWritePm1Control (Pm1aControl, Pm1bControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } if (SleepState > ACPI_STATE_S3) { /* * We wanted to sleep > S3, but it didn't happen (by virtue of the * fact that we are still executing!) * * Wait ten seconds, then try again. This is to get S4/S5 to work on * all machines. * * We wait so long to allow chipsets that poll this reg very slowly * to still read the right value. Ideally, this block would go * away entirely. */ AcpiOsStall (10 * ACPI_USEC_PER_SEC); Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL, SleepEnableRegInfo->AccessBitMask); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* Wait for transition back to Working State */ do { Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } while (!InValue); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiHwLegacyWakePrep * * PARAMETERS: SleepState - Which sleep state we just exited * * RETURN: Status * * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a * sleep. * Called with interrupts ENABLED. * ******************************************************************************/ ACPI_STATUS AcpiHwLegacyWakePrep ( UINT8 SleepState) { ACPI_STATUS Status = AE_OK; ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; UINT32 Pm1aControl; UINT32 Pm1bControl; ACPI_FUNCTION_TRACE (HwLegacyWakePrep); /* * Set SLP_TYPE and SLP_EN to state S0. * This is unclear from the ACPI Spec, but it is required * by some machines. */ if (AcpiGbl_SleepTypeAS0 != ACPI_SLEEP_TYPE_INVALID) { SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE); SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE); /* Get current value of PM1A control */ Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, &Pm1aControl); if (ACPI_SUCCESS (Status)) { /* Clear the SLP_EN and SLP_TYP fields */ Pm1aControl &= ~(SleepTypeRegInfo->AccessBitMask | SleepEnableRegInfo->AccessBitMask); Pm1bControl = Pm1aControl; /* Insert the SLP_TYP bits */ Pm1aControl |= (AcpiGbl_SleepTypeAS0 << SleepTypeRegInfo->BitPosition); Pm1bControl |= (AcpiGbl_SleepTypeBS0 << SleepTypeRegInfo->BitPosition); /* Write the control registers and ignore any errors */ (void) AcpiHwWritePm1Control (Pm1aControl, Pm1bControl); } } return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiHwLegacyWake * * PARAMETERS: SleepState - Which sleep state we just exited * * RETURN: Status * * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep * Called with interrupts ENABLED. * ******************************************************************************/ ACPI_STATUS AcpiHwLegacyWake ( UINT8 SleepState) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (HwLegacyWake); /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID; AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); /* * GPEs must be enabled before _WAK is called as GPEs * might get fired there * * Restore the GPEs: * 1) Disable all GPEs * 2) Enable all runtime GPEs */ Status = AcpiHwDisableAllGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiHwEnableAllRuntimeGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Now we can execute _WAK, etc. Some machines require that the GPEs * are enabled before the wake methods are executed. */ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); /* * Some BIOS code assumes that WAK_STS will be cleared on resume * and use it to determine whether the system is rebooting or * resuming. Clear WAK_STS for compatibility. */ (void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); AcpiGbl_SystemAwakeAndRunning = TRUE; /* Enable power button */ (void) AcpiWriteBitRegister( AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId, ACPI_ENABLE_EVENT); (void) AcpiWriteBitRegister( AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); /* Enable sleep button */ (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].EnableRegisterId, ACPI_ENABLE_EVENT); (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); + /* Enable pcie wake event if support */ + if ((AcpiGbl_FADT.Flags & ACPI_FADT_PCI_EXPRESS_WAKE)) { + (void) AcpiWriteBitRegister ( + AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].EnableRegisterId, + ACPI_DISABLE_EVENT); + (void) AcpiWriteBitRegister ( + AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].StatusRegisterId, + ACPI_CLEAR_STATUS); + } + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c index 5067d2348c29..14079d18eec3 100644 --- a/sys/contrib/dev/acpica/components/tables/tbdata.c +++ b/sys/contrib/dev/acpica/components/tables/tbdata.c @@ -1,1378 +1,1378 @@ /****************************************************************************** * * Module Name: tbdata - Table manager data structure functions * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #include #include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbdata") /* Local prototypes */ static ACPI_STATUS AcpiTbCheckDuplication ( ACPI_TABLE_DESC *TableDesc, UINT32 *TableIndex); static BOOLEAN AcpiTbCompareTables ( ACPI_TABLE_DESC *TableDesc, UINT32 TableIndex); /******************************************************************************* * * FUNCTION: AcpiTbCompareTables * * PARAMETERS: TableDesc - Table 1 descriptor to be compared * TableIndex - Index of table 2 to be compared * * RETURN: TRUE if both tables are identical. * * DESCRIPTION: This function compares a table with another table that has * already been installed in the root table list. * ******************************************************************************/ static BOOLEAN AcpiTbCompareTables ( ACPI_TABLE_DESC *TableDesc, UINT32 TableIndex) { ACPI_STATUS Status = AE_OK; BOOLEAN IsIdentical; ACPI_TABLE_HEADER *Table; UINT32 TableLength; UINT8 TableFlags; Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex], &Table, &TableLength, &TableFlags); if (ACPI_FAILURE (Status)) { return (FALSE); } /* * Check for a table match on the entire table length, * not just the header. */ IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || memcmp (TableDesc->Pointer, Table, TableLength)) ? FALSE : TRUE); /* Release the acquired table */ AcpiTbReleaseTable (Table, TableLength, TableFlags); return (IsIdentical); } /******************************************************************************* * * FUNCTION: AcpiTbInitTableDescriptor * * PARAMETERS: TableDesc - Table descriptor * Address - Physical address of the table * Flags - Allocation flags of the table * Table - Pointer to the table * * RETURN: None * * DESCRIPTION: Initialize a new table descriptor * ******************************************************************************/ void AcpiTbInitTableDescriptor ( ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table) { /* * Initialize the table descriptor. Set the pointer to NULL for external * tables, since the table is not fully mapped at this time. */ memset (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); TableDesc->Address = Address; TableDesc->Length = Table->Length; TableDesc->Flags = Flags; ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature); switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: TableDesc->Pointer = Table; break; case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: default: break; } } /******************************************************************************* * * FUNCTION: AcpiTbAcquireTable * * PARAMETERS: TableDesc - Table descriptor * TablePtr - Where table is returned * TableLength - Where table length is returned * TableFlags - Where table allocation flags are returned * * RETURN: Status * * DESCRIPTION: Acquire an ACPI table. It can be used for tables not * maintained in the AcpiGbl_RootTableList. * ******************************************************************************/ ACPI_STATUS AcpiTbAcquireTable ( ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags) { ACPI_TABLE_HEADER *Table = NULL; switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length); break; case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: Table = TableDesc->Pointer; break; default: break; } /* Table is not valid yet */ if (!Table) { return (AE_NO_MEMORY); } /* Fill the return values */ *TablePtr = Table; *TableLength = TableDesc->Length; *TableFlags = TableDesc->Flags; return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbReleaseTable * * PARAMETERS: Table - Pointer for the table * TableLength - Length for the table * TableFlags - Allocation flags for the table * * RETURN: None * * DESCRIPTION: Release a table. The inverse of AcpiTbAcquireTable(). * ******************************************************************************/ void AcpiTbReleaseTable ( ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags) { switch (TableFlags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: AcpiOsUnmapMemory (Table, TableLength); break; case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: default: break; } } /******************************************************************************* * * FUNCTION: AcpiTbAcquireTempTable * * PARAMETERS: TableDesc - Table descriptor to be acquired * Address - Address of the table * Flags - Allocation flags of the table * Table - Pointer to the table (required for virtual * origins, optional for physical) * * RETURN: Status * * DESCRIPTION: This function validates the table header to obtain the length * of a table and fills the table descriptor to make its state as * "INSTALLED". Such a table descriptor is only used for verified * installation. * ******************************************************************************/ ACPI_STATUS AcpiTbAcquireTempTable ( ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table) { BOOLEAN MappedTable = FALSE; switch (Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: /* Get the length of the full table from the header */ if (!Table) { Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER)); if (!Table) { return (AE_NO_MEMORY); } MappedTable = TRUE; } break; case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: if (!Table) { return (AE_BAD_PARAMETER); } break; default: /* Table is not valid yet */ return (AE_NO_MEMORY); } AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table); if (MappedTable) { AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER)); } return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbReleaseTempTable * * PARAMETERS: TableDesc - Table descriptor to be released * * RETURN: Status * * DESCRIPTION: The inverse of AcpiTbAcquireTempTable(). * *****************************************************************************/ void AcpiTbReleaseTempTable ( ACPI_TABLE_DESC *TableDesc) { /* * Note that the .Address is maintained by the callers of * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable() * where .Address will be freed. */ AcpiTbInvalidateTable (TableDesc); } /****************************************************************************** * * FUNCTION: AcpiTbValidateTable * * PARAMETERS: TableDesc - Table descriptor * * RETURN: Status * * DESCRIPTION: This function is called to validate the table, the returned * table descriptor is in "VALIDATED" state. * *****************************************************************************/ ACPI_STATUS AcpiTbValidateTable ( ACPI_TABLE_DESC *TableDesc) { ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (TbValidateTable); /* Validate the table if necessary */ if (!TableDesc->Pointer) { Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer, &TableDesc->Length, &TableDesc->Flags); if (!TableDesc->Pointer) { Status = AE_NO_MEMORY; } } return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbInvalidateTable * * PARAMETERS: TableDesc - Table descriptor * * RETURN: None * * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of * AcpiTbValidateTable(). * ******************************************************************************/ void AcpiTbInvalidateTable ( ACPI_TABLE_DESC *TableDesc) { ACPI_FUNCTION_TRACE (TbInvalidateTable); /* Table must be validated */ if (!TableDesc->Pointer) { return_VOID; } AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length, TableDesc->Flags); switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: TableDesc->Pointer = NULL; break; case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: default: break; } return_VOID; } /****************************************************************************** * * FUNCTION: AcpiTbValidateTempTable * * PARAMETERS: TableDesc - Table descriptor * * RETURN: Status * * DESCRIPTION: This function is called to validate the table, the returned * table descriptor is in "VALIDATED" state. * *****************************************************************************/ ACPI_STATUS AcpiTbValidateTempTable ( ACPI_TABLE_DESC *TableDesc) { if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation) { /* * Only validates the header of the table. * Note that Length contains the size of the mapping after invoking * this work around, this value is required by * AcpiTbReleaseTempTable(). * We can do this because in AcpiInitTableDescriptor(), the Length * field of the installed descriptor is filled with the actual * table length obtaining from the table header. */ TableDesc->Length = sizeof (ACPI_TABLE_HEADER); } return (AcpiTbValidateTable (TableDesc)); } /******************************************************************************* * * FUNCTION: AcpiTbCheckDuplication * * PARAMETERS: TableDesc - Table descriptor * TableIndex - Where the table index is returned * * RETURN: Status * * DESCRIPTION: Avoid installing duplicated tables. However table override and * user aided dynamic table load is allowed, thus comparing the * address of the table is not sufficient, and checking the entire * table content is required. * ******************************************************************************/ static ACPI_STATUS AcpiTbCheckDuplication ( ACPI_TABLE_DESC *TableDesc, UINT32 *TableIndex) { UINT32 i; ACPI_FUNCTION_TRACE (TbCheckDuplication); /* Check if table is already registered */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { /* Do not compare with unverified tables */ if (!(AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_VERIFIED)) { continue; } /* * Check for a table match on the entire table length, * not just the header. */ if (!AcpiTbCompareTables (TableDesc, i)) { continue; } /* * Note: the current mechanism does not unregister a table if it is * dynamically unloaded. The related namespace entries are deleted, * but the table remains in the root table list. * * The assumption here is that the number of different tables that * will be loaded is actually small, and there is minimal overhead * in just keeping the table in case it is needed again. * * If this assumption changes in the future (perhaps on large * machines with many table load/unload operations), tables will * need to be unregistered when they are unloaded, and slots in the * root table list should be reused when empty. */ if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED) { /* Table is still loaded, this is an error */ return_ACPI_STATUS (AE_ALREADY_EXISTS); } else { *TableIndex = i; return_ACPI_STATUS (AE_CTRL_TERMINATE); } } /* Indicate no duplication to the caller */ return_ACPI_STATUS (AE_OK); } /****************************************************************************** * * FUNCTION: AcpiTbVerifyTempTable * * PARAMETERS: TableDesc - Table descriptor * Signature - Table signature to verify * TableIndex - Where the table index is returned * * RETURN: Status * * DESCRIPTION: This function is called to validate and verify the table, the * returned table descriptor is in "VALIDATED" state. * Note that 'TableIndex' is required to be set to !NULL to * enable duplication check. * *****************************************************************************/ ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex) { ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (TbVerifyTempTable); /* Validate the table */ Status = AcpiTbValidateTempTable (TableDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (AE_NO_MEMORY); } /* If a particular signature is expected (DSDT/FACS), it must match */ if (Signature && !ACPI_COMPARE_NAMESEG (&TableDesc->Signature, Signature)) { ACPI_BIOS_ERROR ((AE_INFO, "Invalid signature 0x%X for ACPI table, expected [%s]", TableDesc->Signature.Integer, Signature)); Status = AE_BAD_SIGNATURE; goto InvalidateAndExit; } if (AcpiGbl_EnableTableValidation) { /* Verify the checksum */ - Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); + Status = AcpiUtVerifyChecksum (TableDesc->Pointer, TableDesc->Length); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, "%4.4s 0x%8.8X%8.8X" " Attempted table install failed", AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); goto InvalidateAndExit; } /* Avoid duplications */ if (TableIndex) { Status = AcpiTbCheckDuplication (TableDesc, TableIndex); if (ACPI_FAILURE (Status)) { if (Status != AE_CTRL_TERMINATE) { ACPI_EXCEPTION ((AE_INFO, Status, "%4.4s 0x%8.8X%8.8X" " Table is already loaded", AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); } goto InvalidateAndExit; } } TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED; } return_ACPI_STATUS (Status); InvalidateAndExit: AcpiTbInvalidateTable (TableDesc); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbResizeRootTableList * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Expand the size of global table array * ******************************************************************************/ ACPI_STATUS AcpiTbResizeRootTableList ( void) { ACPI_TABLE_DESC *Tables; UINT32 TableCount; UINT32 CurrentTableCount, MaxTableCount; UINT32 i; ACPI_FUNCTION_TRACE (TbResizeRootTableList); /* AllowResize flag is a parameter to AcpiInitializeTables */ if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE)) { ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed")); return_ACPI_STATUS (AE_SUPPORT); } /* Increase the Table Array size */ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { TableCount = AcpiGbl_RootTableList.MaxTableCount; } else { TableCount = AcpiGbl_RootTableList.CurrentTableCount; } MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; Tables = ACPI_ALLOCATE_ZEROED ( ((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC)); if (!Tables) { ACPI_ERROR ((AE_INFO, "Could not allocate new root table array")); return_ACPI_STATUS (AE_NO_MEMORY); } /* Copy and free the previous table array */ CurrentTableCount = 0; if (AcpiGbl_RootTableList.Tables) { for (i = 0; i < TableCount; i++) { if (AcpiGbl_RootTableList.Tables[i].Address) { memcpy (Tables + CurrentTableCount, AcpiGbl_RootTableList.Tables + i, sizeof (ACPI_TABLE_DESC)); CurrentTableCount++; } } if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { ACPI_FREE (AcpiGbl_RootTableList.Tables); } } AcpiGbl_RootTableList.Tables = Tables; AcpiGbl_RootTableList.MaxTableCount = MaxTableCount; AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount; AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; return_ACPI_STATUS (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbGetNextTableDescriptor * * PARAMETERS: TableIndex - Where table index is returned * TableDesc - Where table descriptor is returned * * RETURN: Status and table index/descriptor. * * DESCRIPTION: Allocate a new ACPI table entry to the global table list * ******************************************************************************/ ACPI_STATUS AcpiTbGetNextTableDescriptor ( UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc) { ACPI_STATUS Status; UINT32 i; /* Ensure that there is room for the table in the Root Table List */ if (AcpiGbl_RootTableList.CurrentTableCount >= AcpiGbl_RootTableList.MaxTableCount) { Status = AcpiTbResizeRootTableList(); if (ACPI_FAILURE (Status)) { return (Status); } } i = AcpiGbl_RootTableList.CurrentTableCount; AcpiGbl_RootTableList.CurrentTableCount++; if (TableIndex) { *TableIndex = i; } if (TableDesc) { *TableDesc = &AcpiGbl_RootTableList.Tables[i]; } return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbTerminate * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Delete all internal ACPI tables * ******************************************************************************/ void AcpiTbTerminate ( void) { UINT32 i; ACPI_FUNCTION_TRACE (TbTerminate); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); /* Delete the individual tables */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]); } /* * Delete the root table array if allocated locally. Array cannot be * mapped, so we don't need to check for that flag. */ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { ACPI_FREE (AcpiGbl_RootTableList.Tables); } AcpiGbl_RootTableList.Tables = NULL; AcpiGbl_RootTableList.Flags = 0; AcpiGbl_RootTableList.CurrentTableCount = 0; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n")); (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_VOID; } /******************************************************************************* * * FUNCTION: AcpiTbDeleteNamespaceByOwner * * PARAMETERS: TableIndex - Table index * * RETURN: Status * * DESCRIPTION: Delete all namespace objects created when this table was loaded. * ******************************************************************************/ ACPI_STATUS AcpiTbDeleteNamespaceByOwner ( UINT32 TableIndex) { ACPI_OWNER_ID OwnerId; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner); Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) { /* The table index does not exist */ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (AE_NOT_EXIST); } /* Get the owner ID for this table, used to delete namespace nodes */ OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); /* * Need to acquire the namespace writer lock to prevent interference * with any concurrent namespace walks. The interpreter must be * released during the deletion since the acquisition of the deletion * lock may block, and also since the execution of a namespace walk * must be allowed to use the interpreter. */ Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } AcpiNsDeleteNamespaceByOwner (OwnerId); AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbAllocateOwnerId * * PARAMETERS: TableIndex - Table index * * RETURN: Status * * DESCRIPTION: Allocates OwnerId in TableDesc * ******************************************************************************/ ACPI_STATUS AcpiTbAllocateOwnerId ( UINT32 TableIndex) { ACPI_STATUS Status = AE_BAD_PARAMETER; ACPI_FUNCTION_TRACE (TbAllocateOwnerId); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { Status = AcpiUtAllocateOwnerId ( &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); } (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbReleaseOwnerId * * PARAMETERS: TableIndex - Table index * * RETURN: Status * * DESCRIPTION: Releases OwnerId in TableDesc * ******************************************************************************/ ACPI_STATUS AcpiTbReleaseOwnerId ( UINT32 TableIndex) { ACPI_STATUS Status = AE_BAD_PARAMETER; ACPI_FUNCTION_TRACE (TbReleaseOwnerId); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { AcpiUtReleaseOwnerId ( &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); Status = AE_OK; } (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbGetOwnerId * * PARAMETERS: TableIndex - Table index * OwnerId - Where the table OwnerId is returned * * RETURN: Status * * DESCRIPTION: returns OwnerId for the ACPI table * ******************************************************************************/ ACPI_STATUS AcpiTbGetOwnerId ( UINT32 TableIndex, ACPI_OWNER_ID *OwnerId) { ACPI_STATUS Status = AE_BAD_PARAMETER; ACPI_FUNCTION_TRACE (TbGetOwnerId); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; Status = AE_OK; } (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbIsTableLoaded * * PARAMETERS: TableIndex - Index into the root table * * RETURN: Table Loaded Flag * ******************************************************************************/ BOOLEAN AcpiTbIsTableLoaded ( UINT32 TableIndex) { BOOLEAN IsLoaded = FALSE; (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { IsLoaded = (BOOLEAN) (AcpiGbl_RootTableList.Tables[TableIndex].Flags & ACPI_TABLE_IS_LOADED); } (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return (IsLoaded); } /******************************************************************************* * * FUNCTION: AcpiTbSetTableLoadedFlag * * PARAMETERS: TableIndex - Table index * IsLoaded - TRUE if table is loaded, FALSE otherwise * * RETURN: None * * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE. * ******************************************************************************/ void AcpiTbSetTableLoadedFlag ( UINT32 TableIndex, BOOLEAN IsLoaded) { (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { if (IsLoaded) { AcpiGbl_RootTableList.Tables[TableIndex].Flags |= ACPI_TABLE_IS_LOADED; } else { AcpiGbl_RootTableList.Tables[TableIndex].Flags &= ~ACPI_TABLE_IS_LOADED; } } (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); } /******************************************************************************* * * FUNCTION: AcpiTbLoadTable * * PARAMETERS: TableIndex - Table index * ParentNode - Where table index is returned * * RETURN: Status * * DESCRIPTION: Load an ACPI table * ******************************************************************************/ ACPI_STATUS AcpiTbLoadTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode) { ACPI_TABLE_HEADER *Table; ACPI_STATUS Status; ACPI_OWNER_ID OwnerId; ACPI_FUNCTION_TRACE (TbLoadTable); /* * Note: Now table is "INSTALLED", it must be validated before * using. */ Status = AcpiGetTableByIndex (TableIndex, &Table); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiNsLoadTable (TableIndex, ParentNode); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is * responsible for discovering any new wake GPEs by running _PRW methods * that may have been loaded by this table. */ Status = AcpiTbGetOwnerId (TableIndex, &OwnerId); if (ACPI_SUCCESS (Status)) { AcpiEvUpdateGpes (OwnerId); } /* Invoke table handler */ AcpiTbNotifyTable (ACPI_TABLE_EVENT_LOAD, Table); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbInstallAndLoadTable * * PARAMETERS: Address - Physical address of the table * Flags - Allocation flags of the table * Table - Pointer to the table (required for * virtual origins, optional for * physical) * Override - Whether override should be performed * TableIndex - Where table index is returned * * RETURN: Status * * DESCRIPTION: Install and load an ACPI table * ******************************************************************************/ ACPI_STATUS AcpiTbInstallAndLoadTable ( ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Override, UINT32 *TableIndex) { ACPI_STATUS Status; UINT32 i; ACPI_FUNCTION_TRACE (TbInstallAndLoadTable); /* Install the table and load it into the namespace */ Status = AcpiTbInstallStandardTable (Address, Flags, Table, TRUE, Override, &i); if (ACPI_FAILURE (Status)) { goto Exit; } Status = AcpiTbLoadTable (i, AcpiGbl_RootNode); Exit: *TableIndex = i; return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbUnloadTable * * PARAMETERS: TableIndex - Table index * * RETURN: Status * * DESCRIPTION: Unload an ACPI table * ******************************************************************************/ ACPI_STATUS AcpiTbUnloadTable ( UINT32 TableIndex) { ACPI_STATUS Status = AE_OK; ACPI_TABLE_HEADER *Table; ACPI_FUNCTION_TRACE (TbUnloadTable); /* Ensure the table is still loaded */ if (!AcpiTbIsTableLoaded (TableIndex)) { return_ACPI_STATUS (AE_NOT_EXIST); } /* Invoke table handler */ Status = AcpiGetTableByIndex (TableIndex, &Table); if (ACPI_SUCCESS (Status)) { AcpiTbNotifyTable (ACPI_TABLE_EVENT_UNLOAD, Table); } /* Delete the portion of the namespace owned by this table */ Status = AcpiTbDeleteNamespaceByOwner (TableIndex); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } (void) AcpiTbReleaseOwnerId (TableIndex); AcpiTbSetTableLoadedFlag (TableIndex, FALSE); return_ACPI_STATUS (Status); } /******************************************************************************* * * FUNCTION: AcpiTbNotifyTable * * PARAMETERS: Event - Table event * Table - Validated table pointer * * RETURN: None * * DESCRIPTION: Notify a table event to the users. * ******************************************************************************/ void AcpiTbNotifyTable ( UINT32 Event, void *Table) { /* Invoke table handler if present */ if (AcpiGbl_TableHandler) { (void) AcpiGbl_TableHandler (Event, Table, AcpiGbl_TableHandlerContext); } } diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c index 0572989db0af..b4dec9b63546 100644 --- a/sys/contrib/dev/acpica/components/tables/tbfadt.c +++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c @@ -1,898 +1,898 @@ /****************************************************************************** * * Module Name: tbfadt - FADT table utilities * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbfadt") /* Local prototypes */ static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, UINT64 Address, const char *RegisterName, UINT8 Flags); static void AcpiTbConvertFadt ( void); static void AcpiTbSetupFadtRegisters ( void); static UINT64 AcpiTbSelectAddress ( char *RegisterName, UINT32 Address32, UINT64 Address64); /* Table for conversion of FADT to common internal format and FADT validation */ typedef struct acpi_fadt_info { const char *Name; UINT16 Address64; UINT16 Address32; UINT16 Length; UINT8 DefaultLength; UINT8 Flags; } ACPI_FADT_INFO; #define ACPI_FADT_OPTIONAL 0 #define ACPI_FADT_REQUIRED 1 #define ACPI_FADT_SEPARATE_LENGTH 2 #define ACPI_FADT_GPE_REGISTER 4 static ACPI_FADT_INFO FadtInfoTable[] = { {"Pm1aEventBlock", ACPI_FADT_OFFSET (XPm1aEventBlock), ACPI_FADT_OFFSET (Pm1aEventBlock), ACPI_FADT_OFFSET (Pm1EventLength), ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */ ACPI_FADT_REQUIRED}, {"Pm1bEventBlock", ACPI_FADT_OFFSET (XPm1bEventBlock), ACPI_FADT_OFFSET (Pm1bEventBlock), ACPI_FADT_OFFSET (Pm1EventLength), ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */ ACPI_FADT_OPTIONAL}, {"Pm1aControlBlock", ACPI_FADT_OFFSET (XPm1aControlBlock), ACPI_FADT_OFFSET (Pm1aControlBlock), ACPI_FADT_OFFSET (Pm1ControlLength), ACPI_PM1_REGISTER_WIDTH, ACPI_FADT_REQUIRED}, {"Pm1bControlBlock", ACPI_FADT_OFFSET (XPm1bControlBlock), ACPI_FADT_OFFSET (Pm1bControlBlock), ACPI_FADT_OFFSET (Pm1ControlLength), ACPI_PM1_REGISTER_WIDTH, ACPI_FADT_OPTIONAL}, {"Pm2ControlBlock", ACPI_FADT_OFFSET (XPm2ControlBlock), ACPI_FADT_OFFSET (Pm2ControlBlock), ACPI_FADT_OFFSET (Pm2ControlLength), ACPI_PM2_REGISTER_WIDTH, ACPI_FADT_SEPARATE_LENGTH}, {"PmTimerBlock", ACPI_FADT_OFFSET (XPmTimerBlock), ACPI_FADT_OFFSET (PmTimerBlock), ACPI_FADT_OFFSET (PmTimerLength), ACPI_PM_TIMER_WIDTH, ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */ {"Gpe0Block", ACPI_FADT_OFFSET (XGpe0Block), ACPI_FADT_OFFSET (Gpe0Block), ACPI_FADT_OFFSET (Gpe0BlockLength), 0, ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}, {"Gpe1Block", ACPI_FADT_OFFSET (XGpe1Block), ACPI_FADT_OFFSET (Gpe1Block), ACPI_FADT_OFFSET (Gpe1BlockLength), 0, ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER} }; #define ACPI_FADT_INFO_ENTRIES \ (sizeof (FadtInfoTable) / sizeof (ACPI_FADT_INFO)) /* Table used to split Event Blocks into separate status/enable registers */ typedef struct acpi_fadt_pm_info { ACPI_GENERIC_ADDRESS *Target; UINT16 Source; UINT8 RegisterNum; } ACPI_FADT_PM_INFO; static ACPI_FADT_PM_INFO FadtPmInfoTable[] = { {&AcpiGbl_XPm1aStatus, ACPI_FADT_OFFSET (XPm1aEventBlock), 0}, {&AcpiGbl_XPm1aEnable, ACPI_FADT_OFFSET (XPm1aEventBlock), 1}, {&AcpiGbl_XPm1bStatus, ACPI_FADT_OFFSET (XPm1bEventBlock), 0}, {&AcpiGbl_XPm1bEnable, ACPI_FADT_OFFSET (XPm1bEventBlock), 1} }; #define ACPI_FADT_PM_INFO_ENTRIES \ (sizeof (FadtPmInfoTable) / sizeof (ACPI_FADT_PM_INFO)) /******************************************************************************* * * FUNCTION: AcpiTbInitGenericAddress * * PARAMETERS: GenericAddress - GAS struct to be initialized * SpaceId - ACPI Space ID for this register * ByteWidth - Width of this register * Address - Address of the register * RegisterName - ASCII name of the ACPI register * * RETURN: None * * DESCRIPTION: Initialize a Generic Address Structure (GAS) * See the ACPI specification for a full description and * definition of this structure. * ******************************************************************************/ static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, UINT64 Address, const char *RegisterName, UINT8 Flags) { UINT8 BitWidth; /* * Bit width field in the GAS is only one byte long, 255 max. * Check for BitWidth overflow in GAS. */ BitWidth = (UINT8) (ByteWidth * 8); if (ByteWidth > 31) /* (31*8)=248, (32*8)=256 */ { /* * No error for GPE blocks, because we do not use the BitWidth * for GPEs, the legacy length (ByteWidth) is used instead to * allow for a large number of GPEs. */ if (!(Flags & ACPI_FADT_GPE_REGISTER)) { ACPI_ERROR ((AE_INFO, "%s - 32-bit FADT register is too long (%u bytes, %u bits) " "to convert to GAS struct - 255 bits max, truncating", RegisterName, ByteWidth, (ByteWidth * 8))); } BitWidth = 255; } /* * The 64-bit Address field is non-aligned in the byte packed * GAS struct. */ ACPI_MOVE_64_TO_64 (&GenericAddress->Address, &Address); /* All other fields are byte-wide */ GenericAddress->SpaceId = SpaceId; GenericAddress->BitWidth = BitWidth; GenericAddress->BitOffset = 0; GenericAddress->AccessWidth = 0; /* Access width ANY */ } /******************************************************************************* * * FUNCTION: AcpiTbSelectAddress * * PARAMETERS: RegisterName - ASCII name of the ACPI register * Address32 - 32-bit address of the register * Address64 - 64-bit address of the register * * RETURN: The resolved 64-bit address * * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within * the FADT. Used for the FACS and DSDT addresses. * * NOTES: * * Check for FACS and DSDT address mismatches. An address mismatch between * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and * DSDT/X_DSDT) could be a corrupted address field or it might indicate * the presence of two FACS or two DSDT tables. * * November 2013: * By default, as per the ACPICA specification, a valid 64-bit address is * used regardless of the value of the 32-bit address. However, this * behavior can be overridden via the AcpiGbl_Use32BitFadtAddresses flag. * ******************************************************************************/ static UINT64 AcpiTbSelectAddress ( char *RegisterName, UINT32 Address32, UINT64 Address64) { if (!Address64) { /* 64-bit address is zero, use 32-bit address */ return ((UINT64) Address32); } if (Address32 && (Address64 != (UINT64) Address32)) { /* Address mismatch between 32-bit and 64-bit versions */ ACPI_BIOS_WARNING ((AE_INFO, "32/64X %s address mismatch in FADT: " "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64), AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); /* 32-bit address override */ if (AcpiGbl_Use32BitFadtAddresses) { return ((UINT64) Address32); } } /* Default is to use the 64-bit address */ return (Address64); } /******************************************************************************* * * FUNCTION: AcpiTbParseFadt * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Initialize the FADT, DSDT and FACS tables * (FADT contains the addresses of the DSDT and FACS) * ******************************************************************************/ void AcpiTbParseFadt ( void) { UINT32 Length; ACPI_TABLE_HEADER *Table; ACPI_TABLE_DESC *FadtDesc; ACPI_STATUS Status; /* * The FADT has multiple versions with different lengths, * and it contains pointers to both the DSDT and FACS tables. * * Get a local copy of the FADT and convert it to a common format * Map entire FADT, assumed to be smaller than one page. */ FadtDesc = &AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex]; Status = AcpiTbGetTable (FadtDesc, &Table); if (ACPI_FAILURE (Status)) { return; } Length = FadtDesc->Length; /* * Validate the FADT checksum before we copy the table. Ignore * checksum error as we want to try to get the DSDT and FACS. */ - (void) AcpiTbVerifyChecksum (Table, Length); + (void) AcpiUtVerifyChecksum (Table, Length); /* Create a local copy of the FADT in common ACPI 2.0+ format */ AcpiTbCreateLocalFadt (Table, Length); /* All done with the real FADT, unmap it */ AcpiTbPutTable (FadtDesc); /* Obtain the DSDT and FACS tables via their addresses within the FADT */ AcpiTbInstallStandardTable ( (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &AcpiGbl_DsdtIndex); /* If Hardware Reduced flag is set, there is no FACS */ if (!AcpiGbl_ReducedHardware) { if (AcpiGbl_FADT.Facs) { AcpiTbInstallStandardTable ( (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &AcpiGbl_FacsIndex); } if (AcpiGbl_FADT.XFacs) { AcpiTbInstallStandardTable ( (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &AcpiGbl_XFacsIndex); } } } /******************************************************************************* * * FUNCTION: AcpiTbCreateLocalFadt * * PARAMETERS: Table - Pointer to BIOS FADT * Length - Length of the table * * RETURN: None * * DESCRIPTION: Get a local copy of the FADT and convert it to a common format. * Performs validation on some important FADT fields. * * NOTE: We create a local copy of the FADT regardless of the version. * ******************************************************************************/ void AcpiTbCreateLocalFadt ( ACPI_TABLE_HEADER *Table, UINT32 Length) { /* * Check if the FADT is larger than the largest table that we expect * (typically the current ACPI specification version). If so, truncate * the table, and issue a warning. */ if (Length > sizeof (ACPI_TABLE_FADT)) { ACPI_BIOS_WARNING ((AE_INFO, "FADT (revision %u) is longer than %s length, " "truncating length %u to %u", Table->Revision, ACPI_FADT_CONFORMANCE, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); } /* Clear the entire local FADT */ memset (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */ memcpy (&AcpiGbl_FADT, Table, ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); /* Take a copy of the Hardware Reduced flag */ AcpiGbl_ReducedHardware = FALSE; if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED) { AcpiGbl_ReducedHardware = TRUE; } /* Convert the local copy of the FADT to the common internal format */ AcpiTbConvertFadt (); /* Initialize the global ACPI register structures */ AcpiTbSetupFadtRegisters (); } /******************************************************************************* * * FUNCTION: AcpiTbConvertFadt * * PARAMETERS: None - AcpiGbl_FADT is used. * * RETURN: None * * DESCRIPTION: Converts all versions of the FADT to a common internal format. * Expand 32-bit addresses to 64-bit as necessary. Also validate * important fields within the FADT. * * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), and must * contain a copy of the actual BIOS-provided FADT. * * Notes on 64-bit register addresses: * * After this FADT conversion, later ACPICA code will only use the 64-bit "X" * fields of the FADT for all ACPI register addresses. * * The 64-bit X fields are optional extensions to the original 32-bit FADT * V1.0 fields. Even if they are present in the FADT, they are optional and * are unused if the BIOS sets them to zero. Therefore, we must copy/expand * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally * zero. * * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address * fields are expanded to the corresponding 64-bit X fields in the internal * common FADT. * * For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded * to the corresponding 64-bit X fields, if the 64-bit field is originally * zero. Adhering to the ACPI specification, we completely ignore the 32-bit * field if the 64-bit field is valid, regardless of whether the host OS is * 32-bit or 64-bit. * * Possible additional checks: * (AcpiGbl_FADT.Pm1EventLength >= 4) * (AcpiGbl_FADT.Pm1ControlLength >= 2) * (AcpiGbl_FADT.PmTimerLength >= 4) * Gpe block lengths must be multiple of 2 * ******************************************************************************/ static void AcpiTbConvertFadt ( void) { const char *Name; ACPI_GENERIC_ADDRESS *Address64; UINT32 Address32; UINT8 Length; UINT8 Flags; UINT32 i; /* * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which * should be zero are indeed zero. This will workaround BIOSs that * inadvertently place values in these fields. * * The ACPI 1.0 reserved fields that will be zeroed are the bytes located * at offset 45, 55, 95, and the word located at offset 109, 110. * * Note: The FADT revision value is unreliable. Only the length can be * trusted. */ if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE) { AcpiGbl_FADT.PreferredProfile = 0; AcpiGbl_FADT.PstateControl = 0; AcpiGbl_FADT.CstControl = 0; AcpiGbl_FADT.BootFlags = 0; } /* * Now we can update the local FADT length to the length of the * current FADT version as defined by the ACPI specification. * Thus, we will have a common FADT internally. */ AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); /* * Expand the 32-bit DSDT addresses to 64-bit as necessary. * Later ACPICA code will always use the X 64-bit field. */ AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT", AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt); /* If Hardware Reduced flag is set, we are all done */ if (AcpiGbl_ReducedHardware) { return; } /* Examine all of the 64-bit extended address fields (X fields) */ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { /* * Get the 32-bit and 64-bit addresses, as well as the register * length and register name. */ Address32 = *ACPI_ADD_PTR (UINT32, &AcpiGbl_FADT, FadtInfoTable[i].Address32); Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtInfoTable[i].Address64); Length = *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length); Name = FadtInfoTable[i].Name; Flags = FadtInfoTable[i].Flags; /* * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" * generic address structures as necessary. Later code will always use * the 64-bit address structures. * * November 2013: * Now always use the 64-bit address if it is valid (non-zero), in * accordance with the ACPI specification which states that a 64-bit * address supersedes the 32-bit version. This behavior can be * overridden by the AcpiGbl_Use32BitFadtAddresses flag. * * During 64-bit address construction and verification, * these cases are handled: * * Address32 zero, Address64 [don't care] - Use Address64 * * No override: if AcpiGbl_Use32BitFadtAddresses is FALSE, and: * Address32 non-zero, Address64 zero - Copy/use Address32 * Address32 non-zero == Address64 non-zero - Use Address64 * Address32 non-zero != Address64 non-zero - Warning, use Address64 * * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and: * Address32 non-zero, Address64 zero - Copy/use Address32 * Address32 non-zero == Address64 non-zero - Copy/use Address32 * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32 * * Note: SpaceId is always I/O for 32-bit legacy address fields */ if (Address32) { if (Address64->Address) { if (Address64->Address != (UINT64) Address32) { /* Address mismatch */ ACPI_BIOS_WARNING ((AE_INFO, "32/64X address mismatch in FADT/%s: " "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address), AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); } /* * For each extended field, check for length mismatch * between the legacy length field and the corresponding * 64-bit X length field. * Note: If the legacy length field is > 0xFF bits, ignore * this check. (GPE registers can be larger than the * 64-bit GAS structure can accommodate, 0xFF bits). */ if ((ACPI_MUL_8 (Length) <= ACPI_UINT8_MAX) && (Address64->BitWidth != ACPI_MUL_8 (Length))) { ACPI_BIOS_WARNING ((AE_INFO, "32/64X length mismatch in FADT/%s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } } /* * Hardware register access code always uses the 64-bit fields. * So if the 64-bit field is zero or is to be overridden, * initialize it with the 32-bit fields. * Note that when the 32-bit address favor is specified, the * 64-bit fields are always re-initialized so that * AccessSize/BitWidth/BitOffset fields can be correctly * configured to the values to trigger a 32-bit compatible * access mode in the hardware register access code. */ if (!Address64->Address || AcpiGbl_Use32BitFadtAddresses) { AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO, Length, (UINT64) Address32, Name, Flags); } } if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED) { /* * Field is required (PM1aEvent, PM1aControl). * Both the address and length must be non-zero. */ if (!Address64->Address || !Length) { ACPI_BIOS_ERROR ((AE_INFO, "Required FADT field %s has zero address and/or length: " "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH) { /* * Field is optional (PM2Control, GPE0, GPE1) AND has its own * length field. If present, both the address and length must * be valid. */ if ((Address64->Address && !Length) || (!Address64->Address && Length)) { ACPI_BIOS_WARNING ((AE_INFO, "Optional FADT field %s has valid %s but zero %s: " "0x%8.8X%8.8X/0x%X", Name, (Length ? "Length" : "Address"), (Length ? "Address": "Length"), ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } } } /******************************************************************************* * * FUNCTION: AcpiTbSetupFadtRegisters * * PARAMETERS: None, uses AcpiGbl_FADT. * * RETURN: None * * DESCRIPTION: Initialize global ACPI PM1 register definitions. Optionally, * force FADT register definitions to their default lengths. * ******************************************************************************/ static void AcpiTbSetupFadtRegisters ( void) { ACPI_GENERIC_ADDRESS *Target64; ACPI_GENERIC_ADDRESS *Source64; UINT8 Pm1RegisterByteWidth; UINT32 i; /* * Optionally check all register lengths against the default values and * update them if they are incorrect. */ if (AcpiGbl_UseDefaultRegisterWidths) { for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { Target64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtInfoTable[i].Address64); /* * If a valid register (Address != 0) and the (DefaultLength > 0) * (Not a GPE register), then check the width against the default. */ if ((Target64->Address) && (FadtInfoTable[i].DefaultLength > 0) && (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { ACPI_BIOS_WARNING ((AE_INFO, "Invalid length for FADT/%s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); /* Incorrect size, set width to the default */ Target64->BitWidth = FadtInfoTable[i].DefaultLength; } } } /* * Get the length of the individual PM1 registers (enable and status). * Each register is defined to be (event block length / 2). Extra divide * by 8 converts bits to bytes. */ Pm1RegisterByteWidth = (UINT8) ACPI_DIV_16 (AcpiGbl_FADT.XPm1aEventBlock.BitWidth); /* * Calculate separate GAS structs for the PM1x (A/B) Status and Enable * registers. These addresses do not appear (directly) in the FADT, so it * is useful to pre-calculate them from the PM1 Event Block definitions. * * The PM event blocks are split into two register blocks, first is the * PM Status Register block, followed immediately by the PM Enable * Register block. Each is of length (Pm1EventLength/2) * * Note: The PM1A event block is required by the ACPI specification. * However, the PM1B event block is optional and is rarely, if ever, * used. */ for (i = 0; i < ACPI_FADT_PM_INFO_ENTRIES; i++) { Source64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtPmInfoTable[i].Source); if (Source64->Address) { AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target, Source64->SpaceId, Pm1RegisterByteWidth, Source64->Address + (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth), "PmRegisters", 0); } } } diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/tables/tbprint.c index 0428968a2908..cfe738ac514d 100644 --- a/sys/contrib/dev/acpica/components/tables/tbprint.c +++ b/sys/contrib/dev/acpica/components/tables/tbprint.c @@ -1,381 +1,297 @@ /****************************************************************************** * * Module Name: tbprint - Table output utilities * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include +#include +#include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbprint") /* Local prototypes */ static void AcpiTbFixString ( char *String, ACPI_SIZE Length); static void AcpiTbCleanupTableHeader ( ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header); /******************************************************************************* * * FUNCTION: AcpiTbFixString * * PARAMETERS: String - String to be repaired * Length - Maximum length * * RETURN: None * * DESCRIPTION: Replace every non-printable or non-ascii byte in the string * with a question mark '?'. * ******************************************************************************/ static void AcpiTbFixString ( char *String, ACPI_SIZE Length) { while (Length && *String) { - if (!isprint ((int) *String)) + if (!isprint ((int) (UINT8) *String)) { *String = '?'; } String++; Length--; } } /******************************************************************************* * * FUNCTION: AcpiTbCleanupTableHeader * * PARAMETERS: OutHeader - Where the cleaned header is returned * Header - Input ACPI table header * * RETURN: Returns the cleaned header in OutHeader * * DESCRIPTION: Copy the table header and ensure that all "string" fields in * the header consist of printable characters. * ******************************************************************************/ static void AcpiTbCleanupTableHeader ( ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header) { memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); AcpiTbFixString (OutHeader->Signature, ACPI_NAMESEG_SIZE); AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAMESEG_SIZE); } /******************************************************************************* * * FUNCTION: AcpiTbPrintTableHeader * * PARAMETERS: Address - Table physical address * Header - Table header * * RETURN: None * * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. * ******************************************************************************/ void AcpiTbPrintTableHeader ( ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header) { ACPI_TABLE_HEADER LocalHeader; if (ACPI_COMPARE_NAMESEG (Header->Signature, ACPI_SIG_FACS)) { /* FACS only has signature and length fields */ ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X", Header->Signature, ACPI_FORMAT_UINT64 (Address), Header->Length)); } else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Signature)) { /* RSDP has no common fields */ memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)", ACPI_FORMAT_UINT64 (Address), (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, LocalHeader.OemId)); } else { /* Standard ACPI table with full common header */ AcpiTbCleanupTableHeader (&LocalHeader, Header); ACPI_INFO (( "%-4.4s 0x%8.8X%8.8X" " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)", LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address), LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, LocalHeader.OemTableId, LocalHeader.OemRevision, LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); } } - -/******************************************************************************* - * - * FUNCTION: AcpiTbValidateChecksum - * - * PARAMETERS: Table - ACPI table to verify - * Length - Length of entire table - * - * RETURN: Status - * - * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns - * exception on bad checksum. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbVerifyChecksum ( - ACPI_TABLE_HEADER *Table, - UINT32 Length) -{ - UINT8 Checksum; - - - /* - * FACS/S3PT: - * They are the odd tables, have no standard ACPI header and no checksum - */ - - if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) || - ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS)) - { - return (AE_OK); - } - - /* Compute the checksum on the table */ - - Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); - - /* Checksum ok? (should be zero) */ - - if (Checksum) - { - ACPI_BIOS_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, " - "should be 0x%2.2X", - Table->Signature, Table->Checksum, - (UINT8) (Table->Checksum - Checksum))); - -#if (ACPI_CHECKSUM_ABORT) - return (AE_BAD_CHECKSUM); -#endif - } - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbChecksum - * - * PARAMETERS: Buffer - Pointer to memory region to be checked - * Length - Length of this memory region - * - * RETURN: Checksum (UINT8) - * - * DESCRIPTION: Calculates circular checksum of memory region. - * - ******************************************************************************/ - -UINT8 -AcpiTbChecksum ( - UINT8 *Buffer, - UINT32 Length) -{ - UINT8 Sum = 0; - UINT8 *End = Buffer + Length; - - - while (Buffer < End) - { - Sum = (UINT8) (Sum + *(Buffer++)); - } - - return (Sum); -} diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c index 7698297c5d92..16a4abc476e5 100644 --- a/sys/contrib/dev/acpica/components/tables/tbutils.c +++ b/sys/contrib/dev/acpica/components/tables/tbutils.c @@ -1,630 +1,630 @@ /****************************************************************************** * * Module Name: tbutils - ACPI Table utilities * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbutils") /* Local prototypes */ static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, UINT32 TableEntrySize); #if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiTbInitializeFacs * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Create a permanent mapping for the FADT and save it in a global * for accessing the Global Lock and Firmware Waking Vector * ******************************************************************************/ ACPI_STATUS AcpiTbInitializeFacs ( void) { ACPI_TABLE_FACS *Facs; /* If Hardware Reduced flag is set, there is no FACS */ if (AcpiGbl_ReducedHardware) { AcpiGbl_FACS = NULL; return (AE_OK); } else if (AcpiGbl_FADT.XFacs && (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses)) { (void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex, ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs)); AcpiGbl_FACS = Facs; } else if (AcpiGbl_FADT.Facs) { (void) AcpiGetTableByIndex (AcpiGbl_FacsIndex, ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs)); AcpiGbl_FACS = Facs; } /* If there is no FACS, just continue. There was already an error msg */ return (AE_OK); } #endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* * * FUNCTION: AcpiTbCheckDsdtHeader * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Quick compare to check validity of the DSDT. This will detect * if the DSDT has been replaced from outside the OS and/or if * the DSDT header has been corrupted. * ******************************************************************************/ void AcpiTbCheckDsdtHeader ( void) { /* Compare original length and checksum to current values */ if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length || AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum) { ACPI_BIOS_ERROR ((AE_INFO, "The DSDT has been corrupted or replaced - " "old, new headers below")); AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader); AcpiTbPrintTableHeader (0, AcpiGbl_DSDT); /* Disable further error messages */ AcpiGbl_OriginalDsdtHeader.Length = AcpiGbl_DSDT->Length; AcpiGbl_OriginalDsdtHeader.Checksum = AcpiGbl_DSDT->Checksum; } } /******************************************************************************* * * FUNCTION: AcpiTbCopyDsdt * * PARAMETERS: TableIndex - Index of installed table to copy * * RETURN: The copied DSDT * * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory. * Some very bad BIOSs are known to either corrupt the DSDT or * install a new, bad DSDT. This copy works around the problem. * ******************************************************************************/ ACPI_TABLE_HEADER * AcpiTbCopyDsdt ( UINT32 TableIndex) { ACPI_TABLE_HEADER *NewTable; ACPI_TABLE_DESC *TableDesc; TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex]; NewTable = ACPI_ALLOCATE (TableDesc->Length); if (!NewTable) { ACPI_ERROR ((AE_INFO, "Could not copy DSDT of length 0x%X", TableDesc->Length)); return (NULL); } memcpy (NewTable, TableDesc->Pointer, TableDesc->Length); AcpiTbUninstallTable (TableDesc); AcpiTbInitTableDescriptor ( &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex], ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable); ACPI_INFO (( "Forced DSDT copy: length 0x%05X copied locally, original unmapped", NewTable->Length)); return (NewTable); } /******************************************************************************* * * FUNCTION: AcpiTbGetRootTableEntry * * PARAMETERS: TableEntry - Pointer to the RSDT/XSDT table entry * TableEntrySize - sizeof 32 or 64 (RSDT or XSDT) * * RETURN: Physical address extracted from the root table * * DESCRIPTION: Get one root table entry. Handles 32-bit and 64-bit cases on * both 32-bit and 64-bit platforms * * NOTE: ACPI_PHYSICAL_ADDRESS is 32-bit on 32-bit platforms, 64-bit on * 64-bit platforms. * ******************************************************************************/ static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, UINT32 TableEntrySize) { UINT64 Address64; /* * Get the table physical address (32-bit for RSDT, 64-bit for XSDT): * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT */ if (TableEntrySize == ACPI_RSDT_ENTRY_SIZE) { /* * 32-bit platform, RSDT: Return 32-bit table entry * 64-bit platform, RSDT: Expand 32-bit to 64-bit and return */ return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR ( UINT32, TableEntry))); } else { /* * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, * return 64-bit */ ACPI_MOVE_64_TO_64 (&Address64, TableEntry); #if ACPI_MACHINE_WIDTH == 32 if (Address64 > ACPI_UINT32_MAX) { /* Will truncate 64-bit address to 32 bits, issue warning */ ACPI_BIOS_WARNING ((AE_INFO, "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," " truncating", ACPI_FORMAT_UINT64 (Address64))); } #endif return ((ACPI_PHYSICAL_ADDRESS) (Address64)); } } /******************************************************************************* * * FUNCTION: AcpiTbParseRootTable * * PARAMETERS: RsdpAddress - Pointer to the RSDP * * RETURN: Status * * DESCRIPTION: This function is called to parse the Root System Description * Table (RSDT or XSDT) * * NOTE: Tables are mapped (not copied) for efficiency. The FACS must * be mapped and cannot be copied because it contains the actual * memory location of the ACPI Global Lock. * ******************************************************************************/ ACPI_STATUS ACPI_INIT_FUNCTION AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS RsdpAddress) { ACPI_TABLE_RSDP *Rsdp; UINT32 TableEntrySize; UINT32 i; UINT32 TableCount; ACPI_TABLE_HEADER *Table; ACPI_PHYSICAL_ADDRESS Address; UINT32 Length; UINT8 *TableEntry; ACPI_STATUS Status; UINT32 TableIndex; ACPI_FUNCTION_TRACE (TbParseRootTable); /* Map the entire RSDP and extract the address of the RSDT or XSDT */ Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP)); if (!Rsdp) { return_ACPI_STATUS (AE_NO_MEMORY); } AcpiTbPrintTableHeader (RsdpAddress, ACPI_CAST_PTR (ACPI_TABLE_HEADER, Rsdp)); /* Use XSDT if present and not overridden. Otherwise, use RSDT */ if ((Rsdp->Revision > 1) && Rsdp->XsdtPhysicalAddress && !AcpiGbl_DoNotUseXsdt) { /* * RSDP contains an XSDT (64-bit physical addresses). We must use * the XSDT if the revision is > 1 and the XSDT pointer is present, * as per the ACPI specification. */ Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress; TableEntrySize = ACPI_XSDT_ENTRY_SIZE; } else { /* Root table is an RSDT (32-bit physical addresses) */ Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress; TableEntrySize = ACPI_RSDT_ENTRY_SIZE; } /* * It is not possible to map more than one entry in some environments, * so unmap the RSDP here before mapping other tables */ AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP)); /* Map the RSDT/XSDT table header to get the full table length */ Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER)); if (!Table) { return_ACPI_STATUS (AE_NO_MEMORY); } AcpiTbPrintTableHeader (Address, Table); /* * Validate length of the table, and map entire table. * Minimum length table must contain at least one entry. */ Length = Table->Length; AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER)); if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize)) { ACPI_BIOS_ERROR ((AE_INFO, "Invalid table length 0x%X in RSDT/XSDT", Length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } Table = AcpiOsMapMemory (Address, Length); if (!Table) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Validate the root table checksum */ - Status = AcpiTbVerifyChecksum (Table, Length); + Status = AcpiUtVerifyChecksum (Table, Length); if (ACPI_FAILURE (Status)) { AcpiOsUnmapMemory (Table, Length); return_ACPI_STATUS (Status); } /* Get the number of entries and pointer to first entry */ TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) / TableEntrySize); TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); /* Initialize the root table array from the RSDT/XSDT */ for (i = 0; i < TableCount; i++) { /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize); /* Skip NULL entries in RSDT/XSDT */ if (!Address) { goto NextTable; } Status = AcpiTbInstallStandardTable (Address, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &TableIndex); if (ACPI_SUCCESS (Status) && ACPI_COMPARE_NAMESEG ( &AcpiGbl_RootTableList.Tables[TableIndex].Signature, ACPI_SIG_FADT)) { AcpiGbl_FadtIndex = TableIndex; AcpiTbParseFadt (); } NextTable: TableEntry += TableEntrySize; } AcpiOsUnmapMemory (Table, Length); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbGetTable * * PARAMETERS: TableDesc - Table descriptor * OutTable - Where the pointer to the table is returned * * RETURN: Status and pointer to the requested table * * DESCRIPTION: Increase a reference to a table descriptor and return the * validated table pointer. * If the table descriptor is an entry of the root table list, * this API must be invoked with ACPI_MTX_TABLES acquired. * ******************************************************************************/ ACPI_STATUS AcpiTbGetTable ( ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiTbGetTable); if (TableDesc->ValidationCount == 0) { /* Table need to be "VALIDATED" */ Status = AcpiTbValidateTable (TableDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS) { TableDesc->ValidationCount++; /* * Detect ValidationCount overflows to ensure that the warning * message will only be printed once. */ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS) { ACPI_WARNING((AE_INFO, "Table %p, Validation count overflows\n", TableDesc)); } } *OutTable = TableDesc->Pointer; return_ACPI_STATUS (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiTbPutTable * * PARAMETERS: TableDesc - Table descriptor * * RETURN: None * * DESCRIPTION: Decrease a reference to a table descriptor and release the * validated table pointer if no references. * If the table descriptor is an entry of the root table list, * this API must be invoked with ACPI_MTX_TABLES acquired. * ******************************************************************************/ void AcpiTbPutTable ( ACPI_TABLE_DESC *TableDesc) { ACPI_FUNCTION_TRACE (AcpiTbPutTable); if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS) { TableDesc->ValidationCount--; /* * Detect ValidationCount underflows to ensure that the warning * message will only be printed once. */ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS) { ACPI_WARNING ((AE_INFO, "Table %p, Validation count underflows\n", TableDesc)); return_VOID; } } if (TableDesc->ValidationCount == 0) { /* Table need to be "INVALIDATED" */ AcpiTbInvalidateTable (TableDesc); } return_VOID; } diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c index 39cf9ba32e8b..4630174b3624 100644 --- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c +++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c @@ -1,431 +1,445 @@ /****************************************************************************** * * Module Name: tbxfroot - Find the root ACPI table (RSDT) * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfroot") /******************************************************************************* * * FUNCTION: AcpiTbGetRsdpLength * * PARAMETERS: Rsdp - Pointer to RSDP * * RETURN: Table length * * DESCRIPTION: Get the length of the RSDP * ******************************************************************************/ UINT32 AcpiTbGetRsdpLength ( ACPI_TABLE_RSDP *Rsdp) { if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature)) { /* BAD Signature */ return (0); } /* "Length" field is available if table version >= 2 */ if (Rsdp->Revision >= 2) { return (Rsdp->Length); } else { return (ACPI_RSDP_CHECKSUM_LENGTH); } } /******************************************************************************* * * FUNCTION: AcpiTbValidateRsdp * * PARAMETERS: Rsdp - Pointer to unvalidated RSDP * * RETURN: Status * * DESCRIPTION: Validate the RSDP (ptr) * ******************************************************************************/ ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP *Rsdp) { /* * The signature and checksum must both be correct * * Note: Sometimes there exists more than one RSDP in memory; the valid * RSDP has a valid checksum, all others have an invalid checksum. */ if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature)) { /* Nope, BAD Signature */ return (AE_BAD_SIGNATURE); } /* Check the standard checksum */ - if (AcpiTbChecksum ((UINT8 *) Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) + if (AcpiUtChecksum ((UINT8 *) Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) { return (AE_BAD_CHECKSUM); } /* Check extended checksum if table version >= 2 */ if ((Rsdp->Revision >= 2) && - (AcpiTbChecksum ((UINT8 *) Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) + (AcpiUtChecksum ((UINT8 *) Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) { return (AE_BAD_CHECKSUM); } return (AE_OK); } /******************************************************************************* * * FUNCTION: AcpiFindRootPointer * * PARAMETERS: TableAddress - Where the table pointer is returned * * RETURN: Status, RSDP physical address * * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor * pointer structure. If it is found, set *RSDP to point to it. * * NOTE1: The RSDP must be either in the first 1K of the Extended * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) * Only a 32-bit physical address is necessary. * * NOTE2: This function is always available, regardless of the * initialization state of the rest of ACPI. * ******************************************************************************/ ACPI_STATUS ACPI_INIT_FUNCTION AcpiFindRootPointer ( ACPI_PHYSICAL_ADDRESS *TableAddress) { UINT8 *TablePtr; UINT8 *MemRover; UINT32 PhysicalAddress; + UINT32 EbdaWindowSize; ACPI_FUNCTION_TRACE (AcpiFindRootPointer); /* 1a) Get the location of the Extended BIOS Data Area (EBDA) */ TablePtr = AcpiOsMapMemory ( (ACPI_PHYSICAL_ADDRESS) ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH); if (!TablePtr) { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH)); return_ACPI_STATUS (AE_NO_MEMORY); } ACPI_MOVE_16_TO_32 (&PhysicalAddress, TablePtr); /* Convert segment part to physical address */ PhysicalAddress <<= 4; AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_PTR_LENGTH); /* EBDA present? */ - if (PhysicalAddress > 0x400) + /* + * Check that the EBDA pointer from memory is sane and does not point + * above valid low memory + */ + if (PhysicalAddress > 0x400 && + PhysicalAddress < 0xA0000) { /* - * 1b) Search EBDA paragraphs (EBDA is required to be a - * minimum of 1K length) + * Calculate the scan window size + * The EBDA is not guaranteed to be larger than a KiB and in case + * that it is smaller, the scanning function would leave the low + * memory and continue to the VGA range. + */ + EbdaWindowSize = ACPI_MIN(ACPI_EBDA_WINDOW_SIZE, + 0xA0000 - PhysicalAddress); + + /* + * 1b) Search EBDA paragraphs */ TablePtr = AcpiOsMapMemory ( (ACPI_PHYSICAL_ADDRESS) PhysicalAddress, - ACPI_EBDA_WINDOW_SIZE); + EbdaWindowSize); if (!TablePtr) { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", - PhysicalAddress, ACPI_EBDA_WINDOW_SIZE)); + PhysicalAddress, EbdaWindowSize)); return_ACPI_STATUS (AE_NO_MEMORY); } MemRover = AcpiTbScanMemoryForRsdp ( - TablePtr, ACPI_EBDA_WINDOW_SIZE); - AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_WINDOW_SIZE); + TablePtr, EbdaWindowSize); + AcpiOsUnmapMemory (TablePtr, EbdaWindowSize); if (MemRover) { /* Return the physical address */ PhysicalAddress += (UINT32) ACPI_PTR_DIFF (MemRover, TablePtr); *TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress; return_ACPI_STATUS (AE_OK); } } /* * 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh */ TablePtr = AcpiOsMapMemory ( (ACPI_PHYSICAL_ADDRESS) ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE); if (!TablePtr) { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE)); return_ACPI_STATUS (AE_NO_MEMORY); } MemRover = AcpiTbScanMemoryForRsdp ( TablePtr, ACPI_HI_RSDP_WINDOW_SIZE); AcpiOsUnmapMemory (TablePtr, ACPI_HI_RSDP_WINDOW_SIZE); if (MemRover) { /* Return the physical address */ PhysicalAddress = (UINT32) (ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (MemRover, TablePtr)); *TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress; return_ACPI_STATUS (AE_OK); } /* A valid RSDP was not found */ ACPI_BIOS_ERROR ((AE_INFO, "A valid RSDP was not found")); return_ACPI_STATUS (AE_NOT_FOUND); } ACPI_EXPORT_SYMBOL_INIT (AcpiFindRootPointer) /******************************************************************************* * * FUNCTION: AcpiTbScanMemoryForRsdp * * PARAMETERS: StartAddress - Starting pointer for search * Length - Maximum length to search * * RETURN: Pointer to the RSDP if found, otherwise NULL. * * DESCRIPTION: Search a block of memory for the RSDP signature * ******************************************************************************/ UINT8 * AcpiTbScanMemoryForRsdp ( UINT8 *StartAddress, UINT32 Length) { ACPI_STATUS Status; UINT8 *MemRover; UINT8 *EndAddress; ACPI_FUNCTION_TRACE (TbScanMemoryForRsdp); EndAddress = StartAddress + Length; /* Search from given start address for the requested length */ for (MemRover = StartAddress; MemRover < EndAddress; MemRover += ACPI_RSDP_SCAN_STEP) { /* The RSDP signature and checksum must both be correct */ Status = AcpiTbValidateRsdp ( ACPI_CAST_PTR (ACPI_TABLE_RSDP, MemRover)); if (ACPI_SUCCESS (Status)) { /* Sig and checksum valid, we have found a real RSDP */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP located at physical address %p\n", MemRover)); return_PTR (MemRover); } /* No sig match or bad checksum, keep searching */ } /* Searched entire block, no RSDP was found */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Searched entire block from %p, valid RSDP was not found\n", StartAddress)); return_PTR (NULL); } diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/utilities/utcksum.c similarity index 72% copy from sys/contrib/dev/acpica/components/tables/tbprint.c copy to sys/contrib/dev/acpica/components/utilities/utcksum.c index 0428968a2908..8713c6a63ef2 100644 --- a/sys/contrib/dev/acpica/components/tables/tbprint.c +++ b/sys/contrib/dev/acpica/components/utilities/utcksum.c @@ -1,381 +1,335 @@ /****************************************************************************** * - * Module Name: tbprint - Table output utilities + * Module Name: utcksum - Support generating table checksums * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include -#include +#include +#include -#define _COMPONENT ACPI_TABLES - ACPI_MODULE_NAME ("tbprint") +/* This module used for application-level code only */ -/* Local prototypes */ - -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length); - -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header); +#define _COMPONENT ACPI_CA_DISASSEMBLER + ACPI_MODULE_NAME ("utcksum") /******************************************************************************* * - * FUNCTION: AcpiTbFixString + * FUNCTION: AcpiUtVerifyChecksum * - * PARAMETERS: String - String to be repaired - * Length - Maximum length + * PARAMETERS: Table - ACPI table to verify + * Length - Length of entire table * - * RETURN: None + * RETURN: Status * - * DESCRIPTION: Replace every non-printable or non-ascii byte in the string - * with a question mark '?'. + * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns + * exception on bad checksum. + * Note: We don't have to check for a CDAT here, since CDAT is + * not in the RSDT/XSDT, and the CDAT table is never installed + * via ACPICA. * ******************************************************************************/ -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length) +ACPI_STATUS +AcpiUtVerifyChecksum ( + ACPI_TABLE_HEADER *Table, + UINT32 Length) { + UINT8 Checksum; - while (Length && *String) - { - if (!isprint ((int) *String)) - { - *String = '?'; - } - String++; - Length--; + /* + * FACS/S3PT: + * They are the odd tables, have no standard ACPI header and no checksum + */ + if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) || + ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS)) + { + return (AE_OK); } -} + /* Compute the checksum on the table */ -/******************************************************************************* - * - * FUNCTION: AcpiTbCleanupTableHeader - * - * PARAMETERS: OutHeader - Where the cleaned header is returned - * Header - Input ACPI table header - * - * RETURN: Returns the cleaned header in OutHeader - * - * DESCRIPTION: Copy the table header and ensure that all "string" fields in - * the header consist of printable characters. - * - ******************************************************************************/ + Length = Table->Length; + Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, Table), Length, Table->Checksum); -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header) -{ + /* Computed checksum matches table? */ - memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); + if (Checksum != Table->Checksum) + { + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", + Table->Signature, Table->Checksum, + Table->Checksum - Checksum)); - AcpiTbFixString (OutHeader->Signature, ACPI_NAMESEG_SIZE); - AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); - AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAMESEG_SIZE); +#if (ACPI_CHECKSUM_ABORT) + return (AE_BAD_CHECKSUM); +#endif + } + + return (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiTbPrintTableHeader + * FUNCTION: AcpiUtVerifyCdatChecksum * - * PARAMETERS: Address - Table physical address - * Header - Table header + * PARAMETERS: Table - CDAT ACPI table to verify + * Length - Length of entire table * - * RETURN: None + * RETURN: Status * - * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. + * DESCRIPTION: Verifies that the CDAT table checksums to zero. Optionally + * returns an exception on bad checksum. * ******************************************************************************/ -void -AcpiTbPrintTableHeader ( - ACPI_PHYSICAL_ADDRESS Address, - ACPI_TABLE_HEADER *Header) +ACPI_STATUS +AcpiUtVerifyCdatChecksum ( + ACPI_TABLE_CDAT *CdatTable, + UINT32 Length) { - ACPI_TABLE_HEADER LocalHeader; + UINT8 Checksum; - if (ACPI_COMPARE_NAMESEG (Header->Signature, ACPI_SIG_FACS)) - { - /* FACS only has signature and length fields */ + /* Compute the checksum on the table */ - ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X", - Header->Signature, ACPI_FORMAT_UINT64 (Address), - Header->Length)); - } - else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP, - Header)->Signature)) - { - /* RSDP has no common fields */ - - memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP, - Header)->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); - - ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)", - ACPI_FORMAT_UINT64 (Address), - (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, - LocalHeader.OemId)); - } - else - { - /* Standard ACPI table with full common header */ + Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, CdatTable), + CdatTable->Length, CdatTable->Checksum); + + /* Computed checksum matches table? */ - AcpiTbCleanupTableHeader (&LocalHeader, Header); + if (Checksum != CdatTable->Checksum) + { + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", + AcpiGbl_CDAT, CdatTable->Checksum, Checksum)); - ACPI_INFO (( - "%-4.4s 0x%8.8X%8.8X" - " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)", - LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address), - LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, - LocalHeader.OemTableId, LocalHeader.OemRevision, - LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); +#if (ACPI_CHECKSUM_ABORT) + return (AE_BAD_CHECKSUM); +#endif } + + CdatTable->Checksum = Checksum; + return (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiTbValidateChecksum + * FUNCTION: AcpiUtGenerateChecksum * - * PARAMETERS: Table - ACPI table to verify - * Length - Length of entire table + * PARAMETERS: Table - Pointer to table to be checksummed + * Length - Length of the table + * OriginalChecksum - Value of the checksum field * - * RETURN: Status + * RETURN: 8 bit checksum of buffer * - * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns - * exception on bad checksum. + * DESCRIPTION: Computes an 8 bit checksum of the table. * ******************************************************************************/ -ACPI_STATUS -AcpiTbVerifyChecksum ( - ACPI_TABLE_HEADER *Table, - UINT32 Length) +UINT8 +AcpiUtGenerateChecksum ( + void *Table, + UINT32 Length, + UINT8 OriginalChecksum) { UINT8 Checksum; - /* - * FACS/S3PT: - * They are the odd tables, have no standard ACPI header and no checksum - */ + /* Sum the entire table as-is */ - if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) || - ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS)) - { - return (AE_OK); - } + Checksum = AcpiUtChecksum ((UINT8 *) Table, Length); - /* Compute the checksum on the table */ + /* Subtract off the existing checksum value in the table */ - Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); + Checksum = (UINT8) (Checksum - OriginalChecksum); - /* Checksum ok? (should be zero) */ + /* Compute and return the final checksum */ - if (Checksum) - { - ACPI_BIOS_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, " - "should be 0x%2.2X", - Table->Signature, Table->Checksum, - (UINT8) (Table->Checksum - Checksum))); - -#if (ACPI_CHECKSUM_ABORT) - return (AE_BAD_CHECKSUM); -#endif - } - - return (AE_OK); + Checksum = (UINT8) (0 - Checksum); + return (Checksum); } /******************************************************************************* * - * FUNCTION: AcpiTbChecksum + * FUNCTION: AcpiUtChecksum * * PARAMETERS: Buffer - Pointer to memory region to be checked * Length - Length of this memory region * * RETURN: Checksum (UINT8) * * DESCRIPTION: Calculates circular checksum of memory region. * ******************************************************************************/ UINT8 -AcpiTbChecksum ( +AcpiUtChecksum ( UINT8 *Buffer, UINT32 Length) { UINT8 Sum = 0; UINT8 *End = Buffer + Length; while (Buffer < End) { Sum = (UINT8) (Sum + *(Buffer++)); } return (Sum); } diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c index 2a121dfcca3c..84ec453c4c14 100644 --- a/sys/contrib/dev/acpica/components/utilities/utglobal.c +++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c @@ -1,348 +1,349 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #define EXPORT_ACPI_INTERFACES #define DEFINE_ACPI_GLOBALS #include #include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utglobal") /******************************************************************************* * * Static global variable initialization. * ******************************************************************************/ /* Various state name strings */ const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = { "\\_S0_", "\\_S1_", "\\_S2_", "\\_S3_", "\\_S4_", "\\_S5_" }; const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] = { "_S0W", "_S1W", "_S2W", "_S3W", "_S4W" }; const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] = { "_S1D", "_S2D", "_S3D", "_S4D" }; /* Hex-to-ascii */ const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef"; const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF"; /******************************************************************************* * * Namespace globals * ******************************************************************************/ /* * Predefined ACPI Names (Built-in to the Interpreter) * * NOTES: * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run * during the initialization sequence. * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to * perform a Notify() operation on it. 09/2010: Changed to type Device. * This still allows notifies, but does not confuse host code that * searches for valid ThermalZone objects. */ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_TZ_", ACPI_TYPE_DEVICE, NULL}, /* * March, 2015: * The _REV object is in the process of being deprecated, because * other ACPI implementations permanently return 2. Thus, it * has little or no value. Return 2 for compatibility with * other ACPI implementations. */ {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)}, {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)}, /* Table terminator */ {NULL, ACPI_TYPE_ANY, NULL} }; #if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * Event and Hardware globals * ******************************************************************************/ ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = { /* Name Parent Register Register Bit Position Register Bit Mask */ /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS}, /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, /* ACPI_BITREG_SLEEP_TYPE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE, ACPI_BITMASK_SLEEP_TYPE}, /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} }; ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = { /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, + /* ACPI_EVENT_PCIE_WAKE */ {ACPI_BITREG_PCIEXP_WAKE_STATUS, ACPI_BITREG_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, }; #endif /* !ACPI_REDUCED_HARDWARE */ #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) /* ToPld macro: compile/disassemble strings */ const char *AcpiGbl_PldPanelList[] = { "TOP", "BOTTOM", "LEFT", "RIGHT", "FRONT", "BACK", "UNKNOWN", NULL }; const char *AcpiGbl_PldVerticalPositionList[] = { "UPPER", "CENTER", "LOWER", NULL }; const char *AcpiGbl_PldHorizontalPositionList[] = { "LEFT", "CENTER", "RIGHT", NULL }; const char *AcpiGbl_PldShapeList[] = { "ROUND", "OVAL", "SQUARE", "VERTICALRECTANGLE", "HORIZONTALRECTANGLE", "VERTICALTRAPEZOID", "HORIZONTALTRAPEZOID", "UNKNOWN", "CHAMFERED", NULL }; #endif /* Public globals */ ACPI_EXPORT_SYMBOL (AcpiGbl_FADT) ACPI_EXPORT_SYMBOL (AcpiDbgLevel) ACPI_EXPORT_SYMBOL (AcpiDbgLayer) ACPI_EXPORT_SYMBOL (AcpiGpeCount) ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount) diff --git a/sys/contrib/dev/acpica/components/utilities/utstring.c b/sys/contrib/dev/acpica/components/utilities/utstring.c index dcbdc6d9edc6..fb514931b479 100644 --- a/sys/contrib/dev/acpica/components/utilities/utstring.c +++ b/sys/contrib/dev/acpica/components/utilities/utstring.c @@ -1,385 +1,385 @@ /******************************************************************************* * * Module Name: utstring - Common functions for strings and characters * ******************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #include #include #include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utstring") /******************************************************************************* * * FUNCTION: AcpiUtPrintString * * PARAMETERS: String - Null terminated ASCII string * MaxLength - Maximum output length. Used to constrain the * length of strings during debug output only. * * RETURN: None * * DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape * sequences. * ******************************************************************************/ void AcpiUtPrintString ( char *String, UINT16 MaxLength) { UINT32 i; if (!String) { AcpiOsPrintf ("<\"NULL STRING PTR\">"); return; } AcpiOsPrintf ("\""); for (i = 0; (i < MaxLength) && String[i]; i++) { /* Escape sequences */ switch (String[i]) { case 0x07: AcpiOsPrintf ("\\a"); /* BELL */ break; case 0x08: AcpiOsPrintf ("\\b"); /* BACKSPACE */ break; case 0x0C: AcpiOsPrintf ("\\f"); /* FORMFEED */ break; case 0x0A: AcpiOsPrintf ("\\n"); /* LINEFEED */ break; case 0x0D: AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/ break; case 0x09: AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */ break; case 0x0B: AcpiOsPrintf ("\\v"); /* VERTICAL TAB */ break; case '\'': /* Single Quote */ case '\"': /* Double Quote */ case '\\': /* Backslash */ AcpiOsPrintf ("\\%c", (int) String[i]); break; default: /* Check for printable character or hex escape */ if (isprint ((int) String[i])) { /* This is a normal character */ AcpiOsPrintf ("%c", (int) String[i]); } else { /* All others will be Hex escapes */ AcpiOsPrintf ("\\x%2.2X", (INT32) String[i]); } break; } } AcpiOsPrintf ("\""); if (i == MaxLength && String[i]) { AcpiOsPrintf ("..."); } } /******************************************************************************* * * FUNCTION: AcpiUtRepairName * * PARAMETERS: Name - The ACPI name to be repaired * * RETURN: Repaired version of the name * * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and * return the new name. NOTE: the Name parameter must reside in * read/write memory, cannot be a const. * * An ACPI Name must consist of valid ACPI characters. We will repair the name * if necessary because we don't want to abort because of this, but we want * all namespace names to be printable. A warning message is appropriate. * * This issue came up because there are in fact machines that exhibit * this problem, and we want to be able to enable ACPI support for them, * even though there are a few bad names. * ******************************************************************************/ void AcpiUtRepairName ( char *Name) { UINT32 i; BOOLEAN FoundBadChar = FALSE; UINT32 OriginalName; ACPI_FUNCTION_NAME (UtRepairName); /* * Special case for the root node. This can happen if we get an * error during the execution of module-level code. */ if (ACPI_COMPARE_NAMESEG (Name, ACPI_ROOT_PATHNAME)) { return; } - ACPI_COPY_NAMESEG (&OriginalName, Name); + ACPI_COPY_NAMESEG (&OriginalName, &Name[0]); /* Check each character in the name */ for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { if (AcpiUtValidNameChar (Name[i], i)) { continue; } /* * Replace a bad character with something printable, yet technically - * still invalid. This prevents any collisions with existing "good" + * "odd". This prevents any collisions with existing "good" * names in the namespace. */ - Name[i] = '*'; + Name[i] = '_'; FoundBadChar = TRUE; } if (FoundBadChar) { /* Report warning only if in strict mode or debug mode */ if (!AcpiGbl_EnableInterpreterSlack) { ACPI_WARNING ((AE_INFO, - "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", - OriginalName, Name)); + "Invalid character(s) in name (0x%.8X) %p, repaired: [%4.4s]", + OriginalName, Name, &Name[0])); } else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", OriginalName, Name)); } } } #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP /******************************************************************************* * * FUNCTION: UtConvertBackslashes * * PARAMETERS: Pathname - File pathname string to be converted * * RETURN: Modifies the input Pathname * * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within * the entire input file pathname string. * ******************************************************************************/ void UtConvertBackslashes ( char *Pathname) { if (!Pathname) { return; } while (*Pathname) { if (*Pathname == '\\') { *Pathname = '/'; } Pathname++; } } #endif diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h index 8ba7dc28473a..04f7f4f0caa0 100644 --- a/sys/contrib/dev/acpica/include/acconfig.h +++ b/sys/contrib/dev/acpica/include/acconfig.h @@ -1,376 +1,378 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef _ACCONFIG_H #define _ACCONFIG_H /****************************************************************************** * * Configuration options * *****************************************************************************/ /* * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the * ACPI subsystem. This includes the DEBUG_PRINT output * statements. When disabled, all DEBUG_PRINT * statements are compiled out. * * ACPI_APPLICATION - Use this switch if the subsystem is going to be run * at the application level. * */ /* * OS name, used for the _OS object. The _OS object is essentially obsolete, * but there is a large base of ASL/AML code in existing machines that check * for the string below. The use of this string usually guarantees that * the ASL will execute down the most tested code path. Also, there is some * code that will not execute the _OSI method unless _OS matches the string * below. Therefore, change this string at your own risk. */ #define ACPI_OS_NAME "Microsoft Windows NT" /* Maximum objects in the various object caches */ #define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ #define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ #define ACPI_MAX_COMMENT_CACHE_DEPTH 96 /* Comments for the -ca option */ /* * Should the subsystem abort the loading of an ACPI table if the * table checksum is incorrect? */ #ifndef ACPI_CHECKSUM_ABORT #define ACPI_CHECKSUM_ABORT FALSE #endif /* * Generate a version of ACPICA that only supports "reduced hardware" * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" * model. In other words, no ACPI hardware is supported. * * If TRUE, this means no support for the following: * PM Event and Control registers * SCI interrupt (and handler) * Fixed Events * General Purpose Events (GPEs) * Global Lock * ACPI PM timer * FACS table (Waking vectors and Global Lock) */ #ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE #endif /****************************************************************************** * * Subsystem Constants * *****************************************************************************/ /* Version of ACPI supported */ #define ACPI_CA_SUPPORT_LEVEL 5 /* Maximum count for a semaphore object */ #define ACPI_MAX_SEMAPHORE_COUNT 256 /* Maximum object reference count (detects object deletion issues) */ #define ACPI_MAX_REFERENCE_COUNT 0x4000 /* Default page size for use in mapping memory for operation regions */ #define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */ /* OwnerId tracking. 128 entries allows for 4095 OwnerIds */ #define ACPI_NUM_OWNERID_MASKS 128 /* Size of the root table array is increased by this increment */ #define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 /* Maximum sleep allowed via Sleep() operator */ #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ /* Address Range lists are per-SpaceId (Memory and I/O only) */ #define ACPI_ADDRESS_RANGE_MAX 2 /* Maximum time (default 30s) of While() loops before abort */ #define ACPI_MAX_LOOP_TIMEOUT 30 /****************************************************************************** * * ACPI Specification constants (Do not change unless the specification changes) * *****************************************************************************/ /* Method info (in WALK_STATE), containing local variables and arguments */ #define ACPI_METHOD_NUM_LOCALS 8 #define ACPI_METHOD_MAX_LOCAL 7 #define ACPI_METHOD_NUM_ARGS 7 #define ACPI_METHOD_MAX_ARG 6 /* * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG */ #define ACPI_OBJ_NUM_OPERANDS 8 #define ACPI_OBJ_MAX_OPERAND 7 /* Number of elements in the Result Stack frame, can be an arbitrary value */ #define ACPI_RESULTS_FRAME_OBJ_NUM 8 /* * Maximal number of elements the Result Stack can contain, * it may be an arbitrary value not exceeding the types of * ResultSize and ResultCount (now UINT8). */ #define ACPI_RESULTS_OBJ_NUM_MAX 255 /* Constants used in searching for the RSDP in low memory */ #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ #define ACPI_EBDA_PTR_LENGTH 2 #define ACPI_EBDA_WINDOW_SIZE 1024 #define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ #define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 #define ACPI_RSDP_SCAN_STEP 16 /* Operation regions */ #define ACPI_USER_REGION_BEGIN 0x80 /* Maximum SpaceIds for Operation Regions */ #define ACPI_MAX_ADDRESS_SPACE 255 #define ACPI_NUM_DEFAULT_SPACES 4 /* Array sizes. Used for range checking also */ #define ACPI_MAX_MATCH_OPCODE 5 /* RSDP checksums */ #define ACPI_RSDP_CHECKSUM_LENGTH 20 #define ACPI_RSDP_XCHECKSUM_LENGTH 36 /* * SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header, * containing both Status and Length. */ #define ACPI_SERIAL_HEADER_SIZE 2 /* Common for below. Status and Length fields */ #define ACPI_SMBUS_DATA_SIZE 32 #define ACPI_SMBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE #define ACPI_IPMI_DATA_SIZE 64 #define ACPI_IPMI_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE #define ACPI_MAX_GSBUS_DATA_SIZE 255 #define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE #define ACPI_PRM_INPUT_BUFFER_SIZE 26 +#define ACPI_FFH_INPUT_BUFFER_SIZE 256 + /* _SxD and _SxW control methods */ #define ACPI_NUM_SxD_METHODS 4 #define ACPI_NUM_SxW_METHODS 5 /****************************************************************************** * * Miscellaneous constants * *****************************************************************************/ /* UUID constants */ #define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */ #define UUID_STRING_LENGTH 36 /* Total length of a UUID string */ /* Positions for required hyphens (dashes) in UUID strings */ #define UUID_HYPHEN1_OFFSET 8 #define UUID_HYPHEN2_OFFSET 13 #define UUID_HYPHEN3_OFFSET 18 #define UUID_HYPHEN4_OFFSET 23 /****************************************************************************** * * ACPI AML Debugger * *****************************************************************************/ #define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */ #define ACPI_DB_LINE_BUFFER_SIZE 512 #define ACPI_DEBUGGER_COMMAND_PROMPT '-' #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' #endif /* _ACCONFIG_H */ diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h index a374b7d4bf89..4bb3f39931bd 100644 --- a/sys/contrib/dev/acpica/include/acdisasm.h +++ b/sys/contrib/dev/acpica/include/acdisasm.h @@ -1,1476 +1,1495 @@ /****************************************************************************** * * Name: acdisasm.h - AML disassembler * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACDISASM_H__ #define __ACDISASM_H__ #include #define BLOCK_NONE 0 #define BLOCK_PAREN 1 #define BLOCK_BRACE 2 #define BLOCK_COMMA_LIST 4 #define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD" /* * Raw table data header. Used by disassembler and data table compiler. * Do not change. */ #define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data" typedef struct acpi_dmtable_info { UINT8 Opcode; UINT16 Offset; char *Name; UINT8 Flags; } ACPI_DMTABLE_INFO; /* Values for Flags field above */ #define DT_LENGTH 0x01 /* Field is a subtable length */ #define DT_FLAG 0x02 /* Field is a flag value */ #define DT_NON_ZERO 0x04 /* Field must be non-zero */ #define DT_OPTIONAL 0x08 /* Field is optional */ #define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */ #define DT_COUNT 0x20 /* Currently not used */ /* * Values for Opcode above. * Note: 0-7 must not change, they are used as a flag shift value. Other * than those, new values can be added wherever appropriate. */ typedef enum { /* Simple Data Types */ ACPI_DMT_FLAG0 = 0, ACPI_DMT_FLAG1 = 1, ACPI_DMT_FLAG2 = 2, ACPI_DMT_FLAG3 = 3, ACPI_DMT_FLAG4 = 4, ACPI_DMT_FLAG5 = 5, ACPI_DMT_FLAG6 = 6, ACPI_DMT_FLAG7 = 7, ACPI_DMT_FLAGS0, ACPI_DMT_FLAGS1, ACPI_DMT_FLAGS2, ACPI_DMT_FLAGS8_2, ACPI_DMT_FLAGS4, ACPI_DMT_FLAGS4_0, ACPI_DMT_FLAGS4_4, ACPI_DMT_FLAGS4_8, ACPI_DMT_FLAGS4_12, ACPI_DMT_FLAGS16_16, ACPI_DMT_UINT8, ACPI_DMT_UINT16, ACPI_DMT_UINT24, ACPI_DMT_UINT32, ACPI_DMT_UINT40, ACPI_DMT_UINT48, ACPI_DMT_UINT56, ACPI_DMT_UINT64, ACPI_DMT_BUF7, ACPI_DMT_BUF10, ACPI_DMT_BUF12, ACPI_DMT_BUF16, ACPI_DMT_BUF18, ACPI_DMT_BUF128, ACPI_DMT_SIG, ACPI_DMT_STRING, ACPI_DMT_NAME4, ACPI_DMT_NAME6, ACPI_DMT_NAME8, /* Types that are decoded to strings and miscellaneous */ ACPI_DMT_ACCWIDTH, ACPI_DMT_CHKSUM, ACPI_DMT_GAS, ACPI_DMT_SPACEID, ACPI_DMT_UNICODE, ACPI_DMT_UUID, /* Types used only for the Data Table Compiler */ ACPI_DMT_BUFFER, ACPI_DMT_RAW_BUFFER, /* Large, multiple line buffer */ ACPI_DMT_DEVICE_PATH, ACPI_DMT_LABEL, ACPI_DMT_PCI_PATH, /* Types that are specific to particular ACPI tables */ ACPI_DMT_AEST, ACPI_DMT_AEST_CACHE, ACPI_DMT_AEST_GIC, ACPI_DMT_AEST_RES, ACPI_DMT_AEST_XFACE, ACPI_DMT_AEST_XRUPT, ACPI_DMT_AGDI, ACPI_DMT_ASF, + ACPI_DMT_CDAT, ACPI_DMT_CEDT, ACPI_DMT_DMAR, ACPI_DMT_DMAR_SCOPE, ACPI_DMT_EINJACT, ACPI_DMT_EINJINST, ACPI_DMT_ERSTACT, ACPI_DMT_ERSTINST, ACPI_DMT_FADTPM, ACPI_DMT_GTDT, ACPI_DMT_HEST, ACPI_DMT_HESTNTFY, ACPI_DMT_HESTNTYP, ACPI_DMT_HMAT, ACPI_DMT_IORTMEM, ACPI_DMT_IVRS, ACPI_DMT_IVRS_DE, ACPI_DMT_IVRS_UNTERMINATED_STRING, ACPI_DMT_LPIT, ACPI_DMT_MADT, ACPI_DMT_NFIT, ACPI_DMT_NHLT1, ACPI_DMT_NHLT1a, ACPI_DMT_NHLT1b, ACPI_DMT_NHLT1c, ACPI_DMT_NHLT1d, ACPI_DMT_NHLT1e, ACPI_DMT_NHLT1f, ACPI_DMT_PCCT, ACPI_DMT_PHAT, ACPI_DMT_PMTT, ACPI_DMT_PMTT_VENDOR, ACPI_DMT_PPTT, ACPI_DMT_RGRT, ACPI_DMT_SDEI, ACPI_DMT_SDEV, ACPI_DMT_SLIC, ACPI_DMT_SRAT, ACPI_DMT_TPM2, ACPI_DMT_VIOT, ACPI_DMT_WPBT_UNICODE, /* Special opcodes */ ACPI_DMT_EXTRA_TEXT, ACPI_DMT_EXIT } ACPI_ENTRY_TYPES; typedef void (*ACPI_DMTABLE_HANDLER) ( ACPI_TABLE_HEADER *Table); typedef ACPI_STATUS (*ACPI_CMTABLE_HANDLER) ( void **PFieldList); typedef struct acpi_dmtable_data { char *Signature; ACPI_DMTABLE_INFO *TableInfo; ACPI_DMTABLE_HANDLER TableHandler; ACPI_CMTABLE_HANDLER CmTableHandler; const unsigned char *Template; } ACPI_DMTABLE_DATA; typedef struct acpi_op_walk_info { ACPI_WALK_STATE *WalkState; ACPI_PARSE_OBJECT *MappingOp; UINT8 *PreviousAml; UINT8 *StartAml; UINT32 Level; UINT32 LastLevel; UINT32 Count; UINT32 BitOffset; UINT32 Flags; UINT32 AmlOffset; } ACPI_OP_WALK_INFO; /* * TBD - another copy of this is in asltypes.h, fix */ #ifndef ASL_WALK_CALLBACK_DEFINED typedef ACPI_STATUS (*ASL_WALK_CALLBACK) ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); #define ASL_WALK_CALLBACK_DEFINED #endif typedef void (*ACPI_RESOURCE_HANDLER) ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); typedef struct acpi_resource_tag { UINT32 BitIndex; char *Tag; } ACPI_RESOURCE_TAG; /* Strings used for decoding flags to ASL keywords */ extern const char *AcpiGbl_WordDecode[]; extern const char *AcpiGbl_IrqDecode[]; extern const char *AcpiGbl_LockRule[]; extern const char *AcpiGbl_AccessTypes[]; extern const char *AcpiGbl_UpdateRules[]; extern const char *AcpiGbl_MatchOps[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestProcError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestCacheRsrc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestTlbRsrc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestGenRsrc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestMemError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestSmmuError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestGicError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXrupt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAgdi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoApmtNode[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBdat[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCcel[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatTableHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatHeader[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat4[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat5[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatEntries[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtEl2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort6a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHware1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHware23[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsMemory[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsCidString[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsCidInteger[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHid[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsUidString[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsUidInteger[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHidString[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHidInteger[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfitHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt3a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt5c[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhatHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttVendor[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtModule[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtHandler[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdevHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev0b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompId[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdevSecCompMem[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdev1b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSvkl[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSvkl0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTdel[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm211[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViot[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViotHeader[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViot1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViot2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViot3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoViot4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; /* * dmtable and ahtable */ extern const ACPI_DMTABLE_DATA AcpiDmTableData[]; extern const AH_TABLE AcpiGbl_SupportedTables[]; UINT8 AcpiDmGenerateChecksum ( void *Table, UINT32 Length, UINT8 OriginalChecksum); const ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature); void AcpiDmDumpDataTable ( ACPI_TABLE_HEADER *Table); ACPI_STATUS AcpiDmDumpTable ( UINT32 TableLength, UINT32 TableOffset, void *Table, UINT32 SubtableLength, ACPI_DMTABLE_INFO *Info); void AcpiDmLineHeader ( UINT32 Offset, UINT32 ByteLength, char *Name); void AcpiDmLineHeader2 ( UINT32 Offset, UINT32 ByteLength, char *Name, UINT32 Value); /* * dmtbdump */ void AcpiDmDumpBuffer ( void *Table, UINT32 BufferOffset, UINT32 Length, UINT32 AbsoluteOffset, char *Header); void AcpiDmDumpUnicode ( void *Table, UINT32 BufferOffset, UINT32 ByteLength); void AcpiDmDumpAest ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpApmt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpAsf ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpCcel ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpCdat ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpCedt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpCsrt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpDbg2 ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpDrtm ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpErst ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpFadt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpFpdt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpGtdt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpHmat ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpIort ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpIvrs ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpLpit ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpMadt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpMcfg ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpMpst ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpMsct ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpNfit ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpNhlt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPcct ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPdtt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPhat ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPmtt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPptt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpPrmt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpRgrt ( ACPI_TABLE_HEADER *Table); UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpRsdt ( ACPI_TABLE_HEADER *Table); UINT32 AcpiDmDumpS3pt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpSdev ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpSlit ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpSrat ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpStao ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpSvkl ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpTcpa ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpTdel ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpTpm2 ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpViot ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpWdat ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpWpbt ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpXsdt ( ACPI_TABLE_HEADER *Table); /* * dmwalk */ void AcpiDmDisassemble ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Origin, UINT32 NumOpcodes); void AcpiDmWalkParseTree ( ACPI_PARSE_OBJECT *Op, ASL_WALK_CALLBACK DescendingCallback, ASL_WALK_CALLBACK AscendingCallback, void *Context); /* * dmopcode */ void AcpiDmDisassembleOneOp ( ACPI_WALK_STATE *WalkState, ACPI_OP_WALK_INFO *Info, ACPI_PARSE_OBJECT *Op); UINT32 AcpiDmListType ( ACPI_PARSE_OBJECT *Op); void AcpiDmMethodFlags ( ACPI_PARSE_OBJECT *Op); void AcpiDmDisplayTargetPathname ( ACPI_PARSE_OBJECT *Op); void AcpiDmNotifyDescription ( ACPI_PARSE_OBJECT *Op); void AcpiDmPredefinedDescription ( ACPI_PARSE_OBJECT *Op); void AcpiDmFieldPredefinedDescription ( ACPI_PARSE_OBJECT *Op); void AcpiDmFieldFlags ( ACPI_PARSE_OBJECT *Op); void AcpiDmAddressSpace ( UINT8 SpaceId); void AcpiDmRegionFlags ( ACPI_PARSE_OBJECT *Op); void AcpiDmMatchOp ( ACPI_PARSE_OBJECT *Op); /* * dmnames */ UINT32 AcpiDmDumpName ( UINT32 Name); ACPI_STATUS AcpiPsDisplayObjectPathname ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op); void AcpiDmNamestring ( char *Name); /* * dmbuffer */ void AcpiDmDisasmByteList ( UINT32 Level, UINT8 *ByteData, UINT32 ByteCount); void AcpiDmByteList ( ACPI_OP_WALK_INFO *Info, ACPI_PARSE_OBJECT *Op); void AcpiDmCheckForHardwareId ( ACPI_PARSE_OBJECT *Op); void AcpiDmDecompressEisaId ( UINT32 EncodedId); BOOLEAN AcpiDmIsUuidBuffer ( ACPI_PARSE_OBJECT *Op); BOOLEAN AcpiDmIsUnicodeBuffer ( ACPI_PARSE_OBJECT *Op); BOOLEAN AcpiDmIsStringBuffer ( ACPI_PARSE_OBJECT *Op); BOOLEAN AcpiDmIsPldBuffer ( ACPI_PARSE_OBJECT *Op); /* * dmdeferred */ ACPI_STATUS AcpiDmParseDeferredOps ( ACPI_PARSE_OBJECT *Root); /* * dmextern */ ACPI_STATUS AcpiDmAddToExternalFileList ( char *PathList); void AcpiDmClearExternalFileList ( void); void AcpiDmAddOpToExternalList ( ACPI_PARSE_OBJECT *Op, char *Path, UINT8 Type, UINT32 Value, UINT16 Flags); void AcpiDmCreateSubobjectForExternal ( UINT8 Type, ACPI_NAMESPACE_NODE **Node, UINT32 Value); void AcpiDmAddNodeToExternalList ( ACPI_NAMESPACE_NODE *Node, UINT8 Type, UINT32 Value, UINT16 Flags); void AcpiDmAddExternalListToNamespace ( void); void AcpiDmAddOneExternalToNamespace ( char *Path, UINT8 Type, UINT32 Value); UINT32 AcpiDmGetUnresolvedExternalMethodCount ( void); void AcpiDmClearExternalList ( void); void AcpiDmEmitExternals ( void); void AcpiDmEmitExternal ( ACPI_PARSE_OBJECT *NameOp, ACPI_PARSE_OBJECT *TypeOp); void AcpiDmUnresolvedWarning ( UINT8 Type); void AcpiDmGetExternalsFromFile ( void); void AcpiDmMarkExternalConflict ( ACPI_NAMESPACE_NODE *Node); /* * dmresrc */ void AcpiDmDumpInteger8 ( UINT8 Value, const char *Name); void AcpiDmDumpInteger16 ( UINT16 Value, const char *Name); void AcpiDmDumpInteger32 ( UINT32 Value, const char *Name); void AcpiDmDumpInteger64 ( UINT64 Value, const char *Name); void AcpiDmResourceTemplate ( ACPI_OP_WALK_INFO *Info, ACPI_PARSE_OBJECT *Op, UINT8 *ByteData, UINT32 ByteCount); ACPI_STATUS AcpiDmIsResourceTemplate ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op); void AcpiDmBitList ( UINT16 Mask); void AcpiDmDescriptorName ( void); /* * dmresrcl */ void AcpiDmWordDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmDwordDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmExtendedDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmQwordDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmMemory24Descriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmMemory32Descriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmFixedMemory32Descriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmGenericRegisterDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmInterruptDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmVendorLargeDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmGpioDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmPinFunctionDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmPinConfigDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmPinGroupDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmPinGroupFunctionDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmPinGroupConfigDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmSerialBusDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmVendorCommon ( const char *Name, UINT8 *ByteData, UINT32 Length, UINT32 Level); /* * dmresrcs */ void AcpiDmIrqDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmDmaDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmFixedDmaDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmIoDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmFixedIoDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmStartDependentDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmEndDependentDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); void AcpiDmVendorSmallDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, UINT32 Length, UINT32 Level); /* * dmutils */ void AcpiDmDecodeAttribute ( UINT8 Attribute); void AcpiDmIndent ( UINT32 Level); BOOLEAN AcpiDmCommaIfListMember ( ACPI_PARSE_OBJECT *Op); void AcpiDmCommaIfFieldMember ( ACPI_PARSE_OBJECT *Op); /* * dmrestag */ void AcpiDmFindResources ( ACPI_PARSE_OBJECT *Root); void AcpiDmCheckResourceReference ( ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState); /* * dmcstyle */ BOOLEAN AcpiDmCheckForSymbolicOpcode ( ACPI_PARSE_OBJECT *Op, ACPI_OP_WALK_INFO *Info); void AcpiDmCloseOperator ( ACPI_PARSE_OBJECT *Op); /* * dmtables */ ACPI_STATUS AcpiDmProcessSwitch ( ACPI_PARSE_OBJECT *Op); void AcpiDmClearTempList( void); /* * dmtables */ void AdDisassemblerHeader ( char *Filename, UINT8 TableType); #define ACPI_IS_AML_TABLE 0 #define ACPI_IS_DATA_TABLE 1 /* * adisasm */ ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, char *Filename, char *Prefix, char **OutFilename); ACPI_STATUS AdGetLocalTables ( void); ACPI_STATUS AdParseTable ( ACPI_TABLE_HEADER *Table, ACPI_OWNER_ID *OwnerId, BOOLEAN LoadTable, BOOLEAN External); ACPI_STATUS AdDisplayTables ( char *Filename, ACPI_TABLE_HEADER *Table); ACPI_STATUS AdDisplayStatistics ( void); /* * dmwalk */ UINT32 AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); #endif /* __ACDISASM_H__ */ diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h index b8831b467232..1850d94beb2e 100644 --- a/sys/contrib/dev/acpica/include/acglobal.h +++ b/sys/contrib/dev/acpica/include/acglobal.h @@ -1,532 +1,533 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACGLOBAL_H__ #define __ACGLOBAL_H__ /***************************************************************************** * * Globals related to the incoming ACPI tables * ****************************************************************************/ /* Master list of all ACPI tables that were found in the RSDT/XSDT */ ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList); /* DSDT information. Used to check for DSDT corruption */ ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT); ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); +ACPI_INIT_GLOBAL (char *, AcpiGbl_CDAT, NULL); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX); #if (!ACPI_REDUCED_HARDWARE) ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); #endif /* !ACPI_REDUCED_HARDWARE */ /* These addresses are calculated from the FADT Event Block addresses */ ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus); ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable); ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus); ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable); /* * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is * determined by the revision of the DSDT: If the DSDT revision is less than * 2, use only the lower 32 bits of the internal 64-bit Integer. */ ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth); ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth); ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth); /***************************************************************************** * * Mutual exclusion within the ACPICA subsystem * ****************************************************************************/ /* * Predefined mutex objects. This array contains the * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. * (The table maps local handles to the real OS handles) */ ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]); /* * Global lock mutex is an actual AML mutex object * Global lock semaphore works in conjunction with the actual global lock * Global lock spinlock is used for "pending" handshake */ ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex); ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore); ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock); ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle); ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired); ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent); ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending); /* * Spinlocks are used for interfaces that can be possibly called at * interrupt level */ ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */ ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */ ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock); /* Mutex for _OSI support */ ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex); /* Reader/Writer lock is used for namespace walk and dynamic table unload */ ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock); /***************************************************************************** * * Miscellaneous globals * ****************************************************************************/ /* Object caches */ ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache); /* System */ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_EarlyInitialization, TRUE); /* Global handlers */ ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]); ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler); ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler); ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler); ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext); ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler); ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList); /* Owner ID support */ ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]); ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex); ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset); /* Initialization sequencing */ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_NamespaceInitialized, FALSE); /* Miscellaneous */ ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode); ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount); ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount); ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave); ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration); ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall); ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent); ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized); ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces); ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]); /* Other miscellaneous, declared and initialized in utglobal */ extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT]; extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]; extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]; extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]; extern const char AcpiGbl_LowerHexDigits[]; extern const char AcpiGbl_UpperHexDigits[]; extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; /* Lists for tracking memory allocations (debug only) */ #ifdef ACPI_DBG_TRACK_ALLOCATIONS ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList); ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking); ACPI_GLOBAL (BOOLEAN, AcpiGbl_VerboseLeakDump); #endif /***************************************************************************** * * ACPI Namespace * ****************************************************************************/ #define NUM_PREDEFINED_NAMES 10 ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct); ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode); ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice); extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]; extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; #ifdef ACPI_DEBUG_OUTPUT ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount); ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize); ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount); ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer); ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); #endif /***************************************************************************** * * Interpreter/Parser globals * ****************************************************************************/ /* Control method single step flag */ ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep); ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList); ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT, *AcpiGbl_CurrentScope, NULL); /* ASL/ASL+ converter */ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CaptureComments, FALSE); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_LastListHead, NULL); /***************************************************************************** * * Hardware globals * ****************************************************************************/ extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG]; ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA); ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB); ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeAS0); ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeBS0); /***************************************************************************** * * Event and GPE globals * ****************************************************************************/ #if (!ACPI_REDUCED_HARDWARE) ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized); ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead); ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]); ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler); ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext); ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]); extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; #endif /* !ACPI_REDUCED_HARDWARE */ /***************************************************************************** * * Debug support * ****************************************************************************/ /* Event counters */ ACPI_GLOBAL (UINT32, AcpiMethodCount); ACPI_GLOBAL (UINT32, AcpiGpeCount); ACPI_GLOBAL (UINT32, AcpiSciCount); ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]); /* Dynamic control method tracing mechanism */ ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel); ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer); /***************************************************************************** * * Debugger and Disassembler * ****************************************************************************/ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT); #ifdef ACPI_DISASSEMBLER /* Do not disassemble buffers to resource descriptors */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DoDisassemblerOptimizations, TRUE); ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT_LIST, *AcpiGbl_TempListHead, NULL); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods); ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods); ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList); ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList); #endif #ifdef ACPI_DEBUGGER ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE); ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NextCmdNum, 1); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile); ACPI_GLOBAL (char *, AcpiGbl_DbBuffer); ACPI_GLOBAL (char *, AcpiGbl_DbFilename); ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel); ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel); ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateLoop); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbThreadsTerminated); ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]); ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]); /* These buffers should all be the same size */ ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]); ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]); ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]); /* Statistics globals */ ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TOTAL_TYPES]); ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TOTAL_TYPES]); ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc); ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects); #endif /* ACPI_DEBUGGER */ #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) ACPI_GLOBAL (const char, *AcpiGbl_PldPanelList[]); ACPI_GLOBAL (const char, *AcpiGbl_PldVerticalPositionList[]); ACPI_GLOBAL (const char, *AcpiGbl_PldHorizontalPositionList[]); ACPI_GLOBAL (const char, *AcpiGbl_PldShapeList[]); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DisasmFlag, FALSE); #endif /***************************************************************************** * * ACPICA application-specific globals * ****************************************************************************/ /* ASL-to-ASL+ conversion utility (implemented within the iASL compiler) */ #ifdef ACPI_ASL_COMPILER ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentInlineComment, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentEndNodeComment, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentOpenBraceComment, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentCloseBraceComment, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_RootFilename, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentFilename, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentParentFilename, NULL); ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentIncludeFilename, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListHead, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListTail, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListHead, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListTail, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListHead, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListTail, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListHead, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListTail, NULL); ACPI_INIT_GLOBAL (ACPI_COMMENT_ADDR_NODE, *AcpiGbl_CommentAddrListHead, NULL); ACPI_INIT_GLOBAL (ACPI_FILE_NODE, *AcpiGbl_FileTreeRoot, NULL); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_RegCommentCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_CommentAddrCache); ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_FileCache); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DebugAslConversion, FALSE); ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_ConvDebugFile, NULL); ACPI_GLOBAL (char, AcpiGbl_TableSig[4]); #endif #ifdef ACPI_APPLICATION ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL); ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DebugTimeout, FALSE); /* Print buffer */ ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */ ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]); #endif /* ACPI_APPLICATION */ #endif /* __ACGLOBAL_H__ */ diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index 6f992916708e..f575bd73320d 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -1,1429 +1,1429 @@ /****************************************************************************** * * Name: acpixf.h - External interfaces to the ACPI subsystem * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACXFACE_H__ #define __ACXFACE_H__ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20220331 +#define ACPI_CA_VERSION 0x20221020 #include #include #include #include /***************************************************************************** * * Macros used for ACPICA globals and configuration * ****************************************************************************/ /* * Ensure that global variables are defined and initialized only once. * * The use of these macros allows for a single list of globals (here) * in order to simplify maintenance of the code. */ #ifdef DEFINE_ACPI_GLOBALS #define ACPI_GLOBAL(type,name) \ extern type name; \ type name #define ACPI_INIT_GLOBAL(type,name,value) \ type name=value #else #ifndef ACPI_GLOBAL #define ACPI_GLOBAL(type,name) \ extern type name #endif #ifndef ACPI_INIT_GLOBAL #define ACPI_INIT_GLOBAL(type,name,value) \ extern type name #endif #endif /* * These macros configure the various ACPICA interfaces. They are * useful for generating stub inline functions for features that are * configured out of the current kernel or ACPICA application. */ #ifndef ACPI_EXTERNAL_RETURN_STATUS #define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \ Prototype; #endif #ifndef ACPI_EXTERNAL_RETURN_OK #define ACPI_EXTERNAL_RETURN_OK(Prototype) \ Prototype; #endif #ifndef ACPI_EXTERNAL_RETURN_VOID #define ACPI_EXTERNAL_RETURN_VOID(Prototype) \ Prototype; #endif #ifndef ACPI_EXTERNAL_RETURN_UINT32 #define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \ Prototype; #endif #ifndef ACPI_EXTERNAL_RETURN_PTR #define ACPI_EXTERNAL_RETURN_PTR(Prototype) \ Prototype; #endif /***************************************************************************** * * Public globals and runtime configuration options * ****************************************************************************/ /* * Enable "slack mode" of the AML interpreter? Default is FALSE, and the * interpreter strictly follows the ACPI specification. Setting to TRUE * allows the interpreter to ignore certain errors and/or bad AML constructs. * * Currently, these features are enabled by this flag: * * 1) Allow "implicit return" of last value in a control method * 2) Allow access beyond the end of an operation region * 3) Allow access to uninitialized locals/args (auto-init to integer 0) * 4) Allow ANY object type to be a source operand for the Store() operator * 5) Allow unresolved references (invalid target name) in package objects * 6) Enable warning messages for behavior that is not ACPI spec compliant */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE); /* * Automatically serialize all methods that create named objects? Default * is TRUE, meaning that all NonSerialized methods are scanned once at * table load time to determine those that create named objects. Methods * that create named objects are marked Serialized in order to prevent * possible run-time problems if they are entered by more than one thread. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE); /* * Create the predefined _OSI method in the namespace? Default is TRUE * because ACPICA is fully compatible with other ACPI implementations. * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE); /* * Optionally use default values for the ACPI register widths. Set this to * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE); /* * Whether or not to validate (map) an entire table to verify * checksum/duplication in early stage before install. Set this to TRUE to * allow early table validation before install it to the table manager. * Note that enabling this option causes errors to happen in some OSPMs * during early initialization stages. Default behavior is to allow such * validation. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableTableValidation, TRUE); /* * Optionally enable output from the AML Debug Object. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE); /* * Optionally copy the entire DSDT to local memory (instead of simply * mapping it.) There are some BIOSs that corrupt or replace the original * DSDT, creating the need for this option. Default is FALSE, do not copy * the DSDT. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE); /* * Optionally ignore an XSDT if present and use the RSDT instead. * Although the ACPI specification requires that an XSDT be used instead * of the RSDT, the XSDT has been found to be corrupt or ill-formed on * some machines. Default behavior is to use the XSDT if present. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); /* * Optionally use 32-bit FADT addresses if and when there is a conflict * (address mismatch) between the 32-bit and 64-bit versions of the * address. Although ACPICA adheres to the ACPI specification which * requires the use of the corresponding 64-bit address if it is non-zero, * some machines have been found to have a corrupted non-zero 64-bit * address. Default is FALSE, do not favor the 32-bit addresses. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE); /* * Optionally use 32-bit FACS table addresses. * It is reported that some platforms fail to resume from system suspending * if 64-bit FACS table address is selected: * https://bugzilla.kernel.org/show_bug.cgi?id=74021 * Default is TRUE, favor the 32-bit addresses. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFacsAddresses, TRUE); /* * Optionally truncate I/O addresses to 16 bits. Provides compatibility * with other ACPI implementations. NOTE: During ACPICA initialization, * this value is set to TRUE if any Windows OSI strings have been * requested by the BIOS. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE); /* * Disable runtime checking and repair of values returned by control methods. * Use only if the repair is causing a problem on a particular machine. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE); /* * Optionally do not install any SSDTs from the RSDT/XSDT during initialization. * This can be useful for debugging ACPI problems on some machines. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE); /* * Optionally enable runtime namespace override. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_RuntimeNamespaceOverride, TRUE); /* * We keep track of the latest version of Windows that has been requested by * the BIOS. ACPI 5.0. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0); /* * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning * that the ACPI hardware is no longer required. A flag in the FADT indicates * a reduced HW machine, and that flag is duplicated here for convenience. */ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE); /* * Maximum timeout for While() loop iterations before forced method abort. * This mechanism is intended to prevent infinite loops during interpreter * execution within a host kernel. */ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT); /* * Optionally ignore AE_NOT_FOUND errors from named reference package elements * during DSDT/SSDT table loading. This reduces error "noise" in platforms * whose firmware is carrying around a bunch of unused package objects that * refer to non-existent named objects. However, If the AML actually tries to * use such a package, the unresolved element(s) will be replaced with NULL * elements. */ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnorePackageResolutionErrors, FALSE); /* * This mechanism is used to trace a specified AML method. The method is * traced each time it is executed. */ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0); ACPI_INIT_GLOBAL (const char *, AcpiGbl_TraceMethodName, NULL); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel, ACPI_TRACE_LEVEL_DEFAULT); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer, ACPI_TRACE_LAYER_DEFAULT); /* * Runtime configuration of debug output control masks. We want the debug * switches statically initialized so they are already set when the debugger * is entered. */ #ifdef ACPI_DEBUG_OUTPUT ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT); #else ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT); #endif ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT); /* Optionally enable timer output with Debug Object output */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisplayDebugTimer, FALSE); /* * Debugger command handshake globals. Host OSes need to access these * variables to implement their own command handshake mechanism. */ #ifdef ACPI_DEBUGGER ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE); ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]); #endif /* * Other miscellaneous globals */ ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT); ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount); ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning); /***************************************************************************** * * ACPICA public interface configuration. * * Interfaces that are configured out of the ACPICA build are replaced * by inlined stubs by default. * ****************************************************************************/ /* * Hardware-reduced prototypes (default: Not hardware reduced). * * All ACPICA hardware-related interfaces that use these macros will be * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag * is set to TRUE. * * Note: This static build option for reduced hardware is intended to * reduce ACPICA code size if desired or necessary. However, even if this * option is not specified, the runtime behavior of ACPICA is dependent * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set, * the flag will enable similar behavior -- ACPICA will not attempt * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.) */ #if (!ACPI_REDUCED_HARDWARE) #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ ACPI_EXTERNAL_RETURN_STATUS(Prototype) #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ ACPI_EXTERNAL_RETURN_OK(Prototype) #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \ ACPI_EXTERNAL_RETURN_UINT32(prototype) #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ ACPI_EXTERNAL_RETURN_VOID(Prototype) #else #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);} #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ static ACPI_INLINE Prototype {return(AE_OK);} #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \ static ACPI_INLINE prototype {return(0);} #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ static ACPI_INLINE Prototype {return;} #endif /* !ACPI_REDUCED_HARDWARE */ /* * Error message prototypes (default: error messages enabled). * * All interfaces related to error and warning messages * will be configured out of the ACPICA build if the * ACPI_NO_ERROR_MESSAGE flag is defined. */ #ifndef ACPI_NO_ERROR_MESSAGES #define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \ Prototype; #else #define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \ static ACPI_INLINE Prototype {return;} #endif /* ACPI_NO_ERROR_MESSAGES */ /* * Debugging output prototypes (default: no debug output). * * All interfaces related to debug output messages * will be configured out of the ACPICA build unless the * ACPI_DEBUG_OUTPUT flag is defined. */ #ifdef ACPI_DEBUG_OUTPUT #define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \ Prototype; #else #define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \ static ACPI_INLINE Prototype {return;} #endif /* ACPI_DEBUG_OUTPUT */ /* * Application prototypes * * All interfaces used by application will be configured * out of the ACPICA build unless the ACPI_APPLICATION * flag is defined. */ #ifdef ACPI_APPLICATION #define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \ Prototype; #else #define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \ static ACPI_INLINE Prototype {return;} #endif /* ACPI_APPLICATION */ /* * Debugger prototypes * * All interfaces used by debugger will be configured * out of the ACPICA build unless the ACPI_DEBUGGER * flag is defined. */ #ifdef ACPI_DEBUGGER #define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \ ACPI_EXTERNAL_RETURN_OK(Prototype) #define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \ ACPI_EXTERNAL_RETURN_VOID(Prototype) #else #define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \ static ACPI_INLINE Prototype {return(AE_OK);} #define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \ static ACPI_INLINE Prototype {return;} #endif /* ACPI_DEBUGGER */ /***************************************************************************** * * ACPICA public interface prototypes * ****************************************************************************/ /* * Initialization */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeTables ( ACPI_TABLE_DESC *InitialStorage, UINT32 InitialTableCount, BOOLEAN AllowResize)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem ( UINT32 Flags)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects ( UINT32 Flags)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiTerminate ( void)) /* * Miscellaneous global interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnable ( void)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisable ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiSubsystemStatus ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetSystemInfo ( ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetStatistics ( ACPI_STATISTICS *Stats)) ACPI_EXTERNAL_RETURN_PTR ( const char * AcpiFormatException ( ACPI_STATUS Exception)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiPurgeCachedObjects ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallInterface ( ACPI_STRING InterfaceName)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiRemoveInterface ( ACPI_STRING InterfaceName)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiUpdateInterfaces ( UINT8 Action)) ACPI_EXTERNAL_RETURN_UINT32 ( UINT32 AcpiCheckAddressRange ( ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, ACPI_SIZE Length, BOOLEAN Warn)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiDecodePldBuffer ( UINT8 *InBuffer, ACPI_SIZE Length, ACPI_PLD_INFO **ReturnBuffer)) /* * ACPI table load/unload interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiInstallTable ( ACPI_TABLE_HEADER *Table)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiInstallPhysicalTable ( ACPI_PHYSICAL_ADDRESS Address)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiLoadTable ( ACPI_TABLE_HEADER *Table, UINT32 *TableIdx)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiUnloadTable ( UINT32 TableIndex)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiUnloadParentTable ( ACPI_HANDLE Object)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiLoadTables ( void)) /* * ACPI table manipulation interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiReallocateRootTable ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS ACPI_INIT_FUNCTION AcpiFindRootPointer ( ACPI_PHYSICAL_ADDRESS *RsdpAddress)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTableHeader ( ACPI_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER *OutTableHeader)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTable ( ACPI_STRING Signature, UINT32 Instance, ACPI_TABLE_HEADER **OutTable)) ACPI_EXTERNAL_RETURN_VOID ( void AcpiPutTable ( ACPI_TABLE_HEADER *Table)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetTableByIndex ( UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallTableHandler ( ACPI_TABLE_HANDLER Handler, void *Context)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiRemoveTableHandler ( ACPI_TABLE_HANDLER Handler)) /* * Namespace and name interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, ACPI_WALK_CALLBACK DescendingCallback, ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetDevices ( char *HID, ACPI_WALK_CALLBACK UserFunction, void *Context, void **ReturnValue)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetName ( ACPI_HANDLE Object, UINT32 NameType, ACPI_BUFFER *RetPathPtr)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetHandle ( ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiAttachData ( ACPI_HANDLE Object, ACPI_OBJECT_HANDLER Handler, void *Data)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiDetachData ( ACPI_HANDLE Object, ACPI_OBJECT_HANDLER Handler)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetData ( ACPI_HANDLE Object, ACPI_OBJECT_HANDLER Handler, void **Data)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiDebugTrace ( const char *Name, UINT32 DebugLevel, UINT32 DebugLayer, UINT32 Flags)) /* * Object manipulation and enumeration */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiEvaluateObject ( ACPI_HANDLE Object, ACPI_STRING Pathname, ACPI_OBJECT_LIST *ParameterObjects, ACPI_BUFFER *ReturnObjectBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiEvaluateObjectTyped ( ACPI_HANDLE Object, ACPI_STRING Pathname, ACPI_OBJECT_LIST *ExternalParams, ACPI_BUFFER *ReturnBuffer, ACPI_OBJECT_TYPE ReturnType)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetObjectInfo ( ACPI_HANDLE Object, ACPI_DEVICE_INFO **ReturnBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallMethod ( UINT8 *Buffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetNextObject ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE Parent, ACPI_HANDLE Child, ACPI_HANDLE *OutHandle)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetType ( ACPI_HANDLE Object, ACPI_OBJECT_TYPE *OutType)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetParent ( ACPI_HANDLE Object, ACPI_HANDLE *OutHandle)) /* * Handler interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallInitializationHandler ( ACPI_INIT_HANDLER Handler, UINT32 Function)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallSciHandler ( ACPI_SCI_HANDLER Address, void *Context)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveSciHandler ( ACPI_SCI_HANDLER Address)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGlobalEventHandler ( ACPI_GBL_EVENT_HANDLER Handler, void *Context)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallFixedEventHandler ( UINT32 AcpiEvent, ACPI_EVENT_HANDLER Handler, void *Context)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveFixedEventHandler ( UINT32 AcpiEvent, ACPI_EVENT_HANDLER Handler)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT32 Type, ACPI_GPE_HANDLER Address, void *Context)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGpeRawHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT32 Type, ACPI_GPE_HANDLER Address, void *Context)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, ACPI_GPE_HANDLER Address)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallNotifyHandler ( ACPI_HANDLE Device, UINT32 HandlerType, ACPI_NOTIFY_HANDLER Handler, void *Context)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiRemoveNotifyHandler ( ACPI_HANDLE Device, UINT32 HandlerType, ACPI_NOTIFY_HANDLER Handler)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallAddressSpaceHandler ( ACPI_HANDLE Device, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiRemoveAddressSpaceHandler ( ACPI_HANDLE Device, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallExceptionHandler ( ACPI_EXCEPTION_HANDLER Handler)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiInstallInterfaceHandler ( ACPI_INTERFACE_HANDLER Handler)) /* * Global Lock interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiAcquireGlobalLock ( UINT16 Timeout, UINT32 *Handle)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiReleaseGlobalLock ( UINT32 Handle)) /* * Interfaces to AML mutex objects */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiAcquireMutex ( ACPI_HANDLE Handle, ACPI_STRING Pathname, UINT16 Timeout)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiReleaseMutex ( ACPI_HANDLE Handle, ACPI_STRING Pathname)) /* * Fixed Event interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableEvent ( UINT32 Event, UINT32 Flags)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableEvent ( UINT32 Event, UINT32 Flags)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiClearEvent ( UINT32 Event)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetEventStatus ( UINT32 Event, ACPI_EVENT_STATUS *EventStatus)) /* * General Purpose Event (GPE) Interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiUpdateAllGpes ( void)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiClearGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiFinishGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiMaskGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, BOOLEAN IsMasked)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiMarkGpeForWake ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetupGpeForWake ( ACPI_HANDLE ParentDevice, ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetGpeWakeMask ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT8 Action)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetGpeStatus ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, ACPI_EVENT_STATUS *EventStatus)) ACPI_HW_DEPENDENT_RETURN_UINT32 ( UINT32 AcpiDispatchGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableAllGpes ( void)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableAllRuntimeGpes ( void)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableAllWakeupGpes ( void)) ACPI_HW_DEPENDENT_RETURN_UINT32 ( UINT32 AcpiAnyGpeStatusSet ( void)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetGpeDevice ( UINT32 GpeIndex, ACPI_HANDLE *GpeDevice)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGpeBlock ( ACPI_HANDLE GpeDevice, ACPI_GENERIC_ADDRESS *GpeBlockAddress, UINT32 RegisterCount, UINT32 InterruptNumber)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveGpeBlock ( ACPI_HANDLE GpeDevice)) /* * Resource interfaces */ typedef ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) ( ACPI_RESOURCE *Resource, void *Context); ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetVendorResource ( ACPI_HANDLE Device, char *Name, ACPI_VENDOR_UUID *Uuid, ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetCurrentResources ( ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetPossibleResources ( ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetEventResources ( ACPI_HANDLE DeviceHandle, ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiWalkResourceBuffer ( ACPI_BUFFER *Buffer, ACPI_WALK_RESOURCE_CALLBACK UserFunction, void *Context)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiWalkResources ( ACPI_HANDLE Device, char *Name, ACPI_WALK_RESOURCE_CALLBACK UserFunction, void *Context)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiSetCurrentResources ( ACPI_HANDLE Device, ACPI_BUFFER *InBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetIrqRoutingTable ( ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiResourceToAddress64 ( ACPI_RESOURCE *Resource, ACPI_RESOURCE_ADDRESS64 *Out)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiBufferToResource ( UINT8 *AmlBuffer, UINT16 AmlBufferLength, ACPI_RESOURCE **ResourcePtr)) /* * Hardware (ACPI device) interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiReset ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiRead ( UINT64 *Value, ACPI_GENERIC_ADDRESS *Reg)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiWrite ( UINT64 Value, ACPI_GENERIC_ADDRESS *Reg)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiReadBitRegister ( UINT32 RegisterId, UINT32 *ReturnValue)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiWriteBitRegister ( UINT32 RegisterId, UINT32 Value)) /* * Sleep/Wake interfaces */ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiGetSleepTypeData ( UINT8 SleepState, UINT8 *Slp_TypA, UINT8 *Slp_TypB)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiEnterSleepStatePrep ( UINT8 SleepState)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiEnterSleepState ( UINT8 SleepState)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnterSleepStateS4bios ( void)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiLeaveSleepStatePrep ( UINT8 SleepState)) ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiLeaveSleepState ( UINT8 SleepState)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetFirmwareWakingVector ( ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_PHYSICAL_ADDRESS PhysicalAddress64)) /* * ACPI Timer interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetTimerResolution ( UINT32 *Resolution)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetTimer ( UINT32 *Ticks)) ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetTimerDuration ( UINT32 StartTicks, UINT32 EndTicks, UINT32 *TimeElapsed)) /* * Error/Warning output */ ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiError ( const char *ModuleName, UINT32 LineNumber, const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(4) void ACPI_INTERNAL_VAR_XFACE AcpiException ( const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiWarning ( const char *ModuleName, UINT32 LineNumber, const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(1) void ACPI_INTERNAL_VAR_XFACE AcpiInfo ( const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiBiosError ( const char *ModuleName, UINT32 LineNumber, const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(4) void ACPI_INTERNAL_VAR_XFACE AcpiBiosException ( const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiBiosWarning ( const char *ModuleName, UINT32 LineNumber, const char *Format, ...)) /* * Debug output */ ACPI_DBG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrint ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *Format, ...)) ACPI_DBG_DEPENDENT_RETURN_VOID ( ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrintRaw ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *Format, ...)) ACPI_DBG_DEPENDENT_RETURN_VOID ( void AcpiTracePoint ( ACPI_TRACE_EVENT_TYPE Type, BOOLEAN Begin, UINT8 *Aml, char *Pathname)) ACPI_STATUS AcpiInitializeDebugger ( void); void AcpiTerminateDebugger ( void); void AcpiRunDebugger ( char *BatchBuffer); void AcpiSetDebuggerThreadId ( ACPI_THREAD_ID ThreadId); #endif /* __ACXFACE_H__ */ diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h index 40b79a47c219..e9b070f91d5f 100644 --- a/sys/contrib/dev/acpica/include/actables.h +++ b/sys/contrib/dev/acpica/include/actables.h @@ -1,393 +1,383 @@ /****************************************************************************** * * Name: actables.h - ACPI table management * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACTABLES_H__ #define __ACTABLES_H__ ACPI_STATUS AcpiAllocateRootTable ( UINT32 InitialTableCount); /* * tbxfroot - Root pointer utilities */ UINT32 AcpiTbGetRsdpLength ( ACPI_TABLE_RSDP *Rsdp); ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP *Rsdp); UINT8 * AcpiTbScanMemoryForRsdp ( UINT8 *StartAddress, UINT32 Length); /* * tbdata - table data structure management */ ACPI_STATUS AcpiTbGetNextTableDescriptor ( UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc); void AcpiTbInitTableDescriptor ( ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table); ACPI_STATUS AcpiTbAcquireTempTable ( ACPI_TABLE_DESC *TableDesc, ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table); void AcpiTbReleaseTempTable ( ACPI_TABLE_DESC *TableDesc); ACPI_STATUS AcpiTbValidateTempTable ( ACPI_TABLE_DESC *TableDesc); ACPI_STATUS AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, char *Signature, UINT32 *TableIndex); BOOLEAN AcpiTbIsTableLoaded ( UINT32 TableIndex); void AcpiTbSetTableLoadedFlag ( UINT32 TableIndex, BOOLEAN IsLoaded); /* * tbfadt - FADT parse/convert/validate */ void AcpiTbParseFadt ( void); void AcpiTbCreateLocalFadt ( ACPI_TABLE_HEADER *Table, UINT32 Length); /* * tbfind - find ACPI table */ ACPI_STATUS AcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, UINT32 *TableIndex); /* * tbinstal - Table removal and deletion */ ACPI_STATUS AcpiTbResizeRootTableList ( void); ACPI_STATUS AcpiTbValidateTable ( ACPI_TABLE_DESC *TableDesc); void AcpiTbInvalidateTable ( ACPI_TABLE_DESC *TableDesc); void AcpiTbOverrideTable ( ACPI_TABLE_DESC *OldTableDesc); ACPI_STATUS AcpiTbAcquireTable ( ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **TablePtr, UINT32 *TableLength, UINT8 *TableFlags); void AcpiTbReleaseTable ( ACPI_TABLE_HEADER *Table, UINT32 TableLength, UINT8 TableFlags); ACPI_STATUS AcpiTbInstallStandardTable ( ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Reload, BOOLEAN Override, UINT32 *TableIndex); void AcpiTbUninstallTable ( ACPI_TABLE_DESC *TableDesc); ACPI_STATUS AcpiTbLoadTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode); ACPI_STATUS AcpiTbInstallAndLoadTable ( ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, ACPI_TABLE_HEADER *Table, BOOLEAN Override, UINT32 *TableIndex); ACPI_STATUS AcpiTbUnloadTable ( UINT32 TableIndex); void AcpiTbNotifyTable ( UINT32 Event, void *Table); void AcpiTbTerminate ( void); ACPI_STATUS AcpiTbDeleteNamespaceByOwner ( UINT32 TableIndex); ACPI_STATUS AcpiTbAllocateOwnerId ( UINT32 TableIndex); ACPI_STATUS AcpiTbReleaseOwnerId ( UINT32 TableIndex); ACPI_STATUS AcpiTbGetOwnerId ( UINT32 TableIndex, ACPI_OWNER_ID *OwnerId); /* * tbutils - table manager utilities */ ACPI_STATUS AcpiTbInitializeFacs ( void); void AcpiTbPrintTableHeader( ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header); -UINT8 -AcpiTbChecksum ( - UINT8 *Buffer, - UINT32 Length); - -ACPI_STATUS -AcpiTbVerifyChecksum ( - ACPI_TABLE_HEADER *Table, - UINT32 Length); - void AcpiTbCheckDsdtHeader ( void); ACPI_TABLE_HEADER * AcpiTbCopyDsdt ( UINT32 TableIndex); void AcpiTbInstallTableWithOverride ( ACPI_TABLE_DESC *NewTableDesc, BOOLEAN Override, UINT32 *TableIndex); ACPI_STATUS AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS RsdpAddress); ACPI_STATUS AcpiTbGetTable ( ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable); void AcpiTbPutTable ( ACPI_TABLE_DESC *TableDesc); /* * tbxfload */ ACPI_STATUS AcpiTbLoadNamespace ( void); #endif /* __ACTABLES_H__ */ diff --git a/sys/contrib/dev/acpica/include/actbinfo.h b/sys/contrib/dev/acpica/include/actbinfo.h index 633f7349b390..7ce3c21e594c 100644 --- a/sys/contrib/dev/acpica/include/actbinfo.h +++ b/sys/contrib/dev/acpica/include/actbinfo.h @@ -1,489 +1,499 @@ /****************************************************************************** * * Module Name: actbinfo - Table disassembly info for non-AML tables * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ /* * Macros used to generate offsets to specific table fields */ #define ACPI_AGDI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_AGDI,f) #define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f) #define ACPI_GAS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) #define ACPI_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEADER,f) #define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f) #define ACPI_BDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BDAT,f) #define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f) #define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f) #define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f) +#define ACPI_CCEL_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CCEL,f) #define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f) #define ACPI_DBG2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f) #define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f) #define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f) #define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f) #define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f) #define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f) #define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f) #define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f) #define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f) #define ACPI_HMAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HMAT,f) #define ACPI_IORT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IORT,f) #define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f) #define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f) #define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f) #define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_NFIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_NFIT,f) #define ACPI_NHLT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_NHLT,f) #define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f) #define ACPI_PDTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PDTT,f) #define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f) #define ACPI_RASF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RASF,f) #define ACPI_RGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RGRT,f) #define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f) #define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f) #define ACPI_SDEV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEV,f) #define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f) #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) #define ACPI_SVKL_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SVKL,f) #define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f) #define ACPI_TDEL_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TDEL,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_TPM23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM23,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_VIOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_VIOT,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) #define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f) #define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f) #define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f) #define ACPI_WPBT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WPBT_UNICODE,f) #define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f) #define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f) /* Subtables */ #define ACPI_AESTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_HEADER,f) #define ACPI_AEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PROCESSOR,f) #define ACPI_AEST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PROCESSOR_CACHE,f) #define ACPI_AEST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PROCESSOR_TLB,f) #define ACPI_AEST0C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PROCESSOR_GENERIC,f) #define ACPI_AEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_MEMORY,f) #define ACPI_AEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_SMMU,f) #define ACPI_AEST3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_VENDOR,f) #define ACPI_AEST4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_GIC,f) #define ACPI_AEST0D_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE,f) #define ACPI_AEST0E_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERRUPT,f) #define ACPI_APMTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_APMT_NODE,f) #define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f) #define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f) #define ACPI_ASF1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f) #define ACPI_ASF2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_REMOTE,f) #define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) #define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) +#define ACPI_CDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CDAT,f) +#define ACPI_CDATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_HEADER,f) +#define ACPI_CDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSMAS,f) +#define ACPI_CDAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSLBIS,f) +#define ACPI_CDAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSMSCIS,f) +#define ACPI_CDAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSIS,f) +#define ACPI_CDAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSEMTS,f) +#define ACPI_CDAT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_SSLBIS,f) +#define ACPI_CDATE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_SSLBE,f) #define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) #define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) #define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f) #define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, f) #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) #define ACPI_CSRT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f) #define ACPI_DBG20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f) #define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) #define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) #define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) #define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f) #define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f) #define ACPI_DMAR5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_SATC,f) #define ACPI_DRTM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST,f) #define ACPI_DRTM1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST,f) #define ACPI_DRTM1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE,f) #define ACPI_DRTM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_DPS_ID,f) #define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) #define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT_POINTER,f) #define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_POINTER,f) #define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f) #define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f) #define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f) #define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f) #define ACPI_GTDT_EL2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_EL2,f) #define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) #define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) #define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) #define ACPI_HEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) #define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f) #define ACPI_HEST11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f) #define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) #define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) #define ACPI_HMAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_PROXIMITY_DOMAIN,f) #define ACPI_HMAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_LOCALITY,f) #define ACPI_HMAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_CACHE,f) #define ACPI_HMATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_STRUCTURE,f) #define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f) #define ACPI_IORT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT,f) #define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ROOT_COMPLEX,f) #define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f) #define ACPI_IORT3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f) #define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f) #define ACPI_IORT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f) #define ACPI_IORT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_RMR,f) #define ACPI_IORT6A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_RMR_DESC,f) #define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f) #define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f) #define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f) #define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f) #define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE1,f) #define ACPI_IVRS01_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE2,f) #define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) #define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) #define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) #define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) #define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) #define ACPI_IVRSHID_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE_HID,f) #define ACPI_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f) #define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f) #define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) #define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) #define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) #define ACPI_MADT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f) #define ACPI_MADT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f) #define ACPI_MADT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f) #define ACPI_MADT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f) #define ACPI_MADT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f) #define ACPI_MADT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) #define ACPI_MADT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) #define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) #define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) #define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) #define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f) #define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f) #define ACPI_MADT15_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_TRANSLATOR,f) #define ACPI_MADT16_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_MULTIPROC_WAKEUP,f) #define ACPI_MADT17_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_OEM_DATA,f) #define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) #define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) #define ACPI_MPST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) #define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) #define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) #define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) #define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) #define ACPI_NFITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_HEADER,f) #define ACPI_NFIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f) #define ACPI_NFIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_MEMORY_MAP,f) #define ACPI_NFIT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_INTERLEAVE,f) #define ACPI_NFIT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_SMBIOS,f) #define ACPI_NFIT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f) #define ACPI_NFIT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f) #define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f) #define ACPI_NFIT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f) #define ACPI_NHLT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_ENDPOINT,f) #define ACPI_NHLT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG,f) #define ACPI_NHLT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_WAVE_EXTENSIBLE,f) #define ACPI_NHLT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_FORMAT_CONFIG,f) #define ACPI_NHLT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_FORMATS_CONFIG,f) #define ACPI_NHLT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG,f) #define ACPI_NHLT5A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A,f) #define ACPI_NHLT5B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B,f) #define ACPI_NHLT5C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C,f) #define ACPI_NHLT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_VENDOR_MIC_CONFIG,f) #define ACPI_NHLT6A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_VENDOR_MIC_COUNT,f) #define ACPI_NHLT6B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_RENDER_FEEDBACK_DEVICE_SPECIFIC_CONFIG,f) #define ACPI_NHLT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_INFO_COUNT,f) #define ACPI_NHLT7A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_DEVICE_INFO,f) #define ACPI_NHLT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) #define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f) #define ACPI_PCCT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f) #define ACPI_PCCT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f) #define ACPI_PCCT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REG,f) #define ACPI_PDTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PDTT_CHANNEL,f) #define ACPI_PHATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PHAT_HEADER,f) #define ACPI_PHAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PHAT_VERSION_DATA,f) #define ACPI_PHAT0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PHAT_VERSION_ELEMENT,f) #define ACPI_PHAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PHAT_HEALTH_DATA,f) #define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) #define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) #define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) #define ACPI_PMTT_VENDOR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_VENDOR_SPECIFIC,f) #define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f) #define ACPI_PPTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_PPTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_PROCESSOR,f) #define ACPI_PPTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_CACHE,f) #define ACPI_PPTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_CACHE_V1,f) #define ACPI_PPTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_ID,f) #define ACPI_PRMTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PRMT_HEADER,f) #define ACPI_PRMT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PRMT_MODULE_INFO,f) #define ACPI_PRMT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PRMT_HANDLER_INFO,f) #define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) #define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) #define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) #define ACPI_SDEVH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_HEADER,f) #define ACPI_SDEV0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_NAMESPACE,f) #define ACPI_SDEV0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_SECURE_COMPONENT,f) #define ACPI_SDEVCH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_HEADER,f) #define ACPI_SDEVC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_ID_COMPONENT, f) #define ACPI_SDEVC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_MEM_COMPONENT, f) #define ACPI_SDEV1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_PCIE,f) #define ACPI_SDEV1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_PCIE_PATH,f) #define ACPI_SLIC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIC,f) #define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) #define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) #define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f) #define ACPI_SRAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GIC_ITS_AFFINITY,f) #define ACPI_SRAT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GENERIC_AFFINITY,f) #define ACPI_SVKL0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SVKL_KEY,f) #define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) #define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f) #define ACPI_TPM2A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_TRAILER,f) #define ACPI_TPM211_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_ARM_SMC,f) #define ACPI_TPM23A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM23_TRAILER,f) #define ACPI_VIOTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VIOT_HEADER,f) #define ACPI_VIOT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VIOT_PCI_RANGE,f) #define ACPI_VIOT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VIOT_MMIO,f) #define ACPI_VIOT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VIOT_VIRTIO_IOMMU_PCI,f) #define ACPI_VIOT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VIOT_VIRTIO_IOMMU_MMIO,f) #define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes */ #define ACPI_FLAG_OFFSET(d,f,o) (UINT16) (ACPI_OFFSET (d,f) + o) /* Flags */ #define ACPI_AEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_PROCESSOR,f,o) #define ACPI_AEST0D_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_NODE_INTERFACE,f,o) #define ACPI_AEST0E_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_NODE_INTERRUPT,f,o) #define ACPI_AGDI_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_AGDI,f,o) #define ACPI_APMTN_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_APMT_NODE,f,o) #define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o) #define ACPI_DRTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_DRTM,f,o) #define ACPI_DRTM1a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DRTM_RESOURCE,f,o) #define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FADT,f,o) #define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FACS,f,o) #define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_HPET,f,o) #define ACPI_PPTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_PROCESSOR,f,o) #define ACPI_PPTT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_CACHE,f,o) #define ACPI_PPTT1A_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_CACHE_V1,f,o) #define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o) #define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o) #define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o) #define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o) #define ACPI_SRAT5_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GENERIC_AFFINITY,f,o) #define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o) #define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o) #define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o) #define ACPI_HMAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_PROXIMITY_DOMAIN,f,o) #define ACPI_HMAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_LOCALITY,f,o) #define ACPI_HMAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_CACHE,f,o) #define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o) #define ACPI_IORT3a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_GSI,f,o) #define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o) #define ACPI_IORT6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_RMR,f,o) #define ACPI_IORTA_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_MEMORY_ACCESS,f,o) #define ACPI_IORTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_ID_MAPPING,f,o) #define ACPI_IVRS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IVRS_HEADER,f,o) #define ACPI_IVRSDE_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IVRS_DE_HEADER,f,o) #define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o) #define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o) #define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o) #define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o) #define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_NMI_SOURCE,f,o) #define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f,o) #define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_SAPIC,f,o) #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o) #define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o) #define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o) #define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o) #define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o) #define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o) #define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o) #define ACPI_NFIT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o) #define ACPI_NFIT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o) #define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o) #define ACPI_NFIT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o) #define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o) #define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o) #define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o) #define ACPI_PCCT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f,o) #define ACPI_PCCT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f,o) #define ACPI_PDTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PDTT_CHANNEL,f,o) #define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o) #define ACPI_SDEVH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SDEV_HEADER,f,o) #define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o) #define ACPI_WSMT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WSMT,f,o) #define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) #define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) #define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o) #define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o) #define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o) #define ACPI_HEST11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f,o) /* * Required terminator for all tables below */ #define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0} #define ACPI_DMT_NEW_LINE {ACPI_DMT_EXTRA_TEXT, 0, "\n", 0} diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h index 3de78b0d8f01..340b636b5e24 100644 --- a/sys/contrib/dev/acpica/include/actbl1.h +++ b/sys/contrib/dev/acpica/include/actbl1.h @@ -1,2179 +1,2354 @@ /****************************************************************************** * * Name: actbl1.h - Additional ACPI table definitions * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACTBL1_H__ #define __ACTBL1_H__ /******************************************************************************* * * Additional ACPI Tables * * These tables are not consumed directly by the ACPICA subsystem, but are * included here to support device drivers and the AML disassembler. * ******************************************************************************/ /* * Values for description table header signatures for tables defined in this * file. Useful because they make it more difficult to inadvertently type in * the wrong signature. */ #define ACPI_SIG_AEST "AEST" /* Arm Error Source Table */ #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ #define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */ #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */ #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */ #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */ #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ #define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */ #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ +#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table*/ #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ /* Reserved table signatures */ #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ /* * These tables have been seen in the field, but no definition has been found */ #ifdef ACPI_UNDEFINED_TABLES #define ACPI_SIG_ATKG "ATKG" #define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */ #define ACPI_SIG_IEIT "IEIT" #endif /* * All tables must be byte-packed to match the ACPI specification, since * the tables are provided by the system BIOS. */ #pragma pack(1) /* * Note: C bitfields are not used for this reason: * * "Bitfields are great and easy to read, but unfortunately the C language * does not specify the layout of bitfields in memory, which means they are * essentially useless for dealing with packed data in on-disk formats or * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, * this decision was a design error in C. Ritchie could have picked an order * and stuck with it." Norman Ramsey. * See http://stackoverflow.com/a/1053662/41661 */ /******************************************************************************* * * Common subtable headers * ******************************************************************************/ /* Generic subtable header (used in MADT, SRAT, etc.) */ typedef struct acpi_subtable_header { UINT8 Type; UINT8 Length; } ACPI_SUBTABLE_HEADER; /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */ typedef struct acpi_whea_header { UINT8 Action; UINT8 Instruction; UINT8 Flags; UINT8 Reserved; ACPI_GENERIC_ADDRESS RegisterRegion; UINT64 Value; /* Value used with Read/Write register */ UINT64 Mask; /* Bitmask required for this register instruction */ } ACPI_WHEA_HEADER; /******************************************************************************* * * ASF - Alert Standard Format table (Signature "ASF!") * Revision 0x10 * * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003 * ******************************************************************************/ typedef struct acpi_table_asf { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_ASF; /* ASF subtable header */ typedef struct acpi_asf_header { UINT8 Type; UINT8 Reserved; UINT16 Length; } ACPI_ASF_HEADER; /* Values for Type field above */ enum AcpiAsfType { ACPI_ASF_TYPE_INFO = 0, ACPI_ASF_TYPE_ALERT = 1, ACPI_ASF_TYPE_CONTROL = 2, ACPI_ASF_TYPE_BOOT = 3, ACPI_ASF_TYPE_ADDRESS = 4, ACPI_ASF_TYPE_RESERVED = 5 }; /* * ASF subtables */ /* 0: ASF Information */ typedef struct acpi_asf_info { ACPI_ASF_HEADER Header; UINT8 MinResetValue; UINT8 MinPollInterval; UINT16 SystemId; UINT32 MfgId; UINT8 Flags; UINT8 Reserved2[3]; } ACPI_ASF_INFO; /* Masks for Flags field above */ #define ACPI_ASF_SMBUS_PROTOCOLS (1) /* 1: ASF Alerts */ typedef struct acpi_asf_alert { ACPI_ASF_HEADER Header; UINT8 AssertMask; UINT8 DeassertMask; UINT8 Alerts; UINT8 DataLength; } ACPI_ASF_ALERT; typedef struct acpi_asf_alert_data { UINT8 Address; UINT8 Command; UINT8 Mask; UINT8 Value; UINT8 SensorType; UINT8 Type; UINT8 Offset; UINT8 SourceType; UINT8 Severity; UINT8 SensorNumber; UINT8 Entity; UINT8 Instance; } ACPI_ASF_ALERT_DATA; /* 2: ASF Remote Control */ typedef struct acpi_asf_remote { ACPI_ASF_HEADER Header; UINT8 Controls; UINT8 DataLength; UINT16 Reserved2; } ACPI_ASF_REMOTE; typedef struct acpi_asf_control_data { UINT8 Function; UINT8 Address; UINT8 Command; UINT8 Value; } ACPI_ASF_CONTROL_DATA; /* 3: ASF RMCP Boot Options */ typedef struct acpi_asf_rmcp { ACPI_ASF_HEADER Header; UINT8 Capabilities[7]; UINT8 CompletionCode; UINT32 EnterpriseId; UINT8 Command; UINT16 Parameter; UINT16 BootOptions; UINT16 OemParameters; } ACPI_ASF_RMCP; /* 4: ASF Address */ typedef struct acpi_asf_address { ACPI_ASF_HEADER Header; UINT8 EpromAddress; UINT8 Devices; } ACPI_ASF_ADDRESS; /******************************************************************************* * * BERT - Boot Error Record Table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_bert { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 RegionLength; /* Length of the boot error region */ UINT64 Address; /* Physical address of the error region */ } ACPI_TABLE_BERT; /* Boot Error Region (not a subtable, pointed to by Address field above) */ typedef struct acpi_bert_region { UINT32 BlockStatus; /* Type of error information */ UINT32 RawDataOffset; /* Offset to raw error data */ UINT32 RawDataLength; /* Length of raw error data */ UINT32 DataLength; /* Length of generic error data */ UINT32 ErrorSeverity; /* Severity code */ } ACPI_BERT_REGION; /* Values for BlockStatus flags above */ #define ACPI_BERT_UNCORRECTABLE (1) #define ACPI_BERT_CORRECTABLE (1<<1) #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2) #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3) #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ /* Values for ErrorSeverity above */ enum AcpiBertErrorSeverity { ACPI_BERT_ERROR_CORRECTABLE = 0, ACPI_BERT_ERROR_FATAL = 1, ACPI_BERT_ERROR_CORRECTED = 2, ACPI_BERT_ERROR_NONE = 3, ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */ }; /* * Note: The generic error data that follows the ErrorSeverity field above * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below */ /******************************************************************************* * * BGRT - Boot Graphics Resource Table (ACPI 5.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_bgrt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT16 Version; UINT8 Status; UINT8 ImageType; UINT64 ImageAddress; UINT32 ImageOffsetX; UINT32 ImageOffsetY; } ACPI_TABLE_BGRT; /* Flags for Status field above */ #define ACPI_BGRT_DISPLAYED (1) #define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1) /******************************************************************************* * * BOOT - Simple Boot Flag Table * Version 1 * * Conforms to the "Simple Boot Flag Specification", Version 2.1 * ******************************************************************************/ typedef struct acpi_table_boot { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 CmosIndex; /* Index in CMOS RAM for the boot register */ UINT8 Reserved[3]; } ACPI_TABLE_BOOT; + +/******************************************************************************* + * + * CDAT - Coherent Device Attribute Table + * Version 1 + * + * Conforms to the "Coherent Device Attribute Table (CDAT) Specification + " (Revision 1.01, October 2020.) + * + ******************************************************************************/ + +typedef struct acpi_table_cdat +{ + UINT32 Length; /* Length of table in bytes, including this header */ + UINT8 Revision; /* ACPI Specification minor version number */ + UINT8 Checksum; /* To make sum of entire table == 0 */ + UINT8 Reserved[6]; + UINT32 Sequence; /* Used to detect runtime CDAT table changes */ + +} ACPI_TABLE_CDAT; + + +/* CDAT common subtable header */ + +typedef struct acpi_cdat_header +{ + UINT8 Type; + UINT8 Reserved; + UINT16 Length; + +} ACPI_CDAT_HEADER; + +/* Values for Type field above */ + +enum AcpiCdatType +{ + ACPI_CDAT_TYPE_DSMAS = 0, + ACPI_CDAT_TYPE_DSLBIS = 1, + ACPI_CDAT_TYPE_DSMSCIS = 2, + ACPI_CDAT_TYPE_DSIS = 3, + ACPI_CDAT_TYPE_DSEMTS = 4, + ACPI_CDAT_TYPE_SSLBIS = 5, + ACPI_CDAT_TYPE_RESERVED = 6 /* 6 through 0xFF are reserved */ +}; + + +/* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */ + +typedef struct acpi_cadt_dsmas +{ + UINT8 DsmadHandle; + UINT8 Flags; + UINT16 Reserved; + UINT64 DpaBaseAddress; + UINT64 DpaLength; + +} ACPI_CDAT_DSMAS; + +/* Flags for subtable above */ + +#define ACPI_CEDT_DSMAS_NON_VOLATILE (1 << 2) + + +/* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */ + +typedef struct acpi_cdat_dslbis +{ + UINT8 Handle; + UINT8 Flags; /* If Handle matches a DSMAS handle, the definition of this field matches + * Flags field in HMAT System Locality Latency */ + UINT8 DataType; + UINT8 Reserved; + UINT64 EntryBaseUnit; + UINT16 Entry[3]; + UINT16 Reserved2; + +} ACPI_CDAT_DSLBIS; + + +/* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */ + +typedef struct acpi_cdat_dsmscis +{ + UINT8 DsmasHandle; + UINT8 Reserved[3]; + UINT64 SideCacheSize; + UINT32 CacheAttributes; + +} ACPI_CDAT_DSMSCIS; + + +/* Subtable 3: Device Scoped Initiator Structure (DSIS) */ + +typedef struct acpi_cdat_dsis +{ + UINT8 Flags; + UINT8 Handle; + UINT16 Reserved; + +} ACPI_CDAT_DSIS; + +/* Flags for above subtable */ + +#define ACPI_CDAT_DSIS_MEM_ATTACHED (1 << 0) + + +/* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */ + +typedef struct acpi_cdat_dsemts +{ + UINT8 DsmasHandle; + UINT8 MemoryType; + UINT16 Reserved; + UINT64 DpaOffset; + UINT64 RangeLength; + +} ACPI_CDAT_DSEMTS; + + +/* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */ + +typedef struct acpi_cdat_sslbis +{ + UINT8 DataType; + UINT8 Reserved[3]; + UINT64 EntryBaseUnit; + +} ACPI_CDAT_SSLBIS; + + +/* Sub-subtable for above, SslbeEntries field */ + +typedef struct acpi_cdat_sslbe +{ + UINT16 PortxId; + UINT16 PortyId; + UINT16 LatencyOrBandwidth; + UINT16 Reserved; + +} ACPI_CDAT_SSLBE; + + /******************************************************************************* * * CEDT - CXL Early Discovery Table * Version 1 * - * Conforms to the "CXL Early Discovery Table" (CXL 2.0) + * Conforms to the "CXL Early Discovery Table" (CXL 2.0, October 2020) * ******************************************************************************/ typedef struct acpi_table_cedt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_CEDT; /* CEDT subtable header (Performance Record Structure) */ typedef struct acpi_cedt_header { UINT8 Type; UINT8 Reserved; UINT16 Length; } ACPI_CEDT_HEADER; /* Values for Type field above */ enum AcpiCedtType { ACPI_CEDT_TYPE_CHBS = 0, ACPI_CEDT_TYPE_CFMWS = 1, - ACPI_CEDT_TYPE_RESERVED = 2, + ACPI_CEDT_TYPE_CXIMS = 2, + ACPI_CEDT_TYPE_RDPAS = 3, + ACPI_CEDT_TYPE_RESERVED = 4, }; /* Values for version field above */ #define ACPI_CEDT_CHBS_VERSION_CXL11 (0) #define ACPI_CEDT_CHBS_VERSION_CXL20 (1) /* Values for length field above */ #define ACPI_CEDT_CHBS_LENGTH_CXL11 (0x2000) #define ACPI_CEDT_CHBS_LENGTH_CXL20 (0x10000) /* * CEDT subtables */ /* 0: CXL Host Bridge Structure */ typedef struct acpi_cedt_chbs { ACPI_CEDT_HEADER Header; UINT32 Uid; UINT32 CxlVersion; UINT32 Reserved; UINT64 Base; UINT64 Length; } ACPI_CEDT_CHBS; /* 1: CXL Fixed Memory Window Structure */ typedef struct acpi_cedt_cfmws { ACPI_CEDT_HEADER Header; UINT32 Reserved1; UINT64 BaseHpa; UINT64 WindowSize; UINT8 InterleaveWays; UINT8 InterleaveArithmetic; UINT16 Reserved2; UINT32 Granularity; UINT16 Restrictions; UINT16 QtgId; UINT32 InterleaveTargets[]; } ACPI_CEDT_CFMWS; typedef struct acpi_cedt_cfmws_target_element { UINT32 InterleaveTarget; } ACPI_CEDT_CFMWS_TARGET_ELEMENT; /* Values for Interleave Arithmetic field above */ #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) +#define ACPI_CEDT_CFMWS_ARITHMETIC_XOR (1) /* Values for Restrictions field above */ #define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) #define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) #define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) #define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) #define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) +/* 2: CXL XOR Interleave Math Structure */ + +struct acpi_cedt_cxims { + ACPI_CEDT_HEADER Header; + UINT16 Reserved1; + UINT8 Hbig; + UINT8 NrXormaps; + UINT64 XormapList[]; +}; + +/* 3: CXL RCEC Downstream Port Association Structure */ + +struct acpi_cedt_rdpas { + ACPI_CEDT_HEADER Header; + UINT8 Reserved1; + UINT16 Length; + UINT16 Segment; + UINT16 Bdf; + UINT8 Protocol; + UINT64 Address; +}; + +/* Masks for bdf field above */ +#define ACPI_CEDT_RDPAS_BUS_MASK 0xff00 +#define ACPI_CEDT_RDPAS_DEVICE_MASK 0x00f8 +#define ACPI_CEDT_RDPAS_FUNCTION_MASK 0x0007 + +#define ACPI_CEDT_RDPAS_PROTOCOL_IO (0) +#define ACPI_CEDT_RDPAS_PROTOCOL_CACHEMEM (1) /******************************************************************************* * * CPEP - Corrected Platform Error Polling table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_cpep { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT64 Reserved; } ACPI_TABLE_CPEP; /* Subtable */ typedef struct acpi_cpep_polling { ACPI_SUBTABLE_HEADER Header; UINT8 Id; /* Processor ID */ UINT8 Eid; /* Processor EID */ UINT32 Interval; /* Polling interval (msec) */ } ACPI_CPEP_POLLING; /******************************************************************************* * * CSRT - Core System Resource Table * Version 0 * * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011 * ******************************************************************************/ typedef struct acpi_table_csrt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_CSRT; /* Resource Group subtable */ typedef struct acpi_csrt_group { UINT32 Length; UINT32 VendorId; UINT32 SubvendorId; UINT16 DeviceId; UINT16 SubdeviceId; UINT16 Revision; UINT16 Reserved; UINT32 SharedInfoLength; /* Shared data immediately follows (Length = SharedInfoLength) */ } ACPI_CSRT_GROUP; /* Shared Info subtable */ typedef struct acpi_csrt_shared_info { UINT16 MajorVersion; UINT16 MinorVersion; UINT32 MmioBaseLow; UINT32 MmioBaseHigh; UINT32 GsiInterrupt; UINT8 InterruptPolarity; UINT8 InterruptMode; UINT8 NumChannels; UINT8 DmaAddressWidth; UINT16 BaseRequestLine; UINT16 NumHandshakeSignals; UINT32 MaxBlockSize; /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */ } ACPI_CSRT_SHARED_INFO; /* Resource Descriptor subtable */ typedef struct acpi_csrt_descriptor { UINT32 Length; UINT16 Type; UINT16 Subtype; UINT32 Uid; /* Resource-specific information immediately follows */ } ACPI_CSRT_DESCRIPTOR; /* Resource Types */ #define ACPI_CSRT_TYPE_INTERRUPT 0x0001 #define ACPI_CSRT_TYPE_TIMER 0x0002 #define ACPI_CSRT_TYPE_DMA 0x0003 /* Resource Subtypes */ #define ACPI_CSRT_XRUPT_LINE 0x0000 #define ACPI_CSRT_XRUPT_CONTROLLER 0x0001 #define ACPI_CSRT_TIMER 0x0000 #define ACPI_CSRT_DMA_CHANNEL 0x0000 #define ACPI_CSRT_DMA_CONTROLLER 0x0001 /******************************************************************************* * * DBG2 - Debug Port Table 2 * Version 0 (Both main table and subtables) * * Conforms to "Microsoft Debug Port Table 2 (DBG2)", September 21, 2020 * ******************************************************************************/ typedef struct acpi_table_dbg2 { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 InfoOffset; UINT32 InfoCount; } ACPI_TABLE_DBG2; typedef struct acpi_dbg2_header { UINT32 InfoOffset; UINT32 InfoCount; } ACPI_DBG2_HEADER; /* Debug Device Information Subtable */ typedef struct acpi_dbg2_device { UINT8 Revision; UINT16 Length; UINT8 RegisterCount; /* Number of BaseAddress registers */ UINT16 NamepathLength; UINT16 NamepathOffset; UINT16 OemDataLength; UINT16 OemDataOffset; UINT16 PortType; UINT16 PortSubtype; UINT16 Reserved; UINT16 BaseAddressOffset; UINT16 AddressSizeOffset; /* * Data that follows: * BaseAddress (required) - Each in 12-byte Generic Address Structure format. * AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register. * Namepath (required) - Null terminated string. Single dot if not supported. * OemData (optional) - Length is OemDataLength. */ } ACPI_DBG2_DEVICE; /* Types for PortType field above */ #define ACPI_DBG2_SERIAL_PORT 0x8000 #define ACPI_DBG2_1394_PORT 0x8001 #define ACPI_DBG2_USB_PORT 0x8002 #define ACPI_DBG2_NET_PORT 0x8003 /* Subtypes for PortSubtype field above */ #define ACPI_DBG2_16550_COMPATIBLE 0x0000 #define ACPI_DBG2_16550_SUBSET 0x0001 #define ACPI_DBG2_MAX311XE_SPI 0x0002 #define ACPI_DBG2_ARM_PL011 0x0003 #define ACPI_DBG2_MSM8X60 0x0004 #define ACPI_DBG2_16550_NVIDIA 0x0005 #define ACPI_DBG2_TI_OMAP 0x0006 #define ACPI_DBG2_APM88XXXX 0x0008 #define ACPI_DBG2_MSM8974 0x0009 #define ACPI_DBG2_SAM5250 0x000A #define ACPI_DBG2_INTEL_USIF 0x000B #define ACPI_DBG2_IMX6 0x000C #define ACPI_DBG2_ARM_SBSA_32BIT 0x000D #define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E #define ACPI_DBG2_ARM_DCC 0x000F #define ACPI_DBG2_BCM2835 0x0010 #define ACPI_DBG2_SDM845_1_8432MHZ 0x0011 #define ACPI_DBG2_16550_WITH_GAS 0x0012 #define ACPI_DBG2_SDM845_7_372MHZ 0x0013 #define ACPI_DBG2_INTEL_LPSS 0x0014 #define ACPI_DBG2_1394_STANDARD 0x0000 #define ACPI_DBG2_USB_XHCI 0x0000 #define ACPI_DBG2_USB_EHCI 0x0001 /******************************************************************************* * * DBGP - Debug Port table * Version 1 * * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000 * ******************************************************************************/ typedef struct acpi_table_dbgp { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Type; /* 0=full 16550, 1=subset of 16550 */ UINT8 Reserved[3]; ACPI_GENERIC_ADDRESS DebugPort; } ACPI_TABLE_DBGP; /******************************************************************************* * * DMAR - DMA Remapping table * Version 1 * * Conforms to "Intel Virtualization Technology for Directed I/O", * Version 2.3, October 2014 * ******************************************************************************/ typedef struct acpi_table_dmar { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Width; /* Host Address Width */ UINT8 Flags; UINT8 Reserved[10]; } ACPI_TABLE_DMAR; /* Masks for Flags field above */ #define ACPI_DMAR_INTR_REMAP (1) #define ACPI_DMAR_X2APIC_OPT_OUT (1<<1) #define ACPI_DMAR_X2APIC_MODE (1<<2) /* DMAR subtable header */ typedef struct acpi_dmar_header { UINT16 Type; UINT16 Length; } ACPI_DMAR_HEADER; /* Values for subtable type in ACPI_DMAR_HEADER */ enum AcpiDmarType { ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, ACPI_DMAR_TYPE_ROOT_ATS = 2, ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3, ACPI_DMAR_TYPE_NAMESPACE = 4, ACPI_DMAR_TYPE_SATC = 5, ACPI_DMAR_TYPE_RESERVED = 6 /* 6 and greater are reserved */ }; /* DMAR Device Scope structure */ typedef struct acpi_dmar_device_scope { UINT8 EntryType; UINT8 Length; UINT16 Reserved; UINT8 EnumerationId; UINT8 Bus; } ACPI_DMAR_DEVICE_SCOPE; /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */ enum AcpiDmarScopeType { ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1, ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, ACPI_DMAR_SCOPE_TYPE_HPET = 4, ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5, ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */ }; typedef struct acpi_dmar_pci_path { UINT8 Device; UINT8 Function; } ACPI_DMAR_PCI_PATH; /* * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER */ /* 0: Hardware Unit Definition */ typedef struct acpi_dmar_hardware_unit { ACPI_DMAR_HEADER Header; UINT8 Flags; UINT8 Reserved; UINT16 Segment; UINT64 Address; /* Register Base Address */ } ACPI_DMAR_HARDWARE_UNIT; /* Masks for Flags field above */ #define ACPI_DMAR_INCLUDE_ALL (1) /* 1: Reserved Memory Definition */ typedef struct acpi_dmar_reserved_memory { ACPI_DMAR_HEADER Header; UINT16 Reserved; UINT16 Segment; UINT64 BaseAddress; /* 4K aligned base address */ UINT64 EndAddress; /* 4K aligned limit address */ } ACPI_DMAR_RESERVED_MEMORY; /* Masks for Flags field above */ #define ACPI_DMAR_ALLOW_ALL (1) /* 2: Root Port ATS Capability Reporting Structure */ typedef struct acpi_dmar_atsr { ACPI_DMAR_HEADER Header; UINT8 Flags; UINT8 Reserved; UINT16 Segment; } ACPI_DMAR_ATSR; /* Masks for Flags field above */ #define ACPI_DMAR_ALL_PORTS (1) /* 3: Remapping Hardware Static Affinity Structure */ typedef struct acpi_dmar_rhsa { ACPI_DMAR_HEADER Header; UINT32 Reserved; UINT64 BaseAddress; UINT32 ProximityDomain; } ACPI_DMAR_RHSA; /* 4: ACPI Namespace Device Declaration Structure */ typedef struct acpi_dmar_andd { ACPI_DMAR_HEADER Header; UINT8 Reserved[3]; UINT8 DeviceNumber; char DeviceName[1]; } ACPI_DMAR_ANDD; /* 5: SoC Integrated Address Translation Cache (SATC) */ typedef struct acpi_dmar_satc { ACPI_DMAR_HEADER Header; UINT8 Flags; UINT8 Reserved; UINT16 Segment; } ACPI_DMAR_SATC ; /******************************************************************************* * * DRTM - Dynamic Root of Trust for Measurement table * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0 * Table version 1 * ******************************************************************************/ typedef struct acpi_table_drtm { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT64 EntryBaseAddress; UINT64 EntryLength; UINT32 EntryAddress32; UINT64 EntryAddress64; UINT64 ExitAddress; UINT64 LogAreaAddress; UINT32 LogAreaLength; UINT64 ArchDependentAddress; UINT32 Flags; } ACPI_TABLE_DRTM; /* Flag Definitions for above */ #define ACPI_DRTM_ACCESS_ALLOWED (1) #define ACPI_DRTM_ENABLE_GAP_CODE (1<<1) #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2) #define ACPI_DRTM_AUTHORITY_ORDER (1<<3) /* 1) Validated Tables List (64-bit addresses) */ typedef struct acpi_drtm_vtable_list { UINT32 ValidatedTableCount; UINT64 ValidatedTables[1]; } ACPI_DRTM_VTABLE_LIST; /* 2) Resources List (of Resource Descriptors) */ /* Resource Descriptor */ typedef struct acpi_drtm_resource { UINT8 Size[7]; UINT8 Type; UINT64 Address; } ACPI_DRTM_RESOURCE; typedef struct acpi_drtm_resource_list { UINT32 ResourceCount; ACPI_DRTM_RESOURCE Resources[1]; } ACPI_DRTM_RESOURCE_LIST; /* 3) Platform-specific Identifiers List */ typedef struct acpi_drtm_dps_id { UINT32 DpsIdLength; UINT8 DpsId[16]; } ACPI_DRTM_DPS_ID; /******************************************************************************* * * ECDT - Embedded Controller Boot Resources Table * Version 1 * ******************************************************************************/ typedef struct acpi_table_ecdt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */ ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */ UINT32 Uid; /* Unique ID - must be same as the EC _UID method */ UINT8 Gpe; /* The GPE for the EC */ UINT8 Id[1]; /* Full namepath of the EC in the ACPI namespace */ } ACPI_TABLE_ECDT; /******************************************************************************* * * EINJ - Error Injection Table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_einj { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 HeaderLength; UINT8 Flags; UINT8 Reserved[3]; UINT32 Entries; } ACPI_TABLE_EINJ; /* EINJ Injection Instruction Entries (actions) */ typedef struct acpi_einj_entry { ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */ } ACPI_EINJ_ENTRY; /* Masks for Flags field above */ #define ACPI_EINJ_PRESERVE (1) /* Values for Action field above */ enum AcpiEinjActions { ACPI_EINJ_BEGIN_OPERATION = 0, ACPI_EINJ_GET_TRIGGER_TABLE = 1, ACPI_EINJ_SET_ERROR_TYPE = 2, ACPI_EINJ_GET_ERROR_TYPE = 3, ACPI_EINJ_END_OPERATION = 4, ACPI_EINJ_EXECUTE_OPERATION = 5, ACPI_EINJ_CHECK_BUSY_STATUS = 6, ACPI_EINJ_GET_COMMAND_STATUS = 7, ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, ACPI_EINJ_GET_EXECUTE_TIMINGS = 9, ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */ ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; /* Values for Instruction field above */ enum AcpiEinjInstructions { ACPI_EINJ_READ_REGISTER = 0, ACPI_EINJ_READ_REGISTER_VALUE = 1, ACPI_EINJ_WRITE_REGISTER = 2, ACPI_EINJ_WRITE_REGISTER_VALUE = 3, ACPI_EINJ_NOOP = 4, ACPI_EINJ_FLUSH_CACHELINE = 5, ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */ }; typedef struct acpi_einj_error_type_with_addr { UINT32 ErrorType; UINT32 VendorStructOffset; UINT32 Flags; UINT32 ApicId; UINT64 Address; UINT64 Range; UINT32 PcieId; } ACPI_EINJ_ERROR_TYPE_WITH_ADDR; typedef struct acpi_einj_vendor { UINT32 Length; UINT32 PcieId; UINT16 VendorId; UINT16 DeviceId; UINT8 RevisionId; UINT8 Reserved[3]; } ACPI_EINJ_VENDOR; /* EINJ Trigger Error Action Table */ typedef struct acpi_einj_trigger { UINT32 HeaderSize; UINT32 Revision; UINT32 TableSize; UINT32 EntryCount; } ACPI_EINJ_TRIGGER; /* Command status return values */ enum AcpiEinjCommandStatus { ACPI_EINJ_SUCCESS = 0, ACPI_EINJ_FAILURE = 1, ACPI_EINJ_INVALID_ACCESS = 2, ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */ }; /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */ #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1) #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1) #define ACPI_EINJ_PROCESSOR_FATAL (1<<2) #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3) #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4) #define ACPI_EINJ_MEMORY_FATAL (1<<5) #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6) #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7) #define ACPI_EINJ_PCIX_FATAL (1<<8) #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) #define ACPI_EINJ_PLATFORM_FATAL (1<<11) #define ACPI_EINJ_VENDOR_DEFINED (1<<31) /******************************************************************************* * * ERST - Error Record Serialization Table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_erst { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 HeaderLength; UINT32 Reserved; UINT32 Entries; } ACPI_TABLE_ERST; /* ERST Serialization Entries (actions) */ typedef struct acpi_erst_entry { ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */ } ACPI_ERST_ENTRY; /* Masks for Flags field above */ #define ACPI_ERST_PRESERVE (1) /* Values for Action field above */ enum AcpiErstActions { ACPI_ERST_BEGIN_WRITE = 0, ACPI_ERST_BEGIN_READ = 1, ACPI_ERST_BEGIN_CLEAR = 2, ACPI_ERST_END = 3, ACPI_ERST_SET_RECORD_OFFSET = 4, ACPI_ERST_EXECUTE_OPERATION = 5, ACPI_ERST_CHECK_BUSY_STATUS = 6, ACPI_ERST_GET_COMMAND_STATUS = 7, ACPI_ERST_GET_RECORD_ID = 8, ACPI_ERST_SET_RECORD_ID = 9, ACPI_ERST_GET_RECORD_COUNT = 10, ACPI_ERST_BEGIN_DUMMY_WRIITE = 11, ACPI_ERST_NOT_USED = 12, ACPI_ERST_GET_ERROR_RANGE = 13, ACPI_ERST_GET_ERROR_LENGTH = 14, ACPI_ERST_GET_ERROR_ATTRIBUTES = 15, ACPI_ERST_EXECUTE_TIMINGS = 16, ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */ }; /* Values for Instruction field above */ enum AcpiErstInstructions { ACPI_ERST_READ_REGISTER = 0, ACPI_ERST_READ_REGISTER_VALUE = 1, ACPI_ERST_WRITE_REGISTER = 2, ACPI_ERST_WRITE_REGISTER_VALUE = 3, ACPI_ERST_NOOP = 4, ACPI_ERST_LOAD_VAR1 = 5, ACPI_ERST_LOAD_VAR2 = 6, ACPI_ERST_STORE_VAR1 = 7, ACPI_ERST_ADD = 8, ACPI_ERST_SUBTRACT = 9, ACPI_ERST_ADD_VALUE = 10, ACPI_ERST_SUBTRACT_VALUE = 11, ACPI_ERST_STALL = 12, ACPI_ERST_STALL_WHILE_TRUE = 13, ACPI_ERST_SKIP_NEXT_IF_TRUE = 14, ACPI_ERST_GOTO = 15, ACPI_ERST_SET_SRC_ADDRESS_BASE = 16, ACPI_ERST_SET_DST_ADDRESS_BASE = 17, ACPI_ERST_MOVE_DATA = 18, ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */ }; /* Command status return values */ enum AcpiErstCommandStatus { ACPI_ERST_SUCCESS = 0, ACPI_ERST_NO_SPACE = 1, ACPI_ERST_NOT_AVAILABLE = 2, ACPI_ERST_FAILURE = 3, ACPI_ERST_RECORD_EMPTY = 4, ACPI_ERST_NOT_FOUND = 5, ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */ }; /* Error Record Serialization Information */ typedef struct acpi_erst_info { UINT16 Signature; /* Should be "ER" */ UINT8 Data[48]; } ACPI_ERST_INFO; /******************************************************************************* * * FPDT - Firmware Performance Data Table (ACPI 5.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_fpdt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_FPDT; /* FPDT subtable header (Performance Record Structure) */ typedef struct acpi_fpdt_header { UINT16 Type; UINT8 Length; UINT8 Revision; } ACPI_FPDT_HEADER; /* Values for Type field above */ enum AcpiFpdtType { ACPI_FPDT_TYPE_BOOT = 0, ACPI_FPDT_TYPE_S3PERF = 1 }; /* * FPDT subtables */ /* 0: Firmware Basic Boot Performance Record */ typedef struct acpi_fpdt_boot_pointer { ACPI_FPDT_HEADER Header; UINT8 Reserved[4]; UINT64 Address; } ACPI_FPDT_BOOT_POINTER; /* 1: S3 Performance Table Pointer Record */ typedef struct acpi_fpdt_s3pt_pointer { ACPI_FPDT_HEADER Header; UINT8 Reserved[4]; UINT64 Address; } ACPI_FPDT_S3PT_POINTER; /* * S3PT - S3 Performance Table. This table is pointed to by the * S3 Pointer Record above. */ typedef struct acpi_table_s3pt { UINT8 Signature[4]; /* "S3PT" */ UINT32 Length; } ACPI_TABLE_S3PT; /* * S3PT Subtables (Not part of the actual FPDT) */ /* Values for Type field in S3PT header */ enum AcpiS3ptType { ACPI_S3PT_TYPE_RESUME = 0, ACPI_S3PT_TYPE_SUSPEND = 1, ACPI_FPDT_BOOT_PERFORMANCE = 2 }; typedef struct acpi_s3pt_resume { ACPI_FPDT_HEADER Header; UINT32 ResumeCount; UINT64 FullResume; UINT64 AverageResume; } ACPI_S3PT_RESUME; typedef struct acpi_s3pt_suspend { ACPI_FPDT_HEADER Header; UINT64 SuspendStart; UINT64 SuspendEnd; } ACPI_S3PT_SUSPEND; /* * FPDT Boot Performance Record (Not part of the actual FPDT) */ typedef struct acpi_fpdt_boot { ACPI_FPDT_HEADER Header; UINT8 Reserved[4]; UINT64 ResetEnd; UINT64 LoadStart; UINT64 StartupStart; UINT64 ExitServicesEntry; UINT64 ExitServicesExit; } ACPI_FPDT_BOOT; /******************************************************************************* * * GTDT - Generic Timer Description Table (ACPI 5.1) * Version 2 * ******************************************************************************/ typedef struct acpi_table_gtdt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT64 CounterBlockAddresss; UINT32 Reserved; UINT32 SecureEl1Interrupt; UINT32 SecureEl1Flags; UINT32 NonSecureEl1Interrupt; UINT32 NonSecureEl1Flags; UINT32 VirtualTimerInterrupt; UINT32 VirtualTimerFlags; UINT32 NonSecureEl2Interrupt; UINT32 NonSecureEl2Flags; UINT64 CounterReadBlockAddress; UINT32 PlatformTimerCount; UINT32 PlatformTimerOffset; } ACPI_TABLE_GTDT; /* Flag Definitions: Timer Block Physical Timers and Virtual timers */ #define ACPI_GTDT_INTERRUPT_MODE (1) #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1) #define ACPI_GTDT_ALWAYS_ON (1<<2) typedef struct acpi_gtdt_el2 { UINT32 VirtualEL2TimerGsiv; UINT32 VirtualEL2TimerFlags; } ACPI_GTDT_EL2; /* Common GTDT subtable header */ typedef struct acpi_gtdt_header { UINT8 Type; UINT16 Length; } ACPI_GTDT_HEADER; /* Values for GTDT subtable type above */ enum AcpiGtdtType { ACPI_GTDT_TYPE_TIMER_BLOCK = 0, ACPI_GTDT_TYPE_WATCHDOG = 1, ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ }; /* GTDT Subtables, correspond to Type in acpi_gtdt_header */ /* 0: Generic Timer Block */ typedef struct acpi_gtdt_timer_block { ACPI_GTDT_HEADER Header; UINT8 Reserved; UINT64 BlockAddress; UINT32 TimerCount; UINT32 TimerOffset; } ACPI_GTDT_TIMER_BLOCK; /* Timer Sub-Structure, one per timer */ typedef struct acpi_gtdt_timer_entry { UINT8 FrameNumber; UINT8 Reserved[3]; UINT64 BaseAddress; UINT64 El0BaseAddress; UINT32 TimerInterrupt; UINT32 TimerFlags; UINT32 VirtualTimerInterrupt; UINT32 VirtualTimerFlags; UINT32 CommonFlags; } ACPI_GTDT_TIMER_ENTRY; /* Flag Definitions: TimerFlags and VirtualTimerFlags above */ #define ACPI_GTDT_GT_IRQ_MODE (1) #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1) /* Flag Definitions: CommonFlags above */ #define ACPI_GTDT_GT_IS_SECURE_TIMER (1) #define ACPI_GTDT_GT_ALWAYS_ON (1<<1) /* 1: SBSA Generic Watchdog Structure */ typedef struct acpi_gtdt_watchdog { ACPI_GTDT_HEADER Header; UINT8 Reserved; UINT64 RefreshFrameAddress; UINT64 ControlFrameAddress; UINT32 TimerInterrupt; UINT32 TimerFlags; } ACPI_GTDT_WATCHDOG; /* Flag Definitions: TimerFlags above */ #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1) #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1) #define ACPI_GTDT_WATCHDOG_SECURE (1<<2) /******************************************************************************* * * HEST - Hardware Error Source Table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_hest { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 ErrorSourceCount; } ACPI_TABLE_HEST; /* HEST subtable header */ typedef struct acpi_hest_header { UINT16 Type; UINT16 SourceId; } ACPI_HEST_HEADER; /* Values for Type field above for subtables */ enum AcpiHestTypes { ACPI_HEST_TYPE_IA32_CHECK = 0, ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1, ACPI_HEST_TYPE_IA32_NMI = 2, ACPI_HEST_TYPE_NOT_USED3 = 3, ACPI_HEST_TYPE_NOT_USED4 = 4, ACPI_HEST_TYPE_NOT_USED5 = 5, ACPI_HEST_TYPE_AER_ROOT_PORT = 6, ACPI_HEST_TYPE_AER_ENDPOINT = 7, ACPI_HEST_TYPE_AER_BRIDGE = 8, ACPI_HEST_TYPE_GENERIC_ERROR = 9, ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10, ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11, ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */ }; /* * HEST substructures contained in subtables */ /* * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and * ACPI_HEST_IA_CORRECTED structures. */ typedef struct acpi_hest_ia_error_bank { UINT8 BankNumber; UINT8 ClearStatusOnInit; UINT8 StatusFormat; UINT8 Reserved; UINT32 ControlRegister; UINT64 ControlData; UINT32 StatusRegister; UINT32 AddressRegister; UINT32 MiscRegister; } ACPI_HEST_IA_ERROR_BANK; /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */ typedef struct acpi_hest_aer_common { UINT16 Reserved1; UINT8 Flags; UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 Bus; /* Bus and Segment numbers */ UINT16 Device; UINT16 Function; UINT16 DeviceControl; UINT16 Reserved2; UINT32 UncorrectableMask; UINT32 UncorrectableSeverity; UINT32 CorrectableMask; UINT32 AdvancedCapabilities; } ACPI_HEST_AER_COMMON; /* Masks for HEST Flags fields */ #define ACPI_HEST_FIRMWARE_FIRST (1) #define ACPI_HEST_GLOBAL (1<<1) #define ACPI_HEST_GHES_ASSIST (1<<2) /* * Macros to access the bus/segment numbers in Bus field above: * Bus number is encoded in bits 7:0 * Segment number is encoded in bits 23:8 */ #define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF) #define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF) /* Hardware Error Notification */ typedef struct acpi_hest_notify { UINT8 Type; UINT8 Length; UINT16 ConfigWriteEnable; UINT32 PollInterval; UINT32 Vector; UINT32 PollingThresholdValue; UINT32 PollingThresholdWindow; UINT32 ErrorThresholdValue; UINT32 ErrorThresholdWindow; } ACPI_HEST_NOTIFY; /* Values for Notify Type field above */ enum AcpiHestNotifyTypes { ACPI_HEST_NOTIFY_POLLED = 0, ACPI_HEST_NOTIFY_EXTERNAL = 1, ACPI_HEST_NOTIFY_LOCAL = 2, ACPI_HEST_NOTIFY_SCI = 3, ACPI_HEST_NOTIFY_NMI = 4, ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */ ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */ ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */ }; /* Values for ConfigWriteEnable bitfield above */ #define ACPI_HEST_TYPE (1) #define ACPI_HEST_POLL_INTERVAL (1<<1) #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2) #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3) #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4) #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5) /* * HEST subtables */ /* 0: IA32 Machine Check Exception */ typedef struct acpi_hest_ia_machine_check { ACPI_HEST_HEADER Header; UINT16 Reserved1; UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT64 GlobalCapabilityData; UINT64 GlobalControlData; UINT8 NumHardwareBanks; UINT8 Reserved3[7]; } ACPI_HEST_IA_MACHINE_CHECK; /* 1: IA32 Corrected Machine Check */ typedef struct acpi_hest_ia_corrected { ACPI_HEST_HEADER Header; UINT16 Reserved1; UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; ACPI_HEST_NOTIFY Notify; UINT8 NumHardwareBanks; UINT8 Reserved2[3]; } ACPI_HEST_IA_CORRECTED; /* 2: IA32 Non-Maskable Interrupt */ typedef struct acpi_hest_ia_nmi { ACPI_HEST_HEADER Header; UINT32 Reserved; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 MaxRawDataLength; } ACPI_HEST_IA_NMI; /* 3,4,5: Not used */ /* 6: PCI Express Root Port AER */ typedef struct acpi_hest_aer_root { ACPI_HEST_HEADER Header; ACPI_HEST_AER_COMMON Aer; UINT32 RootErrorCommand; } ACPI_HEST_AER_ROOT; /* 7: PCI Express AER (AER Endpoint) */ typedef struct acpi_hest_aer { ACPI_HEST_HEADER Header; ACPI_HEST_AER_COMMON Aer; } ACPI_HEST_AER; /* 8: PCI Express/PCI-X Bridge AER */ typedef struct acpi_hest_aer_bridge { ACPI_HEST_HEADER Header; ACPI_HEST_AER_COMMON Aer; UINT32 UncorrectableMask2; UINT32 UncorrectableSeverity2; UINT32 AdvancedCapabilities2; } ACPI_HEST_AER_BRIDGE; /* 9: Generic Hardware Error Source */ typedef struct acpi_hest_generic { ACPI_HEST_HEADER Header; UINT16 RelatedSourceId; UINT8 Reserved; UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 MaxRawDataLength; ACPI_GENERIC_ADDRESS ErrorStatusAddress; ACPI_HEST_NOTIFY Notify; UINT32 ErrorBlockLength; } ACPI_HEST_GENERIC; /* 10: Generic Hardware Error Source, version 2 */ typedef struct acpi_hest_generic_v2 { ACPI_HEST_HEADER Header; UINT16 RelatedSourceId; UINT8 Reserved; UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 MaxRawDataLength; ACPI_GENERIC_ADDRESS ErrorStatusAddress; ACPI_HEST_NOTIFY Notify; UINT32 ErrorBlockLength; ACPI_GENERIC_ADDRESS ReadAckRegister; UINT64 ReadAckPreserve; UINT64 ReadAckWrite; } ACPI_HEST_GENERIC_V2; /* Generic Error Status block */ typedef struct acpi_hest_generic_status { UINT32 BlockStatus; UINT32 RawDataOffset; UINT32 RawDataLength; UINT32 DataLength; UINT32 ErrorSeverity; } ACPI_HEST_GENERIC_STATUS; /* Values for BlockStatus flags above */ #define ACPI_HEST_UNCORRECTABLE (1) #define ACPI_HEST_CORRECTABLE (1<<1) #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ /* Generic Error Data entry */ typedef struct acpi_hest_generic_data { UINT8 SectionType[16]; UINT32 ErrorSeverity; UINT16 Revision; UINT8 ValidationBits; UINT8 Flags; UINT32 ErrorDataLength; UINT8 FruId[16]; UINT8 FruText[20]; } ACPI_HEST_GENERIC_DATA; /* Extension for revision 0x0300 */ typedef struct acpi_hest_generic_data_v300 { UINT8 SectionType[16]; UINT32 ErrorSeverity; UINT16 Revision; UINT8 ValidationBits; UINT8 Flags; UINT32 ErrorDataLength; UINT8 FruId[16]; UINT8 FruText[20]; UINT64 TimeStamp; } ACPI_HEST_GENERIC_DATA_V300; /* Values for ErrorSeverity above */ #define ACPI_HEST_GEN_ERROR_RECOVERABLE 0 #define ACPI_HEST_GEN_ERROR_FATAL 1 #define ACPI_HEST_GEN_ERROR_CORRECTED 2 #define ACPI_HEST_GEN_ERROR_NONE 3 /* Flags for ValidationBits above */ #define ACPI_HEST_GEN_VALID_FRU_ID (1) #define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1) #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2) /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */ typedef struct acpi_hest_ia_deferred_check { ACPI_HEST_HEADER Header; UINT16 Reserved1; UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; ACPI_HEST_NOTIFY Notify; UINT8 NumHardwareBanks; UINT8 Reserved2[3]; } ACPI_HEST_IA_DEFERRED_CHECK; /******************************************************************************* * * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.3) * ******************************************************************************/ typedef struct acpi_table_hmat { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Reserved; } ACPI_TABLE_HMAT; /* Values for HMAT structure types */ enum AcpiHmatType { ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subsystem address range */ ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */ ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */ ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ }; typedef struct acpi_hmat_structure { UINT16 Type; UINT16 Reserved; UINT32 Length; } ACPI_HMAT_STRUCTURE; /* * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE */ /* 0: Memory proximity domain attributes */ typedef struct acpi_hmat_proximity_domain { ACPI_HMAT_STRUCTURE Header; UINT16 Flags; UINT16 Reserved1; UINT32 InitiatorPD; /* Attached Initiator proximity domain */ UINT32 MemoryPD; /* Memory proximity domain */ UINT32 Reserved2; UINT64 Reserved3; UINT64 Reserved4; } ACPI_HMAT_PROXIMITY_DOMAIN; /* Masks for Flags field above */ #define ACPI_HMAT_INITIATOR_PD_VALID (1) /* 1: InitiatorPD field is valid */ /* 1: System locality latency and bandwidth information */ typedef struct acpi_hmat_locality { ACPI_HMAT_STRUCTURE Header; UINT8 Flags; UINT8 DataType; UINT8 MinTransferSize; UINT8 Reserved1; UINT32 NumberOfInitiatorPDs; UINT32 NumberOfTargetPDs; UINT32 Reserved2; UINT64 EntryBaseUnit; } ACPI_HMAT_LOCALITY; /* Masks for Flags field above */ #define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) /* Bits 0-3 */ /* Values for Memory Hierarchy flags */ #define ACPI_HMAT_MEMORY 0 #define ACPI_HMAT_1ST_LEVEL_CACHE 1 #define ACPI_HMAT_2ND_LEVEL_CACHE 2 #define ACPI_HMAT_3RD_LEVEL_CACHE 3 #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10 /* Bit 4: ACPI 6.4 */ #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20 /* Bit 5: ACPI 6.4 */ /* Values for DataType field above */ #define ACPI_HMAT_ACCESS_LATENCY 0 #define ACPI_HMAT_READ_LATENCY 1 #define ACPI_HMAT_WRITE_LATENCY 2 #define ACPI_HMAT_ACCESS_BANDWIDTH 3 #define ACPI_HMAT_READ_BANDWIDTH 4 #define ACPI_HMAT_WRITE_BANDWIDTH 5 /* 2: Memory side cache information */ typedef struct acpi_hmat_cache { ACPI_HMAT_STRUCTURE Header; UINT32 MemoryPD; UINT32 Reserved1; UINT64 CacheSize; UINT32 CacheAttributes; UINT16 Reserved2; UINT16 NumberOfSMBIOSHandles; } ACPI_HMAT_CACHE; /* Masks for CacheAttributes field above */ #define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F) #define ACPI_HMAT_CACHE_LEVEL (0x000000F0) #define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00) #define ACPI_HMAT_WRITE_POLICY (0x0000F000) #define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000) /* Values for cache associativity flag */ #define ACPI_HMAT_CA_NONE (0) #define ACPI_HMAT_CA_DIRECT_MAPPED (1) #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2) /* Values for write policy flag */ #define ACPI_HMAT_CP_NONE (0) #define ACPI_HMAT_CP_WB (1) #define ACPI_HMAT_CP_WT (2) /******************************************************************************* * * HPET - High Precision Event Timer table * Version 1 * * Conforms to "IA-PC HPET (High Precision Event Timers) Specification", * Version 1.0a, October 2004 * ******************************************************************************/ typedef struct acpi_table_hpet { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Id; /* Hardware ID of event timer block */ ACPI_GENERIC_ADDRESS Address; /* Address of event timer block */ UINT8 Sequence; /* HPET sequence number */ UINT16 MinimumTick; /* Main counter min tick, periodic mode */ UINT8 Flags; } ACPI_TABLE_HPET; /* Masks for Flags field above */ #define ACPI_HPET_PAGE_PROTECT_MASK (3) /* Values for Page Protect flags */ enum AcpiHpetPageProtect { ACPI_HPET_NO_PAGE_PROTECT = 0, ACPI_HPET_PAGE_PROTECT4 = 1, ACPI_HPET_PAGE_PROTECT64 = 2 }; /******************************************************************************* * * IBFT - Boot Firmware Table * Version 1 * * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b * Specification", Version 1.01, March 1, 2007 * * Note: It appears that this table is not intended to appear in the RSDT/XSDT. * Therefore, it is not currently supported by the disassembler. * ******************************************************************************/ typedef struct acpi_table_ibft { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Reserved[12]; } ACPI_TABLE_IBFT; /* IBFT common subtable header */ typedef struct acpi_ibft_header { UINT8 Type; UINT8 Version; UINT16 Length; UINT8 Index; UINT8 Flags; } ACPI_IBFT_HEADER; /* Values for Type field above */ enum AcpiIbftType { ACPI_IBFT_TYPE_NOT_USED = 0, ACPI_IBFT_TYPE_CONTROL = 1, ACPI_IBFT_TYPE_INITIATOR = 2, ACPI_IBFT_TYPE_NIC = 3, ACPI_IBFT_TYPE_TARGET = 4, ACPI_IBFT_TYPE_EXTENSIONS = 5, ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ }; /* IBFT subtables */ typedef struct acpi_ibft_control { ACPI_IBFT_HEADER Header; UINT16 Extensions; UINT16 InitiatorOffset; UINT16 Nic0Offset; UINT16 Target0Offset; UINT16 Nic1Offset; UINT16 Target1Offset; } ACPI_IBFT_CONTROL; typedef struct acpi_ibft_initiator { ACPI_IBFT_HEADER Header; UINT8 SnsServer[16]; UINT8 SlpServer[16]; UINT8 PrimaryServer[16]; UINT8 SecondaryServer[16]; UINT16 NameLength; UINT16 NameOffset; } ACPI_IBFT_INITIATOR; typedef struct acpi_ibft_nic { ACPI_IBFT_HEADER Header; UINT8 IpAddress[16]; UINT8 SubnetMaskPrefix; UINT8 Origin; UINT8 Gateway[16]; UINT8 PrimaryDns[16]; UINT8 SecondaryDns[16]; UINT8 Dhcp[16]; UINT16 Vlan; UINT8 MacAddress[6]; UINT16 PciAddress; UINT16 NameLength; UINT16 NameOffset; } ACPI_IBFT_NIC; typedef struct acpi_ibft_target { ACPI_IBFT_HEADER Header; UINT8 TargetIpAddress[16]; UINT16 TargetIpSocket; UINT8 TargetBootLun[8]; UINT8 ChapType; UINT8 NicAssociation; UINT16 TargetNameLength; UINT16 TargetNameOffset; UINT16 ChapNameLength; UINT16 ChapNameOffset; UINT16 ChapSecretLength; UINT16 ChapSecretOffset; UINT16 ReverseChapNameLength; UINT16 ReverseChapNameOffset; UINT16 ReverseChapSecretLength; UINT16 ReverseChapSecretOffset; } ACPI_IBFT_TARGET; /* Reset to default packing */ #pragma pack() #endif /* __ACTBL1_H__ */ diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h index 3032c5e25003..4be5f0fce884 100644 --- a/sys/contrib/dev/acpica/include/actbl2.h +++ b/sys/contrib/dev/acpica/include/actbl2.h @@ -1,3199 +1,3354 @@ /****************************************************************************** * * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec) * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACTBL2_H__ #define __ACTBL2_H__ /******************************************************************************* * * Additional ACPI Tables (2) * * These tables are not consumed directly by the ACPICA subsystem, but are * included here to support device drivers and the AML disassembler. * ******************************************************************************/ /* * Values for description table header signatures for tables defined in this * file. Useful because they make it more difficult to inadvertently type in * the wrong signature. */ #define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */ #define ACPI_SIG_APMT "APMT" /* Arm Performance Monitoring Unit table */ #define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */ +#define ACPI_SIG_CCEL "CCEL" /* CC Event Log Table */ +#define ACPI_SIG_CDAT "CDAT" /* Coherent Device Attribute Table */ #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */ #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ -#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */ #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */ #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */ #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */ #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */ #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */ #define ACPI_SIG_SVKL "SVKL" /* Storage Volume Key Location Table */ #define ACPI_SIG_TDEL "TDEL" /* TD Event Log Table */ /* * All tables must be byte-packed to match the ACPI specification, since * the tables are provided by the system BIOS. */ #pragma pack(1) /* * Note: C bitfields are not used for this reason: * * "Bitfields are great and easy to read, but unfortunately the C language * does not specify the layout of bitfields in memory, which means they are * essentially useless for dealing with packed data in on-disk formats or * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, * this decision was a design error in C. Ritchie could have picked an order * and stuck with it." Norman Ramsey. * See http://stackoverflow.com/a/1053662/41661 */ /******************************************************************************* * * AEST - Arm Error Source Table * * Conforms to: ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document * September 2020. * ******************************************************************************/ typedef struct acpi_table_aest { ACPI_TABLE_HEADER Header; void *NodeArray[]; } ACPI_TABLE_AEST; /* Common Subtable header - one per Node Structure (Subtable) */ typedef struct acpi_aest_hdr { UINT8 Type; UINT16 Length; UINT8 Reserved; UINT32 NodeSpecificOffset; UINT32 NodeInterfaceOffset; UINT32 NodeInterruptOffset; UINT32 NodeInterruptCount; UINT64 TimestampRate; UINT64 Reserved1; UINT64 ErrorInjectionRate; } ACPI_AEST_HEADER; /* Values for Type above */ #define ACPI_AEST_PROCESSOR_ERROR_NODE 0 #define ACPI_AEST_MEMORY_ERROR_NODE 1 #define ACPI_AEST_SMMU_ERROR_NODE 2 #define ACPI_AEST_VENDOR_ERROR_NODE 3 #define ACPI_AEST_GIC_ERROR_NODE 4 #define ACPI_AEST_NODE_TYPE_RESERVED 5 /* 5 and above are reserved */ /* * AEST subtables (Error nodes) */ /* 0: Processor Error */ typedef struct acpi_aest_processor { UINT32 ProcessorId; UINT8 ResourceType; UINT8 Reserved; UINT8 Flags; UINT8 Revision; UINT64 ProcessorAffinity; } ACPI_AEST_PROCESSOR; /* Values for ResourceType above, related structs below */ #define ACPI_AEST_CACHE_RESOURCE 0 #define ACPI_AEST_TLB_RESOURCE 1 #define ACPI_AEST_GENERIC_RESOURCE 2 #define ACPI_AEST_RESOURCE_RESERVED 3 /* 3 and above are reserved */ /* 0R: Processor Cache Resource Substructure */ typedef struct acpi_aest_processor_cache { UINT32 CacheReference; UINT32 Reserved; } ACPI_AEST_PROCESSOR_CACHE; /* Values for CacheType above */ #define ACPI_AEST_CACHE_DATA 0 #define ACPI_AEST_CACHE_INSTRUCTION 1 #define ACPI_AEST_CACHE_UNIFIED 2 #define ACPI_AEST_CACHE_RESERVED 3 /* 3 and above are reserved */ /* 1R: Processor TLB Resource Substructure */ typedef struct acpi_aest_processor_tlb { UINT32 TlbLevel; UINT32 Reserved; } ACPI_AEST_PROCESSOR_TLB; /* 2R: Processor Generic Resource Substructure */ typedef struct acpi_aest_processor_generic { UINT32 Resource; } ACPI_AEST_PROCESSOR_GENERIC; /* 1: Memory Error */ typedef struct acpi_aest_memory { UINT32 SratProximityDomain; } ACPI_AEST_MEMORY; /* 2: Smmu Error */ typedef struct acpi_aest_smmu { UINT32 IortNodeReference; UINT32 SubcomponentReference; } ACPI_AEST_SMMU; /* 3: Vendor Defined */ typedef struct acpi_aest_vendor { UINT32 AcpiHid; UINT32 AcpiUid; UINT8 VendorSpecificData[16]; } ACPI_AEST_VENDOR; /* 4: Gic Error */ typedef struct acpi_aest_gic { UINT32 InterfaceType; UINT32 InstanceId; } ACPI_AEST_GIC; /* Values for InterfaceType above */ #define ACPI_AEST_GIC_CPU 0 #define ACPI_AEST_GIC_DISTRIBUTOR 1 #define ACPI_AEST_GIC_REDISTRIBUTOR 2 #define ACPI_AEST_GIC_ITS 3 #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */ /* Node Interface Structure */ typedef struct acpi_aest_node_interface { UINT8 Type; UINT8 Reserved[3]; UINT32 Flags; UINT64 Address; UINT32 ErrorRecordIndex; UINT32 ErrorRecordCount; UINT64 ErrorRecordImplemented; UINT64 ErrorStatusReporting; UINT64 AddressingMode; } ACPI_AEST_NODE_INTERFACE; /* Values for Type field above */ #define ACPI_AEST_NODE_SYSTEM_REGISTER 0 #define ACPI_AEST_NODE_MEMORY_MAPPED 1 #define ACPI_AEST_XFACE_RESERVED 2 /* 2 and above are reserved */ /* Node Interrupt Structure */ typedef struct acpi_aest_node_interrupt { UINT8 Type; UINT8 Reserved[2]; UINT8 Flags; UINT32 Gsiv; UINT8 IortId; UINT8 Reserved1[3]; } ACPI_AEST_NODE_INTERRUPT; /* Values for Type field above */ #define ACPI_AEST_NODE_FAULT_HANDLING 0 #define ACPI_AEST_NODE_ERROR_RECOVERY 1 #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */ /******************************************************************************* * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface * * Conforms to "ACPI for Arm Components 1.1, Platform Design Document" * ARM DEN0093 v1.1 * ******************************************************************************/ typedef struct acpi_table_agdi { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Flags; UINT8 Reserved[3]; UINT32 SdeiEvent; UINT32 Gsiv; } ACPI_TABLE_AGDI; /* Mask for Flags field above */ #define ACPI_AGDI_SIGNALING_MODE (1) /******************************************************************************* * * APMT - ARM Performance Monitoring Unit Table * * Conforms to: * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document * ARM DEN0117 v1.0 November 25, 2021 * ******************************************************************************/ typedef struct acpi_table_apmt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_APMT; #define ACPI_APMT_NODE_ID_LENGTH 4 /* * APMT subtables */ typedef struct acpi_apmt_node { UINT16 Length; UINT8 Flags; UINT8 Type; UINT32 Id; UINT64 InstPrimary; UINT32 InstSecondary; UINT64 BaseAddress0; UINT64 BaseAddress1; UINT32 OvflwIrq; UINT32 Reserved; UINT32 OvflwIrqFlags; UINT32 ProcAffinity; UINT32 ImplId; } ACPI_APMT_NODE; /* Masks for Flags field above */ #define ACPI_APMT_FLAGS_DUAL_PAGE (1<<0) #define ACPI_APMT_FLAGS_AFFINITY (1<<1) #define ACPI_APMT_FLAGS_ATOMIC (1<<2) /* Values for Flags dual page field above */ #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP (0<<0) #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP (1<<0) /* Values for Flags processor affinity field above */ #define ACPI_APMT_FLAGS_AFFINITY_PROC (0<<1) #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1) /* Values for Flags 64-bit atomic field above */ #define ACPI_APMT_FLAGS_ATOMIC_NSUPP (0<<2) #define ACPI_APMT_FLAGS_ATOMIC_SUPP (1<<2) /* Values for Type field above */ enum acpi_apmt_node_type { ACPI_APMT_NODE_TYPE_MC = 0x00, ACPI_APMT_NODE_TYPE_SMMU = 0x01, ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02, ACPI_APMT_NODE_TYPE_ACPI = 0x03, ACPI_APMT_NODE_TYPE_CACHE = 0x04, ACPI_APMT_NODE_TYPE_COUNT }; /* Masks for ovflw_irq_flags field above */ #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE (1<<0) #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE (1<<1) /* Values for ovflw_irq_flags mode field above */ #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL (0<<0) #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE (1<<0) /* Values for ovflw_irq_flags type field above */ #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED (0<<1) /******************************************************************************* * * BDAT - BIOS Data ACPI Table * * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5 * Nov 2020 * ******************************************************************************/ typedef struct acpi_table_bdat { ACPI_TABLE_HEADER Header; ACPI_GENERIC_ADDRESS Gas; } ACPI_TABLE_BDAT; +/******************************************************************************* + * + * CCEL - CC-Event Log + * From: "Guest-Host-Communication Interface (GHCI) for Intel + * Trust Domain Extensions (Intel TDX)". Feb 2022 + * + ******************************************************************************/ + +typedef struct acpi_table_ccel +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT8 CCType; + UINT8 CCSubType; + UINT16 Reserved; + UINT64 LogAreaMinimumLength; + UINT64 LogAreaStartAddress; + +} ACPI_TABLE_CCEL; /******************************************************************************* * * IORT - IO Remapping Table * * Conforms to "IO Remapping Table System Software on ARM Platforms", - * Document number: ARM DEN 0049E.d, Feb 2022 + * Document number: ARM DEN 0049E.e, Sep 2022 * ******************************************************************************/ typedef struct acpi_table_iort { ACPI_TABLE_HEADER Header; UINT32 NodeCount; UINT32 NodeOffset; UINT32 Reserved; } ACPI_TABLE_IORT; /* * IORT subtables */ typedef struct acpi_iort_node { UINT8 Type; UINT16 Length; UINT8 Revision; UINT32 Identifier; UINT32 MappingCount; UINT32 MappingOffset; char NodeData[1]; } ACPI_IORT_NODE; /* Values for subtable Type above */ enum AcpiIortNodeType { ACPI_IORT_NODE_ITS_GROUP = 0x00, ACPI_IORT_NODE_NAMED_COMPONENT = 0x01, ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, ACPI_IORT_NODE_SMMU = 0x03, ACPI_IORT_NODE_SMMU_V3 = 0x04, ACPI_IORT_NODE_PMCG = 0x05, ACPI_IORT_NODE_RMR = 0x06, }; typedef struct acpi_iort_id_mapping { UINT32 InputBase; /* Lowest value in input range */ UINT32 IdCount; /* Number of IDs */ UINT32 OutputBase; /* Lowest value in output range */ UINT32 OutputReference; /* A reference to the output node */ UINT32 Flags; } ACPI_IORT_ID_MAPPING; /* Masks for Flags field above for IORT subtable */ #define ACPI_IORT_ID_SINGLE_MAPPING (1) typedef struct acpi_iort_memory_access { UINT32 CacheCoherency; UINT8 Hints; UINT16 Reserved; UINT8 MemoryFlags; } ACPI_IORT_MEMORY_ACCESS; /* Values for CacheCoherency field above */ #define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */ #define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */ /* Masks for Hints field above */ #define ACPI_IORT_HT_TRANSIENT (1) #define ACPI_IORT_HT_WRITE (1<<1) #define ACPI_IORT_HT_READ (1<<2) #define ACPI_IORT_HT_OVERRIDE (1<<3) /* Masks for MemoryFlags field above */ #define ACPI_IORT_MF_COHERENCY (1) #define ACPI_IORT_MF_ATTRIBUTES (1<<1) /* * IORT node specific subtables */ typedef struct acpi_iort_its_group { UINT32 ItsCount; UINT32 Identifiers[1]; /* GIC ITS identifier array */ } ACPI_IORT_ITS_GROUP; typedef struct acpi_iort_named_component { UINT32 NodeFlags; UINT64 MemoryProperties; /* Memory access properties */ UINT8 MemoryAddressLimit; /* Memory address size limit */ char DeviceName[1]; /* Path of namespace object */ } ACPI_IORT_NAMED_COMPONENT; /* Masks for Flags field above */ #define ACPI_IORT_NC_STALL_SUPPORTED (1) #define ACPI_IORT_NC_PASID_BITS (31<<1) typedef struct acpi_iort_root_complex { UINT64 MemoryProperties; /* Memory access properties */ UINT32 AtsAttribute; UINT32 PciSegmentNumber; UINT8 MemoryAddressLimit; /* Memory address size limit */ UINT16 PasidCapabilities; /* PASID Capabilities */ UINT8 Reserved[1]; /* Reserved, must be zero */ } ACPI_IORT_ROOT_COMPLEX; /* Masks for AtsAttribute field above */ #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */ #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */ #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */ /* Masks for PasidCapabilities field above */ #define ACPI_IORT_PASID_MAX_WIDTH (0x1F) /* Bits 0-4 */ typedef struct acpi_iort_smmu { UINT64 BaseAddress; /* SMMU base address */ UINT64 Span; /* Length of memory range */ UINT32 Model; UINT32 Flags; UINT32 GlobalInterruptOffset; UINT32 ContextInterruptCount; UINT32 ContextInterruptOffset; UINT32 PmuInterruptCount; UINT32 PmuInterruptOffset; UINT64 Interrupts[1]; /* Interrupt array */ } ACPI_IORT_SMMU; /* Values for Model field above */ #define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */ #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */ #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */ #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */ #define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */ #define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium ThunderX SMMUv2 */ /* Masks for Flags field above */ #define ACPI_IORT_SMMU_DVM_SUPPORTED (1) #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) /* Global interrupt format */ typedef struct acpi_iort_smmu_gsi { UINT32 NSgIrpt; UINT32 NSgIrptFlags; UINT32 NSgCfgIrpt; UINT32 NSgCfgIrptFlags; } ACPI_IORT_SMMU_GSI; typedef struct acpi_iort_smmu_v3 { UINT64 BaseAddress; /* SMMUv3 base address */ UINT32 Flags; UINT32 Reserved; UINT64 VatosAddress; UINT32 Model; UINT32 EventGsiv; UINT32 PriGsiv; UINT32 GerrGsiv; UINT32 SyncGsiv; UINT32 Pxm; UINT32 IdMappingIndex; } ACPI_IORT_SMMU_V3; /* Values for Model field above */ #define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */ #define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* HiSilicon Hi161x SMMUv3 */ #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */ /* Masks for Flags field above */ #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1) #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3) +#define ACPI_IORT_SMMU_V3_DEVICEID_VALID (1<<4) typedef struct acpi_iort_pmcg { UINT64 Page0BaseAddress; UINT32 OverflowGsiv; UINT32 NodeReference; UINT64 Page1BaseAddress; } ACPI_IORT_PMCG; typedef struct acpi_iort_rmr { UINT32 Flags; UINT32 RmrCount; UINT32 RmrOffset; } ACPI_IORT_RMR; /* Masks for Flags field above */ #define ACPI_IORT_RMR_REMAP_PERMITTED (1) #define ACPI_IORT_RMR_ACCESS_PRIVILEGE (1<<1) /* * Macro to access the Access Attributes in flags field above: * Access Attributes is encoded in bits 9:2 */ #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags) (((flags) >> 2) & 0xFF) /* Values for above Access Attributes */ #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE 0x00 #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE 0x01 #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE 0x02 #define ACPI_IORT_RMR_ATTR_DEVICE_GRE 0x03 #define ACPI_IORT_RMR_ATTR_NORMAL_NC 0x04 #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB 0x05 typedef struct acpi_iort_rmr_desc { UINT64 BaseAddress; UINT64 Length; UINT32 Reserved; } ACPI_IORT_RMR_DESC; /******************************************************************************* * * IVRS - I/O Virtualization Reporting Structure * Version 1 * * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification", * Revision 1.26, February 2009. * ******************************************************************************/ typedef struct acpi_table_ivrs { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Info; /* Common virtualization info */ UINT64 Reserved; } ACPI_TABLE_IVRS; /* Values for Info field above */ #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */ #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */ #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */ /* IVRS subtable header */ typedef struct acpi_ivrs_header { UINT8 Type; /* Subtable type */ UINT8 Flags; UINT16 Length; /* Subtable length */ UINT16 DeviceId; /* ID of IOMMU */ } ACPI_IVRS_HEADER; /* Values for subtable Type above */ enum AcpiIvrsType { ACPI_IVRS_TYPE_HARDWARE1 = 0x10, ACPI_IVRS_TYPE_HARDWARE2 = 0x11, ACPI_IVRS_TYPE_HARDWARE3 = 0x40, ACPI_IVRS_TYPE_MEMORY1 = 0x20, ACPI_IVRS_TYPE_MEMORY2 = 0x21, ACPI_IVRS_TYPE_MEMORY3 = 0x22 }; /* Masks for Flags field above for IVHD subtable */ #define ACPI_IVHD_TT_ENABLE (1) #define ACPI_IVHD_PASS_PW (1<<1) #define ACPI_IVHD_RES_PASS_PW (1<<2) #define ACPI_IVHD_ISOC (1<<3) #define ACPI_IVHD_IOTLB (1<<4) /* Masks for Flags field above for IVMD subtable */ #define ACPI_IVMD_UNITY (1) #define ACPI_IVMD_READ (1<<1) #define ACPI_IVMD_WRITE (1<<2) #define ACPI_IVMD_EXCLUSION_RANGE (1<<3) /* * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER */ /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */ typedef struct acpi_ivrs_hardware_10 { ACPI_IVRS_HEADER Header; UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ UINT64 BaseAddress; /* IOMMU control registers */ UINT16 PciSegmentGroup; UINT16 Info; /* MSI number and unit ID */ UINT32 FeatureReporting; } ACPI_IVRS_HARDWARE1; /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */ typedef struct acpi_ivrs_hardware_11 { ACPI_IVRS_HEADER Header; UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ UINT64 BaseAddress; /* IOMMU control registers */ UINT16 PciSegmentGroup; UINT16 Info; /* MSI number and unit ID */ UINT32 Attributes; UINT64 EfrRegisterImage; UINT64 Reserved; } ACPI_IVRS_HARDWARE2; /* Masks for Info field above */ #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */ #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, UnitID */ /* * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure. * Upper two bits of the Type field are the (encoded) length of the structure. * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries * are reserved for future use but not defined. */ typedef struct acpi_ivrs_de_header { UINT8 Type; UINT16 Id; UINT8 DataSetting; } ACPI_IVRS_DE_HEADER; /* Length of device entry is in the top two bits of Type field above */ #define ACPI_IVHD_ENTRY_LENGTH 0xC0 /* Values for device entry Type field above */ enum AcpiIvrsDeviceEntryType { /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */ ACPI_IVRS_TYPE_PAD4 = 0, ACPI_IVRS_TYPE_ALL = 1, ACPI_IVRS_TYPE_SELECT = 2, ACPI_IVRS_TYPE_START = 3, ACPI_IVRS_TYPE_END = 4, /* 8-byte device entries */ ACPI_IVRS_TYPE_PAD8 = 64, ACPI_IVRS_TYPE_NOT_USED = 65, ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses ACPI_IVRS_DEVICE8A */ ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses ACPI_IVRS_DEVICE8A */ ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses ACPI_IVRS_DEVICE8B */ ACPI_IVRS_TYPE_EXT_START = 71, /* Uses ACPI_IVRS_DEVICE8B */ ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses ACPI_IVRS_DEVICE8C */ /* Variable-length device entries */ ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */ }; /* Values for Data field above */ #define ACPI_IVHD_INIT_PASS (1) #define ACPI_IVHD_EINT_PASS (1<<1) #define ACPI_IVHD_NMI_PASS (1<<2) #define ACPI_IVHD_SYSTEM_MGMT (3<<4) #define ACPI_IVHD_LINT0_PASS (1<<6) #define ACPI_IVHD_LINT1_PASS (1<<7) /* Types 0-4: 4-byte device entry */ typedef struct acpi_ivrs_device4 { ACPI_IVRS_DE_HEADER Header; } ACPI_IVRS_DEVICE4; /* Types 66-67: 8-byte device entry */ typedef struct acpi_ivrs_device8a { ACPI_IVRS_DE_HEADER Header; UINT8 Reserved1; UINT16 UsedId; UINT8 Reserved2; } ACPI_IVRS_DEVICE8A; /* Types 70-71: 8-byte device entry */ typedef struct acpi_ivrs_device8b { ACPI_IVRS_DE_HEADER Header; UINT32 ExtendedData; } ACPI_IVRS_DEVICE8B; /* Values for ExtendedData above */ #define ACPI_IVHD_ATS_DISABLED (1<<31) /* Type 72: 8-byte device entry */ typedef struct acpi_ivrs_device8c { ACPI_IVRS_DE_HEADER Header; UINT8 Handle; UINT16 UsedId; UINT8 Variety; } ACPI_IVRS_DEVICE8C; /* Values for Variety field above */ #define ACPI_IVHD_IOAPIC 1 #define ACPI_IVHD_HPET 2 /* Type 240: variable-length device entry */ typedef struct acpi_ivrs_device_hid { ACPI_IVRS_DE_HEADER Header; UINT64 AcpiHid; UINT64 AcpiCid; UINT8 UidType; UINT8 UidLength; } ACPI_IVRS_DEVICE_HID; /* Values for UidType above */ #define ACPI_IVRS_UID_NOT_PRESENT 0 #define ACPI_IVRS_UID_IS_INTEGER 1 #define ACPI_IVRS_UID_IS_STRING 2 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */ typedef struct acpi_ivrs_memory { ACPI_IVRS_HEADER Header; UINT16 AuxData; UINT64 Reserved; UINT64 StartAddress; UINT64 MemoryLength; } ACPI_IVRS_MEMORY; /******************************************************************************* * * LPIT - Low Power Idle Table * * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014. * ******************************************************************************/ typedef struct acpi_table_lpit { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_LPIT; /* LPIT subtable header */ typedef struct acpi_lpit_header { UINT32 Type; /* Subtable type */ UINT32 Length; /* Subtable length */ UINT16 UniqueId; UINT16 Reserved; UINT32 Flags; } ACPI_LPIT_HEADER; /* Values for subtable Type above */ enum AcpiLpitType { ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00, ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */ }; /* Masks for Flags field above */ #define ACPI_LPIT_STATE_DISABLED (1) #define ACPI_LPIT_NO_COUNTER (1<<1) /* * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER */ /* 0x00: Native C-state instruction based LPI structure */ typedef struct acpi_lpit_native { ACPI_LPIT_HEADER Header; ACPI_GENERIC_ADDRESS EntryTrigger; UINT32 Residency; UINT32 Latency; ACPI_GENERIC_ADDRESS ResidencyCounter; UINT64 CounterFrequency; } ACPI_LPIT_NATIVE; /******************************************************************************* * * MADT - Multiple APIC Description Table * Version 3 * ******************************************************************************/ typedef struct acpi_table_madt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Address; /* Physical address of local APIC */ UINT32 Flags; } ACPI_TABLE_MADT; /* Masks for Flags field above */ #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ /* Values for PCATCompat flag */ #define ACPI_MADT_DUAL_PIC 1 #define ACPI_MADT_MULTIPLE_APIC 0 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */ enum AcpiMadtType { ACPI_MADT_TYPE_LOCAL_APIC = 0, ACPI_MADT_TYPE_IO_APIC = 1, ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, ACPI_MADT_TYPE_NMI_SOURCE = 3, ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, ACPI_MADT_TYPE_IO_SAPIC = 6, ACPI_MADT_TYPE_LOCAL_SAPIC = 7, ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, ACPI_MADT_TYPE_LOCAL_X2APIC = 9, ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16, - ACPI_MADT_TYPE_RESERVED = 17, /* 17 to 0x7F are reserved */ + ACPI_MADT_TYPE_CORE_PIC = 17, + ACPI_MADT_TYPE_LIO_PIC = 18, + ACPI_MADT_TYPE_HT_PIC = 19, + ACPI_MADT_TYPE_EIO_PIC = 20, + ACPI_MADT_TYPE_MSI_PIC = 21, + ACPI_MADT_TYPE_BIO_PIC = 22, + ACPI_MADT_TYPE_LPC_PIC = 23, + ACPI_MADT_TYPE_RESERVED = 24, /* 24 to 0x7F are reserved */ ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */ }; /* * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER */ /* 0: Processor Local APIC */ typedef struct acpi_madt_local_apic { ACPI_SUBTABLE_HEADER Header; UINT8 ProcessorId; /* ACPI processor id */ UINT8 Id; /* Processor's local APIC id */ UINT32 LapicFlags; } ACPI_MADT_LOCAL_APIC; /* 1: IO APIC */ typedef struct acpi_madt_io_apic { ACPI_SUBTABLE_HEADER Header; UINT8 Id; /* I/O APIC ID */ UINT8 Reserved; /* Reserved - must be zero */ UINT32 Address; /* APIC physical address */ UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */ } ACPI_MADT_IO_APIC; /* 2: Interrupt Override */ typedef struct acpi_madt_interrupt_override { ACPI_SUBTABLE_HEADER Header; UINT8 Bus; /* 0 - ISA */ UINT8 SourceIrq; /* Interrupt source (IRQ) */ UINT32 GlobalIrq; /* Global system interrupt */ UINT16 IntiFlags; } ACPI_MADT_INTERRUPT_OVERRIDE; /* 3: NMI Source */ typedef struct acpi_madt_nmi_source { ACPI_SUBTABLE_HEADER Header; UINT16 IntiFlags; UINT32 GlobalIrq; /* Global system interrupt */ } ACPI_MADT_NMI_SOURCE; /* 4: Local APIC NMI */ typedef struct acpi_madt_local_apic_nmi { ACPI_SUBTABLE_HEADER Header; UINT8 ProcessorId; /* ACPI processor id */ UINT16 IntiFlags; UINT8 Lint; /* LINTn to which NMI is connected */ } ACPI_MADT_LOCAL_APIC_NMI; /* 5: Address Override */ typedef struct acpi_madt_local_apic_override { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* Reserved, must be zero */ UINT64 Address; /* APIC physical address */ } ACPI_MADT_LOCAL_APIC_OVERRIDE; /* 6: I/O Sapic */ typedef struct acpi_madt_io_sapic { ACPI_SUBTABLE_HEADER Header; UINT8 Id; /* I/O SAPIC ID */ UINT8 Reserved; /* Reserved, must be zero */ UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */ UINT64 Address; /* SAPIC physical address */ } ACPI_MADT_IO_SAPIC; /* 7: Local Sapic */ typedef struct acpi_madt_local_sapic { ACPI_SUBTABLE_HEADER Header; UINT8 ProcessorId; /* ACPI processor id */ UINT8 Id; /* SAPIC ID */ UINT8 Eid; /* SAPIC EID */ UINT8 Reserved[3]; /* Reserved, must be zero */ UINT32 LapicFlags; UINT32 Uid; /* Numeric UID - ACPI 3.0 */ char UidString[1]; /* String UID - ACPI 3.0 */ } ACPI_MADT_LOCAL_SAPIC; /* 8: Platform Interrupt Source */ typedef struct acpi_madt_interrupt_source { ACPI_SUBTABLE_HEADER Header; UINT16 IntiFlags; UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */ UINT8 Id; /* Processor ID */ UINT8 Eid; /* Processor EID */ UINT8 IoSapicVector; /* Vector value for PMI interrupts */ UINT32 GlobalIrq; /* Global system interrupt */ UINT32 Flags; /* Interrupt Source Flags */ } ACPI_MADT_INTERRUPT_SOURCE; /* Masks for Flags field above */ #define ACPI_MADT_CPEI_OVERRIDE (1) /* 9: Processor Local X2APIC (ACPI 4.0) */ typedef struct acpi_madt_local_x2apic { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* Reserved - must be zero */ UINT32 LocalApicId; /* Processor x2APIC ID */ UINT32 LapicFlags; UINT32 Uid; /* ACPI processor UID */ } ACPI_MADT_LOCAL_X2APIC; /* 10: Local X2APIC NMI (ACPI 4.0) */ typedef struct acpi_madt_local_x2apic_nmi { ACPI_SUBTABLE_HEADER Header; UINT16 IntiFlags; UINT32 Uid; /* ACPI processor UID */ UINT8 Lint; /* LINTn to which NMI is connected */ UINT8 Reserved[3]; /* Reserved - must be zero */ } ACPI_MADT_LOCAL_X2APIC_NMI; /* 11: Generic Interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */ typedef struct acpi_madt_generic_interrupt { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* Reserved - must be zero */ UINT32 CpuInterfaceNumber; UINT32 Uid; UINT32 Flags; UINT32 ParkingVersion; UINT32 PerformanceInterrupt; UINT64 ParkedAddress; UINT64 BaseAddress; UINT64 GicvBaseAddress; UINT64 GichBaseAddress; UINT32 VgicInterrupt; UINT64 GicrBaseAddress; UINT64 ArmMpidr; UINT8 EfficiencyClass; UINT8 Reserved2[1]; UINT16 SpeInterrupt; /* ACPI 6.3 */ } ACPI_MADT_GENERIC_INTERRUPT; /* Masks for Flags field above */ /* ACPI_MADT_ENABLED (1) Processor is usable if set */ #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */ #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */ /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */ typedef struct acpi_madt_generic_distributor { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* Reserved - must be zero */ UINT32 GicId; UINT64 BaseAddress; UINT32 GlobalIrqBase; UINT8 Version; UINT8 Reserved2[3]; /* Reserved - must be zero */ } ACPI_MADT_GENERIC_DISTRIBUTOR; /* Values for Version field above */ enum AcpiMadtGicVersion { ACPI_MADT_GIC_VERSION_NONE = 0, ACPI_MADT_GIC_VERSION_V1 = 1, ACPI_MADT_GIC_VERSION_V2 = 2, ACPI_MADT_GIC_VERSION_V3 = 3, ACPI_MADT_GIC_VERSION_V4 = 4, ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */ }; /* 13: Generic MSI Frame (ACPI 5.1) */ typedef struct acpi_madt_generic_msi_frame { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* Reserved - must be zero */ UINT32 MsiFrameId; UINT64 BaseAddress; UINT32 Flags; UINT16 SpiCount; UINT16 SpiBase; } ACPI_MADT_GENERIC_MSI_FRAME; /* Masks for Flags field above */ #define ACPI_MADT_OVERRIDE_SPI_VALUES (1) /* 14: Generic Redistributor (ACPI 5.1) */ typedef struct acpi_madt_generic_redistributor { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* reserved - must be zero */ UINT64 BaseAddress; UINT32 Length; } ACPI_MADT_GENERIC_REDISTRIBUTOR; /* 15: Generic Translator (ACPI 6.0) */ typedef struct acpi_madt_generic_translator { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; /* reserved - must be zero */ UINT32 TranslationId; UINT64 BaseAddress; UINT32 Reserved2; } ACPI_MADT_GENERIC_TRANSLATOR; /* 16: Multiprocessor wakeup (ACPI 6.4) */ typedef struct acpi_madt_multiproc_wakeup { ACPI_SUBTABLE_HEADER Header; UINT16 MailboxVersion; UINT32 Reserved; /* reserved - must be zero */ UINT64 BaseAddress; } ACPI_MADT_MULTIPROC_WAKEUP; #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE 2032 #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE 2048 typedef struct acpi_madt_multiproc_wakeup_mailbox { UINT16 Command; UINT16 Reserved; /* reserved - must be zero */ UINT32 ApicId; UINT64 WakeupVector; UINT8 ReservedOs[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */ UINT8 ReservedFirmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */ } ACPI_MADT_MULTIPROC_WAKEUP_MAILBOX; #define ACPI_MP_WAKE_COMMAND_WAKEUP 1 -/* 17: OEM data */ +/* 17: CPU Core Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_core_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT32 ProcessorId; + UINT32 CoreId; + UINT32 Flags; +} ACPI_MADT_CORE_PIC; + +/* Values for Version field above */ + +enum AcpiMadtCorePicVersion { + ACPI_MADT_CORE_PIC_VERSION_NONE = 0, + ACPI_MADT_CORE_PIC_VERSION_V1 = 1, + ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 18: Legacy I/O Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_lio_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT64 Address; + UINT16 Size; + UINT8 Cascade[2]; + UINT32 CascadeMap[2]; +} ACPI_MADT_LIO_PIC; + +/* Values for Version field above */ + +enum AcpiMadtLioPicVersion { + ACPI_MADT_LIO_PIC_VERSION_NONE = 0, + ACPI_MADT_LIO_PIC_VERSION_V1 = 1, + ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 19: HT Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_ht_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT64 Address; + UINT16 Size; + UINT8 Cascade[8]; +} ACPI_MADT_HT_PIC; + +/* Values for Version field above */ + +enum AcpiMadtHtPicVersion { + ACPI_MADT_HT_PIC_VERSION_NONE = 0, + ACPI_MADT_HT_PIC_VERSION_V1 = 1, + ACPI_MADT_HT_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 20: Extend I/O Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_eio_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT8 Cascade; + UINT8 Node; + UINT64 NodeMap; +} ACPI_MADT_EIO_PIC; + +/* Values for Version field above */ + +enum AcpiMadtEioPicVersion { + ACPI_MADT_EIO_PIC_VERSION_NONE = 0, + ACPI_MADT_EIO_PIC_VERSION_V1 = 1, + ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 21: MSI Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_msi_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT64 MsgAddress; + UINT32 Start; + UINT32 Count; +} ACPI_MADT_MSI_PIC; + +/* Values for Version field above */ + +enum AcpiMadtMsiPicVersion { + ACPI_MADT_MSI_PIC_VERSION_NONE = 0, + ACPI_MADT_MSI_PIC_VERSION_V1 = 1, + ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 22: Bridge I/O Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_bio_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT64 Address; + UINT16 Size; + UINT16 Id; + UINT16 GsiBase; +} ACPI_MADT_BIO_PIC; + +/* Values for Version field above */ + +enum AcpiMadtBioPicVersion { + ACPI_MADT_BIO_PIC_VERSION_NONE = 0, + ACPI_MADT_BIO_PIC_VERSION_V1 = 1, + ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 23: LPC Interrupt Controller (ACPI 6.5) */ + +typedef struct acpi_madt_lpc_pic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT64 Address; + UINT16 Size; + UINT8 Cascade; +} ACPI_MADT_LPC_PIC; + +/* Values for Version field above */ + +enum AcpiMadtLpcPicVersion { + ACPI_MADT_LPC_PIC_VERSION_NONE = 0, + ACPI_MADT_LPC_PIC_VERSION_V1 = 1, + ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + +/* 80: OEM data */ typedef struct acpi_madt_oem_data { UINT8 OemData[0]; } ACPI_MADT_OEM_DATA; /* * Common flags fields for MADT subtables */ /* MADT Local APIC flags */ #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ #define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */ /* MADT MPS INTI flags (IntiFlags) */ #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */ #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */ /* Values for MPS INTI flags */ #define ACPI_MADT_POLARITY_CONFORMS 0 #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 #define ACPI_MADT_POLARITY_RESERVED 2 #define ACPI_MADT_POLARITY_ACTIVE_LOW 3 #define ACPI_MADT_TRIGGER_CONFORMS (0) #define ACPI_MADT_TRIGGER_EDGE (1<<2) #define ACPI_MADT_TRIGGER_RESERVED (2<<2) #define ACPI_MADT_TRIGGER_LEVEL (3<<2) /******************************************************************************* * * MCFG - PCI Memory Mapped Configuration table and subtable * Version 1 * * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005 * ******************************************************************************/ typedef struct acpi_table_mcfg { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Reserved[8]; } ACPI_TABLE_MCFG; /* Subtable */ typedef struct acpi_mcfg_allocation { UINT64 Address; /* Base address, processor-relative */ UINT16 PciSegment; /* PCI segment group number */ UINT8 StartBusNumber; /* Starting PCI Bus number */ UINT8 EndBusNumber; /* Final PCI Bus number */ UINT32 Reserved; } ACPI_MCFG_ALLOCATION; /******************************************************************************* * * MCHI - Management Controller Host Interface Table * Version 1 * * Conforms to "Management Component Transport Protocol (MCTP) Host * Interface Specification", Revision 1.0.0a, October 13, 2009 * ******************************************************************************/ typedef struct acpi_table_mchi { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 InterfaceType; UINT8 Protocol; UINT64 ProtocolData; UINT8 InterruptType; UINT8 Gpe; UINT8 PciDeviceFlag; UINT32 GlobalInterrupt; ACPI_GENERIC_ADDRESS ControlRegister; UINT8 PciSegment; UINT8 PciBus; UINT8 PciDevice; UINT8 PciFunction; } ACPI_TABLE_MCHI; /******************************************************************************* * * MPST - Memory Power State Table (ACPI 5.0) * Version 1 * ******************************************************************************/ #define ACPI_MPST_CHANNEL_INFO \ UINT8 ChannelId; \ UINT8 Reserved1[3]; \ UINT16 PowerNodeCount; \ UINT16 Reserved2; /* Main table */ typedef struct acpi_table_mpst { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ } ACPI_TABLE_MPST; /* Memory Platform Communication Channel Info */ typedef struct acpi_mpst_channel { ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ } ACPI_MPST_CHANNEL; /* Memory Power Node Structure */ typedef struct acpi_mpst_power_node { UINT8 Flags; UINT8 Reserved1; UINT16 NodeId; UINT32 Length; UINT64 RangeAddress; UINT64 RangeLength; UINT32 NumPowerStates; UINT32 NumPhysicalComponents; } ACPI_MPST_POWER_NODE; /* Values for Flags field above */ #define ACPI_MPST_ENABLED 1 #define ACPI_MPST_POWER_MANAGED 2 #define ACPI_MPST_HOT_PLUG_CAPABLE 4 /* Memory Power State Structure (follows POWER_NODE above) */ typedef struct acpi_mpst_power_state { UINT8 PowerState; UINT8 InfoIndex; } ACPI_MPST_POWER_STATE; /* Physical Component ID Structure (follows POWER_STATE above) */ typedef struct acpi_mpst_component { UINT16 ComponentId; } ACPI_MPST_COMPONENT; /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ typedef struct acpi_mpst_data_hdr { UINT16 CharacteristicsCount; UINT16 Reserved; } ACPI_MPST_DATA_HDR; typedef struct acpi_mpst_power_data { UINT8 StructureId; UINT8 Flags; UINT16 Reserved1; UINT32 AveragePower; UINT32 PowerSaving; UINT64 ExitLatency; UINT64 Reserved2; } ACPI_MPST_POWER_DATA; /* Values for Flags field above */ #define ACPI_MPST_PRESERVE 1 #define ACPI_MPST_AUTOENTRY 2 #define ACPI_MPST_AUTOEXIT 4 /* Shared Memory Region (not part of an ACPI table) */ typedef struct acpi_mpst_shared { UINT32 Signature; UINT16 PccCommand; UINT16 PccStatus; UINT32 CommandRegister; UINT32 StatusRegister; UINT32 PowerStateId; UINT32 PowerNodeId; UINT64 EnergyConsumed; UINT64 AveragePower; } ACPI_MPST_SHARED; /******************************************************************************* * * MSCT - Maximum System Characteristics Table (ACPI 4.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_msct { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 ProximityOffset; /* Location of proximity info struct(s) */ UINT32 MaxProximityDomains;/* Max number of proximity domains */ UINT32 MaxClockDomains; /* Max number of clock domains */ UINT64 MaxAddress; /* Max physical address in system */ } ACPI_TABLE_MSCT; /* Subtable - Maximum Proximity Domain Information. Version 1 */ typedef struct acpi_msct_proximity { UINT8 Revision; UINT8 Length; UINT32 RangeStart; /* Start of domain range */ UINT32 RangeEnd; /* End of domain range */ UINT32 ProcessorCapacity; UINT64 MemoryCapacity; /* In bytes */ } ACPI_MSCT_PROXIMITY; /******************************************************************************* * * MSDM - Microsoft Data Management table * * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)", * November 29, 2011. Copyright 2011 Microsoft * ******************************************************************************/ /* Basic MSDM table is only the common ACPI header */ typedef struct acpi_table_msdm { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_MSDM; /******************************************************************************* * * NFIT - NVDIMM Interface Table (ACPI 6.0+) * Version 1 * ******************************************************************************/ typedef struct acpi_table_nfit { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Reserved; /* Reserved, must be zero */ } ACPI_TABLE_NFIT; /* Subtable header for NFIT */ typedef struct acpi_nfit_header { UINT16 Type; UINT16 Length; } ACPI_NFIT_HEADER; /* Values for subtable type in ACPI_NFIT_HEADER */ enum AcpiNfitType { ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0, ACPI_NFIT_TYPE_MEMORY_MAP = 1, ACPI_NFIT_TYPE_INTERLEAVE = 2, ACPI_NFIT_TYPE_SMBIOS = 3, ACPI_NFIT_TYPE_CONTROL_REGION = 4, ACPI_NFIT_TYPE_DATA_REGION = 5, ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6, ACPI_NFIT_TYPE_CAPABILITIES = 7, ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */ }; /* * NFIT Subtables */ /* 0: System Physical Address Range Structure */ typedef struct acpi_nfit_system_address { ACPI_NFIT_HEADER Header; UINT16 RangeIndex; UINT16 Flags; UINT32 Reserved; /* Reserved, must be zero */ UINT32 ProximityDomain; UINT8 RangeGuid[16]; UINT64 Address; UINT64 Length; UINT64 MemoryMapping; UINT64 LocationCookie; /* ACPI 6.4 */ } ACPI_NFIT_SYSTEM_ADDRESS; /* Flags */ #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */ #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */ #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */ /* Range Type GUIDs appear in the include/acuuid.h file */ /* 1: Memory Device to System Address Range Map Structure */ typedef struct acpi_nfit_memory_map { ACPI_NFIT_HEADER Header; UINT32 DeviceHandle; UINT16 PhysicalId; UINT16 RegionId; UINT16 RangeIndex; UINT16 RegionIndex; UINT64 RegionSize; UINT64 RegionOffset; UINT64 Address; UINT16 InterleaveIndex; UINT16 InterleaveWays; UINT16 Flags; UINT16 Reserved; /* Reserved, must be zero */ } ACPI_NFIT_MEMORY_MAP; /* Flags */ #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */ #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */ #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */ #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */ #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */ #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */ #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */ /* 2: Interleave Structure */ typedef struct acpi_nfit_interleave { ACPI_NFIT_HEADER Header; UINT16 InterleaveIndex; UINT16 Reserved; /* Reserved, must be zero */ UINT32 LineCount; UINT32 LineSize; UINT32 LineOffset[1]; /* Variable length */ } ACPI_NFIT_INTERLEAVE; /* 3: SMBIOS Management Information Structure */ typedef struct acpi_nfit_smbios { ACPI_NFIT_HEADER Header; UINT32 Reserved; /* Reserved, must be zero */ UINT8 Data[1]; /* Variable length */ } ACPI_NFIT_SMBIOS; /* 4: NVDIMM Control Region Structure */ typedef struct acpi_nfit_control_region { ACPI_NFIT_HEADER Header; UINT16 RegionIndex; UINT16 VendorId; UINT16 DeviceId; UINT16 RevisionId; UINT16 SubsystemVendorId; UINT16 SubsystemDeviceId; UINT16 SubsystemRevisionId; UINT8 ValidFields; UINT8 ManufacturingLocation; UINT16 ManufacturingDate; UINT8 Reserved[2]; /* Reserved, must be zero */ UINT32 SerialNumber; UINT16 Code; UINT16 Windows; UINT64 WindowSize; UINT64 CommandOffset; UINT64 CommandSize; UINT64 StatusOffset; UINT64 StatusSize; UINT16 Flags; UINT8 Reserved1[6]; /* Reserved, must be zero */ } ACPI_NFIT_CONTROL_REGION; /* Flags */ #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */ /* ValidFields bits */ #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */ /* 5: NVDIMM Block Data Window Region Structure */ typedef struct acpi_nfit_data_region { ACPI_NFIT_HEADER Header; UINT16 RegionIndex; UINT16 Windows; UINT64 Offset; UINT64 Size; UINT64 Capacity; UINT64 StartAddress; } ACPI_NFIT_DATA_REGION; /* 6: Flush Hint Address Structure */ typedef struct acpi_nfit_flush_address { ACPI_NFIT_HEADER Header; UINT32 DeviceHandle; UINT16 HintCount; UINT8 Reserved[6]; /* Reserved, must be zero */ UINT64 HintAddress[1]; /* Variable length */ } ACPI_NFIT_FLUSH_ADDRESS; /* 7: Platform Capabilities Structure */ typedef struct acpi_nfit_capabilities { ACPI_NFIT_HEADER Header; UINT8 HighestCapability; UINT8 Reserved[3]; /* Reserved, must be zero */ UINT32 Capabilities; UINT32 Reserved2; } ACPI_NFIT_CAPABILITIES; /* Capabilities Flags */ #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */ #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */ #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */ /* * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM */ typedef struct nfit_device_handle { UINT32 Handle; } NFIT_DEVICE_HANDLE; /* Device handle construction and extraction macros */ #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0 #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00 #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000 #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000 #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0 #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4 #define ACPI_NFIT_MEMORY_ID_OFFSET 8 #define ACPI_NFIT_SOCKET_ID_OFFSET 12 #define ACPI_NFIT_NODE_ID_OFFSET 16 /* Macro to construct a NFIT/NVDIMM device handle */ #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \ ((dimm) | \ ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \ ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \ ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \ ((node) << ACPI_NFIT_NODE_ID_OFFSET)) /* Macros to extract individual fields from a NFIT/NVDIMM device handle */ #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \ ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK) #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \ (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET) #define ACPI_NFIT_GET_MEMORY_ID(handle) \ (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET) #define ACPI_NFIT_GET_SOCKET_ID(handle) \ (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET) #define ACPI_NFIT_GET_NODE_ID(handle) \ (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET) /******************************************************************************* * * NHLT - Non HD Audio Link Table * * Conforms to: Intel Smart Sound Technology NHLT Specification * Version 0.8.1, January 2020. * ******************************************************************************/ /* Main table */ typedef struct acpi_table_nhlt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 EndpointCount; } ACPI_TABLE_NHLT; typedef struct acpi_table_nhlt_endpoint_count { UINT8 EndpointCount; } ACPI_TABLE_NHLT_ENDPOINT_COUNT; typedef struct acpi_nhlt_endpoint { UINT32 DescriptorLength; UINT8 LinkType; UINT8 InstanceId; UINT16 VendorId; UINT16 DeviceId; UINT16 RevisionId; UINT32 SubsystemId; UINT8 DeviceType; UINT8 Direction; UINT8 VirtualBusId; } ACPI_NHLT_ENDPOINT; /* Types for LinkType field above */ #define ACPI_NHLT_RESERVED_HD_AUDIO 0 #define ACPI_NHLT_RESERVED_DSP 1 #define ACPI_NHLT_PDM 2 #define ACPI_NHLT_SSP 3 #define ACPI_NHLT_RESERVED_SLIMBUS 4 #define ACPI_NHLT_RESERVED_SOUNDWIRE 5 #define ACPI_NHLT_TYPE_RESERVED 6 /* 6 and above are reserved */ /* All other values above are reserved */ /* Values for DeviceId field above */ #define ACPI_NHLT_PDM_DMIC 0xAE20 #define ACPI_NHLT_BT_SIDEBAND 0xAE30 #define ACPI_NHLT_I2S_TDM_CODECS 0xAE23 /* Values for DeviceType field above */ /* SSP Link */ #define ACPI_NHLT_LINK_BT_SIDEBAND 0 #define ACPI_NHLT_LINK_FM 1 #define ACPI_NHLT_LINK_MODEM 2 /* 3 is reserved */ #define ACPI_NHLT_LINK_SSP_ANALOG_CODEC 4 /* PDM Link */ #define ACPI_NHLT_PDM_ON_CAVS_1P8 0 #define ACPI_NHLT_PDM_ON_CAVS_1P5 1 /* Values for Direction field above */ #define ACPI_NHLT_DIR_RENDER 0 #define ACPI_NHLT_DIR_CAPTURE 1 #define ACPI_NHLT_DIR_RENDER_LOOPBACK 2 #define ACPI_NHLT_DIR_RENDER_FEEDBACK 3 #define ACPI_NHLT_DIR_RESERVED 4 /* 4 and above are reserved */ /* Capabilities = 2 */ typedef struct acpi_nhlt_device_specific_config { UINT32 CapabilitiesSize; UINT8 VirtualSlot; UINT8 ConfigType; } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG; /* Capabilities = 3 */ typedef struct acpi_nhlt_device_specific_config_a { UINT32 CapabilitiesSize; UINT8 VirtualSlot; UINT8 ConfigType; UINT8 ArrayType; } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A; /* Capabilities = 3 */ typedef struct acpi_nhlt_device_specific_config_d { UINT8 VirtualSlot; UINT8 ConfigType; UINT8 ArrayType; } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D; /* Values for Config Type above */ #define ACPI_NHLT_CONFIG_TYPE_GENERIC 0x00 #define ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY 0x01 #define ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK 0x03 #define ACPI_NHLT_CONFIG_TYPE_RESERVED 0x04 /* 4 and above are reserved */ /* Capabilities = 0 */ typedef struct acpi_nhlt_device_specific_config_b { UINT32 CapabilitiesSize; } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B; /* Capabilities = 1 */ typedef struct acpi_nhlt_device_specific_config_c { UINT32 CapabilitiesSize; UINT8 VirtualSlot; } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C; typedef struct acpi_nhlt_render_device_specific_config { UINT32 CapabilitiesSize; UINT8 VirtualSlot; } ACPI_NHLT_RENDER_DEVICE_SPECIFIC_CONFIG; typedef struct acpi_nhlt_wave_extensible { UINT16 FormatTag; UINT16 ChannelCount; UINT32 SamplesPerSec; UINT32 AvgBytesPerSec; UINT16 BlockAlign; UINT16 BitsPerSample; UINT16 ExtraFormatSize; UINT16 ValidBitsPerSample; UINT32 ChannelMask; UINT8 SubFormatGuid[16]; } ACPI_NHLT_WAVE_EXTENSIBLE; /* Values for ChannelMask above */ #define ACPI_NHLT_SPKR_FRONT_LEFT 0x1 #define ACPI_NHLT_SPKR_FRONT_RIGHT 0x2 #define ACPI_NHLT_SPKR_FRONT_CENTER 0x4 #define ACPI_NHLT_SPKR_LOW_FREQ 0x8 #define ACPI_NHLT_SPKR_BACK_LEFT 0x10 #define ACPI_NHLT_SPKR_BACK_RIGHT 0x20 #define ACPI_NHLT_SPKR_FRONT_LEFT_OF_CENTER 0x40 #define ACPI_NHLT_SPKR_FRONT_RIGHT_OF_CENTER 0x80 #define ACPI_NHLT_SPKR_BACK_CENTER 0x100 #define ACPI_NHLT_SPKR_SIDE_LEFT 0x200 #define ACPI_NHLT_SPKR_SIDE_RIGHT 0x400 #define ACPI_NHLT_SPKR_TOP_CENTER 0x800 #define ACPI_NHLT_SPKR_TOP_FRONT_LEFT 0x1000 #define ACPI_NHLT_SPKR_TOP_FRONT_CENTER 0x2000 #define ACPI_NHLT_SPKR_TOP_FRONT_RIGHT 0x4000 #define ACPI_NHLT_SPKR_TOP_BACK_LEFT 0x8000 #define ACPI_NHLT_SPKR_TOP_BACK_CENTER 0x10000 #define ACPI_NHLT_SPKR_TOP_BACK_RIGHT 0x20000 typedef struct acpi_nhlt_format_config { ACPI_NHLT_WAVE_EXTENSIBLE Format; UINT32 CapabilitySize; UINT8 Capabilities[]; } ACPI_NHLT_FORMAT_CONFIG; typedef struct acpi_nhlt_formats_config { UINT8 FormatsCount; } ACPI_NHLT_FORMATS_CONFIG; typedef struct acpi_nhlt_device_specific_hdr { UINT8 VirtualSlot; UINT8 ConfigType; } ACPI_NHLT_DEVICE_SPECIFIC_HDR; /* Types for ConfigType above */ #define ACPI_NHLT_GENERIC 0 #define ACPI_NHLT_MIC 1 #define ACPI_NHLT_RENDER 3 typedef struct acpi_nhlt_mic_device_specific_config { ACPI_NHLT_DEVICE_SPECIFIC_HDR DeviceConfig; UINT8 ArrayTypeExt; } ACPI_NHLT_MIC_DEVICE_SPECIFIC_CONFIG; /* Values for ArrayTypeExt above */ #define ACPI_NHLT_ARRAY_TYPE_RESERVED 0x09 /* 9 and below are reserved */ #define ACPI_NHLT_SMALL_LINEAR_2ELEMENT 0x0A #define ACPI_NHLT_BIG_LINEAR_2ELEMENT 0x0B #define ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT 0x0C #define ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT 0x0D #define ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT 0x0E #define ACPI_NHLT_VENDOR_DEFINED 0x0F #define ACPI_NHLT_ARRAY_TYPE_MASK 0x0F #define ACPI_NHLT_ARRAY_TYPE_EXT_MASK 0x10 #define ACPI_NHLT_NO_EXTENSION 0x0 #define ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT (1<<4) typedef struct acpi_nhlt_vendor_mic_count { UINT8 MicrophoneCount; } ACPI_NHLT_VENDOR_MIC_COUNT; typedef struct acpi_nhlt_vendor_mic_config { UINT8 Type; UINT8 Panel; UINT16 SpeakerPositionDistance; /* mm */ UINT16 HorizontalOffset; /* mm */ UINT16 VerticalOffset; /* mm */ UINT8 FrequencyLowBand; /* 5*Hz */ UINT8 FrequencyHighBand; /* 500*Hz */ UINT16 DirectionAngle; /* -180 - + 180 */ UINT16 ElevationAngle; /* -180 - + 180 */ UINT16 WorkVerticalAngleBegin; /* -180 - + 180 with 2 deg step */ UINT16 WorkVerticalAngleEnd; /* -180 - + 180 with 2 deg step */ UINT16 WorkHorizontalAngleBegin; /* -180 - + 180 with 2 deg step */ UINT16 WorkHorizontalAngleEnd; /* -180 - + 180 with 2 deg step */ } ACPI_NHLT_VENDOR_MIC_CONFIG; /* Values for Type field above */ #define ACPI_NHLT_MIC_OMNIDIRECTIONAL 0 #define ACPI_NHLT_MIC_SUBCARDIOID 1 #define ACPI_NHLT_MIC_CARDIOID 2 #define ACPI_NHLT_MIC_SUPER_CARDIOID 3 #define ACPI_NHLT_MIC_HYPER_CARDIOID 4 #define ACPI_NHLT_MIC_8_SHAPED 5 #define ACPI_NHLT_MIC_RESERVED6 6 /* 6 is reserved */ #define ACPI_NHLT_MIC_VENDOR_DEFINED 7 #define ACPI_NHLT_MIC_RESERVED 8 /* 8 and above are reserved */ /* Values for Panel field above */ #define ACPI_NHLT_MIC_POSITION_TOP 0 #define ACPI_NHLT_MIC_POSITION_BOTTOM 1 #define ACPI_NHLT_MIC_POSITION_LEFT 2 #define ACPI_NHLT_MIC_POSITION_RIGHT 3 #define ACPI_NHLT_MIC_POSITION_FRONT 4 #define ACPI_NHLT_MIC_POSITION_BACK 5 #define ACPI_NHLT_MIC_POSITION_RESERVED 6 /* 6 and above are reserved */ typedef struct acpi_nhlt_vendor_mic_device_specific_config { ACPI_NHLT_MIC_DEVICE_SPECIFIC_CONFIG MicArrayDeviceConfig; UINT8 NumberOfMicrophones; ACPI_NHLT_VENDOR_MIC_CONFIG MicConfig[]; /* Indexed by NumberOfMicrophones */ } ACPI_NHLT_VENDOR_MIC_DEVICE_SPECIFIC_CONFIG; /* Microphone SNR and Sensitivity extension */ typedef struct acpi_nhlt_mic_snr_sensitivity_extension { UINT32 SNR; UINT32 Sensitivity; } ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION; /* Render device with feedback */ typedef struct acpi_nhlt_render_feedback_device_specific_config { UINT8 FeedbackVirtualSlot; /* Render slot in case of capture */ UINT16 FeedbackChannels; /* Informative only */ UINT16 FeedbackValidBitsPerSample; } ACPI_NHLT_RENDER_FEEDBACK_DEVICE_SPECIFIC_CONFIG; /* Non documented structures */ typedef struct acpi_nhlt_device_info_count { UINT8 StructureCount; } ACPI_NHLT_DEVICE_INFO_COUNT; typedef struct acpi_nhlt_device_info { UINT8 DeviceId[16]; UINT8 DeviceInstanceId; UINT8 DevicePortId; } ACPI_NHLT_DEVICE_INFO; /******************************************************************************* * * PCCT - Platform Communications Channel Table (ACPI 5.0) * Version 2 (ACPI 6.2) * ******************************************************************************/ typedef struct acpi_table_pcct { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Flags; UINT64 Reserved; } ACPI_TABLE_PCCT; /* Values for Flags field above */ #define ACPI_PCCT_DOORBELL 1 /* Values for subtable type in ACPI_SUBTABLE_HEADER */ enum AcpiPcctType { ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */ ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */ ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */ ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ }; /* * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER */ /* 0: Generic Communications Subspace */ typedef struct acpi_pcct_subspace { ACPI_SUBTABLE_HEADER Header; UINT8 Reserved[6]; UINT64 BaseAddress; UINT64 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 PreserveMask; UINT64 WriteMask; UINT32 Latency; UINT32 MaxAccessRate; UINT16 MinTurnaroundTime; } ACPI_PCCT_SUBSPACE; /* 1: HW-reduced Communications Subspace (ACPI 5.1) */ typedef struct acpi_pcct_hw_reduced { ACPI_SUBTABLE_HEADER Header; UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved; UINT64 BaseAddress; UINT64 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 PreserveMask; UINT64 WriteMask; UINT32 Latency; UINT32 MaxAccessRate; UINT16 MinTurnaroundTime; } ACPI_PCCT_HW_REDUCED; /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ typedef struct acpi_pcct_hw_reduced_type2 { ACPI_SUBTABLE_HEADER Header; UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved; UINT64 BaseAddress; UINT64 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 PreserveMask; UINT64 WriteMask; UINT32 Latency; UINT32 MaxAccessRate; UINT16 MinTurnaroundTime; ACPI_GENERIC_ADDRESS PlatformAckRegister; UINT64 AckPreserveMask; UINT64 AckWriteMask; } ACPI_PCCT_HW_REDUCED_TYPE2; /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ typedef struct acpi_pcct_ext_pcc_master { ACPI_SUBTABLE_HEADER Header; UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved1; UINT64 BaseAddress; UINT32 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 PreserveMask; UINT64 WriteMask; UINT32 Latency; UINT32 MaxAccessRate; UINT32 MinTurnaroundTime; ACPI_GENERIC_ADDRESS PlatformAckRegister; UINT64 AckPreserveMask; UINT64 AckSetMask; UINT64 Reserved2; ACPI_GENERIC_ADDRESS CmdCompleteRegister; UINT64 CmdCompleteMask; ACPI_GENERIC_ADDRESS CmdUpdateRegister; UINT64 CmdUpdatePreserveMask; UINT64 CmdUpdateSetMask; ACPI_GENERIC_ADDRESS ErrorStatusRegister; UINT64 ErrorStatusMask; } ACPI_PCCT_EXT_PCC_MASTER; /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ typedef struct acpi_pcct_ext_pcc_slave { ACPI_SUBTABLE_HEADER Header; UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved1; UINT64 BaseAddress; UINT32 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 PreserveMask; UINT64 WriteMask; UINT32 Latency; UINT32 MaxAccessRate; UINT32 MinTurnaroundTime; ACPI_GENERIC_ADDRESS PlatformAckRegister; UINT64 AckPreserveMask; UINT64 AckSetMask; UINT64 Reserved2; ACPI_GENERIC_ADDRESS CmdCompleteRegister; UINT64 CmdCompleteMask; ACPI_GENERIC_ADDRESS CmdUpdateRegister; UINT64 CmdUpdatePreserveMask; UINT64 CmdUpdateSetMask; ACPI_GENERIC_ADDRESS ErrorStatusRegister; UINT64 ErrorStatusMask; } ACPI_PCCT_EXT_PCC_SLAVE; /* 5: HW Registers based Communications Subspace */ typedef struct acpi_pcct_hw_reg { ACPI_SUBTABLE_HEADER Header; UINT16 Version; UINT64 BaseAddress; UINT64 Length; ACPI_GENERIC_ADDRESS DoorbellRegister; UINT64 DoorbellPreserve; UINT64 DoorbellWrite; ACPI_GENERIC_ADDRESS CmdCompleteRegister; UINT64 CmdCompleteMask; ACPI_GENERIC_ADDRESS ErrorStatusRegister; UINT64 ErrorStatusMask; UINT32 NominalLatency; UINT32 MinTurnaroundTime; } ACPI_PCCT_HW_REG; /* Values for doorbell flags above */ #define ACPI_PCCT_INTERRUPT_POLARITY (1) #define ACPI_PCCT_INTERRUPT_MODE (1<<1) /* * PCC memory structures (not part of the ACPI table) */ /* Shared Memory Region */ typedef struct acpi_pcct_shared_memory { UINT32 Signature; UINT16 Command; UINT16 Status; } ACPI_PCCT_SHARED_MEMORY; /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */ typedef struct acpi_pcct_ext_pcc_shared_memory { UINT32 Signature; UINT32 Flags; UINT32 Length; UINT32 Command; } ACPI_PCCT_EXT_PCC_SHARED_MEMORY; /******************************************************************************* * * PDTT - Platform Debug Trigger Table (ACPI 6.2) * Version 0 * ******************************************************************************/ typedef struct acpi_table_pdtt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 TriggerCount; UINT8 Reserved[3]; UINT32 ArrayOffset; } ACPI_TABLE_PDTT; /* * PDTT Communication Channel Identifier Structure. * The number of these structures is defined by TriggerCount above, * starting at ArrayOffset. */ typedef struct acpi_pdtt_channel { UINT8 SubchannelId; UINT8 Flags; } ACPI_PDTT_CHANNEL; /* Flags for above */ #define ACPI_PDTT_RUNTIME_TRIGGER (1) #define ACPI_PDTT_WAIT_COMPLETION (1<<1) #define ACPI_PDTT_TRIGGER_ORDER (1<<2) /******************************************************************************* * * PHAT - Platform Health Assessment Table (ACPI 6.4) * Version 1 * ******************************************************************************/ typedef struct acpi_table_phat { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_PHAT; /* Common header for PHAT subtables that follow main table */ typedef struct acpi_phat_header { UINT16 Type; UINT16 Length; UINT8 Revision; } ACPI_PHAT_HEADER; /* Values for Type field above */ #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0 #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1 #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */ /* * PHAT subtables, correspond to Type in ACPI_PHAT_HEADER */ /* 0: Firmware Version Data Record */ typedef struct acpi_phat_version_data { ACPI_PHAT_HEADER Header; UINT8 Reserved[3]; UINT32 ElementCount; } ACPI_PHAT_VERSION_DATA; typedef struct acpi_phat_version_element { UINT8 Guid[16]; UINT64 VersionValue; UINT32 ProducerId; } ACPI_PHAT_VERSION_ELEMENT; /* 1: Firmware Health Data Record */ typedef struct acpi_phat_health_data { ACPI_PHAT_HEADER Header; UINT8 Reserved[2]; UINT8 Health; UINT8 DeviceGuid[16]; UINT32 DeviceSpecificOffset; /* Zero if no Device-specific data */ } ACPI_PHAT_HEALTH_DATA; /* Values for Health field above */ #define ACPI_PHAT_ERRORS_FOUND 0 #define ACPI_PHAT_NO_ERRORS 1 #define ACPI_PHAT_UNKNOWN_ERRORS 2 #define ACPI_PHAT_ADVISORY 3 /******************************************************************************* * * PMTT - Platform Memory Topology Table (ACPI 5.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_pmtt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 MemoryDeviceCount; /* * Immediately followed by: * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount]; */ } ACPI_TABLE_PMTT; /* Common header for PMTT subtables that follow main table */ typedef struct acpi_pmtt_header { UINT8 Type; UINT8 Reserved1; UINT16 Length; UINT16 Flags; UINT16 Reserved2; UINT32 MemoryDeviceCount; /* Zero means no memory device structs follow */ /* * Immediately followed by: * UINT8 TypeSpecificData[] * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount]; */ } ACPI_PMTT_HEADER; /* Values for Type field above */ #define ACPI_PMTT_TYPE_SOCKET 0 #define ACPI_PMTT_TYPE_CONTROLLER 1 #define ACPI_PMTT_TYPE_DIMM 2 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */ #define ACPI_PMTT_TYPE_VENDOR 0xFF /* Values for Flags field above */ #define ACPI_PMTT_TOP_LEVEL 0x0001 #define ACPI_PMTT_PHYSICAL 0x0002 #define ACPI_PMTT_MEMORY_TYPE 0x000C /* * PMTT subtables, correspond to Type in acpi_pmtt_header */ /* 0: Socket Structure */ typedef struct acpi_pmtt_socket { ACPI_PMTT_HEADER Header; UINT16 SocketId; UINT16 Reserved; } ACPI_PMTT_SOCKET; /* * Immediately followed by: * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount]; */ /* 1: Memory Controller subtable */ typedef struct acpi_pmtt_controller { ACPI_PMTT_HEADER Header; UINT16 ControllerId; UINT16 Reserved; } ACPI_PMTT_CONTROLLER; /* * Immediately followed by: * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount]; */ /* 2: Physical Component Identifier (DIMM) */ typedef struct acpi_pmtt_physical_component { ACPI_PMTT_HEADER Header; UINT32 BiosHandle; } ACPI_PMTT_PHYSICAL_COMPONENT; /* 0xFF: Vendor Specific Data */ typedef struct acpi_pmtt_vendor_specific { ACPI_PMTT_HEADER Header; UINT8 TypeUuid[16]; UINT8 Specific[]; /* * Immediately followed by: * UINT8 VendorSpecificData[]; * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount]; */ } ACPI_PMTT_VENDOR_SPECIFIC; /******************************************************************************* * * PPTT - Processor Properties Topology Table (ACPI 6.2) * Version 1 * ******************************************************************************/ typedef struct acpi_table_pptt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_PPTT; /* Values for Type field above */ enum AcpiPpttType { ACPI_PPTT_TYPE_PROCESSOR = 0, ACPI_PPTT_TYPE_CACHE = 1, ACPI_PPTT_TYPE_ID = 2, ACPI_PPTT_TYPE_RESERVED = 3 }; /* 0: Processor Hierarchy Node Structure */ typedef struct acpi_pptt_processor { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; UINT32 Flags; UINT32 Parent; UINT32 AcpiProcessorId; UINT32 NumberOfPrivResources; } ACPI_PPTT_PROCESSOR; /* Flags */ #define ACPI_PPTT_PHYSICAL_PACKAGE (1) #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1) #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */ #define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */ #define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */ /* 1: Cache Type Structure */ typedef struct acpi_pptt_cache { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; UINT32 Flags; UINT32 NextLevelOfCache; UINT32 Size; UINT32 NumberOfSets; UINT8 Associativity; UINT8 Attributes; UINT16 LineSize; } ACPI_PPTT_CACHE; /* 1: Cache Type Structure for PPTT version 3 */ typedef struct acpi_pptt_cache_v1 { UINT32 CacheId; } ACPI_PPTT_CACHE_V1; /* Flags */ #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */ #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */ #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */ #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */ #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */ #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */ #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */ #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */ /* Masks for Attributes */ #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */ #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ /* Attributes describing cache */ #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */ #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */ #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */ #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */ #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */ #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */ #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */ #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */ #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */ #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */ /* 2: ID Structure */ typedef struct acpi_pptt_id { ACPI_SUBTABLE_HEADER Header; UINT16 Reserved; UINT32 VendorId; UINT64 Level1Id; UINT64 Level2Id; UINT16 MajorRev; UINT16 MinorRev; UINT16 SpinRev; } ACPI_PPTT_ID; /******************************************************************************* * * PRMT - Platform Runtime Mechanism Table * Version 1 * ******************************************************************************/ typedef struct acpi_table_prmt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_PRMT; typedef struct acpi_table_prmt_header { UINT8 PlatformGuid[16]; UINT32 ModuleInfoOffset; UINT32 ModuleInfoCount; } ACPI_TABLE_PRMT_HEADER; typedef struct acpi_prmt_module_header { UINT16 Revision; UINT16 Length; } ACPI_PRMT_MODULE_HEADER; typedef struct acpi_prmt_module_info { UINT16 Revision; UINT16 Length; UINT8 ModuleGuid[16]; UINT16 MajorRev; UINT16 MinorRev; UINT16 HandlerInfoCount; UINT32 HandlerInfoOffset; UINT64 MmioListPointer; } ACPI_PRMT_MODULE_INFO; typedef struct acpi_prmt_handler_info { UINT16 Revision; UINT16 Length; UINT8 HandlerGuid[16]; UINT64 HandlerAddress; UINT64 StaticDataBufferAddress; UINT64 AcpiParamBufferAddress; } ACPI_PRMT_HANDLER_INFO; /******************************************************************************* * * RASF - RAS Feature Table (ACPI 5.0) * Version 1 * ******************************************************************************/ typedef struct acpi_table_rasf { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 ChannelId[12]; } ACPI_TABLE_RASF; /* RASF Platform Communication Channel Shared Memory Region */ typedef struct acpi_rasf_shared_memory { UINT32 Signature; UINT16 Command; UINT16 Status; UINT16 Version; UINT8 Capabilities[16]; UINT8 SetCapabilities[16]; UINT16 NumParameterBlocks; UINT32 SetCapabilitiesStatus; } ACPI_RASF_SHARED_MEMORY; /* RASF Parameter Block Structure Header */ typedef struct acpi_rasf_parameter_block { UINT16 Type; UINT16 Version; UINT16 Length; } ACPI_RASF_PARAMETER_BLOCK; /* RASF Parameter Block Structure for PATROL_SCRUB */ typedef struct acpi_rasf_patrol_scrub_parameter { ACPI_RASF_PARAMETER_BLOCK Header; UINT16 PatrolScrubCommand; UINT64 RequestedAddressRange[2]; UINT64 ActualAddressRange[2]; UINT16 Flags; UINT8 RequestedSpeed; } ACPI_RASF_PATROL_SCRUB_PARAMETER; /* Masks for Flags and Speed fields above */ #define ACPI_RASF_SCRUBBER_RUNNING 1 #define ACPI_RASF_SPEED (7<<1) #define ACPI_RASF_SPEED_SLOW (0<<1) #define ACPI_RASF_SPEED_MEDIUM (4<<1) #define ACPI_RASF_SPEED_FAST (7<<1) /* Channel Commands */ enum AcpiRasfCommands { ACPI_RASF_EXECUTE_RASF_COMMAND = 1 }; /* Platform RAS Capabilities */ enum AcpiRasfCapabiliities { ACPI_HW_PATROL_SCRUB_SUPPORTED = 0, ACPI_SW_PATROL_SCRUB_EXPOSED = 1 }; /* Patrol Scrub Commands */ enum AcpiRasfPatrolScrubCommands { ACPI_RASF_GET_PATROL_PARAMETERS = 1, ACPI_RASF_START_PATROL_SCRUBBER = 2, ACPI_RASF_STOP_PATROL_SCRUBBER = 3 }; /* Channel Command flags */ #define ACPI_RASF_GENERATE_SCI (1<<15) /* Status values */ enum AcpiRasfStatus { ACPI_RASF_SUCCESS = 0, ACPI_RASF_NOT_VALID = 1, ACPI_RASF_NOT_SUPPORTED = 2, ACPI_RASF_BUSY = 3, ACPI_RASF_FAILED = 4, ACPI_RASF_ABORTED = 5, ACPI_RASF_INVALID_DATA = 6 }; /* Status flags */ #define ACPI_RASF_COMMAND_COMPLETE (1) #define ACPI_RASF_SCI_DOORBELL (1<<1) #define ACPI_RASF_ERROR (1<<2) #define ACPI_RASF_STATUS (0x1F<<3) /******************************************************************************* * * RGRT - Regulatory Graphics Resource Table * Version 1 * * Conforms to "ACPI RGRT" available at: * https://microsoft.github.io/mu/dyn/mu_plus/MsCorePkg/AcpiRGRT/feature_acpi_rgrt/ * ******************************************************************************/ typedef struct acpi_table_rgrt { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT16 Version; UINT8 ImageType; UINT8 Reserved; UINT8 Image[]; } ACPI_TABLE_RGRT; /* ImageType values */ enum AcpiRgrtImageType { ACPI_RGRT_TYPE_RESERVED0 = 0, ACPI_RGRT_IMAGE_TYPE_PNG = 1, ACPI_RGRT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ }; /******************************************************************************* * * SBST - Smart Battery Specification Table * Version 1 * ******************************************************************************/ typedef struct acpi_table_sbst { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 WarningLevel; UINT32 LowLevel; UINT32 CriticalLevel; } ACPI_TABLE_SBST; /******************************************************************************* * * SDEI - Software Delegated Exception Interface Descriptor Table * * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A, * May 8th, 2017. Copyright 2017 ARM Ltd. * ******************************************************************************/ typedef struct acpi_table_sdei { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_SDEI; /******************************************************************************* * * SDEV - Secure Devices Table (ACPI 6.2) * Version 1 * ******************************************************************************/ typedef struct acpi_table_sdev { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ } ACPI_TABLE_SDEV; typedef struct acpi_sdev_header { UINT8 Type; UINT8 Flags; UINT16 Length; } ACPI_SDEV_HEADER; /* Values for subtable type above */ enum AcpiSdevType { ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0, ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1, ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */ }; /* Values for flags above */ #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1) #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1) /* * SDEV subtables */ /* 0: Namespace Device Based Secure Device Structure */ typedef struct acpi_sdev_namespace { ACPI_SDEV_HEADER Header; UINT16 DeviceIdOffset; UINT16 DeviceIdLength; UINT16 VendorDataOffset; UINT16 VendorDataLength; } ACPI_SDEV_NAMESPACE; typedef struct acpi_sdev_secure_component { UINT16 SecureComponentOffset; UINT16 SecureComponentLength; } ACPI_SDEV_SECURE_COMPONENT; /* * SDEV sub-subtables ("Components") for above */ typedef struct acpi_sdev_component { ACPI_SDEV_HEADER Header; } ACPI_SDEV_COMPONENT; /* Values for sub-subtable type above */ enum AcpiSacType { ACPI_SDEV_TYPE_ID_COMPONENT = 0, ACPI_SDEV_TYPE_MEM_COMPONENT = 1 }; typedef struct acpi_sdev_id_component { ACPI_SDEV_HEADER Header; UINT16 HardwareIdOffset; UINT16 HardwareIdLength; UINT16 SubsystemIdOffset; UINT16 SubsystemIdLength; UINT16 HardwareRevision; UINT8 HardwareRevPresent; UINT8 ClassCodePresent; UINT8 PciBaseClass; UINT8 PciSubClass; UINT8 PciProgrammingXface; } ACPI_SDEV_ID_COMPONENT; typedef struct acpi_sdev_mem_component { ACPI_SDEV_HEADER Header; UINT32 Reserved; UINT64 MemoryBaseAddress; UINT64 MemoryLength; } ACPI_SDEV_MEM_COMPONENT; /* 1: PCIe Endpoint Device Based Device Structure */ typedef struct acpi_sdev_pcie { ACPI_SDEV_HEADER Header; UINT16 Segment; UINT16 StartBus; UINT16 PathOffset; UINT16 PathLength; UINT16 VendorDataOffset; UINT16 VendorDataLength; } ACPI_SDEV_PCIE; /* 1a: PCIe Endpoint path entry */ typedef struct acpi_sdev_pcie_path { UINT8 Device; UINT8 Function; } ACPI_SDEV_PCIE_PATH; /******************************************************************************* * * SVKL - Storage Volume Key Location Table (ACPI 6.4) * From: "Guest-Host-Communication Interface (GHCI) for Intel * Trust Domain Extensions (Intel TDX)". * Version 1 * ******************************************************************************/ typedef struct acpi_table_svkl { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Count; } ACPI_TABLE_SVKL; typedef struct acpi_svkl_key { UINT16 Type; UINT16 Format; UINT32 Size; UINT64 Address; } ACPI_SVKL_KEY; enum acpi_svkl_type { ACPI_SVKL_TYPE_MAIN_STORAGE = 0, ACPI_SVKL_TYPE_RESERVED = 1 /* 1 and greater are reserved */ }; enum acpi_svkl_format { ACPI_SVKL_FORMAT_RAW_BINARY = 0, ACPI_SVKL_FORMAT_RESERVED = 1 /* 1 and greater are reserved */ }; /******************************************************************************* * * TDEL - TD-Event Log * From: "Guest-Host-Communication Interface (GHCI) for Intel * Trust Domain Extensions (Intel TDX)". * September 2020 * ******************************************************************************/ typedef struct acpi_table_tdel { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 Reserved; UINT64 LogAreaMinimumLength; UINT64 LogAreaStartAddress; } ACPI_TABLE_TDEL; /* Reset to default packing */ #pragma pack() #endif /* __ACTBL2_H__ */ diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h index 99588f6717a0..92da002ab6b3 100644 --- a/sys/contrib/dev/acpica/include/actypes.h +++ b/sys/contrib/dev/acpica/include/actypes.h @@ -1,1570 +1,1577 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACTYPES_H__ #define __ACTYPES_H__ /* acpisrc:StructDefs -- for acpisrc conversion */ /* * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent * header and must be either 32 or 64. 16-bit ACPICA is no longer * supported, as of 12/2006. */ #ifndef ACPI_MACHINE_WIDTH #error ACPI_MACHINE_WIDTH not defined #endif /* * Data type ranges * Note: These macros are designed to be compiler independent as well as * working around problems that some 32-bit compilers have with 64-bit * constants. */ #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ #define ACPI_ASCII_MAX 0x7F /* * Architecture-specific ACPICA Subsystem Data Types * * The goal of these types is to provide source code portability across * 16-bit, 32-bit, and 64-bit targets. * * 1) The following types are of fixed size for all targets (16/32/64): * * BOOLEAN Logical boolean * * UINT8 8-bit (1 byte) unsigned value * UINT16 16-bit (2 byte) unsigned value * UINT32 32-bit (4 byte) unsigned value * UINT64 64-bit (8 byte) unsigned value * * INT16 16-bit (2 byte) signed value * INT32 32-bit (4 byte) signed value * INT64 64-bit (8 byte) signed value * * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the * compiler-dependent header(s) and were introduced because there is no * common 64-bit integer type across the various compilation models, as * shown in the table below. * * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit * char 8 8 8 8 8 8 * short 16 16 16 16 16 16 * _int32 32 * int 32 64 32 32 16 16 * long 64 64 32 32 32 32 * long long 64 64 * pointer 64 64 64 32 32 32 * * Note: ILP64 and LP32 are currently not supported. * * * 2) These types represent the native word size of the target mode of the * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are * usually used for memory allocation, efficient loop counters, and array * indexes. The types are similar to the size_t type in the C library and * are required because there is no C type that consistently represents the * native data width. ACPI_SIZE is needed because there is no guarantee * that a kernel-level C library is present. * * ACPI_SIZE 16/32/64-bit unsigned value * ACPI_NATIVE_INT 16/32/64-bit signed value */ /******************************************************************************* * * Common types for all compilers, all targets * ******************************************************************************/ #ifndef ACPI_USE_SYSTEM_INTTYPES typedef unsigned char BOOLEAN; typedef unsigned char UINT8; typedef unsigned short UINT16; typedef short INT16; typedef COMPILER_DEPENDENT_UINT64 UINT64; typedef COMPILER_DEPENDENT_INT64 INT64; #endif /* ACPI_USE_SYSTEM_INTTYPES */ /* * Value returned by AcpiOsGetThreadId. There is no standard "thread_id" * across operating systems or even the various UNIX systems. Since ACPICA * only needs the thread ID as a unique thread identifier, we use a UINT64 * as the only common data type - it will accommodate any type of pointer or * any type of integer. It is up to the host-dependent OSL to cast the * native thread ID type to a UINT64 (in AcpiOsGetThreadId). */ #define ACPI_THREAD_ID UINT64 /******************************************************************************* * * Types specific to 64-bit targets * ******************************************************************************/ #if ACPI_MACHINE_WIDTH == 64 #ifndef ACPI_USE_SYSTEM_INTTYPES typedef unsigned int UINT32; typedef int INT32; #endif /* ACPI_USE_SYSTEM_INTTYPES */ typedef INT64 ACPI_NATIVE_INT; typedef UINT64 ACPI_SIZE; typedef UINT64 ACPI_IO_ADDRESS; typedef UINT64 ACPI_PHYSICAL_ADDRESS; #define ACPI_MAX_PTR ACPI_UINT64_MAX #define ACPI_SIZE_MAX ACPI_UINT64_MAX #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ #define ACPI_USE_NATIVE_MATH64 /* Has native 64-bit integer support */ /* * In the case of the Itanium Processor Family (IPF), the hardware does not * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED * flag to indicate that special precautions must be taken to avoid alignment * faults. (IA64 or ia64 is currently used by existing compilers to indicate * IPF.) * * Note: EM64T and other X86-64 processors support misaligned transfers, * so there is no need to define this flag. */ #if defined (__IA64__) || defined (__ia64__) #define ACPI_MISALIGNMENT_NOT_SUPPORTED #endif /******************************************************************************* * * Types specific to 32-bit targets * ******************************************************************************/ #elif ACPI_MACHINE_WIDTH == 32 #ifndef ACPI_USE_SYSTEM_INTTYPES typedef unsigned int UINT32; typedef int INT32; #endif /* ACPI_USE_SYSTEM_INTTYPES */ typedef INT32 ACPI_NATIVE_INT; typedef UINT32 ACPI_SIZE; #ifdef ACPI_32BIT_PHYSICAL_ADDRESS /* * OSPMs can define this to shrink the size of the structures for 32-bit * none PAE environment. ASL compiler may always define this to generate * 32-bit OSPM compliant tables. */ typedef UINT32 ACPI_IO_ADDRESS; typedef UINT32 ACPI_PHYSICAL_ADDRESS; #else /* ACPI_32BIT_PHYSICAL_ADDRESS */ /* * It is reported that, after some calculations, the physical addresses can * wrap over the 32-bit boundary on 32-bit PAE environment. * https://bugzilla.kernel.org/show_bug.cgi?id=87971 */ typedef UINT64 ACPI_IO_ADDRESS; typedef UINT64 ACPI_PHYSICAL_ADDRESS; #endif /* ACPI_32BIT_PHYSICAL_ADDRESS */ #define ACPI_MAX_PTR ACPI_UINT32_MAX #define ACPI_SIZE_MAX ACPI_UINT32_MAX #else /* ACPI_MACHINE_WIDTH must be either 64 or 32 */ #error unknown ACPI_MACHINE_WIDTH #endif /******************************************************************************* * * OS-dependent types * * If the defaults below are not appropriate for the host system, they can * be defined in the OS-specific header, and this will take precedence. * ******************************************************************************/ /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */ #ifndef ACPI_CPU_FLAGS #define ACPI_CPU_FLAGS ACPI_SIZE #endif /* Object returned from AcpiOsCreateCache */ #ifndef ACPI_CACHE_T #ifdef ACPI_USE_LOCAL_CACHE #define ACPI_CACHE_T ACPI_MEMORY_LIST #else #define ACPI_CACHE_T void * #endif #endif /* * Synchronization objects - Mutexes, Semaphores, and SpinLocks */ #if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE) /* * These macros are used if the host OS does not support a mutex object. * Map the OSL Mutex interfaces to binary semaphores. */ #define ACPI_MUTEX ACPI_SEMAPHORE #define AcpiOsCreateMutex(OutHandle) AcpiOsCreateSemaphore (1, 1, OutHandle) #define AcpiOsDeleteMutex(Handle) (void) AcpiOsDeleteSemaphore (Handle) #define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time) #define AcpiOsReleaseMutex(Handle) (void) AcpiOsSignalSemaphore (Handle, 1) #endif /* Configurable types for synchronization objects */ #ifndef ACPI_SPINLOCK #define ACPI_SPINLOCK void * #endif #ifndef ACPI_SEMAPHORE #define ACPI_SEMAPHORE void * #endif #ifndef ACPI_MUTEX #define ACPI_MUTEX void * #endif /******************************************************************************* * * Compiler-dependent types * * If the defaults below are not appropriate for the host compiler, they can * be defined in the compiler-specific header, and this will take precedence. * ******************************************************************************/ /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ #ifndef ACPI_UINTPTR_T #define ACPI_UINTPTR_T void * #endif /* * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because * some compilers can catch printf format string problems */ #ifndef ACPI_PRINTF_LIKE #define ACPI_PRINTF_LIKE(c) #endif /* * Some compilers complain about unused variables. Sometimes we don't want * to use all the variables (for example, _AcpiModuleName). This allows us * to tell the compiler in a per-variable manner that a variable * is unused */ #ifndef ACPI_UNUSED_VAR #define ACPI_UNUSED_VAR #endif /* * All ACPICA external functions that are available to the rest of the * kernel are tagged with these macros which can be defined as appropriate * for the host. * * Notes: * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination * interfaces that may need special processing. * ACPI_EXPORT_SYMBOL is used for all other public external functions. */ #ifndef ACPI_EXPORT_SYMBOL_INIT #define ACPI_EXPORT_SYMBOL_INIT(Symbol) #endif #ifndef ACPI_EXPORT_SYMBOL #define ACPI_EXPORT_SYMBOL(Symbol) #endif /* * Compiler/Clibrary-dependent debug initialization. Used for ACPICA * utilities only. */ #ifndef ACPI_DEBUG_INITIALIZE #define ACPI_DEBUG_INITIALIZE() #endif /******************************************************************************* * * Configuration * ******************************************************************************/ #ifdef ACPI_NO_MEM_ALLOCATIONS #define ACPI_ALLOCATE(a) NULL #define ACPI_ALLOCATE_ZEROED(a) NULL #define ACPI_FREE(a) #define ACPI_MEM_TRACKING(a) #else /* ACPI_NO_MEM_ALLOCATIONS */ #ifdef ACPI_DBG_TRACK_ALLOCATIONS /* * Memory allocation tracking (used by AcpiExec to detect memory leaks) */ #define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ #define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) #define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) #define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS) #define ACPI_MEM_TRACKING(a) a #else /* * Normal memory allocation directly via the OS services layer */ #define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a)) #define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a)) #define ACPI_FREE(a) AcpiOsFree (a) #define ACPI_MEM_TRACKING(a) #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ #endif /* ACPI_NO_MEM_ALLOCATIONS */ /****************************************************************************** * * ACPI Specification constants (Do not change unless the specification * changes) * *****************************************************************************/ /* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */ #define ACPI_MAX_GPE_BLOCKS 2 /* Default ACPI register widths */ #define ACPI_GPE_REGISTER_WIDTH 8 #define ACPI_PM1_REGISTER_WIDTH 16 #define ACPI_PM2_REGISTER_WIDTH 8 #define ACPI_PM_TIMER_WIDTH 32 #define ACPI_RESET_REGISTER_WIDTH 8 /* Names within the namespace are 4 bytes long */ #define ACPI_NAMESEG_SIZE 4 /* Fixed by ACPI spec */ #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ #define ACPI_PATH_SEPARATOR '.' /* Sizes for ACPI table headers */ #define ACPI_OEM_ID_SIZE 6 #define ACPI_OEM_TABLE_ID_SIZE 8 /* ACPI/PNP hardware IDs */ #define PCI_ROOT_HID_STRING "PNP0A03" #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" /* PM Timer ticks per second (HZ) */ #define ACPI_PM_TIMER_FREQUENCY 3579545 /******************************************************************************* * * Independent types * ******************************************************************************/ /* Logical defines and NULL */ #ifdef FALSE #undef FALSE #endif #define FALSE (1 == 0) #ifdef TRUE #undef TRUE #endif #define TRUE (1 == 1) #ifndef NULL #define NULL (void *) 0 #endif /* * Miscellaneous types */ typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */ typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */ typedef char * ACPI_STRING; /* Null terminated ASCII string */ typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */ /* Time constants for timer calculations */ #define ACPI_MSEC_PER_SEC 1000L #define ACPI_USEC_PER_MSEC 1000L #define ACPI_USEC_PER_SEC 1000000L #define ACPI_100NSEC_PER_USEC 10L #define ACPI_100NSEC_PER_MSEC 10000L #define ACPI_100NSEC_PER_SEC 10000000L #define ACPI_NSEC_PER_USEC 1000L #define ACPI_NSEC_PER_MSEC 1000000L #define ACPI_NSEC_PER_SEC 1000000000L #define ACPI_TIME_AFTER(a, b) ((INT64)((b) - (a)) < 0) /* Owner IDs are used to track namespace nodes for selective deletion */ typedef UINT16 ACPI_OWNER_ID; #define ACPI_OWNER_ID_MAX 0xFFF /* 4095 possible owner IDs */ #define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ #define ACPI_MAX64_DECIMAL_DIGITS 20 #define ACPI_MAX32_DECIMAL_DIGITS 10 #define ACPI_MAX16_DECIMAL_DIGITS 5 #define ACPI_MAX8_DECIMAL_DIGITS 3 /* * Constants with special meanings */ #define ACPI_ROOT_OBJECT ((ACPI_HANDLE) ACPI_TO_POINTER (ACPI_MAX_PTR)) #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */ #define ACPI_DO_NOT_WAIT 0 /* * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits. * Note that this pertains to the ACPI integer type only, not to other * integers used in the implementation of the ACPICA subsystem. * * 01/2010: This type is obsolete and has been removed from the entire ACPICA * code base. It remains here for compatibility with device drivers that use * the type. However, it will be removed in the future. */ typedef UINT64 ACPI_INTEGER; #define ACPI_INTEGER_MAX ACPI_UINT64_MAX /******************************************************************************* * * Commonly used macros * ******************************************************************************/ /* Data manipulation */ #define ACPI_LOBYTE(Integer) ((UINT8) (UINT16)(Integer)) #define ACPI_HIBYTE(Integer) ((UINT8) (((UINT16)(Integer)) >> 8)) #define ACPI_LOWORD(Integer) ((UINT16) (UINT32)(Integer)) #define ACPI_HIWORD(Integer) ((UINT16)(((UINT32)(Integer)) >> 16)) #define ACPI_LODWORD(Integer64) ((UINT32) (UINT64)(Integer64)) #define ACPI_HIDWORD(Integer64) ((UINT32)(((UINT64)(Integer64)) >> 32)) #define ACPI_SET_BIT(target,bit) ((target) |= (bit)) #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) #define ACPI_MAX(a,b) (((a)>(b))?(a):(b)) /* Size calculation */ #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) /* Pointer manipulation */ #define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b))) #define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) #define ACPI_PTR_DIFF(a, b) ((ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b)))) /* Pointer/Integer type conversions */ #define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i)) #ifndef ACPI_TO_INTEGER #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0) #endif #ifndef ACPI_OFFSET #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0) #endif #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) /* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */ #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_COMPARE_NAMESEG(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) #define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) #else #define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE)) #define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE)) #endif /* Support for the special RSDP signature (8 characters) */ #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) /* Support for OEMx signature (x can be any character) */ #define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\ strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE) /* * Algorithm to obtain access bit or byte width. * Can be used with AccessSize field of ACPI_GENERIC_ADDRESS and * ACPI_RESOURCE_GENERIC_REGISTER. */ #define ACPI_ACCESS_BIT_SHIFT 2 #define ACPI_ACCESS_BYTE_SHIFT -1 #define ACPI_ACCESS_BIT_MAX (31 - ACPI_ACCESS_BIT_SHIFT) #define ACPI_ACCESS_BYTE_MAX (31 - ACPI_ACCESS_BYTE_SHIFT) #define ACPI_ACCESS_BIT_DEFAULT (8 - ACPI_ACCESS_BIT_SHIFT) #define ACPI_ACCESS_BYTE_DEFAULT (8 - ACPI_ACCESS_BYTE_SHIFT) #define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + ACPI_ACCESS_BIT_SHIFT)) #define ACPI_ACCESS_BYTE_WIDTH(size) (1 << ((size) + ACPI_ACCESS_BYTE_SHIFT)) /******************************************************************************* * * Miscellaneous constants * ******************************************************************************/ /* * Initialization sequence options */ #define ACPI_FULL_INITIALIZATION 0x0000 #define ACPI_NO_FACS_INIT 0x0001 #define ACPI_NO_ACPI_ENABLE 0x0002 #define ACPI_NO_HARDWARE_INIT 0x0004 #define ACPI_NO_EVENT_INIT 0x0008 #define ACPI_NO_HANDLER_INIT 0x0010 #define ACPI_NO_OBJECT_INIT 0x0020 #define ACPI_NO_DEVICE_INIT 0x0040 #define ACPI_NO_ADDRESS_SPACE_INIT 0x0080 /* * Initialization state */ #define ACPI_SUBSYSTEM_INITIALIZE 0x01 #define ACPI_INITIALIZED_OK 0x02 /* * Power state values */ #define ACPI_STATE_UNKNOWN (UINT8) 0xFF #define ACPI_STATE_S0 (UINT8) 0 #define ACPI_STATE_S1 (UINT8) 1 #define ACPI_STATE_S2 (UINT8) 2 #define ACPI_STATE_S3 (UINT8) 3 #define ACPI_STATE_S4 (UINT8) 4 #define ACPI_STATE_S5 (UINT8) 5 #define ACPI_S_STATES_MAX ACPI_STATE_S5 #define ACPI_S_STATE_COUNT 6 #define ACPI_STATE_D0 (UINT8) 0 #define ACPI_STATE_D1 (UINT8) 1 #define ACPI_STATE_D2 (UINT8) 2 #define ACPI_STATE_D3 (UINT8) 3 #define ACPI_D_STATES_MAX ACPI_STATE_D3 #define ACPI_D_STATE_COUNT 4 #define ACPI_STATE_C0 (UINT8) 0 #define ACPI_STATE_C1 (UINT8) 1 #define ACPI_STATE_C2 (UINT8) 2 #define ACPI_STATE_C3 (UINT8) 3 #define ACPI_C_STATES_MAX ACPI_STATE_C3 #define ACPI_C_STATE_COUNT 4 /* * Sleep type invalid value */ #define ACPI_SLEEP_TYPE_MAX 0x7 #define ACPI_SLEEP_TYPE_INVALID 0xFF /* * Standard notify values */ #define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00 #define ACPI_NOTIFY_DEVICE_CHECK (UINT8) 0x01 #define ACPI_NOTIFY_DEVICE_WAKE (UINT8) 0x02 #define ACPI_NOTIFY_EJECT_REQUEST (UINT8) 0x03 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (UINT8) 0x04 #define ACPI_NOTIFY_FREQUENCY_MISMATCH (UINT8) 0x05 #define ACPI_NOTIFY_BUS_MODE_MISMATCH (UINT8) 0x06 #define ACPI_NOTIFY_POWER_FAULT (UINT8) 0x07 #define ACPI_NOTIFY_CAPABILITIES_CHECK (UINT8) 0x08 #define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09 #define ACPI_NOTIFY_RESERVED (UINT8) 0x0A #define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B #define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C #define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D #define ACPI_NOTIFY_MEMORY_UPDATE (UINT8) 0x0E #define ACPI_NOTIFY_DISCONNECT_RECOVER (UINT8) 0x0F #define ACPI_GENERIC_NOTIFY_MAX 0x0F #define ACPI_SPECIFIC_NOTIFY_MAX 0x84 /* * Types associated with ACPI names and objects. The first group of * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore, * only add to the first group if the spec changes. * * NOTE: Types must be kept in sync with the global AcpiNsProperties * and AcpiNsTypeNames arrays. */ typedef UINT32 ACPI_OBJECT_TYPE; #define ACPI_TYPE_ANY 0x00 #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ #define ACPI_TYPE_STRING 0x02 #define ACPI_TYPE_BUFFER 0x03 #define ACPI_TYPE_PACKAGE 0x04 /* ByteConst, multiple DataTerm/Constant/SuperName */ #define ACPI_TYPE_FIELD_UNIT 0x05 #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ #define ACPI_TYPE_EVENT 0x07 #define ACPI_TYPE_METHOD 0x08 /* Name, ByteConst, multiple Code */ #define ACPI_TYPE_MUTEX 0x09 #define ACPI_TYPE_REGION 0x0A #define ACPI_TYPE_POWER 0x0B /* Name,ByteConst,WordConst,multi Node */ #define ACPI_TYPE_PROCESSOR 0x0C /* Name,ByteConst,DWordConst,ByteConst,multi NmO */ #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ #define ACPI_TYPE_BUFFER_FIELD 0x0E #define ACPI_TYPE_DDB_HANDLE 0x0F #define ACPI_TYPE_DEBUG_OBJECT 0x10 #define ACPI_TYPE_EXTERNAL_MAX 0x10 #define ACPI_NUM_TYPES (ACPI_TYPE_EXTERNAL_MAX + 1) /* * These are object types that do not map directly to the ACPI * ObjectType() operator. They are used for various internal purposes * only. If new predefined ACPI_TYPEs are added (via the ACPI * specification), these internal types must move upwards. (There * is code that depends on these values being contiguous with the * external types above.) */ #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, RefOf, Index */ #define ACPI_TYPE_LOCAL_ALIAS 0x15 #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 #define ACPI_TYPE_LOCAL_NOTIFY 0x17 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 #define ACPI_TYPE_LOCAL_RESOURCE 0x19 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */ #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ #define ACPI_TOTAL_TYPES (ACPI_TYPE_NS_NODE_MAX + 1) /* * These are special object types that never appear in * a Namespace node, only in an object of ACPI_OPERAND_OBJECT */ #define ACPI_TYPE_LOCAL_EXTRA 0x1C #define ACPI_TYPE_LOCAL_DATA 0x1D #define ACPI_TYPE_LOCAL_MAX 0x1D /* All types above here are invalid */ #define ACPI_TYPE_INVALID 0x1E #define ACPI_TYPE_NOT_FOUND 0xFF #define ACPI_NUM_NS_TYPES (ACPI_TYPE_INVALID + 1) /* * All I/O */ #define ACPI_READ 0 #define ACPI_WRITE 1 #define ACPI_IO_MASK 1 /* * Event Types: Fixed & General Purpose */ typedef UINT32 ACPI_EVENT_TYPE; /* * Fixed events */ #define ACPI_EVENT_PMTIMER 0 #define ACPI_EVENT_GLOBAL 1 #define ACPI_EVENT_POWER_BUTTON 2 #define ACPI_EVENT_SLEEP_BUTTON 3 #define ACPI_EVENT_RTC 4 -#define ACPI_EVENT_MAX 4 +#define ACPI_EVENT_PCIE_WAKE 5 +#define ACPI_EVENT_MAX 5 #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 /* * Event Status - Per event * ------------- * The encoding of ACPI_EVENT_STATUS is illustrated below. * Note that a set bit (1) indicates the property is TRUE * (e.g. if bit 0 is set then the event is enabled). * +-------------+-+-+-+-+-+-+ * | Bits 31:6 |5|4|3|2|1|0| * +-------------+-+-+-+-+-+-+ * | | | | | | | * | | | | | | +- Enabled? * | | | | | +--- Enabled for wake? * | | | | +----- Status bit set? * | | | +------- Enable bit set? * | | +--------- Has a handler? * | +----------- Masked? * +----------------- */ typedef UINT32 ACPI_EVENT_STATUS; #define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00 #define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01 #define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02 #define ACPI_EVENT_FLAG_STATUS_SET (ACPI_EVENT_STATUS) 0x04 #define ACPI_EVENT_FLAG_ENABLE_SET (ACPI_EVENT_STATUS) 0x08 #define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x10 #define ACPI_EVENT_FLAG_MASKED (ACPI_EVENT_STATUS) 0x20 #define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */ #define ACPI_GPE_ENABLE 0 #define ACPI_GPE_DISABLE 1 #define ACPI_GPE_CONDITIONAL_ENABLE 2 /* * GPE info flags - Per GPE * +---+-+-+-+---+ * |7:6|5|4|3|2:0| * +---+-+-+-+---+ * | | | | | * | | | | +-- Type of dispatch:to method, handler, notify, or none * | | | +----- Interrupt type: edge or level triggered * | | +------- Is a Wake GPE * | +--------- Has been enabled automatically at init time * +------------ */ #define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00 #define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01 #define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02 #define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03 #define ACPI_GPE_DISPATCH_RAW_HANDLER (UINT8) 0x04 #define ACPI_GPE_DISPATCH_MASK (UINT8) 0x07 #define ACPI_GPE_DISPATCH_TYPE(flags) ((UINT8) ((flags) & ACPI_GPE_DISPATCH_MASK)) #define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x08 #define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00 #define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x08 #define ACPI_GPE_CAN_WAKE (UINT8) 0x10 #define ACPI_GPE_AUTO_ENABLED (UINT8) 0x20 #define ACPI_GPE_INITIALIZED (UINT8) 0x40 /* * Flags for GPE and Lock interfaces */ #define ACPI_NOT_ISR 0x1 #define ACPI_ISR 0x0 /* Notify types */ #define ACPI_SYSTEM_NOTIFY 0x1 #define ACPI_DEVICE_NOTIFY 0x2 #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 #define ACPI_NUM_NOTIFY_TYPES 2 #define ACPI_MAX_SYS_NOTIFY 0x7F #define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF #define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */ #define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */ /* Address Space (Operation Region) Types */ typedef UINT8 ACPI_ADR_SPACE_TYPE; #define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0 #define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1 #define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2 #define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3 #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 #define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 #define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8 #define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9 #define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10 #define ACPI_ADR_SPACE_PLATFORM_RT (ACPI_ADR_SPACE_TYPE) 11 #define ACPI_NUM_PREDEFINED_REGIONS 12 /* * Special Address Spaces * * Note: A Data Table region is a special type of operation region * that has its own AML opcode. However, internally, the AML * interpreter simply creates an operation region with an address * space type of ACPI_ADR_SPACE_DATA_TABLE. */ #define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */ #define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F /* Values for _REG connection code */ #define ACPI_REG_DISCONNECT 0 #define ACPI_REG_CONNECT 1 /* * BitRegister IDs * * These values are intended to be used by the hardware interfaces * and are mapped to individual bitfields defined within the ACPI * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c * for this mapping. */ /* PM1 Status register */ #define ACPI_BITREG_TIMER_STATUS 0x00 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 #define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 #define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 #define ACPI_BITREG_RT_CLOCK_STATUS 0x05 #define ACPI_BITREG_WAKE_STATUS 0x06 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 /* PM1 Enable register */ #define ACPI_BITREG_TIMER_ENABLE 0x08 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09 #define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A #define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B #define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C #define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0D /* PM1 Control register */ #define ACPI_BITREG_SCI_ENABLE 0x0E #define ACPI_BITREG_BUS_MASTER_RLD 0x0F #define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10 #define ACPI_BITREG_SLEEP_TYPE 0x11 #define ACPI_BITREG_SLEEP_ENABLE 0x12 /* PM2 Control register */ #define ACPI_BITREG_ARB_DISABLE 0x13 #define ACPI_BITREG_MAX 0x13 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 /* Status register values. A 1 clears a status bit. 0 = no effect */ #define ACPI_CLEAR_STATUS 1 /* Enable and Control register values */ #define ACPI_ENABLE_EVENT 1 #define ACPI_DISABLE_EVENT 0 /* Sleep function dispatch */ typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) ( UINT8 SleepState); typedef struct acpi_sleep_functions { ACPI_SLEEP_FUNCTION LegacyFunction; ACPI_SLEEP_FUNCTION ExtendedFunction; } ACPI_SLEEP_FUNCTIONS; /* * External ACPI object definition */ /* * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package * element or an unresolved named reference. */ typedef union acpi_object { ACPI_OBJECT_TYPE Type; /* See definition of AcpiNsType for values */ struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ UINT64 Value; /* The actual number */ } Integer; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_STRING */ UINT32 Length; /* # of bytes in string, excluding trailing null */ char *Pointer; /* points to the string value */ } String; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_BUFFER */ UINT32 Length; /* # of bytes in buffer */ UINT8 *Pointer; /* points to the buffer */ } Buffer; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PACKAGE */ UINT32 Count; /* # of elements in package */ union acpi_object *Elements; /* Pointer to an array of ACPI_OBJECTs */ } Package; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_LOCAL_REFERENCE */ ACPI_OBJECT_TYPE ActualType; /* Type associated with the Handle */ ACPI_HANDLE Handle; /* object reference */ } Reference; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PROCESSOR */ UINT32 ProcId; ACPI_IO_ADDRESS PblkAddress; UINT32 PblkLength; } Processor; struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_POWER */ UINT32 SystemLevel; UINT32 ResourceOrder; } PowerResource; } ACPI_OBJECT; /* * List of objects, used as a parameter list for control method evaluation */ typedef struct acpi_object_list { UINT32 Count; ACPI_OBJECT *Pointer; } ACPI_OBJECT_LIST; /* * Miscellaneous common Data Structures used by the interfaces */ #define ACPI_NO_BUFFER 0 #ifdef ACPI_NO_MEM_ALLOCATIONS #define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0) #define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0) #else /* ACPI_NO_MEM_ALLOCATIONS */ #define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */ #define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */ #endif /* ACPI_NO_MEM_ALLOCATIONS */ typedef struct acpi_buffer { ACPI_SIZE Length; /* Length in bytes of the buffer */ void *Pointer; /* pointer to buffer */ } ACPI_BUFFER; /* * NameType for AcpiGetName */ #define ACPI_FULL_PATHNAME 0 #define ACPI_SINGLE_NAME 1 #define ACPI_FULL_PATHNAME_NO_TRAILING 2 #define ACPI_NAME_TYPE_MAX 2 /* * Predefined Namespace items */ typedef struct acpi_predefined_names { const char *Name; UINT8 Type; char *Val; } ACPI_PREDEFINED_NAMES; /* * Structure and flags for AcpiGetSystemInfo */ #define ACPI_SYS_MODE_UNKNOWN 0x0000 #define ACPI_SYS_MODE_ACPI 0x0001 #define ACPI_SYS_MODE_LEGACY 0x0002 #define ACPI_SYS_MODES_MASK 0x0003 /* * System info returned by AcpiGetSystemInfo() */ typedef struct acpi_system_info { UINT32 AcpiCaVersion; UINT32 Flags; UINT32 TimerResolution; UINT32 Reserved1; UINT32 Reserved2; UINT32 DebugLevel; UINT32 DebugLayer; } ACPI_SYSTEM_INFO; /* * System statistics returned by AcpiGetStatistics() */ typedef struct acpi_statistics { UINT32 SciCount; UINT32 GpeCount; UINT32 FixedEventCount[ACPI_NUM_FIXED_EVENTS]; UINT32 MethodCount; } ACPI_STATISTICS; /* * Types specific to the OS service interfaces */ typedef UINT32 (ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) ( void *Context); typedef void (ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) ( void *Context); /* * Various handlers and callback procedures */ typedef UINT32 (*ACPI_SCI_HANDLER) ( void *Context); typedef void (*ACPI_GBL_EVENT_HANDLER) ( UINT32 EventType, ACPI_HANDLE Device, UINT32 EventNumber, void *Context); #define ACPI_EVENT_TYPE_GPE 0 #define ACPI_EVENT_TYPE_FIXED 1 typedef UINT32 (*ACPI_EVENT_HANDLER) ( void *Context); typedef UINT32 (*ACPI_GPE_HANDLER) ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, void *Context); typedef void (*ACPI_NOTIFY_HANDLER) ( ACPI_HANDLE Device, UINT32 Value, void *Context); typedef void (*ACPI_OBJECT_HANDLER) ( ACPI_HANDLE Object, void *Data); typedef ACPI_STATUS (*ACPI_INIT_HANDLER) ( ACPI_HANDLE Object, UINT32 Function); #define ACPI_INIT_DEVICE_INI 1 typedef ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) ( ACPI_STATUS AmlStatus, ACPI_NAME Name, UINT16 Opcode, UINT32 AmlOffset, void *Context); /* Table Event handler (Load, LoadTable, etc.) and types */ typedef ACPI_STATUS (*ACPI_TABLE_HANDLER) ( UINT32 Event, void *Table, void *Context); /* Table Event Types */ #define ACPI_TABLE_EVENT_LOAD 0x0 #define ACPI_TABLE_EVENT_UNLOAD 0x1 #define ACPI_TABLE_EVENT_INSTALL 0x2 #define ACPI_TABLE_EVENT_UNINSTALL 0x3 #define ACPI_NUM_TABLE_EVENTS 4 /* Address Spaces (For Operation Regions) */ typedef ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext); #define ACPI_DEFAULT_HANDLER NULL /* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ typedef struct acpi_connection_info { UINT8 *Connection; UINT16 Length; UINT8 AccessLength; } ACPI_CONNECTION_INFO; /* Special Context data for PCC Opregion (ACPI 6.3) */ typedef struct acpi_pcc_info { UINT8 SubspaceId; UINT16 Length; UINT8 *InternalBuffer; } ACPI_PCC_INFO; +/* Special Context data for FFH Opregion (ACPI 6.5) */ + +typedef struct acpi_ffh_info { + UINT64 Offset; + UINT64 Length; +} ACPI_FFH_INFO; typedef ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( ACPI_HANDLE RegionHandle, UINT32 Function, void *HandlerContext, void **RegionContext); #define ACPI_REGION_ACTIVATE 0 #define ACPI_REGION_DEACTIVATE 1 typedef ACPI_STATUS (*ACPI_WALK_CALLBACK) ( ACPI_HANDLE Object, UINT32 NestingLevel, void *Context, void **ReturnValue); typedef UINT32 (*ACPI_INTERFACE_HANDLER) ( ACPI_STRING InterfaceName, UINT32 Supported); /* Interrupt handler return values */ #define ACPI_INTERRUPT_NOT_HANDLED 0x00 #define ACPI_INTERRUPT_HANDLED 0x01 /* GPE handler return values */ #define ACPI_REENABLE_GPE 0x80 /* Length of 32-bit EISAID values when converted back to a string */ #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ /* Length of UUID (string) values */ #define ACPI_UUID_LENGTH 16 /* Length of 3-byte PCI class code values when converted back to a string */ #define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */ /* Structures used for device/processor HID, UID, CID */ typedef struct acpi_pnp_device_id { UINT32 Length; /* Length of string + null */ char *String; } ACPI_PNP_DEVICE_ID; typedef struct acpi_pnp_device_id_list { UINT32 Count; /* Number of IDs in Ids array */ UINT32 ListSize; /* Size of list, including ID strings */ ACPI_PNP_DEVICE_ID Ids[]; /* ID array */ } ACPI_PNP_DEVICE_ID_LIST; /* * Structure returned from AcpiGetObjectInfo. * Optimized for both 32-bit and 64-bit builds. */ typedef struct acpi_device_info { UINT32 InfoSize; /* Size of info, including ID strings */ UINT32 Name; /* ACPI object Name */ ACPI_OBJECT_TYPE Type; /* ACPI object Type */ UINT8 ParamCount; /* If a method, required parameter count */ UINT16 Valid; /* Indicates which optional fields are valid */ UINT8 Flags; /* Miscellaneous info */ UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ UINT64 Address; /* _ADR value */ ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ ACPI_PNP_DEVICE_ID ClassCode; /* _CLS value */ ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ } ACPI_DEVICE_INFO; /* Values for Flags field above (AcpiGetObjectInfo) */ #define ACPI_PCI_ROOT_BRIDGE 0x01 /* Flags for Valid field above (AcpiGetObjectInfo) */ #define ACPI_VALID_ADR 0x0002 #define ACPI_VALID_HID 0x0004 #define ACPI_VALID_UID 0x0008 #define ACPI_VALID_CID 0x0020 #define ACPI_VALID_CLS 0x0040 #define ACPI_VALID_SXDS 0x0100 #define ACPI_VALID_SXWS 0x0200 /* Flags for _STA method */ #define ACPI_STA_DEVICE_PRESENT 0x01 #define ACPI_STA_DEVICE_ENABLED 0x02 #define ACPI_STA_DEVICE_UI 0x04 #define ACPI_STA_DEVICE_FUNCTIONING 0x08 #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ #define ACPI_STA_BATTERY_PRESENT 0x10 /* Context structs for address space handlers */ typedef struct acpi_pci_id { UINT16 Segment; UINT16 Bus; UINT16 Device; UINT16 Function; } ACPI_PCI_ID; typedef struct acpi_mem_mapping { ACPI_PHYSICAL_ADDRESS PhysicalAddress; UINT8 *LogicalAddress; ACPI_SIZE Length; struct acpi_mem_mapping *NextMm; } ACPI_MEM_MAPPING; typedef struct acpi_mem_space_context { UINT32 Length; ACPI_PHYSICAL_ADDRESS Address; ACPI_MEM_MAPPING *CurMm; ACPI_MEM_MAPPING *FirstMm; } ACPI_MEM_SPACE_CONTEXT; typedef struct acpi_data_table_space_context { void *Pointer; } ACPI_DATA_TABLE_MAPPING; /* * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled */ typedef struct acpi_memory_list { const char *ListName; void *ListHead; UINT16 ObjectSize; UINT16 MaxDepth; UINT16 CurrentDepth; #ifdef ACPI_DBG_TRACK_ALLOCATIONS /* Statistics for debug memory tracking only */ UINT32 TotalAllocated; UINT32 TotalFreed; UINT32 MaxOccupied; UINT32 TotalSize; UINT32 CurrentTotalSize; UINT32 Requests; UINT32 Hits; #endif } ACPI_MEMORY_LIST; /* Definitions of trace event types */ typedef enum { ACPI_TRACE_AML_METHOD, ACPI_TRACE_AML_OPCODE, ACPI_TRACE_AML_REGION } ACPI_TRACE_EVENT_TYPE; /* Definitions of _OSI support */ #define ACPI_VENDOR_STRINGS 0x01 #define ACPI_FEATURE_STRINGS 0x02 #define ACPI_ENABLE_INTERFACES 0x00 #define ACPI_DISABLE_INTERFACES 0x04 #define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS) #define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS) #define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) #define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS) #define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS) #define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) #define ACPI_OSI_WIN_2000 0x01 #define ACPI_OSI_WIN_XP 0x02 #define ACPI_OSI_WIN_XP_SP1 0x03 #define ACPI_OSI_WINSRV_2003 0x04 #define ACPI_OSI_WIN_XP_SP2 0x05 #define ACPI_OSI_WINSRV_2003_SP1 0x06 #define ACPI_OSI_WIN_VISTA 0x07 #define ACPI_OSI_WINSRV_2008 0x08 #define ACPI_OSI_WIN_VISTA_SP1 0x09 #define ACPI_OSI_WIN_VISTA_SP2 0x0A #define ACPI_OSI_WIN_7 0x0B #define ACPI_OSI_WIN_8 0x0C #define ACPI_OSI_WIN_8_1 0x0D #define ACPI_OSI_WIN_10 0x0E #define ACPI_OSI_WIN_10_RS1 0x0F #define ACPI_OSI_WIN_10_RS2 0x10 #define ACPI_OSI_WIN_10_RS3 0x11 #define ACPI_OSI_WIN_10_RS4 0x12 #define ACPI_OSI_WIN_10_RS5 0x13 #define ACPI_OSI_WIN_10_19H1 0x14 #define ACPI_OSI_WIN_10_20H1 0x15 #define ACPI_OSI_WIN_11 0x16 /* Definitions of getopt */ #define ACPI_OPT_END -1 /* Definitions for explicit fallthrough */ #ifndef ACPI_FALLTHROUGH #define ACPI_FALLTHROUGH do {} while(0) #endif #endif /* __ACTYPES_H__ */ diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h index 5d49fa137c75..92901860b82d 100644 --- a/sys/contrib/dev/acpica/include/acutils.h +++ b/sys/contrib/dev/acpica/include/acutils.h @@ -1,1278 +1,1303 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef _ACUTILS_H #define _ACUTILS_H extern const UINT8 AcpiGbl_ResourceAmlSizes[]; extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[]; /* Strings used by the disassembler and debugger resource dump routines */ #if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) extern const char *AcpiGbl_BmDecode[]; extern const char *AcpiGbl_ConfigDecode[]; extern const char *AcpiGbl_ConsumeDecode[]; extern const char *AcpiGbl_DecDecode[]; extern const char *AcpiGbl_HeDecode[]; extern const char *AcpiGbl_IoDecode[]; extern const char *AcpiGbl_LlDecode[]; extern const char *AcpiGbl_MaxDecode[]; extern const char *AcpiGbl_MemDecode[]; extern const char *AcpiGbl_MinDecode[]; extern const char *AcpiGbl_MtpDecode[]; extern const char *AcpiGbl_PhyDecode[]; extern const char *AcpiGbl_RngDecode[]; extern const char *AcpiGbl_RwDecode[]; extern const char *AcpiGbl_ShrDecode[]; extern const char *AcpiGbl_SizDecode[]; extern const char *AcpiGbl_TrsDecode[]; extern const char *AcpiGbl_TtpDecode[]; extern const char *AcpiGbl_TypDecode[]; extern const char *AcpiGbl_PpcDecode[]; extern const char *AcpiGbl_IorDecode[]; extern const char *AcpiGbl_DtsDecode[]; extern const char *AcpiGbl_CtDecode[]; extern const char *AcpiGbl_SbtDecode[]; extern const char *AcpiGbl_AmDecode[]; extern const char *AcpiGbl_SmDecode[]; extern const char *AcpiGbl_WmDecode[]; extern const char *AcpiGbl_CphDecode[]; extern const char *AcpiGbl_CpoDecode[]; extern const char *AcpiGbl_DpDecode[]; extern const char *AcpiGbl_EdDecode[]; extern const char *AcpiGbl_BpbDecode[]; extern const char *AcpiGbl_SbDecode[]; extern const char *AcpiGbl_FcDecode[]; extern const char *AcpiGbl_PtDecode[]; extern const char *AcpiGbl_PtypDecode[]; #endif /* * For the iASL compiler case, the output is redirected to stderr so that * any of the various ACPI errors and warnings do not appear in the output * files, for either the compiler or disassembler portions of the tool. */ #ifdef ACPI_ASL_COMPILER #include #define ACPI_MSG_REDIRECT_BEGIN \ FILE *OutputFile = AcpiGbl_OutputFile; \ AcpiOsRedirectOutput (stderr); #define ACPI_MSG_REDIRECT_END \ AcpiOsRedirectOutput (OutputFile); #else /* * non-iASL case - no redirection, nothing to do */ #define ACPI_MSG_REDIRECT_BEGIN #define ACPI_MSG_REDIRECT_END #endif /* * Common error message prefixes */ #ifndef ACPI_MSG_ERROR #define ACPI_MSG_ERROR "ACPI Error: " #endif #ifndef ACPI_MSG_WARNING #define ACPI_MSG_WARNING "ACPI Warning: " #endif #ifndef ACPI_MSG_INFO #define ACPI_MSG_INFO "ACPI: " #endif #ifndef ACPI_MSG_BIOS_ERROR #define ACPI_MSG_BIOS_ERROR "Firmware Error (ACPI): " #endif #ifndef ACPI_MSG_BIOS_WARNING #define ACPI_MSG_BIOS_WARNING "Firmware Warning (ACPI): " #endif /* * Common message suffix */ #define ACPI_MSG_SUFFIX \ AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) /* Flags to indicate implicit or explicit string-to-integer conversion */ #define ACPI_IMPLICIT_CONVERSION TRUE #define ACPI_NO_IMPLICIT_CONVERSION FALSE /* Types for Resource descriptor entries */ #define ACPI_INVALID_RESOURCE 0 #define ACPI_FIXED_LENGTH 1 #define ACPI_VARIABLE_LENGTH 2 #define ACPI_SMALL_VARIABLE_LENGTH 3 typedef ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( UINT8 *Aml, UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, void **Context); typedef ACPI_STATUS (*ACPI_PKG_CALLBACK) ( UINT8 ObjectType, ACPI_OPERAND_OBJECT *SourceObject, ACPI_GENERIC_STATE *State, void *Context); typedef struct acpi_pkg_info { UINT8 *FreeSpace; ACPI_SIZE Length; UINT32 ObjectSpace; UINT32 NumPackages; } ACPI_PKG_INFO; /* Object reference counts */ #define REF_INCREMENT (UINT16) 0 #define REF_DECREMENT (UINT16) 1 /* AcpiUtDumpBuffer */ #define DB_BYTE_DISPLAY 0x01 #define DB_WORD_DISPLAY 0x02 #define DB_DWORD_DISPLAY 0x04 #define DB_QWORD_DISPLAY 0x08 #define DB_DISPLAY_DATA_ONLY 0x10 /* * utascii - ASCII utilities */ BOOLEAN AcpiUtValidNameseg ( char *Signature); BOOLEAN AcpiUtValidNameChar ( char Character, UINT32 Position); void AcpiUtCheckAndRepairAscii ( UINT8 *Name, char *RepairedName, UINT32 Count); +/* + * utcksum - Checksum utilities + */ +UINT8 +AcpiUtGenerateChecksum ( + void *Table, + UINT32 Length, + UINT8 OriginalChecksum); + +UINT8 +AcpiUtChecksum ( + UINT8 *Buffer, + UINT32 Length); + +ACPI_STATUS +AcpiUtVerifyCdatChecksum ( + ACPI_TABLE_CDAT *CdatTable, + UINT32 Length); + +ACPI_STATUS +AcpiUtVerifyChecksum ( + ACPI_TABLE_HEADER *Table, + UINT32 Length); + + /* * utnonansi - Non-ANSI C library functions */ void AcpiUtStrupr ( char *SrcString); void AcpiUtStrlwr ( char *SrcString); int AcpiUtStricmp ( char *String1, char *String2); /* * utstrsuppt - string-to-integer conversion support functions */ ACPI_STATUS AcpiUtConvertOctalString ( char *String, UINT64 *ReturnValue); ACPI_STATUS AcpiUtConvertDecimalString ( char *String, UINT64 *ReturnValuePtr); ACPI_STATUS AcpiUtConvertHexString ( char *String, UINT64 *ReturnValuePtr); char AcpiUtRemoveWhitespace ( char **String); char AcpiUtRemoveLeadingZeros ( char **String); BOOLEAN AcpiUtDetectHexPrefix ( char **String); void AcpiUtRemoveHexPrefix ( char **String); BOOLEAN AcpiUtDetectOctalPrefix ( char **String); /* * utstrtoul64 - string-to-integer conversion functions */ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT64 *RetInteger); UINT64 AcpiUtExplicitStrtoul64 ( char *String); UINT64 AcpiUtImplicitStrtoul64 ( char *String); /* * utglobal - Global data structures and procedures */ ACPI_STATUS AcpiUtInitGlobals ( void); const char * AcpiUtGetMutexName ( UINT32 MutexId); #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) const char * AcpiUtGetNotifyName ( UINT32 NotifyValue, ACPI_OBJECT_TYPE Type); #endif const char * AcpiUtGetTypeName ( ACPI_OBJECT_TYPE Type); const char * AcpiUtGetNodeName ( void *Object); const char * AcpiUtGetDescriptorName ( void *Object); const char * AcpiUtGetReferenceName ( ACPI_OPERAND_OBJECT *Object); const char * AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT *ObjDesc); const char * AcpiUtGetRegionName ( UINT8 SpaceId); const char * AcpiUtGetEventName ( UINT32 EventId); const char * AcpiUtGetArgumentTypeName ( UINT32 ArgType); char AcpiUtHexToAsciiChar ( UINT64 Integer, UINT32 Position); ACPI_STATUS AcpiUtAsciiToHexByte ( char *TwoAsciiChars, UINT8 *ReturnByte); UINT8 AcpiUtAsciiCharToHex ( int HexChar); BOOLEAN AcpiUtValidObjectType ( ACPI_OBJECT_TYPE Type); /* * utinit - miscellaneous initialization and shutdown */ ACPI_STATUS AcpiUtHardwareInitialize ( void); void AcpiUtSubsystemShutdown ( void); /* * utcopy - Object construction and conversion interfaces */ ACPI_STATUS AcpiUtBuildSimpleObject( ACPI_OPERAND_OBJECT *Obj, ACPI_OBJECT *UserObj, UINT8 *DataSpace, UINT32 *BufferSpaceUsed); ACPI_STATUS AcpiUtBuildPackageObject ( ACPI_OPERAND_OBJECT *Obj, UINT8 *Buffer, UINT32 *SpaceUsed); ACPI_STATUS AcpiUtCopyIobjectToEobject ( ACPI_OPERAND_OBJECT *Obj, ACPI_BUFFER *RetBuffer); ACPI_STATUS AcpiUtCopyEobjectToIobject ( ACPI_OBJECT *Obj, ACPI_OPERAND_OBJECT **InternalObj); ACPI_STATUS AcpiUtCopyISimpleToIsimple ( ACPI_OPERAND_OBJECT *SourceObj, ACPI_OPERAND_OBJECT *DestObj); ACPI_STATUS AcpiUtCopyIobjectToIobject ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT **DestDesc, ACPI_WALK_STATE *WalkState); /* * utcreate - Object creation */ ACPI_STATUS AcpiUtUpdateObjectReference ( ACPI_OPERAND_OBJECT *Object, UINT16 Action); /* * utdebug - Debug interfaces */ void AcpiUtInitStackPtrTrace ( void); void AcpiUtTrackStackPtr ( void); void AcpiUtTrace ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId); void AcpiUtTracePtr ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const void *Pointer); void AcpiUtTraceU32 ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT32 Integer); void AcpiUtTraceStr ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *String); void AcpiUtExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId); void AcpiUtStatusExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, ACPI_STATUS Status); void AcpiUtValueExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT64 Value); void AcpiUtPtrExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT8 *Ptr); void AcpiUtStrExit ( UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *String); void AcpiUtDebugDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 ComponentId); void AcpiUtDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 Offset); #ifdef ACPI_APPLICATION void AcpiUtDumpBufferToFile ( ACPI_FILE File, UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 BaseOffset); #endif void AcpiUtReportError ( char *ModuleName, UINT32 LineNumber); void AcpiUtReportInfo ( char *ModuleName, UINT32 LineNumber); void AcpiUtReportWarning ( char *ModuleName, UINT32 LineNumber); /* * utdelete - Object deletion and reference counts */ void AcpiUtAddReference ( ACPI_OPERAND_OBJECT *Object); void AcpiUtRemoveReference ( ACPI_OPERAND_OBJECT *Object); void AcpiUtDeleteInternalPackageObject ( ACPI_OPERAND_OBJECT *Object); void AcpiUtDeleteInternalSimpleObject ( ACPI_OPERAND_OBJECT *Object); void AcpiUtDeleteInternalObjectList ( ACPI_OPERAND_OBJECT **ObjList); /* * uteval - object evaluation */ ACPI_STATUS AcpiUtEvaluateObject ( ACPI_NAMESPACE_NODE *PrefixNode, const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc); ACPI_STATUS AcpiUtEvaluateNumericObject ( const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value); ACPI_STATUS AcpiUtExecute_STA ( ACPI_NAMESPACE_NODE *DeviceNode, UINT32 *StatusFlags); ACPI_STATUS AcpiUtExecutePowerMethods ( ACPI_NAMESPACE_NODE *DeviceNode, const char **MethodNames, UINT8 MethodCount, UINT8 *OutValues); /* * utids - device ID support */ ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); ACPI_STATUS AcpiUtExecute_CLS ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId); /* * utlock - reader/writer locks */ ACPI_STATUS AcpiUtCreateRwLock ( ACPI_RW_LOCK *Lock); void AcpiUtDeleteRwLock ( ACPI_RW_LOCK *Lock); ACPI_STATUS AcpiUtAcquireReadLock ( ACPI_RW_LOCK *Lock); ACPI_STATUS AcpiUtReleaseReadLock ( ACPI_RW_LOCK *Lock); ACPI_STATUS AcpiUtAcquireWriteLock ( ACPI_RW_LOCK *Lock); void AcpiUtReleaseWriteLock ( ACPI_RW_LOCK *Lock); /* * utobject - internal object create/delete/cache routines */ ACPI_OPERAND_OBJECT * AcpiUtCreateInternalObjectDbg ( const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId, ACPI_OBJECT_TYPE Type); void * AcpiUtAllocateObjectDescDbg ( const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId); #define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) #define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) void AcpiUtDeleteObjectDesc ( ACPI_OPERAND_OBJECT *Object); BOOLEAN AcpiUtValidInternalObject ( void *Object); ACPI_OPERAND_OBJECT * AcpiUtCreatePackageObject ( UINT32 Count); ACPI_OPERAND_OBJECT * AcpiUtCreateIntegerObject ( UINT64 Value); ACPI_OPERAND_OBJECT * AcpiUtCreateBufferObject ( ACPI_SIZE BufferSize); ACPI_OPERAND_OBJECT * AcpiUtCreateStringObject ( ACPI_SIZE StringSize); ACPI_STATUS AcpiUtGetObjectSize( ACPI_OPERAND_OBJECT *Obj, ACPI_SIZE *ObjLength); /* * utosi - Support for the _OSI predefined control method */ ACPI_STATUS AcpiUtInitializeInterfaces ( void); ACPI_STATUS AcpiUtInterfaceTerminate ( void); ACPI_STATUS AcpiUtInstallInterface ( ACPI_STRING InterfaceName); ACPI_STATUS AcpiUtRemoveInterface ( ACPI_STRING InterfaceName); ACPI_STATUS AcpiUtUpdateInterfaces ( UINT8 Action); ACPI_INTERFACE_INFO * AcpiUtGetInterface ( ACPI_STRING InterfaceName); ACPI_STATUS AcpiUtOsiImplementation ( ACPI_WALK_STATE *WalkState); /* * utpredef - support for predefined names */ const ACPI_PREDEFINED_INFO * AcpiUtGetNextPredefinedMethod ( const ACPI_PREDEFINED_INFO *ThisName); const ACPI_PREDEFINED_INFO * AcpiUtMatchPredefinedMethod ( char *Name); void AcpiUtGetExpectedReturnTypes ( char *Buffer, UINT32 ExpectedBtypes); #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP) const ACPI_PREDEFINED_INFO * AcpiUtMatchResourceName ( char *Name); void AcpiUtDisplayPredefinedMethod ( char *Buffer, const ACPI_PREDEFINED_INFO *ThisName, BOOLEAN MultiLine); UINT32 AcpiUtGetResourceBitWidth ( char *Buffer, UINT16 Types); #endif /* * utstate - Generic state creation/cache routines */ void AcpiUtPushGenericState ( ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State); ACPI_GENERIC_STATE * AcpiUtPopGenericState ( ACPI_GENERIC_STATE **ListHead); ACPI_GENERIC_STATE * AcpiUtCreateGenericState ( void); ACPI_THREAD_STATE * AcpiUtCreateThreadState ( void); ACPI_GENERIC_STATE * AcpiUtCreateUpdateState ( ACPI_OPERAND_OBJECT *Object, UINT16 Action); ACPI_GENERIC_STATE * AcpiUtCreatePkgState ( void *InternalObject, void *ExternalObject, UINT32 Index); ACPI_STATUS AcpiUtCreateUpdateStateAndPush ( ACPI_OPERAND_OBJECT *Object, UINT16 Action, ACPI_GENERIC_STATE **StateList); ACPI_GENERIC_STATE * AcpiUtCreateControlState ( void); void AcpiUtDeleteGenericState ( ACPI_GENERIC_STATE *State); /* * utmath */ ACPI_STATUS AcpiUtDivide ( UINT64 InDividend, UINT64 InDivisor, UINT64 *OutQuotient, UINT64 *OutRemainder); ACPI_STATUS AcpiUtShortDivide ( UINT64 InDividend, UINT32 Divisor, UINT64 *OutQuotient, UINT32 *OutRemainder); ACPI_STATUS AcpiUtShortMultiply ( UINT64 InMultiplicand, UINT32 Multiplier, UINT64 *Outproduct); ACPI_STATUS AcpiUtShortShiftLeft ( UINT64 Operand, UINT32 Count, UINT64 *OutResult); ACPI_STATUS AcpiUtShortShiftRight ( UINT64 Operand, UINT32 Count, UINT64 *OutResult); /* * utmisc */ const ACPI_EXCEPTION_INFO * AcpiUtValidateException ( ACPI_STATUS Status); BOOLEAN AcpiUtIsPciRootBridge ( char *Id); #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP) BOOLEAN AcpiUtIsAmlTable ( ACPI_TABLE_HEADER *Table); #endif ACPI_STATUS AcpiUtWalkPackageTree ( ACPI_OPERAND_OBJECT *SourceObject, void *TargetObject, ACPI_PKG_CALLBACK WalkCallback, void *Context); /* Values for Base above (16=Hex, 10=Decimal) */ #define ACPI_ANY_BASE 0 UINT32 AcpiUtDwordByteSwap ( UINT32 Value); void AcpiUtSetIntegerWidth ( UINT8 Revision); #ifdef ACPI_DEBUG_OUTPUT void AcpiUtDisplayInitPathname ( UINT8 Type, ACPI_NAMESPACE_NODE *ObjHandle, const char *Path); #endif /* * utownerid - Support for Table/Method Owner IDs */ ACPI_STATUS AcpiUtAllocateOwnerId ( ACPI_OWNER_ID *OwnerId); void AcpiUtReleaseOwnerId ( ACPI_OWNER_ID *OwnerId); /* * utresrc */ ACPI_STATUS AcpiUtWalkAmlResources ( ACPI_WALK_STATE *WalkState, UINT8 *Aml, ACPI_SIZE AmlLength, ACPI_WALK_AML_CALLBACK UserFunction, void **Context); ACPI_STATUS AcpiUtValidateResource ( ACPI_WALK_STATE *WalkState, void *Aml, UINT8 *ReturnIndex); UINT32 AcpiUtGetDescriptorLength ( void *Aml); UINT16 AcpiUtGetResourceLength ( void *Aml); UINT8 AcpiUtGetResourceHeaderLength ( void *Aml); UINT8 AcpiUtGetResourceType ( void *Aml); ACPI_STATUS AcpiUtGetResourceEndTag ( ACPI_OPERAND_OBJECT *ObjDesc, UINT8 **EndTag); /* * utstring - String and character utilities */ void AcpiUtPrintString ( char *String, UINT16 MaxLength); #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP void UtConvertBackslashes ( char *Pathname); #endif void AcpiUtRepairName ( char *Name); #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) || defined (ACPI_DEBUG_OUTPUT) BOOLEAN AcpiUtSafeStrcpy ( char *Dest, ACPI_SIZE DestSize, char *Source); void AcpiUtSafeStrncpy ( char *Dest, char *Source, ACPI_SIZE DestSize); BOOLEAN AcpiUtSafeStrcat ( char *Dest, ACPI_SIZE DestSize, char *Source); BOOLEAN AcpiUtSafeStrncat ( char *Dest, ACPI_SIZE DestSize, char *Source, ACPI_SIZE MaxTransferLength); #endif /* * utmutex - mutex support */ ACPI_STATUS AcpiUtMutexInitialize ( void); void AcpiUtMutexTerminate ( void); ACPI_STATUS AcpiUtAcquireMutex ( ACPI_MUTEX_HANDLE MutexId); ACPI_STATUS AcpiUtReleaseMutex ( ACPI_MUTEX_HANDLE MutexId); /* * utalloc - memory allocation and object caching */ ACPI_STATUS AcpiUtCreateCaches ( void); ACPI_STATUS AcpiUtDeleteCaches ( void); ACPI_STATUS AcpiUtValidateBuffer ( ACPI_BUFFER *Buffer); ACPI_STATUS AcpiUtInitializeBuffer ( ACPI_BUFFER *Buffer, ACPI_SIZE RequiredLength); #ifdef ACPI_DBG_TRACK_ALLOCATIONS void * AcpiUtAllocateAndTrack ( ACPI_SIZE Size, UINT32 Component, const char *Module, UINT32 Line); void * AcpiUtAllocateZeroedAndTrack ( ACPI_SIZE Size, UINT32 Component, const char *Module, UINT32 Line); void AcpiUtFreeAndTrack ( void *Address, UINT32 Component, const char *Module, UINT32 Line); void AcpiUtDumpAllocationInfo ( void); void AcpiUtDumpAllocations ( UINT32 Component, const char *Module); ACPI_STATUS AcpiUtCreateList ( const char *ListName, UINT16 ObjectSize, ACPI_MEMORY_LIST **ReturnCache); #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ /* * utaddress - address range check */ ACPI_STATUS AcpiUtAddAddressRange ( ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, ACPI_NAMESPACE_NODE *RegionNode); void AcpiUtRemoveAddressRange ( ACPI_ADR_SPACE_TYPE SpaceId, ACPI_NAMESPACE_NODE *RegionNode); UINT32 AcpiUtCheckAddressRange ( ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, BOOLEAN Warn); void AcpiUtDeleteAddressLists ( void); /* * utxferror - various error/warning output functions */ ACPI_PRINTF_LIKE(5) void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedWarning ( const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format, ...); ACPI_PRINTF_LIKE(5) void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedInfo ( const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format, ...); ACPI_PRINTF_LIKE(5) void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedBiosError ( const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format, ...); void AcpiUtPrefixedNamespaceError ( const char *ModuleName, UINT32 LineNumber, ACPI_GENERIC_STATE *PrefixScope, const char *InternalName, ACPI_STATUS LookupStatus); void AcpiUtMethodError ( const char *ModuleName, UINT32 LineNumber, const char *Message, ACPI_NAMESPACE_NODE *Node, const char *Path, ACPI_STATUS LookupStatus); /* * Utility functions for ACPI names and IDs */ const AH_PREDEFINED_NAME * AcpiAhMatchPredefinedName ( char *Nameseg); const AH_DEVICE_ID * AcpiAhMatchHardwareId ( char *Hid); const char * AcpiAhMatchUuid ( UINT8 *Data); /* * utuuid -- UUID support functions */ #if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP) void AcpiUtConvertStringToUuid ( char *InString, UINT8 *UuidBuffer); ACPI_STATUS AcpiUtConvertUuidToString ( char *UuidBuffer, char *OutString); #endif #endif /* _ACUTILS_H */ diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h index bc41fa40bab9..2ab07bb39508 100644 --- a/sys/contrib/dev/acpica/include/acuuid.h +++ b/sys/contrib/dev/acpica/include/acuuid.h @@ -1,215 +1,216 @@ /****************************************************************************** * * Name: acuuid.h - ACPI-related UUID/GUID definitions * *****************************************************************************/ /****************************************************************************** * * 1. Copyright Notice * * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a * copy of the source code appearing in this file ("Covered Code") an * irrevocable, perpetual, worldwide license under Intel's copyrights in the * base code distributed originally by Intel ("Original Intel Code") to copy, * make derivatives, distribute, use and display any portion of the Covered * Code in any form, with the right to sublicense such rights; and * * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following * conditions are met: * * 3. Conditions * * 3.1. Redistribution of Source with Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered * Code and the date of any change. Licensee must include in that file the * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * * 3.2. Redistribution of Source with no Rights to Further Distribute Source. * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual * property embodied in the software Licensee provides to its licensee, and * not to intellectual property embodied in modifications its licensee may * make. * * 3.3. Redistribution of Executable. Redistribution in executable form of any * substantial portion of the Covered Code or modification must reproduce the * above Copyright Notice, and the following Disclaimer and Export Compliance * provision in the documentation and/or other materials provided with the * distribution. * * 3.4. Intel retains all right, title, and interest in and to the Original * Intel Code. * * 3.5. Neither the name Intel nor any other trademark owned or controlled by * Intel shall be used in advertising or otherwise to promote the sale, use or * other dealings in products derived from or relating to the Covered Code * without prior written authorization from Intel. * * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in * compliance with all laws, regulations, orders, or other restrictions of the * U.S. Export Administration Regulations. Licensee agrees that neither it nor * any of its subsidiaries will export/re-export any technical data, process, * software, or service, directly or indirectly, to any country for which the * United States government or any agency thereof requires an export license, * other governmental approval, or letter of assurance, without first obtaining * such license, approval or letter. * ***************************************************************************** * * Alternatively, you may choose to be licensed under the terms of the * following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, you may choose to be licensed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * *****************************************************************************/ #ifndef __ACUUID_H__ #define __ACUUID_H__ /* * Note1: UUIDs and GUIDs are defined to be identical in ACPI. * * Note2: This file is standalone and should remain that way. */ /* Controllers */ #define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f" #define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899" #define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f" /* Devices */ #define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" #define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" #define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" #define UUID_MEMORY_DEVICE "03b19910-f473-11dd-87af-0800200c9a66" #define UUID_GENERIC_BUTTONS_DEVICE "fa6bd625-9ce8-470d-a2c7-b3ca36c4282e" #define UUID_NVDIMM_ROOT_DEVICE "2f10e7a4-9e91-11e4-89d3-123b93f75cba" #define UUID_CONTROL_METHOD_BATTERY "f18fc78b-0f15-4978-b793-53f833a1d35b" /* Interfaces */ #define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d" #define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653" /* NVDIMM - NFIT table */ #define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66" #define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0" #define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb" #define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c" #define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249" #define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e" #define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb" #define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" #define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" #define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05" #define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6" #define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e" #define UUID_NFIT_DIMM_N_HYPERV "5746c5f2-a9a2-4264-ad0e-e4ddc9e09e80" /* Processor Properties (ACPI 6.2) */ #define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D" #define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7" /* Miscellaneous */ #define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" #define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf" #define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" #define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" #define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" #define UUID_DEVICE_GRAPHS "ab02a46b-74c7-45a2-bd68-f7d344ef2153" #define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b" #define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd" #define UUID_USB4_CAPABILITIES "23a0d13a-26ab-486c-9c5f-0ffa525a575a" - +#define UUID_1ST_FUNCTION_ID "893f00a6-660c-494e-bcfd-3043f4fb67c0" +#define UUID_2ND_FUNCTION_ID "107ededd-d381-4fd7-8da9-08e9a6c79644" #endif /* __ACUUID_H__ */