From 7ef02d9e049f41b9ca75da8bfdadbf4545155e6d Mon Sep 17 00:00:00 2001 From: Al Stone Date: May 22 2015 00:00:22 +0000 Subject: Imported Upstream version 20150515 --- diff --git a/changes.txt b/changes.txt index ad9d23c..511652f 100755 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,52 @@ ---------------------------------------- +08 April 2015. Summary of changes for version 20150515: + +This release implements most of ACPI 6.0 as described below. + +1) ACPICA kernel-resident subsystem: + +Implemented runtime argument checking and return value checking for all +new ACPI 6.0 predefined names. This includes: _BTH, _CR3, _DSD, _LPI, +_MTL, _PRR, _RDI, _RST, _TFP, _TSN. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total + Debug Version: 195.2K Code, 80.8K Data, 276.0K Total + Previous Release: + Non-Debug Version: 99.1K Code, 27.3K Data, 126.4K Total + Debug Version: 192.8K Code, 79.9K Data, 272.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL compiler: Added compile-time support for all new ACPI 6.0 predefined +names (argument count validation and return value typechecking.) + +iASL disassembler and table compiler: implemented support for all new +ACPI 6.0 tables. This includes: DRTM, IORT, LPIT, NFIT, STAO, WPBT, XENV. + +iASL disassembler and table compiler: Added ACPI 6.0 changes to existing +tables: FADT, MADT. + +iASL preprocessor: Added a new directive to enable inclusion of binary +blobs into ASL code. The new directive is #includebinary. It takes a +binary file as input and emits a named ascii buffer object into the ASL +code. + +AcpiHelp: Added support for all new ACPI 6.0 predefined names. + +AcpiHelp: Added a new option, -d, to display all iASL preprocessor +directives. + +AcpiHelp: Added a new option, -t, to display all known/supported ACPI +tables. + +---------------------------------------- 10 April 2015. Summary of changes for version 20150410: Reverted a change introduced in version 20150408 that caused diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 6ad84de..1e3f6e3 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -55,6 +55,10 @@ ifeq ($(UNAME_S), Darwin) # Mac OS X HOST = _APPLE endif +ifeq ($(UNAME_S), DragonFly) +HOST = _DragonFly +endif + ifeq ($(UNAME_S), FreeBSD) HOST = _FreeBSD endif diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile index 8cf0014..79cfadc 100644 --- a/generate/unix/acpidump/Makefile +++ b/generate/unix/acpidump/Makefile @@ -51,6 +51,10 @@ OBJECTS = \ # # Per-host interfaces # +ifeq ($(HOST), _DragonFly) +HOST_FAMILY = BSD +endif + ifeq ($(HOST), _FreeBSD) HOST_FAMILY = BSD endif diff --git a/generate/unix/acpihelp/Makefile b/generate/unix/acpihelp/Makefile index ed4ee8a..30a2764 100644 --- a/generate/unix/acpihelp/Makefile +++ b/generate/unix/acpihelp/Makefile @@ -35,6 +35,7 @@ OBJECTS = \ $(OBJDIR)/ahids.o\ $(OBJDIR)/ahpredef.o\ $(OBJDIR)/ahmain.o\ + $(OBJDIR)/ahtable.o\ $(OBJDIR)/ahuuids.o\ $(OBJDIR)/getopt.o\ $(OBJDIR)/oslibcfs.o\ diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index d9a4db0..be1117d 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -48,6 +48,7 @@ OBJECTS = \ $(OBJDIR)/adwalk.o\ $(OBJDIR)/ahids.o\ $(OBJDIR)/ahpredef.o\ + $(OBJDIR)/ahtable.o\ $(OBJDIR)/ahuuids.o\ $(OBJDIR)/aslanalyze.o\ $(OBJDIR)/aslascii.o\ diff --git a/source/common/adisasm.c b/source/common/adisasm.c index b04a352..a092923 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -214,6 +214,7 @@ AdAmlDisassemble ( char **OutFilename) { ACPI_STATUS Status; + ACPI_STATUS GlobalStatus = AE_OK; char *DisasmFilename = NULL; char *ExternalFilename; ACPI_EXTERNAL_FILE *ExternalFileList = AcpiGbl_ExternalFileList; @@ -229,7 +230,7 @@ AdAmlDisassemble ( */ if (Filename) { - Status = AcpiDbGetTableFromFile (Filename, &Table); + Status = AcpiDbGetTableFromFile (Filename, &Table, FALSE); if (ACPI_FAILURE (Status)) { return (Status); @@ -250,9 +251,16 @@ AdAmlDisassemble ( continue; } - Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); + Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable, TRUE); if (ACPI_FAILURE (Status)) { + if (Status == AE_TYPE) + { + ExternalFileList = ExternalFileList->Next; + GlobalStatus = AE_TYPE; + Status = AE_OK; + continue; + } return (Status); } @@ -282,6 +290,11 @@ AdAmlDisassemble ( ExternalFileList = ExternalFileList->Next; } + if (ACPI_FAILURE (GlobalStatus)) + { + return (GlobalStatus); + } + /* Clear external list generated by Scope in external tables */ if (AcpiGbl_ExternalFileList) diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c index 72e518a..e728c64 100644 --- a/source/common/ahpredef.c +++ b/source/common/ahpredef.c @@ -94,6 +94,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_BMS", "Battery Measurement Sampling Time", "Sets the battery measurement sampling time"), AH_PREDEF ("_BQC", "Brightness Query Current", "Returns the current display brightness level"), AH_PREDEF ("_BST", "Battery Status", "Returns a Control Method Battery status block"), + AH_PREDEF ("_BTH", "Battery Throttle Limit", "Thermal limit for charging and discharging"), AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"), AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"), AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"), @@ -102,6 +103,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"), AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"), AH_PREDEF ("_CPC", "Continuous Performance Control", "Returns a list of performance control interfaces"), + AH_PREDEF ("_CR3", "Warm/Standby Temperature", "Temperature for a fast low power state"), AH_PREDEF ("_CRS", "Current Resource Settings", "Returns the current resource settings for a device"), AH_PREDEF ("_CRT", "Critical Temperature", "Returns the shutdown critical temperature"), AH_PREDEF ("_CSD", "C-State Dependencies", "Returns a list of C-state dependencies"), @@ -175,6 +177,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_LIN", "Lines In Use", "Handshake lines, Resource Descriptor field"), AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"), AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"), + AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"), AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"), AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"), AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"), @@ -186,6 +189,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_MOD", "Mode", "Interrupt mode, Resource Descriptor field"), AH_PREDEF ("_MSG", "Message", "Sets the system message waiting status indicator"), AH_PREDEF ("_MSM", "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"), + AH_PREDEF ("_MTL", "Minimum Throttle Limit", "Returns the minimum throttle limit for a thermal zone"), AH_PREDEF ("_MTP", "Memory Type", "Resource Descriptor field"), AH_PREDEF ("_NTT", "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"), AH_PREDEF ("_OFF", "Power Off", "Sets a power resource to the off state"), @@ -209,7 +213,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_PMD", "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"), AH_PREDEF ("_PMM", "Power Meter Measurement", "Returns the current value of the Power Meter"), AH_PREDEF ("_POL", "Polarity", "Interrupt polarity, Resource Descriptor field"), - AH_PREDEF ("_PPC", "Performance Present Capabilites", "Returns a list of the performance states currently supported by the platform"), + AH_PREDEF ("_PPC", "Performance Present Capabilities", "Returns a list of the performance states currently supported by the platform"), AH_PREDEF ("_PPE", "Polling for Platform Error", "Returns the polling interval to retrieve Corrected Platform Error information"), AH_PREDEF ("_PPI", "Pin Configuration", "Resource Descriptor field"), AH_PREDEF ("_PR", "Processor", "Predefined scope for processor objects"), @@ -219,6 +223,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_PR3", "Power Resources for D3hot", "Returns a list of dependent power resources to enter state D3hot"), AH_PREDEF ("_PRE", "Power Resources for Enumeration", "Returns a list of dependent power resources to enumerate devices on a bus"), AH_PREDEF ("_PRL", "Power Source Redundancy List", "Returns a list of power source devices in the same redundancy grouping"), + AH_PREDEF ("_PRR", "Power Resource for Reset", "Execute a reset on a device"), AH_PREDEF ("_PRS", "Possible Resource Settings", "Returns a list of a device's possible resource settings"), AH_PREDEF ("_PRT", "PCI Routing Table", "Returns a list of PCI interrupt mappings"), AH_PREDEF ("_PRW", "Power Resources for Wake", "Returns a list of dependent power resources for waking"), @@ -242,10 +247,12 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_Qxx", "EC Query", "Embedded Controller query and SMBus Alarm control method"), AH_PREDEF ("_RBO", "Register Bit Offset", "Resource Descriptor field"), AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), + AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"), AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"), AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"), AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"), + AH_PREDEF ("_RST", "Device Reset", "Executes a reset on a device"), AH_PREDEF ("_ROM", "Read-Only Memory", "Returns a copy of the ROM data for a display device"), AH_PREDEF ("_RT_", "Resource Type", "Resource Descriptor field"), AH_PREDEF ("_RTV", "Relative Temperature Values", "Returns temperature value information"), @@ -296,6 +303,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_TC1", "Thermal Constant 1", "Returns TC1 for the passive cooling formula"), AH_PREDEF ("_TC2", "Thermal Constant 2", "Returns TC2 for the passive cooling formula"), AH_PREDEF ("_TDL", "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"), + AH_PREDEF ("_TFP", "Thermal Fast Sampling Period", "Returns the sampling period for passive cooling"), AH_PREDEF ("_TIP", "Expired Timer Wake Policy", "Returns timer policies of the wake alarm device"), AH_PREDEF ("_TIV", "Timer Values", "Returns remaining time of the wake alarm device"), AH_PREDEF ("_TMP", "Temperature", "Returns a thermal zone's current temperature"), @@ -306,6 +314,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_TRT", "Thermal Relationship Table", "Returns thermal relationships between platform devices"), AH_PREDEF ("_TSD", "Throttling State Dependencies", "Returns a list of T-state dependencies"), AH_PREDEF ("_TSF", "Type-Specific Flags", "Resource Descriptor field"), + AH_PREDEF ("_TSN", "Thermal Sensor Device", "Returns a reference to a thermal sensor"), AH_PREDEF ("_TSP", "Thermal Sampling Period", "Returns the thermal sampling period for passive cooling"), AH_PREDEF ("_TSS", "Throttling Supported States", "Returns supported throttling state information"), AH_PREDEF ("_TST", "Temperature Sensor Threshold", "Returns the minimum separation for a device's temperature trip points"), diff --git a/source/common/ahtable.c b/source/common/ahtable.c new file mode 100644 index 0000000..3b1d544 --- /dev/null +++ b/source/common/ahtable.c @@ -0,0 +1,150 @@ +/****************************************************************************** + * + * Module Name: ahtable - Table of known ACPI tables with descriptions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include "acpi.h" +#include "accommon.h" + + +/* Local prototypes */ + +const AH_TABLE * +AcpiAhGetTableInfo ( + char *Signature); + +extern const AH_TABLE AcpiSupportedTables[]; + + +/******************************************************************************* + * + * 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 = AcpiSupportedTables; Info->Signature; Info++) + { + if (ACPI_COMPARE_NAME (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 AcpiSupportedTables[] = +{ + {ACPI_SIG_ASF, "Alert Standard Format table"}, + {ACPI_SIG_BERT, "Boot Error Record Table"}, + {ACPI_SIG_BGRT, "Boot Graphics Resource Table"}, + {ACPI_SIG_BOOT, "Simple Boot Flag 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_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_MTMR, "MID Timer Table"}, + {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, + {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, + {ACPI_SIG_PMTT, "Platform Memory Topology 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_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_TCPA, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_TPM2, "Trusted Platform Module hardware interface table"}, + {ACPI_SIG_UEFI, "UEFI Boot Optimization Table"}, + {ACPI_SIG_VRTC, "Virtual Real-Time Clock 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_XENV, "Xen Environment table"}, + {ACPI_SIG_XSDT, "Extended System Description Table"}, + {NULL, NULL} +}; diff --git a/source/common/dmextern.c b/source/common/dmextern.c index 35430cb..a24ce0b 100644 --- a/source/common/dmextern.c +++ b/source/common/dmextern.c @@ -1286,7 +1286,9 @@ AcpiDmUnresolvedWarning ( " * compile because the disassembler did not know how many arguments\n" " * to assign to these methods. To specify the tables needed to resolve\n" " * external control method references, the -e option can be used to\n" - " * specify the filenames. Example iASL invocations:\n" + " * specify the filenames. Note: SSDTs can be dynamically loaded at\n" + " * runtime and may or may not be available via the host OS.\n" + " * Example iASL invocations:\n" " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" " * iasl -e ssdt*.aml -d dsdt.aml\n" @@ -1314,7 +1316,8 @@ AcpiDmUnresolvedWarning ( " * ACPI tables may be required to properly disassemble the code. This\n" " * resulting disassembler output file may not compile because the\n" " * disassembler did not know how many arguments to assign to the\n" - " * unresolved methods.\n" + " * unresolved methods. Note: SSDTs can be dynamically loaded at\n" + " * runtime and may or may not be available via the host OS.\n" " *\n" " * If necessary, the -fe option can be used to specify a file containing\n" " * control method external declarations with the associated method\n" @@ -1345,7 +1348,9 @@ AcpiDmUnresolvedWarning ( "compile because the disassembler did not know how many arguments\n" "to assign to these methods. To specify the tables needed to resolve\n" "external control method references, the -e option can be used to\n" - "specify the filenames. Example iASL invocations:\n" + "specify the filenames. Note: SSDTs can be dynamically loaded at\n" + "runtime and may or may not be available via the host OS.\n" + "Example iASL invocations:\n" " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" " iasl -e ssdt*.aml -d dsdt.aml\n" @@ -1368,7 +1373,8 @@ AcpiDmUnresolvedWarning ( "ACPI tables may be required to properly disassemble the code. The\n" "resulting disassembler output file may not compile because the\n" "disassembler did not know how many arguments to assign to the\n" - "unresolved methods.\n" + "unresolved methods. Note: SSDTs can be dynamically loaded at\n" + "runtime and may or may not be available via the host OS.\n" "\n" "If necessary, the -fe option can be used to specify a file containing\n" "control method external declarations with the associated method\n" diff --git a/source/common/dmtable.c b/source/common/dmtable.c index 2c3f95d..125bd18 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -53,6 +53,11 @@ #define _COMPONENT ACPI_CA_DISASSEMBLER ACPI_MODULE_NAME ("dmtable") +const AH_TABLE * +AcpiAhGetTableInfo ( + char *Signature); + + /* Local Prototypes */ static void @@ -78,7 +83,7 @@ static const char *AcpiDmAsfSubnames[] = "ASF Remote Control", "ASF RMCP Boot Options", "ASF Address", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmDmarSubnames[] = @@ -88,7 +93,7 @@ static const char *AcpiDmDmarSubnames[] = "Root Port ATS Capability", "Remapping Hardware Static Affinity", "ACPI Namespace Device Declaration", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmDmarScope[] = @@ -176,7 +181,7 @@ static const char *AcpiDmGtdtSubnames[] = { "Generic Timer Block", "Generic Watchdog Timer", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmHestSubnames[] = @@ -191,7 +196,7 @@ static const char *AcpiDmHestSubnames[] = "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", "Generic Hardware Error Source", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmHestNotifySubnames[] = @@ -223,14 +228,27 @@ static const char *AcpiDmMadtSubnames[] = "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */ "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */ "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */ - "Unknown SubTable Type" /* Reserved */ + "Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */ + "Unknown Subtable Type" /* Reserved */ +}; + +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 */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmPcctSubnames[] = { "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */ - "HW-Reduced Communications Subspace", - "Unknown SubTable Type" /* Reserved */ + "HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmPmttSubnames[] = @@ -238,7 +256,7 @@ 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 */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmSratSubnames[] = @@ -247,21 +265,20 @@ static const char *AcpiDmSratSubnames[] = "Memory Affinity", "Processor Local x2APIC Affinity", "GICC Affinity", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmIvrsSubnames[] = { "Hardware Definition Block", "Memory Definition Block", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; static const char *AcpiDmLpitSubnames[] = { "Native C-state Idle Structure", - "Simple I/O Idle Structure", - "Unknown SubTable Type" /* Reserved */ + "Unknown Subtable Type" /* Reserved */ }; #define ACPI_FADT_PM_RESERVED 9 @@ -304,56 +321,65 @@ static const char *AcpiDmGasAccessWidth[] = * handler. This table must be NULL terminated. RSDP and FACS are * special-cased elsewhere. * + * Note: Any tables added here should be duplicated within AcpiSupportedTables + * in the file common/ahtable.c + * ******************************************************************************/ -ACPI_DMTABLE_DATA AcpiDmTableData[] = +const ACPI_DMTABLE_DATA AcpiDmTableData[] = { - {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, - {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, - {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"}, - {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, - {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, - {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt, "Core System Resource Table"}, - {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2, "Debug Port table type 2"}, - {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, - {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, - {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"}, - {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, - {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, - {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"}, - {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"}, - {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"}, - {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, - {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, - {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, - {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"}, - {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"}, - {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, - {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, - {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"}, - {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, - {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm, "Microsoft Data Management table"}, - {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"}, - {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"}, - {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"}, - {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, - {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"}, - {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, - {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"}, - {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, - {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"}, - {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"}, - {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"}, - {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"}, - {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2, "Trusted Platform Module hardware interface table"}, - {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi, "UEFI Boot Optimization Table"}, - {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc, "Virtual Real-Time Clock Table"}, - {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"}, - {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"}, - {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"}, - {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"}, - {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"}, - {NULL, NULL, NULL, NULL, NULL, NULL} + {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf}, + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, + {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_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_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr}, + {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, + {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, + {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, + {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt}, + {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, + {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, + {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_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa}, + {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, + {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, + {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_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv}, + {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt}, + {NULL, NULL, NULL, NULL, NULL} }; @@ -407,18 +433,18 @@ AcpiDmGenerateChecksum ( * ******************************************************************************/ -ACPI_DMTABLE_DATA * +const ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature) { - ACPI_DMTABLE_DATA *TableData; + const ACPI_DMTABLE_DATA *Info; - for (TableData = AcpiDmTableData; TableData->Signature; TableData++) + for (Info = AcpiDmTableData; Info->Signature; Info++) { - if (ACPI_COMPARE_NAME (Signature, TableData->Signature)) + if (ACPI_COMPARE_NAME (Signature, Info->Signature)) { - return (TableData); + return (Info); } } @@ -444,7 +470,7 @@ AcpiDmDumpDataTable ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DMTABLE_DATA *TableData; + const ACPI_DMTABLE_DATA *TableData; UINT32 Length; @@ -558,7 +584,6 @@ AcpiDmDumpDataTable ( * PARAMETERS: Offset - Current byte offset, from table start * ByteLength - Length of the field in bytes, 0 for flags * Name - Name of this field - * Value - Optional value, displayed on left of ':' * * RETURN: None * @@ -692,7 +717,7 @@ AcpiDmDumpTable ( UINT16 Temp16; UINT32 Temp32; UINT64 Value; - ACPI_DMTABLE_DATA *TableData; + const AH_TABLE *TableData; const char *Name; BOOLEAN LastOutputBlankLine = FALSE; char RepairedName[8]; @@ -715,13 +740,24 @@ AcpiDmDumpTable ( Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset); CurrentOffset = TableOffset + Info->Offset; - /* Check for beyond EOT or beyond subtable end */ + /* Check for beyond subtable end or (worse) beyond EOT */ + + if (SubtableLength && (Info->Offset >= SubtableLength)) + { + AcpiOsPrintf ( + "/**** ACPI subtable terminates early - " + "may be older version (dump table) */\n"); - if ((CurrentOffset >= TableLength) || - (SubtableLength && (Info->Offset >= 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"); + "/**** ACPI table terminates " + "in the middle of a data structure! (dump table) */\n"); return (AE_BAD_DATA); } @@ -754,6 +790,7 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: + case ACPI_DMT_NFIT: ByteLength = 2; break; @@ -810,6 +847,7 @@ AcpiDmDumpTable ( ByteLength = 128; break; + case ACPI_DMT_UNICODE: case ACPI_DMT_BUFFER: case ACPI_DMT_RAW_BUFFER: @@ -841,16 +879,39 @@ AcpiDmDumpTable ( 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"); + "/**** ACPI table terminates " + "in the middle of a data structure! */\n"); return (AE_BAD_DATA); } @@ -980,10 +1041,10 @@ AcpiDmDumpTable ( AcpiDmCheckAscii (Target, RepairedName, 4); AcpiOsPrintf ("\"%.4s\" ", RepairedName); - TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); + TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target)); if (TableData) { - AcpiOsPrintf (STRING_FORMAT, TableData->Name); + AcpiOsPrintf (STRING_FORMAT, TableData->Description); } else { @@ -1209,6 +1270,16 @@ AcpiDmDumpTable ( AcpiDmHestNotifySubnames[Temp8]); break; + case ACPI_DMT_IORTMEM: + + AcpiOsPrintf (STRING_FORMAT, + "IORT Memory Access Properties"); + + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc); + LastOutputBlankLine = TRUE; + break; + case ACPI_DMT_MADT: /* MADT subtable types */ @@ -1223,6 +1294,20 @@ AcpiDmDumpTable ( 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_PCCT: /* PCCT subtable types */ @@ -1251,16 +1336,27 @@ AcpiDmDumpTable ( AcpiDmPmttSubnames[Temp8]); break; + case ACPI_DMT_UNICODE: + + if (ByteLength == 0) + { + AcpiOsPrintf ("/* Zero-length Data */\n"); + break; + } + + AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength); + break; + case ACPI_DMT_RAW_BUFFER: - /* - * Currently only used for SLIC table - */ - AcpiOsPrintf ("/* Proprietary data structure */ "); - AcpiDmDumpBuffer (Table, sizeof (ACPI_TABLE_HEADER), - ByteLength, sizeof (ACPI_TABLE_HEADER), - "Licensing Data", TRUE); - AcpiOsPrintf ("\n"); + if (ByteLength == 0) + { + AcpiOsPrintf ("/* Zero-length Data */\n"); + break; + } + + AcpiDmDumpBuffer (Table, CurrentOffset, ByteLength, + CurrentOffset, NULL); break; case ACPI_DMT_SRAT: diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c index 5ecb0cc..af69f56 100644 --- a/source/common/dmtbdump.c +++ b/source/common/dmtbdump.c @@ -70,7 +70,6 @@ AcpiDmValidateFadtLength ( * AbsoluteOffset - Offset of buffer in the main ACPI table * Header - Name of the buffer field (printed on the * first line only.) - * MultiLine - TRUE if a large, multi-line buffer * * RETURN: None * @@ -85,8 +84,7 @@ AcpiDmDumpBuffer ( UINT32 BufferOffset, UINT32 Length, UINT32 AbsoluteOffset, - char *Header, - BOOLEAN MultiLine) + char *Header) { UINT8 *Buffer; UINT32 i; @@ -104,18 +102,11 @@ AcpiDmDumpBuffer ( { if (!(i % 16)) { - if (MultiLine) - { - /* Insert a backslash - line continuation character */ + /* Insert a backslash - line continuation character */ - AcpiOsPrintf ("\\\n "); - } - else + if (Length > 16) { - AcpiOsPrintf ("\n"); - AcpiDmLineHeader (AbsoluteOffset, - ((Length - i) > 16) ? 16 : (Length - i), Header); - Header = NULL; + AcpiOsPrintf ("\\\n "); } } @@ -131,6 +122,74 @@ AcpiDmDumpBuffer ( /******************************************************************************* * + * 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 (!ACPI_IS_PRINT (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 @@ -313,6 +372,13 @@ AcpiDmDumpFadt ( { AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); } + + /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ + + if (Table->Length > ACPI_FADT_V3_SIZE) + { + AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6); + } } /* Validate various fields in the FADT, including length */ @@ -693,10 +759,17 @@ AcpiDmDumpCsrt ( /* Resource-specific info buffer */ InfoLength = SubSubTable->Length - SubSubOffset; - - AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength, - Offset + SubOffset + SubSubOffset, "ResourceInfo", FALSE); - SubSubOffset += InfoLength; + if (InfoLength) + { + Status = AcpiDmDumpTable (Length, + Offset + SubOffset + SubSubOffset, Table, + InfoLength, AcpiDmTableInfoCsrt2a); + if (ACPI_FAILURE (Status)) + { + return; + } + SubSubOffset += InfoLength; + } /* Point to next sub-subtable */ @@ -814,8 +887,13 @@ AcpiDmDumpDbg2 ( if (SubTable->OemDataOffset) { - AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength, - Offset + SubTable->OemDataOffset, "OEM Data", FALSE); + Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset, + Table, SubTable->OemDataLength, + AcpiDmTableInfoDbg2OemData); + if (ACPI_FAILURE (Status)) + { + return; + } } /* Point to next subtable */ @@ -840,7 +918,6 @@ AcpiDmDumpDbg2 ( * ******************************************************************************/ - void AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table) @@ -985,6 +1062,120 @@ NextSubtable: /******************************************************************************* * + * 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"); + Status = AcpiDmDumpTable (Table->Length, Offset, + DrtmDps, sizeof (ACPI_DRTM_DPS_ID), + AcpiDmTableInfoDrtm2); + if (ACPI_FAILURE (Status)) + { + return; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpEinj * * PARAMETERS: Table - A EINJ table @@ -1429,6 +1620,230 @@ AcpiDmDumpHest ( /******************************************************************************* * + * 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; + UINT32 Offset; + UINT32 NodeOffset; + UINT32 Length; + ACPI_DMTABLE_INFO *InfoTable; + char *String; + UINT32 i; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort); + if (ACPI_FAILURE (Status)) + { + 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); + Status = AcpiDmDumpTable (Table->Length, Offset, + IortNode, Length, AcpiDmTableInfoIortHdr); + 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 += ACPI_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; + + 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); + NodeOffset += 4; + } + } + break; + + case ACPI_IORT_NODE_NAMED_COMPONENT: + + /* Dump the Padding (optional) */ + + if (IortNode->Length > NodeOffset) + { + Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, + Table, IortNode->Length - NodeOffset, + 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); + + 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); + 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); + NodeOffset += 8; + } + } + 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); + NodeOffset += Length; + } + +NextSubTable: + /* Point to next node subtable */ + + Offset += IortNode->Length; + IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpIvrs * * PARAMETERS: Table - A IVRS table @@ -1654,12 +2069,6 @@ AcpiDmDumpLpit ( SubTableLength = sizeof (ACPI_LPIT_NATIVE); break; - case ACPI_LPIT_TYPE_SIMPLE_IO: - - InfoTable = AcpiDmTableInfoLpit1; - SubTableLength = sizeof (ACPI_LPIT_IO); - break; - default: /* Cannot continue on unknown type - no length */ @@ -1808,6 +2217,11 @@ AcpiDmDumpMadt ( InfoTable = AcpiDmTableInfoMadt14; break; + case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: + + InfoTable = AcpiDmTableInfoMadt15; + break; + default: AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type); @@ -2146,6 +2560,180 @@ AcpiDmDumpMtmr ( /******************************************************************************* * + * 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; + Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, SubTable); + 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; + Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, SubTable); + FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); + 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: + + for (i = 0; i < Interleave->LineCount; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, + &Interleave->LineOffset[i], + sizeof (UINT32), AcpiDmTableInfoNfit2a); + 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: + + for (i = 0; i < Hint->HintCount; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, + &Hint->HintAddress[i], + sizeof (UINT64), AcpiDmTableInfoNfit6a); + 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: AcpiDmDumpPcct * * PARAMETERS: Table - A PCCT table @@ -2720,6 +3308,56 @@ NextSubTable: /******************************************************************************* * + * FUNCTION: AcpiDmDumpStao + * + * PARAMETERS: Table - A STAO table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a STAO. This is a variable-length + * table that contains an open-ended number of ASCII strings + * at the end of the table. + * + ******************************************************************************/ + +void +AcpiDmDumpStao ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + char *Namepath; + UINT32 Length = Table->Length; + UINT32 StringLength; + UINT32 Offset = sizeof (ACPI_TABLE_STAO); + + + /* Main table */ + + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* The rest of the table consists of Namepath strings */ + + while (Offset < Table->Length) + { + Namepath = ACPI_ADD_PTR (char, Table, Offset); + StringLength = ACPI_STRLEN (Namepath) + 1; + + AcpiDmLineHeader (Offset, StringLength, "Namestring"); + AcpiOsPrintf ("\"%s\"\n", Namepath); + + /* Point to next namepath */ + + Offset += StringLength; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpVrtc * * PARAMETERS: Table - A VRTC table @@ -2820,3 +3458,49 @@ AcpiDmDumpWdat ( SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY)); } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpWpbt + * + * PARAMETERS: Table - A WPBT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a WPBT. This table type consists + * of an open-ended arguments buffer at the end of the table. + * + ******************************************************************************/ + +void +AcpiDmDumpWpbt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_TABLE_WPBT *SubTable; + UINT32 Length = Table->Length; + UINT16 ArgumentsLength; + + + /* Dump the main table */ + + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Extract the arguments buffer length from the main table */ + + SubTable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table); + ArgumentsLength = SubTable->ArgumentsLength; + + /* Dump the arguments buffer */ + + AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength, + AcpiDmTableInfoWpbt0); + if (ACPI_FAILURE (Status)) + { + return; + } +} diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index 7377ed1..446e984 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -96,12 +96,14 @@ #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_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_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f) #define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f) #define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f) @@ -110,6 +112,7 @@ #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_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) @@ -117,6 +120,8 @@ #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_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f) /* Subtables */ @@ -138,6 +143,10 @@ #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_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) @@ -156,6 +165,13 @@ #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,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_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_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_HARDWARE,f) #define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) @@ -165,7 +181,6 @@ #define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,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_LPIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_IO,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) @@ -181,6 +196,7 @@ #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_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) @@ -190,6 +206,14 @@ #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_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,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_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_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) @@ -216,6 +240,8 @@ /* Flags */ +#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) @@ -226,6 +252,9 @@ #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_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,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_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) @@ -240,6 +269,9 @@ #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_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_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o) @@ -490,6 +522,14 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = ACPI_DMT_TERMINATOR }; +/* ACPI 6.0 Extensions (FADT version 6) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[] = +{ + {ACPI_DMT_UINT64, ACPI_FADT_OFFSET (HypervisorId), "Hypervisor ID", 0}, + ACPI_DMT_TERMINATOR +}; + /* * Remaining tables are not consumed directly by the ACPICA subsystem @@ -680,7 +720,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] = ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[] = { - {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (Length), "Length", 0}, + {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}, @@ -715,13 +755,19 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[] = { - {ACPI_DMT_UINT32, ACPI_CSRT2_OFFSET (Length), "Length", 0}, + {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 +}; + /******************************************************************************* * @@ -777,7 +823,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] = ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] = { - {ACPI_DMT_BUFFER, 0, "OEM Data", DT_OPTIONAL}, + {ACPI_DMT_RAW_BUFFER, 0, "OEM Data", DT_OPTIONAL}, ACPI_DMT_TERMINATOR }; @@ -895,7 +941,54 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] = 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 }; @@ -1302,6 +1395,148 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] = /******************************************************************************* * + * 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 (Reserved), "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 +}; + +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_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_UINT64, 0, "SMMU_NSgIrpt Interrupt", 0}, + {ACPI_DMT_UINT64, 0, "SMMU_NSgCfgIrpt Interrupt", 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 +}; + + +/******************************************************************************* + * * IVRS - I/O Virtualization Reporting Structure * ******************************************************************************/ @@ -1432,22 +1667,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] = ACPI_DMT_TERMINATOR }; -/* 1: Simple I/O */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[] = -{ - {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (EntryTrigger), "Entry Trigger", 0}, - {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (TriggerAction), "Trigger Action", 0}, - {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerValue), "Trigger Value", 0}, - {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerMask), "Trigger Mask", 0}, - {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (MinimumIdleState), "Minimum Idle State", 0}, - {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Residency), "Residency", 0}, - {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Latency), "Latency", 0}, - {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (ResidencyCounter), "Residency Counter", 0}, - {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (CounterFrequency), "Counter Frequency", 0}, - ACPI_DMT_TERMINATOR -}; - /******************************************************************************* * @@ -1629,6 +1848,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = {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_UINT24, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -1640,7 +1861,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] = {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_UINT32, ACPI_MADT12_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_MADT12_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT24, ACPI_MADT12_OFFSET (Reserved2[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -1668,6 +1890,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] = 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 +}; /******************************************************************************* * @@ -1850,6 +2082,156 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[] = /******************************************************************************* * + * 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_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]), "Address Range 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_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_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_UINT48, 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 +}; + + +/******************************************************************************* + * * PCCT - Platform Communications Channel Table (ACPI 5.0) * ******************************************************************************/ @@ -2210,6 +2592,25 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] = /******************************************************************************* * + * 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 +}; + + +/******************************************************************************* + * * TCPA - Trusted Computing Platform Alliance table * ******************************************************************************/ @@ -2388,6 +2789,49 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] = 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_UNICODE, sizeof (ACPI_TABLE_WPBT), "Command-line Arguments", 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 */ /* diff --git a/source/compiler/aslascii.c b/source/compiler/aslascii.c index dfb28f2..90abef2 100644 --- a/source/compiler/aslascii.c +++ b/source/compiler/aslascii.c @@ -148,8 +148,7 @@ FlCheckForAcpiTable ( * * FUNCTION: FlCheckForAscii * - * PARAMETERS: Handle - Open input file - * Filename - Input filename + * PARAMETERS: Filename - Full input filename * DisplayErrors - TRUE if error messages desired * * RETURN: Status @@ -165,7 +164,6 @@ FlCheckForAcpiTable ( ACPI_STATUS FlCheckForAscii ( - FILE *Handle, char *Filename, BOOLEAN DisplayErrors) { @@ -173,7 +171,12 @@ FlCheckForAscii ( ACPI_SIZE BadBytes = 0; BOOLEAN OpeningComment = FALSE; ASL_FILE_STATUS Status; + FILE *Handle; + + + /* Open file in text mode so file offset is always accurate */ + Handle = fopen (Filename, "rb"); Status.Line = 1; Status.Offset = 0; @@ -214,16 +217,30 @@ FlCheckForAscii ( if ((BadBytes < 10) && (DisplayErrors)) { AcpiOsPrintf ( - "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n", + "Found non-ASCII character in source text: " + "0x%2.2X in line %u, file offset 0x%2.2X\n", Byte, Status.Line, Status.Offset); } + BadBytes++; + } + /* Ensure character is either printable or a "space" char */ + + else if (!ACPI_IS_PRINT (Byte) && !ACPI_IS_SPACE (Byte)) + { + if ((BadBytes < 10) && (DisplayErrors)) + { + AcpiOsPrintf ( + "Found invalid character in source text: " + "0x%2.2X in line %u, file offset 0x%2.2X\n", + Byte, Status.Line, Status.Offset); + } BadBytes++; } - /* Update line counter */ + /* Update line counter as necessary */ - else if (Byte == 0x0A) + if (Byte == 0x0A) { Status.Line++; } @@ -231,9 +248,7 @@ FlCheckForAscii ( Status.Offset++; } - /* Seek back to the beginning of the source file */ - - fseek (Handle, 0, SEEK_SET); + fclose (Handle); /* Were there any non-ASCII characters in the file? */ @@ -242,8 +257,8 @@ FlCheckForAscii ( if (DisplayErrors) { AcpiOsPrintf ( - "%u non-ASCII characters found in input source text, could be a binary file\n", - BadBytes); + "Total %u invalid characters found in input source text, " + "could be a binary file\n", BadBytes); AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename); } @@ -286,6 +301,7 @@ FlConsumeAnsiComment ( { if (Byte == '/') { + Status->Offset++; return; } diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index 898d651..0156961 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -172,7 +172,6 @@ FlCheckForAcpiTable ( ACPI_STATUS FlCheckForAscii ( - FILE *Handle, char *Filename, BOOLEAN DisplayErrors); diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index 9030003..9da55bd 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -709,9 +709,18 @@ NamePathTail [.]{NameSeg} return (PARSEOP_NAMESTRING); } . { count (1); - sprintf (MsgBuffer, - "Invalid character (0x%2.2X), expecting ASL keyword or name", - *AslCompilertext); + if (ACPI_IS_PRINT (*AslCompilertext)) + { + sprintf (MsgBuffer, + "Invalid character (%c), expecting ASL keyword or name", + *AslCompilertext); + } + else + { + sprintf (MsgBuffer, + "Invalid character (0x%2.2X), expecting ASL keyword or name", + *AslCompilertext); + } AslCompilererror (MsgBuffer);} <> { if (AslPopInputFileStack ()) diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 14307c1..0697276 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -53,7 +53,7 @@ #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.1" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.0" /* Configuration constants */ diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c index de8e1ca..947e465 100644 --- a/source/compiler/aslfiles.c +++ b/source/compiler/aslfiles.c @@ -49,9 +49,10 @@ /* Local prototypes */ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, + ACPI_PARSE_OBJECT *Op, char *Filename); @@ -294,9 +295,10 @@ ConvertBackslashes: * ******************************************************************************/ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, + ACPI_PARSE_OBJECT *Op, char *Filename) { FILE *IncludeFile; @@ -320,6 +322,26 @@ FlOpenIncludeWithPrefix ( return (NULL); } +#ifdef _MUST_HANDLE_COMMENTS + /* + * Check entire include file for any # preprocessor directives. + * This is because there may be some confusion between the #include + * preprocessor directive and the ASL Include statement. + */ + while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) + { + if (Gbl_CurrentLineBuffer[0] == '#') + { + AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE, + Op, "use #include instead"); + } + } +#endif + + /* Must seek back to the start of the file */ + + fseek (IncludeFile, 0, SEEK_SET); + /* Push the include file on the open input file stack */ AslPushInputFileStack (IncludeFile, Pathname); @@ -376,7 +398,7 @@ FlOpenIncludeFile ( (Op->Asl.Value.String[0] == '\\') || (Op->Asl.Value.String[1] == ':')) { - IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix ("", Op, Op->Asl.Value.String); if (!IncludeFile) { goto ErrorExit; @@ -392,7 +414,7 @@ FlOpenIncludeFile ( * * Construct the file pathname from the global directory name. */ - IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op, Op->Asl.Value.String); if (IncludeFile) { return; @@ -405,7 +427,7 @@ FlOpenIncludeFile ( NextDir = Gbl_IncludeDirList; while (NextDir) { - IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op, Op->Asl.Value.String); if (IncludeFile) { return; diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c index 1f7a3b0..520ebe0 100644 --- a/source/compiler/aslmessages.c +++ b/source/compiler/aslmessages.c @@ -270,7 +270,8 @@ const char *AslPreprocessorMsgs [] = /* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments", /* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive", /* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma", -/* ASL_MSG_WARNING_DIRECTIVE */ "#warning" +/* ASL_MSG_WARNING_DIRECTIVE */ "#warning", +/* ASL_MSG_INCLUDE_FILE */ "Found a # preprocessor directive in ASL Include() file" }; @@ -331,7 +332,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs)) { - return ("[Unknown Preprocesor exception ID]"); + return ("[Unknown Preprocessor exception ID]"); } } diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index 7a04a63..9837d54 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -267,6 +267,7 @@ typedef enum ASL_MSG_UNKNOWN_DIRECTIVE, ASL_MSG_UNKNOWN_PRAGMA, ASL_MSG_WARNING_DIRECTIVE, + ASL_MSG_INCLUDE_FILE } ASL_MESSAGE_IDS; diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c index 037329a..eb62127 100644 --- a/source/compiler/aslprepkg.c +++ b/source/compiler/aslprepkg.c @@ -151,6 +151,7 @@ ApCheckPackage ( case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_FIX_VAR: + case ACPI_PTYPE2_VAR_VAR: default: break; @@ -324,6 +325,32 @@ ApCheckPackage ( break; + case ACPI_PTYPE2_VAR_VAR: + + /* Check for minimum size (ints at beginning + 1 subpackage) */ + + ExpectedCount = Package->RetInfo4.Count1 + 1; + if (Count < ExpectedCount) + { + goto PackageTooSmall; + } + + /* Check the non-package elements at beginning of main package */ + + for (i = 0; i < Package->RetInfo4.Count1; ++i) + { + Status = ApCheckObjectType (Predefined->Info.Name, Op, + Package->RetInfo4.ObjectType1, i); + Op = Op->Asl.Next; + } + + /* Examine the variable-length list of subpackages */ + + ApCheckPackageList (Predefined->Info.Name, Op, + Package, Package->RetInfo4.Count1, Count); + + break; + case ACPI_PTYPE2: case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: @@ -427,6 +454,7 @@ ApCheckPackageElements ( * ACPI_PTYPE2_MIN * ACPI_PTYPE2_COUNT * ACPI_PTYPE2_FIX_VAR + * ACPI_PTYPE2_VAR_VAR * ******************************************************************************/ @@ -473,9 +501,12 @@ ApCheckPackageList ( Count = (UINT32) Op->Asl.Value.Integer; Op = Op->Asl.Next; - /* The subpackage must have at least one element */ - - if (!Count) + /* + * Most subpackage must have at least one element, with + * only rare exceptions. (_RDI) + */ + if (!Count && + (Package->RetInfo.Type != ACPI_PTYPE2_VAR_VAR)) { ApZeroLengthPackage (PredefinedName, SubPackageOp); goto NextSubpackage; @@ -533,6 +564,25 @@ ApCheckPackageList ( Count - Package->RetInfo.Count1); break; + case ACPI_PTYPE2_VAR_VAR: + /* + * Must have at least the minimum number elements. + * A zero PkgCount means the number of elements is variable. + */ + ExpectedCount = Package->RetInfo4.PkgCount; + if (ExpectedCount && (Count < ExpectedCount)) + { + ApPackageTooSmall (PredefinedName, SubPackageOp, + Count, 1); + break; + } + + ApCheckPackageElements (PredefinedName, Op, + Package->RetInfo4.SubObjectTypes, + Package->RetInfo4.PkgCount, + 0, 0); + break; + case ACPI_PTYPE2_FIXED: /* Each subpackage has a fixed length */ diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index b25dd32..7cee85c 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -159,10 +159,10 @@ AslDetectSourceFileType ( /* Check for 100% ASCII source file (comments are ignored) */ - Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE); + Status = FlCheckForAscii (Info->Filename, TRUE); if (ACPI_FAILURE (Status)) { - printf ("Non-ascii input file - %s\n", Info->Filename); + printf ("Invalid characters in input file - %s\n", Info->Filename); if (!Gbl_IgnoreErrors) { diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index 4d3edc0..6b94d28 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -77,13 +77,11 @@ UtAttachNameseg ( * ******************************************************************************/ -#define ACPI_TABLE_HELP_FORMAT "%8u) %s %s\n" - void UtDisplaySupportedTables ( void) { - ACPI_DMTABLE_DATA *TableData; + const AH_TABLE *TableData; UINT32 i; @@ -91,20 +89,14 @@ UtDisplaySupportedTables ( " (Compiler, Disassembler, Template Generator)\n\n", ACPI_CA_VERSION); - /* Special tables */ - - printf (" Special tables and AML tables:\n"); - printf (ACPI_TABLE_HELP_FORMAT, 1, ACPI_RSDP_NAME, "Root System Description Pointer"); - printf (ACPI_TABLE_HELP_FORMAT, 2, ACPI_SIG_FACS, "Firmware ACPI Control Structure"); - printf (ACPI_TABLE_HELP_FORMAT, 3, ACPI_SIG_DSDT, "Differentiated System Description Table"); - printf (ACPI_TABLE_HELP_FORMAT, 4, ACPI_SIG_SSDT, "Secondary System Description Table"); - - /* All data tables with common table header */ + /* All ACPI tables with the common table header */ - printf ("\n Standard ACPI data tables:\n"); - for (TableData = AcpiDmTableData, i = 5; TableData->Signature; TableData++, i++) + printf ("\n Supported ACPI tables:\n"); + for (TableData = AcpiSupportedTables, i = 1; + TableData->Signature; TableData++, i++) { - printf (ACPI_TABLE_HELP_FORMAT, i, TableData->Signature, TableData->Name); + printf ("%8u) %s %s\n", i, + TableData->Signature, TableData->Description); } } diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c index 0b94919..8279055 100644 --- a/source/compiler/dtcompile.c +++ b/source/compiler/dtcompile.c @@ -283,7 +283,7 @@ static ACPI_STATUS DtCompileDataTable ( DT_FIELD **FieldList) { - ACPI_DMTABLE_DATA *TableData; + const ACPI_DMTABLE_DATA *TableData; DT_SUBTABLE *Subtable; char *Signature; ACPI_TABLE_HEADER *AcpiTableHeader; @@ -358,7 +358,7 @@ DtCompileDataTable ( TableData = AcpiDmGetTableData (Signature); if (!TableData || Gbl_CompileGeneric) { - DtCompileGeneric ((void **) FieldList); + DtCompileGeneric ((void **) FieldList, NULL, NULL); goto FinishHeader; } @@ -436,14 +436,14 @@ DtCompileTable ( DT_FIELD *LocalField; UINT32 Length; DT_SUBTABLE *Subtable; - DT_SUBTABLE *InlineSubtable; + DT_SUBTABLE *InlineSubtable = NULL; UINT32 FieldLength = 0; UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; char *String; UINT32 CurrentFlagByteOffset = 0; - ACPI_STATUS Status; + ACPI_STATUS Status = AE_OK; if (!Field || !*Field) @@ -479,6 +479,7 @@ DtCompileTable ( Buffer = Subtable->Buffer; LocalField = *Field; + Subtable->Name = LocalField->Name; /* * Main loop walks the info table for this ACPI table or subtable @@ -555,15 +556,32 @@ DtCompileTable ( */ *Field = LocalField; - if (Info->Opcode == ACPI_DMT_GAS) + switch (Info->Opcode) { + case ACPI_DMT_GAS: + Status = DtCompileTable (Field, AcpiDmTableInfoGas, &InlineSubtable, TRUE); - } - else - { + break; + + case ACPI_DMT_HESTNTFY: + Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify, &InlineSubtable, TRUE); + break; + + case ACPI_DMT_IORTMEM: + + Status = DtCompileTable (Field, AcpiDmTableInfoIortAcc, + &InlineSubtable, TRUE); + break; + + default: + sprintf (MsgBuffer, "Invalid DMT opcode: 0x%.2X", + Info->Opcode); + DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); + Status = AE_BAD_DATA; + break; } if (ACPI_FAILURE (Status)) @@ -600,7 +618,6 @@ DtCompileTable ( Subtable->LengthField = Buffer; Subtable->SizeOfLengthField = FieldLength; } - break; } @@ -616,3 +633,43 @@ Error: ACPI_FREE (Subtable); return (Status); } + + +/****************************************************************************** + * + * 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 = UtStringCacheCalloc (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/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index c6097ff..765e61c 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -115,6 +115,7 @@ typedef struct dt_subtable struct dt_subtable *StackTop; UINT8 *Buffer; UINT8 *LengthField; + char *Name; UINT32 Length; UINT32 TotalLength; UINT32 SizeOfLengthField; @@ -170,6 +171,11 @@ DtCompileTable ( DT_SUBTABLE **RetSubtable, BOOLEAN Required); +ACPI_STATUS +DtCompilePadding ( + UINT32 Length, + DT_SUBTABLE **RetSubtable); + /* dtio - binary and text input/output */ @@ -429,6 +435,10 @@ DtCompileDmar ( void **PFieldList); ACPI_STATUS +DtCompileDrtm ( + void **PFieldList); + +ACPI_STATUS DtCompileEinj ( void **PFieldList); @@ -453,6 +463,10 @@ DtCompileHest ( void **PFieldList); ACPI_STATUS +DtCompileIort ( + void **PFieldList); + +ACPI_STATUS DtCompileIvrs ( void **PFieldList); @@ -481,6 +495,10 @@ DtCompileMtmr ( void **PFieldList); ACPI_STATUS +DtCompileNfit ( + void **PFieldList); + +ACPI_STATUS DtCompilePmtt ( void **PFieldList); @@ -509,6 +527,10 @@ DtCompileSrat ( void **PFieldList); ACPI_STATUS +DtCompileStao ( + void **PFieldList); + +ACPI_STATUS DtCompileUefi ( void **PFieldList); @@ -521,12 +543,18 @@ DtCompileWdat ( void **PFieldList); ACPI_STATUS +DtCompileWpbt ( + void **PFieldList); + +ACPI_STATUS DtCompileXsdt ( void **PFieldList); ACPI_STATUS DtCompileGeneric ( - void **PFieldList); + void **PFieldList, + char *TermFieldName, + UINT32 *PFieldLength); ACPI_DMTABLE_INFO * DtGetGenericTableInfo ( @@ -543,6 +571,7 @@ 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[]; @@ -551,6 +580,7 @@ extern const unsigned char TemplateFpdt[]; extern const unsigned char TemplateGtdt[]; extern const unsigned char TemplateHest[]; 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[]; @@ -560,6 +590,7 @@ extern const unsigned char TemplateMpst[]; extern const unsigned char TemplateMsct[]; extern const unsigned char TemplateMsdm[]; extern const unsigned char TemplateMtmr[]; +extern const unsigned char TemplateNfit[]; extern const unsigned char TemplatePcct[]; extern const unsigned char TemplatePmtt[]; extern const unsigned char TemplateRsdt[]; @@ -570,6 +601,7 @@ 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 TemplateTcpa[]; extern const unsigned char TemplateTpm2[]; extern const unsigned char TemplateUefi[]; @@ -578,6 +610,8 @@ 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 TemplateXenv[]; extern const unsigned char TemplateXsdt[]; #endif diff --git a/source/compiler/dtio.c b/source/compiler/dtio.c index 98837d5..a42ca2d 100644 --- a/source/compiler/dtio.c +++ b/source/compiler/dtio.c @@ -978,8 +978,8 @@ DtDumpSubtableInfo ( { DbgPrint (ASL_DEBUG_OUTPUT, - "[%.04X] %.08X %.08X %.08X %.08X %.08X %p %p %p\n", - Subtable->Depth, Subtable->Length, Subtable->TotalLength, + "[%.04X] %24s %.08X %.08X %.08X %.08X %.08X %p %p %p\n", + Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength, Subtable->SizeOfLengthField, Subtable->Flags, Subtable, Subtable->Parent, Subtable->Child, Subtable->Peer); } @@ -992,8 +992,8 @@ DtDumpSubtableTree ( { DbgPrint (ASL_DEBUG_OUTPUT, - "[%.04X] %*s%08X (%.02X) - (%.02X)\n", - Subtable->Depth, (4 * Subtable->Depth), " ", + "[%.04X] %24s %*s%08X (%.02X) - (%.02X)\n", + Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ", Subtable, Subtable->Length, Subtable->TotalLength); } @@ -1024,12 +1024,12 @@ DtDumpSubtableList ( DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Info:\n" - "Depth Length TotalLen LenSize Flags " + "Depth Name Length TotalLen LenSize Flags " "This Parent Child Peer\n\n"); DtWalkTableTree (Gbl_RootTable, DtDumpSubtableInfo, NULL, NULL); DbgPrint (ASL_DEBUG_OUTPUT, - "\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n"); + "\nSubtable Tree: (Depth, Name, Subtable, Length, TotalLength)\n\n"); DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL); DbgPrint (ASL_DEBUG_OUTPUT, "\n"); diff --git a/source/compiler/dtsubtable.c b/source/compiler/dtsubtable.c index 7d656db..d7e4eff 100644 --- a/source/compiler/dtsubtable.c +++ b/source/compiler/dtsubtable.c @@ -321,6 +321,11 @@ DtGetSubtableLength ( Step = 9; break; + case ACPI_DMT_IORTMEM: + + Step = 10; + break; + default: Step = 1; diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c index 438a3ed..d7b2e90 100644 --- a/source/compiler/dttable.c +++ b/source/compiler/dttable.c @@ -65,12 +65,6 @@ static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] = }; -/* TBD: move to acmacros.h */ - -#define ACPI_SUB_PTR(t, a, b) \ - ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) - - /* Local prototypes */ static ACPI_STATUS @@ -454,6 +448,7 @@ DtCompileCsrt ( /* Subtables (Resource Groups) */ + ParentTable = DtPeekSubtable (); while (*PFieldList) { /* Resource group subtable */ @@ -477,9 +472,9 @@ DtCompileCsrt ( DescriptorCount = (GroupLength / sizeof (ACPI_CSRT_DESCRIPTOR)); - ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); + ParentTable = DtPeekSubtable (); /* Shared info subtable (One per resource group) */ @@ -490,26 +485,44 @@ DtCompileCsrt ( return (Status); } - ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); /* Sub-Subtables (Resource Descriptors) */ while (*PFieldList && DescriptorCount) { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2, &Subtable, TRUE); if (ACPI_FAILURE (Status)) { return (Status); } + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); ParentTable = DtPeekSubtable (); - DtInsertSubtable (ParentTable, Subtable); + if (*PFieldList) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (Subtable) + { + DtInsertSubtable (ParentTable, Subtable); + } + } + DtPopSubtable (); + ParentTable = DtPeekSubtable (); + DescriptorCount--; } DtPopSubtable (); + ParentTable = DtPeekSubtable (); } return (Status); @@ -828,6 +841,135 @@ DtCompileDmar ( /****************************************************************************** * + * 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + + /* + * Using ACPI_SUB_PTR, We needn't define a seperate 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, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + 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 @@ -946,6 +1088,18 @@ DtCompileFadt ( DtInsertSubtable (ParentTable, Subtable); } + + if (Revision >= 6) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + } } return (AE_OK); @@ -1285,6 +1439,309 @@ DtCompileHest ( /****************************************************************************** * + * 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_IORT *Iort; + ACPI_IORT_NODE *IortNode; + ACPI_IORT_ITS_GROUP *IortItsGroup; + ACPI_IORT_SMMU *IortSmmu; + UINT32 NodeNumber; + UINT32 NodeLength; + UINT32 IdMappingNumber; + UINT32 ItsNumber; + UINT32 ContextIrptNumber; + UINT32 PmuIrptNumber; + UINT32 PaddingLength; + + + ParentTable = DtPeekSubtable (); + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + + /* + * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care + * should be taken to avoid accessing ACPI_TABLE_HADER 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, TRUE); + 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; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr, + &Subtable, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + NodeLength += Subtable->Length; + break; + + case ACPI_IORT_NODE_SMMU: + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3, + &Subtable, TRUE); + 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, TRUE); + 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, TRUE); + 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + NodeLength += Subtable->Length; + PmuIrptNumber++; + } + IortSmmu->PmuInterruptCount = PmuIrptNumber; + 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + NodeLength += sizeof (ACPI_IORT_ID_MAPPING); + IdMappingNumber++; + } + IortNode->MappingCount = IdMappingNumber; + + /* + * 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 @@ -1487,11 +1944,6 @@ DtCompileLpit ( InfoTable = AcpiDmTableInfoLpit0; break; - case ACPI_LPIT_TYPE_SIMPLE_IO: - - InfoTable = AcpiDmTableInfoLpit1; - break; - default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT"); @@ -1643,6 +2095,11 @@ DtCompileMadt ( InfoTable = AcpiDmTableInfoMadt14; break; + case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: + + InfoTable = AcpiDmTableInfoMadt15; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT"); @@ -1878,6 +2335,201 @@ DtCompileMtmr ( /****************************************************************************** * + * 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + /* Subtables */ + + while (*PFieldList) + { + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr, + &Subtable, TRUE); + 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; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT"); + return (AE_ERROR); + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + 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, FALSE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + DtPopSubtable (); + break; + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + Count++; + } + + Interleave->LineCount = Count; + DtPopSubtable (); + break; + + case ACPI_NFIT_TYPE_SMBIOS: + + if (*PFieldList) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a, + &Subtable, TRUE); + 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, FALSE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + DtPopSubtable (); + break; + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + Count++; + } + + Hint->HintCount = (UINT16) Count; + DtPopSubtable (); + break; + + default: + break; + } + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompilePcct * * PARAMETERS: List - Current field list pointer @@ -1901,6 +2553,8 @@ DtCompilePcct ( ACPI_DMTABLE_INFO *InfoTable; + /* Main table */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct, &Subtable, TRUE); if (ACPI_FAILURE (Status)) @@ -1911,6 +2565,8 @@ DtCompilePcct ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + /* Subtables */ + while (*PFieldList) { SubtableStart = *PFieldList; @@ -2413,6 +3069,59 @@ DtCompileSrat ( /****************************************************************************** * + * 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, TRUE); + 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, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtGetGenericTableInfo * * PARAMETERS: Name - Generic type name @@ -2503,7 +3212,7 @@ DtCompileUefi ( * operators may be used. */ - DtCompileGeneric ((void **) PFieldList); + DtCompileGeneric ((void **) PFieldList, NULL, NULL); return (AE_OK); } @@ -2561,6 +3270,63 @@ DtCompileWdat ( /****************************************************************************** * + * 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; + UINT16 Length; + + + /* Compile the main table */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + /* Compile the argument list subtable */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Extract the length of the Arguments buffer, insert into main table */ + + Length = (UINT16) Subtable->TotalLength; + Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer); + Table->ArgumentsLength = Length; + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileXsdt * * PARAMETERS: List - Current field list pointer @@ -2580,6 +3346,7 @@ DtCompileXsdt ( DT_FIELD *FieldList = *(DT_FIELD **) List; UINT64 Address; + ParentTable = DtPeekSubtable (); while (FieldList) @@ -2600,6 +3367,8 @@ DtCompileXsdt ( * FUNCTION: DtCompileGeneric * * PARAMETERS: List - Current field list pointer + * Name - Field name to end generic compiling + * Length - Compiled table length to return * * RETURN: Status * @@ -2609,7 +3378,9 @@ DtCompileXsdt ( ACPI_STATUS DtCompileGeneric ( - void **List) + void **List, + char *Name, + UINT32 *Length) { ACPI_STATUS Status; DT_SUBTABLE *Subtable; @@ -2632,8 +3403,16 @@ DtCompileGeneric ( /* Now we can actually compile the parse tree */ + if (*Length) + { + *Length = 0; + } while (*PFieldList) { + if (Name && !ACPI_STRCMP ((*PFieldList)->Name, Name)) + { + break; + } Info = DtGetGenericTableInfo ((*PFieldList)->Name); if (!Info) { @@ -2651,6 +3430,10 @@ DtCompileGeneric ( if (ACPI_SUCCESS (Status)) { DtInsertSubtable (ParentTable, Subtable); + if (Length) + { + *Length += Subtable->Length; + } } else { diff --git a/source/compiler/dttemplate.c b/source/compiler/dttemplate.c index eb93e9b..70dfe2d 100644 --- a/source/compiler/dttemplate.c +++ b/source/compiler/dttemplate.c @@ -59,7 +59,7 @@ AcpiUtIsSpecialTable ( static ACPI_STATUS DtCreateOneTemplate ( char *Signature, - ACPI_DMTABLE_DATA *TableData); + const ACPI_DMTABLE_DATA *TableData); static ACPI_STATUS DtCreateAllTemplates ( @@ -112,7 +112,7 @@ ACPI_STATUS DtCreateTemplates ( char *Signature) { - ACPI_DMTABLE_DATA *TableData; + const ACPI_DMTABLE_DATA *TableData; ACPI_STATUS Status; @@ -213,7 +213,7 @@ static ACPI_STATUS DtCreateAllTemplates ( void) { - ACPI_DMTABLE_DATA *TableData; + const ACPI_DMTABLE_DATA *TableData; ACPI_STATUS Status; @@ -292,7 +292,7 @@ DtCreateAllTemplates ( static ACPI_STATUS DtCreateOneTemplate ( char *Signature, - ACPI_DMTABLE_DATA *TableData) + const ACPI_DMTABLE_DATA *TableData) { char *DisasmFilename; FILE *File; diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index 39be761..1b27b4e 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -234,6 +234,29 @@ const unsigned char TemplateDmar[] = 0x00,0x00,0x00,0x00 /* 00000088 "...." */ }; +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..." */ @@ -379,11 +402,11 @@ const unsigned char TemplateFacs[] = const unsigned char TemplateFadt[] = { - 0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */ - 0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 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" */ - 0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ + 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 "........" */ @@ -412,7 +435,8 @@ const unsigned char TemplateFadt[] = 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 /* 00000108 "...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ + 0x00,0x00,0x00,0x00 /* 00000110 "...." */ }; const unsigned char TemplateFpdt[] = @@ -538,6 +562,44 @@ const unsigned char TemplateHpet[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */ }; +const unsigned char TemplateIort[] = +{ + 0x49,0x4F,0x52,0x54,0x0C,0x01,0x00,0x00, /* 00000000 "IORT...." */ + 0x00,0xBC,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,0x04,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ + 0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0x00, /* 00000030 ".....,.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */ + 0x18,0x00,0x00,0x00,0x01,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,0x30,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".0......" */ + 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000068 "....0..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x5C,0x5F,0x53, /* 00000078 ".....\_S" */ + 0x42,0x2E,0x50,0x43,0x49,0x30,0x2E,0x44, /* 00000080 "B.PCI0.D" */ + 0x45,0x56,0x30,0x00,0x00,0x00,0x00,0x00, /* 00000088 "EV0....." */ + 0x02,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 ". ......" */ + 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000098 ".... ..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x03,0x5C,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 ".\......" */ + 0x00,0x00,0x00,0x00,0x5C,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,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x3C,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D8 "<......." */ + 0x4C,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000E0 "L......." */ + 0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "T......." */ + 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 /* 00000108 "...." */ +}; + const unsigned char TemplateIvrs[] = { 0x49,0x56,0x52,0x53,0xBC,0x00,0x00,0x00, /* 00000000 "IVRS...." */ @@ -568,73 +630,75 @@ const unsigned char TemplateIvrs[] = const unsigned char TemplateLpit[] = { - 0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "LPIT...." */ - 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 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" */ - 0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "%.. ...." */ + 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */ - 0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00, /* 00000030 "........" */ + 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 "........" */ - 0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ". ......" */ + 0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".@......" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */ - 0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000060 "X......." */ - 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000068 "........" */ + 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 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000088 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ - 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x00,0x00,0x00,0x00 /* 000000B0 "...." */ + 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 5.1 subtables */ +/* MADT with ACPI 6.0 subtables */ const unsigned char TemplateMadt[] = { - 0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00, /* 00000000 "APIC*..." */ - 0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".4INTEL " */ - 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ - 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ - 0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */ + 0x41,0x50,0x49,0x43,0x5A,0x01,0x00,0x00, /* 00000000 "APICZ..." */ + 0x03,0xEA,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 "... ...." */ 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ - 0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00, /* 00000030 "........" */ + 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 "........" */ + 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 "........" */ + 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" */ + 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,0x4c, /* 000000b0 ".......L" */ - 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,0x0e,0x10,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 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,0x0c,0x18,0x00,0x00,0x00,0x00, /* 00000110 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ + 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 /* 00000128 ".. " */ + 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 /* 00000158 ".." */ }; const unsigned char TemplateMcfg[] = @@ -728,6 +792,56 @@ const unsigned char TemplateMsct[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */ }; +const unsigned char TemplateNfit[] = +{ + 0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00, /* 00000000 "NFITp..." */ + 0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".SINTEL " */ + 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 "... ...." */ + 0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00, /* 00000028 "..8....." */ + 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 "........" */ + 0x01,0x00,0x30,0x00,0x01,0x00,0x00,0x00, /* 00000060 "..0....." */ + 0x04,0x00,0x00,0x00,0x01,0x00,0x01,0x00, /* 00000068 "........" */ + 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x01,0x00,0x03,0x00,0x2A,0x00,0x00,0x00, /* 00000088 "....*..." */ + 0x02,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000090 ".. ....." */ + 0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x03,0x00,0x28,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "..(....." */ + 0xB4,0x13,0x5D,0x40,0x91,0x0B,0x29,0x93, /* 000000B8 "..]@..)." */ + 0x67,0xE8,0x23,0x4C,0x00,0x00,0x00,0x88, /* 000000C0 "g.#L...." */ + 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77, /* 000000C8 ".."3DUfw" */ + 0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF, /* 000000D0 "........" */ + 0x04,0x00,0x50,0x00,0x01,0x00,0x86,0x80, /* 000000D8 "..P....." */ + 0x17,0x20,0x01,0x00,0x86,0x80,0x17,0x20, /* 000000E0 ". ..... " */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x89,0x00,0x54,0x76,0x01,0x03,0x00,0x01, /* 000000F0 "..Tv...." */ + 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 ". ......" */ + 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ + 0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0x05,0x00,0x28,0x00,0x01,0x00,0x00,0x01, /* 00000128 "..(....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 ". ......" */ + 0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00, /* 00000140 "........" */ + 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, /* 00000148 "........" */ + 0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000150 ".. ....." */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ + 0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00, /* 00000160 "........" */ + 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00 /* 00000168 "........" */ +}; + const unsigned char TemplateMtmr[] = { 0x4D,0x54,0x4D,0x52,0x4C,0x00,0x00,0x00, /* 00000000 "MTMRL..." */ @@ -999,6 +1113,26 @@ const unsigned char TemplateSrat[] = 0x00,0x00 /* 00000090 ".." */ }; +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 TemplateTcpa[] = { 0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00, /* 00000000 "TCPA2..." */ @@ -1095,6 +1229,41 @@ const unsigned char TemplateWdrt[] = 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 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..." */ diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c index 411ab00..5b88d11 100644 --- a/source/compiler/dtutils.c +++ b/source/compiler/dtutils.c @@ -376,6 +376,7 @@ DtGetFieldType ( case ACPI_DMT_GAS: case ACPI_DMT_HESTNTFY: + case ACPI_DMT_IORTMEM: Type = DT_FIELD_TYPE_INLINE_SUBTABLE; break; @@ -520,6 +521,7 @@ DtGetFieldLength ( case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: + case ACPI_DMT_NFIT: case ACPI_DMT_PCI_PATH: ByteLength = 2; @@ -587,6 +589,11 @@ DtGetFieldLength ( 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: diff --git a/source/compiler/preprocess.h b/source/compiler/preprocess.h index d064287..9dc2bdb 100644 --- a/source/compiler/preprocess.h +++ b/source/compiler/preprocess.h @@ -267,14 +267,18 @@ PrReplaceData ( char *BufferToAdd, UINT32 LengthToAdd); -void +FILE * PrOpenIncludeFile ( - char *Filename); + char *Filename, + char *OpenMode, + char **FullPathname); FILE * PrOpenIncludeWithPrefix ( char *PrefixDir, - char *Filename); + char *Filename, + char *OpenMode, + char **FullPathname); void PrPushInputFileStack ( diff --git a/source/compiler/prscan.c b/source/compiler/prscan.c index 724fb5a..47f772f 100644 --- a/source/compiler/prscan.c +++ b/source/compiler/prscan.c @@ -85,28 +85,42 @@ PrDbgPrint ( char *Action, char *DirectiveName); +static void +PrDoIncludeBuffer ( + char *Pathname, + char *BufferName); + +static void +PrDoIncludeFile ( + char *Pathname); + /* * Supported preprocessor directives + * Each entry is of the form "Name, ArgumentCount" */ static const PR_DIRECTIVE_INFO Gbl_DirectiveInfo[] = { - {"define", 1}, - {"elif", 0}, /* Converted to #else..#if internally */ - {"else", 0}, - {"endif", 0}, - {"error", 1}, - {"if", 1}, - {"ifdef", 1}, - {"ifndef", 1}, - {"include", 0}, /* Argument is not standard format, so 0 */ - {"line", 1}, - {"pragma", 1}, - {"undef", 1}, - {"warning", 1}, - {NULL, 0} + {"define", 1}, + {"elif", 0}, /* Converted to #else..#if internally */ + {"else", 0}, + {"endif", 0}, + {"error", 1}, + {"if", 1}, + {"ifdef", 1}, + {"ifndef", 1}, + {"include", 0}, /* Argument is not standard format, so just use 0 here */ + {"includebuffer", 0}, /* Argument is not standard format, so just use 0 here */ + {"line", 1}, + {"loadbuffer", 0}, + {"pragma", 1}, + {"undef", 1}, + {"warning", 1}, + {NULL, 0} }; +/* This table must match ordering of above table exactly */ + enum Gbl_DirectiveIndexes { PR_DIRECTIVE_DEFINE = 0, @@ -118,6 +132,7 @@ enum Gbl_DirectiveIndexes PR_DIRECTIVE_IFDEF, PR_DIRECTIVE_IFNDEF, PR_DIRECTIVE_INCLUDE, + PR_DIRECTIVE_INCLUDEBUFFER, PR_DIRECTIVE_LINE, PR_DIRECTIVE_PRAGMA, PR_DIRECTIVE_UNDEF, @@ -382,13 +397,6 @@ PrPreprocessInputFile ( Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, &Next); } -#if 0 -/* Line prefix */ - FlPrintFile (ASL_FILE_PREPROCESSOR, "/* %14s %.5u i:%.5u */ ", - Gbl_Files[ASL_FILE_INPUT].Filename, - Gbl_CurrentLineNumber, Gbl_PreprocessorLineNumber); -#endif - /* * Emit a #line directive if necessary, to keep the line numbers in * the (.i) file synchronized with the original source code file, so @@ -433,7 +441,7 @@ PrDoDirective ( char **Next) { char *Token = Gbl_MainTokenBuffer; - char *Token2; + char *Token2 = NULL; char *End; UINT64 Value; ACPI_SIZE TokenOffset; @@ -452,7 +460,7 @@ PrDoDirective ( PrError (ASL_ERROR, ASL_MSG_UNKNOWN_DIRECTIVE, THIS_TOKEN_OFFSET (DirectiveToken)); - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "#%s: Unknown directive\n", Gbl_CurrentLineNumber, DirectiveToken); return; @@ -539,7 +547,7 @@ PrDoDirective ( /* Most directives have at least one argument */ - if (Gbl_DirectiveInfo[Directive].ArgCount == 1) + if (Gbl_DirectiveInfo[Directive].ArgCount >= 1) { Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next); if (!Token) @@ -548,6 +556,15 @@ PrDoDirective ( } } + if (Gbl_DirectiveInfo[Directive].ArgCount >= 2) + { + Token2 = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next); + if (!Token2) + { + goto SyntaxError; + } + } + /* * At this point, if we are ignoring the current code block, * do not process any more directives (i.e., ignore them also.) @@ -599,7 +616,7 @@ PrDoDirective ( Gbl_IgnoringThisCodeBlock = TRUE; } - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "Resolved #if: %8.8X%8.8X %s\n", Gbl_CurrentLineNumber, ACPI_FORMAT_UINT64 (Value), Gbl_IgnoringThisCodeBlock ? "" : ""); @@ -672,7 +689,7 @@ PrDoDirective ( Token2 = ""; } #endif - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "New #define: %s->%s\n", Gbl_CurrentLineNumber, Token, Token2); @@ -700,11 +717,32 @@ PrDoDirective ( goto SyntaxError; } - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "Start #include file \"%s\"\n", Gbl_CurrentLineNumber, Token, Gbl_CurrentLineNumber); - PrOpenIncludeFile (Token); + PrDoIncludeFile (Token); + break; + + case PR_DIRECTIVE_INCLUDEBUFFER: + + Token = PrGetNextToken (NULL, " \"<>", Next); + if (!Token) + { + goto SyntaxError; + } + + Token2 = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, Next); + if (!Token2) + { + goto SyntaxError; + } + + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID + "Start #includebuffer input from file \"%s\", buffer name %s\n", + Gbl_CurrentLineNumber, Token, Token2); + + PrDoIncludeBuffer (Token, Token2); break; case PR_DIRECTIVE_LINE: @@ -718,7 +756,7 @@ PrDoDirective ( return; } - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "User #line invocation %s\n", Gbl_CurrentLineNumber, Token); @@ -768,7 +806,7 @@ PrDoDirective ( case PR_DIRECTIVE_UNDEF: - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "#undef: %s\n", Gbl_CurrentLineNumber, Token); PrRemoveDefine (Token); @@ -783,7 +821,7 @@ PrDoDirective ( default: /* Should never get here */ - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "Unrecognized directive: %u\n", Gbl_CurrentLineNumber, Directive); break; @@ -954,9 +992,92 @@ PrDbgPrint ( { DbgPrint (ASL_DEBUG_OUTPUT, "Pr(%.4u) - [%u %s] " - "%*s %s #%s, Depth %u\n", + "%*s %s #%s, IfDepth %u\n", Gbl_CurrentLineNumber, Gbl_IfDepth, Gbl_IgnoringThisCodeBlock ? "I" : "E", Gbl_IfDepth * 4, " ", Action, DirectiveName, Gbl_IfDepth); } + + +/******************************************************************************* + * + * FUNCTION: PrDoIncludeFile + * + * PARAMETERS: Pathname - Name of the input file + * + * RETURN: None. + * + * DESCRIPTION: Open an include file, from #include. + * + ******************************************************************************/ + +static void +PrDoIncludeFile ( + char *Pathname) +{ + char *FullPathname; + + + (void) PrOpenIncludeFile (Pathname, "r", &FullPathname); +} + + +/******************************************************************************* + * + * FUNCTION: PrDoIncludeBuffer + * + * PARAMETERS: Pathname - Name of the input binary file + * BufferName - ACPI namepath of the buffer + * + * RETURN: None. + * + * DESCRIPTION: Create an ACPI buffer object from a binary file. The contents + * of the file are emitted into the buffer object as ascii + * hex data. From #includebuffer. + * + ******************************************************************************/ + +static void +PrDoIncludeBuffer ( + char *Pathname, + char *BufferName) +{ + char *FullPathname; + FILE *BinaryBufferFile; + UINT32 i = 0; + UINT8 c; + + + BinaryBufferFile = PrOpenIncludeFile (Pathname, "rb", &FullPathname); + if (!BinaryBufferFile) + { + return; + } + + /* Emit "Name (XXXX, Buffer() {" header */ + + FlPrintFile (ASL_FILE_PREPROCESSOR, "Name (%s, Buffer()\n{", BufferName); + + /* Dump the entire file in ascii hex format */ + + while (fread (&c, 1, 1, BinaryBufferFile)) + { + if (!(i % 8)) + { + FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ", c); + } + + FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c); + i++; + } + + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID + "#includebuffer: read %u bytes from %s\n", + Gbl_CurrentLineNumber, i, FullPathname); + + /* Close the Name() operator */ + + FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName); + fclose (BinaryBufferFile); +} diff --git a/source/compiler/prutils.c b/source/compiler/prutils.c index f4873bf..a802fcf 100644 --- a/source/compiler/prutils.c +++ b/source/compiler/prutils.c @@ -238,9 +238,11 @@ PrReplaceData ( * ******************************************************************************/ -void +FILE * PrOpenIncludeFile ( - char *Filename) + char *Filename, + char *OpenMode, + char **FullPathname) { FILE *IncludeFile; ASL_INCLUDE_DIR *NextDir; @@ -257,12 +259,13 @@ PrOpenIncludeFile ( (Filename[0] == '\\') || (Filename[1] == ':')) { - IncludeFile = PrOpenIncludeWithPrefix ("", Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + "", Filename, OpenMode, FullPathname); if (!IncludeFile) { goto ErrorExit; } - return; + return (IncludeFile); } /* @@ -273,10 +276,11 @@ PrOpenIncludeFile ( * * Construct the file pathname from the global directory name. */ - IncludeFile = PrOpenIncludeWithPrefix (Gbl_DirectoryPath, Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + Gbl_DirectoryPath, Filename, OpenMode, FullPathname); if (IncludeFile) { - return; + return (IncludeFile); } /* @@ -286,10 +290,11 @@ PrOpenIncludeFile ( NextDir = Gbl_IncludeDirList; while (NextDir) { - IncludeFile = PrOpenIncludeWithPrefix (NextDir->Dir, Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + NextDir->Dir, Filename, OpenMode, FullPathname); if (IncludeFile) { - return; + return (IncludeFile); } NextDir = NextDir->Next; @@ -300,6 +305,7 @@ PrOpenIncludeFile ( ErrorExit: sprintf (Gbl_MainTokenBuffer, "%s, %s", Filename, strerror (errno)); PrError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, 0); + return (NULL); } @@ -320,7 +326,9 @@ ErrorExit: FILE * PrOpenIncludeWithPrefix ( char *PrefixDir, - char *Filename) + char *Filename, + char *OpenMode, + char **FullPathname) { FILE *IncludeFile; char *Pathname; @@ -336,7 +344,7 @@ PrOpenIncludeWithPrefix ( /* Attempt to open the file, push if successful */ - IncludeFile = fopen (Pathname, "r"); + IncludeFile = fopen (Pathname, OpenMode); if (!IncludeFile) { fprintf (stderr, "Could not open include file %s\n", Pathname); @@ -346,6 +354,7 @@ PrOpenIncludeWithPrefix ( /* Push the include file on the open input file stack */ PrPushInputFileStack (IncludeFile, Pathname); + *FullPathname = Pathname; return (IncludeFile); } diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index 0cda7ab..f9d7635 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -216,7 +216,8 @@ AeLocalLoadTable ( ACPI_STATUS AcpiDbGetTableFromFile ( char *Filename, - ACPI_TABLE_HEADER **ReturnTable) + ACPI_TABLE_HEADER **ReturnTable, + BOOLEAN MustBeAmlFile) { #ifdef ACPI_APPLICATION ACPI_STATUS Status; @@ -230,9 +231,18 @@ AcpiDbGetTableFromFile ( return (Status); } -#ifdef ACPI_DATA_TABLE_DISASSEMBLY - IsAmlTable = AcpiUtIsAmlTable (Table); -#endif + if (MustBeAmlFile) + { + IsAmlTable = AcpiUtIsAmlTable (Table); + if (!IsAmlTable) + { + ACPI_EXCEPTION ((AE_INFO, AE_OK, + "Input for -e is not an AML table: " + "\"%4.4s\" (must be DSDT/SSDT)", + Table->Signature)); + return (AE_TYPE); + } + } if (IsAmlTable) { diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 2441bc8..80fd3e6 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -969,7 +969,7 @@ AcpiDbCommandDispatch ( case CMD_LOAD: - Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL); + Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE); break; case CMD_LOCKS: diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c index 54a5c82..f1c3be8 100644 --- a/source/components/dispatcher/dsmethod.c +++ b/source/components/dispatcher/dsmethod.c @@ -123,6 +123,7 @@ AcpiDsAutoSerializeMethod ( WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL); if (!WalkState) { + AcpiPsFreeOp (Op); return_ACPI_STATUS (AE_NO_MEMORY); } @@ -131,6 +132,7 @@ AcpiDsAutoSerializeMethod ( if (ACPI_FAILURE (Status)) { AcpiDsDeleteWalkState (WalkState); + AcpiPsFreeOp (Op); return_ACPI_STATUS (Status); } @@ -139,10 +141,6 @@ AcpiDsAutoSerializeMethod ( /* Parse the method, scan for creation of named objects */ Status = AcpiPsParseAml (WalkState); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } AcpiPsDeleteParseTree (Op); return_ACPI_STATUS (Status); diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c index 617d5ad..21cc667 100644 --- a/source/components/hardware/hwpci.c +++ b/source/components/hardware/hwpci.c @@ -140,7 +140,7 @@ AcpiHwDerivePciId ( ACPI_HANDLE PciRegion) { ACPI_STATUS Status; - ACPI_PCI_DEVICE *ListHead = NULL; + ACPI_PCI_DEVICE *ListHead; ACPI_FUNCTION_TRACE (HwDerivePciId); @@ -198,7 +198,6 @@ AcpiHwBuildPciList ( ACPI_HANDLE ParentDevice; ACPI_STATUS Status; ACPI_PCI_DEVICE *ListElement; - ACPI_PCI_DEVICE *ListHead = NULL; /* @@ -206,6 +205,7 @@ AcpiHwBuildPciList ( * a list of device nodes. Loop will exit when either the PCI device is * found, or the root of the namespace is reached. */ + *ReturnListHead = NULL; CurrentDevice = PciRegion; while (1) { @@ -222,7 +222,6 @@ AcpiHwBuildPciList ( if (ParentDevice == RootPciDevice) { - *ReturnListHead = ListHead; return (AE_OK); } @@ -237,9 +236,9 @@ AcpiHwBuildPciList ( /* Put new element at the head of the list */ - ListElement->Next = ListHead; + ListElement->Next = *ReturnListHead; ListElement->Device = ParentDevice; - ListHead = ListElement; + *ReturnListHead = ListElement; CurrentDevice = ParentDevice; } diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index c6527cc..599af7e 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -321,6 +321,13 @@ AcpiNsCheckPackage ( Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); break; + case ACPI_PTYPE2_VAR_VAR: + /* + * Returns a variable list of packages, each with a variable list + * of objects. + */ + break; + case ACPI_PTYPE2_UUID_PAIR: /* The package must contain pairs of (UUID + type) */ @@ -490,6 +497,12 @@ AcpiNsCheckPackageList ( } break; + case ACPI_PTYPE2_VAR_VAR: + /* + * Each subpackage has a fixed or variable number of elements + */ + break; + case ACPI_PTYPE2_FIXED: /* Each subpackage has a fixed length */ diff --git a/source/components/namespace/nsrepair.c b/source/components/namespace/nsrepair.c index df0e1e4..160d843 100644 --- a/source/components/namespace/nsrepair.c +++ b/source/components/namespace/nsrepair.c @@ -523,10 +523,10 @@ AcpiNsRemoveNullElements ( case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_REV_FIXED: case ACPI_PTYPE2_FIX_VAR: - break; default: + case ACPI_PTYPE2_VAR_VAR: case ACPI_PTYPE1_FIXED: case ACPI_PTYPE1_OPTION: return; diff --git a/source/components/parser/psopinfo.c b/source/components/parser/psopinfo.c index e3cd31f..90940c8 100644 --- a/source/components/parser/psopinfo.c +++ b/source/components/parser/psopinfo.c @@ -52,9 +52,6 @@ ACPI_MODULE_NAME ("psopinfo") -extern const UINT8 AcpiGbl_ShortOpIndex[]; -extern const UINT8 AcpiGbl_LongOpIndex[]; - static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; diff --git a/source/components/utilities/utfileio.c b/source/components/utilities/utfileio.c index 39ef3e6..1e524fb 100644 --- a/source/components/utilities/utfileio.c +++ b/source/components/utilities/utfileio.c @@ -228,11 +228,8 @@ AcpiUtReadTable ( TableHeader.Length, FileSize); #ifdef ACPI_ASL_COMPILER - Status = FlCheckForAscii (fp, NULL, FALSE); - if (ACPI_SUCCESS (Status)) - { - AcpiOsPrintf ("File appears to be ASCII only, must be binary\n"); - } + AcpiOsPrintf ("File is corrupt or is ASCII text -- " + "it must be a binary file\n"); #endif return (AE_BAD_HEADER); } @@ -344,7 +341,7 @@ AcpiUtReadTableFromFile ( /* Get the entire file */ - fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n", + fprintf (stderr, "Reading ACPI table from file %10s - Length %.8u (0x%06X)\n", Filename, FileSize, FileSize); Status = AcpiUtReadTable (File, Table, &TableLength); diff --git a/source/components/utilities/uthex.c b/source/components/utilities/uthex.c index 4dcf1cf..abbf5f4 100644 --- a/source/components/utilities/uthex.c +++ b/source/components/utilities/uthex.c @@ -82,9 +82,9 @@ AcpiUtHexToAsciiChar ( /******************************************************************************* * - * FUNCTION: AcpiUtHexCharToValue + * FUNCTION: AcpiUtAsciiCharToHex * - * PARAMETERS: AsciiChar - Hex character in Ascii + * PARAMETERS: HexChar - Hex character in Ascii * * RETURN: The binary value of the ascii/hex character * diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c index 05b7652..a6a6818 100644 --- a/source/components/utilities/utxferror.c +++ b/source/components/utilities/utxferror.c @@ -123,8 +123,18 @@ AcpiException ( ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status)); + /* For AE_OK, just print the message */ + + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf (ACPI_MSG_EXCEPTION); + + } + else + { + AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status)); + } va_start (ArgList, Format); AcpiOsVprintf (Format, ArgList); ACPI_MSG_SUFFIX; diff --git a/source/include/acdebug.h b/source/include/acdebug.h index 23464d6..11cf02e 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -375,7 +375,8 @@ AcpiDbLoadAcpiTable ( ACPI_STATUS AcpiDbGetTableFromFile ( char *Filename, - ACPI_TABLE_HEADER **Table); + ACPI_TABLE_HEADER **Table, + BOOLEAN MustBeAmlTable); /* diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index f394bd0..966ec93 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -60,7 +60,7 @@ #define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data" -typedef const struct acpi_dmtable_info +typedef struct acpi_dmtable_info { UINT8 Opcode; UINT16 Offset; @@ -148,9 +148,11 @@ typedef enum ACPI_DMT_HEST, ACPI_DMT_HESTNTFY, ACPI_DMT_HESTNTYP, + ACPI_DMT_IORTMEM, ACPI_DMT_IVRS, ACPI_DMT_LPIT, ACPI_DMT_MADT, + ACPI_DMT_NFIT, ACPI_DMT_PCCT, ACPI_DMT_PMTT, ACPI_DMT_SLIC, @@ -178,7 +180,6 @@ typedef struct acpi_dmtable_data ACPI_DMTABLE_HANDLER TableHandler; ACPI_CMTABLE_HANDLER CmTableHandler; const unsigned char *Template; - char *Name; } ACPI_DMTABLE_DATA; @@ -246,6 +247,7 @@ 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[]; @@ -262,6 +264,11 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[]; 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[]; @@ -272,6 +279,7 @@ 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[]; @@ -297,6 +305,20 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[]; +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 AcpiDmTableInfoIortAcc[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[]; @@ -321,6 +343,7 @@ 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 AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; @@ -335,6 +358,18 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[]; +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 AcpiDmTableInfoPmtt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; @@ -362,6 +397,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; @@ -372,14 +409,17 @@ 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 AcpiDmTableInfoXenv[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; - /* - * dmtable + * dmtable and ahtable */ -extern ACPI_DMTABLE_DATA AcpiDmTableData[]; +extern const ACPI_DMTABLE_DATA AcpiDmTableData[]; +extern const AH_TABLE AcpiSupportedTables[]; UINT8 AcpiDmGenerateChecksum ( @@ -387,7 +427,7 @@ AcpiDmGenerateChecksum ( UINT32 Length, UINT8 OriginalChecksum); -ACPI_DMTABLE_DATA * +const ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature); @@ -426,8 +466,13 @@ AcpiDmDumpBuffer ( UINT32 BufferOffset, UINT32 Length, UINT32 AbsoluteOffset, - char *Header, - BOOLEAN MultiLine); + char *Header); + +void +AcpiDmDumpUnicode ( + void *Table, + UINT32 BufferOffset, + UINT32 ByteLength); void AcpiDmDumpAsf ( @@ -450,6 +495,10 @@ AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpDrtm ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table); @@ -474,6 +523,10 @@ AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpIort ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpIvrs ( ACPI_TABLE_HEADER *Table); @@ -502,6 +555,10 @@ AcpiDmDumpMtmr ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpNfit ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpPcct ( ACPI_TABLE_HEADER *Table); @@ -534,6 +591,10 @@ AcpiDmDumpSrat ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpStao ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpVrtc ( ACPI_TABLE_HEADER *Table); @@ -542,6 +603,10 @@ AcpiDmDumpWdat ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpWpbt ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpXsdt ( ACPI_TABLE_HEADER *Table); diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 9729930..4c96303 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -401,12 +401,24 @@ typedef struct acpi_package_info3 } ACPI_PACKAGE_INFO3; +typedef struct acpi_package_info4 +{ + UINT8 Type; + UINT8 ObjectType1; + UINT8 Count1; + UINT8 SubObjectTypes; + UINT8 PkgCount; + UINT16 Reserved; + +} ACPI_PACKAGE_INFO4; + typedef union acpi_predefined_info { ACPI_NAME_INFO Info; ACPI_PACKAGE_INFO RetInfo; ACPI_PACKAGE_INFO2 RetInfo2; ACPI_PACKAGE_INFO3 RetInfo3; + ACPI_PACKAGE_INFO4 RetInfo4; } ACPI_PREDEFINED_INFO; @@ -1371,4 +1383,11 @@ typedef struct ah_uuid } AH_UUID; +typedef struct ah_table +{ + char *Signature; + char *Description; + +} AH_TABLE; + #endif /* __ACLOCAL_H__ */ diff --git a/source/include/acparser.h b/source/include/acparser.h index 4ad2ec2..a3c7666 100644 --- a/source/include/acparser.h +++ b/source/include/acparser.h @@ -72,6 +72,9 @@ * *****************************************************************************/ +extern const UINT8 AcpiGbl_ShortOpIndex[]; +extern const UINT8 AcpiGbl_LongOpIndex[]; + /* * psxface - Parser external interfaces diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 9d38916..e9180b3 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20150410 +#define ACPI_CA_VERSION 0x20150515 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/acpredef.h b/source/include/acpredef.h index c832f51..5dae6aa 100644 --- a/source/include/acpredef.h +++ b/source/include/acpredef.h @@ -106,6 +106,11 @@ * count = 0 (optional) * (Used for _DLM) * + * ACPI_PTYPE2_VAR_VAR: Variable number of subpackages, each of either a + * constant or variable length. The subpackages are preceded by a + * constant number of objects. + * (Used for _LPI, _RDI) + * * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID * defines the format of the package. Zero-length parent package is * allowed. @@ -125,7 +130,8 @@ enum AcpiReturnPackageTypes ACPI_PTYPE2_MIN = 8, ACPI_PTYPE2_REV_FIXED = 9, ACPI_PTYPE2_FIX_VAR = 10, - ACPI_PTYPE2_UUID_PAIR = 11 + ACPI_PTYPE2_VAR_VAR = 11, + ACPI_PTYPE2_UUID_PAIR = 12 }; @@ -177,7 +183,7 @@ enum AcpiReturnPackageTypes * These are the names that can actually be evaluated via AcpiEvaluateObject. * Not present in this table are the following: * - * 1) Predefined/Reserved names that are never evaluated via + * 1) Predefined/Reserved names that are not usually evaluated via * AcpiEvaluateObject: * _Lxx and _Exx GPE methods * _Qxx EC methods @@ -363,6 +369,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0), + {{"_BTH", METHOD_1ARGS (ACPI_TYPE_INTEGER), /* ACPI 6.0 */ + METHOD_NO_RETURN_VALUE}}, + {{"_BTM", METHOD_1ARGS (ACPI_TYPE_INTEGER), METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, @@ -390,6 +399,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Bufs) */ PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0,0,0), + {{"_CR3", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_CRS", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, @@ -443,7 +455,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER), METHOD_NO_RETURN_VALUE}}, - {{"_DSD", METHOD_0ARGS, + {{"_DSD", METHOD_0ARGS, /* ACPI 6.0 */ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */ PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0), @@ -597,6 +609,11 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */ PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0), + {{"_LPI", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (3 Int, n Pkg (10 Int/Buf) */ + PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0), + {{"_MAT", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, @@ -614,6 +631,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_MSM", METHOD_4ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_NTT", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, @@ -701,6 +721,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + {{"_PRR", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Ref) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_REFERENCE, 1,0,0,0), + {{"_PRS", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, @@ -778,6 +802,11 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_PXM", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_RDI", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int, n Pkg (m Ref)) */ + PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 1, + ACPI_RTYPE_REFERENCE,0,0), + {{"_REG", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), METHOD_NO_RETURN_VALUE}}, @@ -790,6 +819,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_ROM", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + {{"_RST", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_NO_RETURN_VALUE}}, + {{"_RTV", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, @@ -916,6 +948,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_TDL", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_TFP", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_TIP", METHOD_1ARGS (ACPI_TYPE_INTEGER), METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, @@ -939,6 +974,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 5 Int with count */ PACKAGE_INFO (ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0,0,0), + {{"_TSN", METHOD_0ARGS, /* ACPI 6.0 */ + METHOD_RETURNS (ACPI_RTYPE_REFERENCE)}}, + {{"_TSP", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, diff --git a/source/include/actbl.h b/source/include/actbl.h index 866e76b..2842195 100644 --- a/source/include/actbl.h +++ b/source/include/actbl.h @@ -310,6 +310,7 @@ typedef struct acpi_table_fadt ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ + UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */ } ACPI_TABLE_FADT; @@ -369,7 +370,7 @@ enum AcpiPreferredPmProfiles PM_TABLET = 8 }; -/* Values for SleepStatus and SleepControl registers (V5 FADT) */ +/* Values for SleepStatus and SleepControl registers (V5+ FADT) */ #define ACPI_X_WAKE_STATUS 0x80 #define ACPI_X_SLEEP_TYPE_MASK 0x1C @@ -434,15 +435,17 @@ typedef struct acpi_table_desc * FADT is the bottom line as to what the version really is. * * For reference, the values below are as follows: - * FADT V1 size: 0x074 - * FADT V2 size: 0x084 - * FADT V3 size: 0x0F4 - * FADT V4 size: 0x0F4 - * FADT V5 size: 0x10C + * FADT V1 size: 0x074 + * FADT V2 size: 0x084 + * FADT V3 size: 0x0F4 + * FADT V4 size: 0x0F4 + * FADT V5 size: 0x10C + * FADT V6 size: 0x114 */ #define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) #define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1) #define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) -#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) +#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) +#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) #endif /* __ACTBL_H__ */ diff --git a/source/include/actbl1.h b/source/include/actbl1.h index 66b3d07..962324a 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -73,6 +73,7 @@ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ +#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ /* @@ -777,7 +778,8 @@ enum AcpiMadtType ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, - ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */ + ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, + ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */ }; @@ -932,7 +934,7 @@ typedef struct acpi_madt_local_x2apic_nmi } ACPI_MADT_LOCAL_X2APIC_NMI; -/* 11: Generic Interrupt (ACPI 5.0) */ +/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */ typedef struct acpi_madt_generic_interrupt { @@ -950,6 +952,8 @@ typedef struct acpi_madt_generic_interrupt UINT32 VgicInterrupt; UINT64 GicrBaseAddress; UINT64 ArmMpidr; + UINT8 EfficiencyClass; + UINT8 Reserved2[3]; } ACPI_MADT_GENERIC_INTERRUPT; @@ -960,7 +964,7 @@ typedef struct acpi_madt_generic_interrupt #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */ -/* 12: Generic Distributor (ACPI 5.0) */ +/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */ typedef struct acpi_madt_generic_distributor { @@ -969,7 +973,8 @@ typedef struct acpi_madt_generic_distributor UINT32 GicId; UINT64 BaseAddress; UINT32 GlobalIrqBase; - UINT32 Reserved2; /* Reserved - must be zero */ + UINT8 Version; + UINT8 Reserved2[3]; /* Reserved - must be zero */ } ACPI_MADT_GENERIC_DISTRIBUTOR; @@ -1005,6 +1010,19 @@ typedef struct acpi_madt_generic_redistributor } 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; + + /* * Common flags fields for MADT subtables */ @@ -1065,6 +1083,186 @@ typedef struct acpi_msct_proximity /******************************************************************************* * + * 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_RESERVED = 7 /* 7 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; /* Reseved, must be zero */ + UINT32 ProximityDomain; + UINT8 RangeGuid[16]; + UINT64 Address; + UINT64 Length; + UINT64 MemoryMapping; + +} 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 */ + +/* 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_ARMED (1<<3) /* 03: Memory Device observed to be 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 */ + + +/* 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 Reserved[6]; /* 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 */ + + +/* 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; + + +/******************************************************************************* + * * SBST - Smart Battery Specification Table * Version 1 * @@ -1202,6 +1400,7 @@ typedef struct acpi_srat_gicc_affinity #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ + /* Reset to default packing */ #pragma pack() diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 0dd988b..6f0c62e 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -71,6 +71,7 @@ #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware 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_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ @@ -752,6 +753,156 @@ typedef struct acpi_ibft_target /******************************************************************************* * + * IORT - IO Remapping Table + * + * Conforms to "IO Remapping Table System Software on ARM Platforms", + * Document number: ARM DEN 0049A, 2015 + * + ******************************************************************************/ + +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 Reserved; + 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 +}; + + +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 arrary */ + +} 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; + + +typedef struct acpi_iort_root_complex +{ + UINT64 MemoryProperties; /* Memory access properties */ + UINT32 AtsAttribute; + UINT32 PciSegmentNumber; + +} ACPI_IORT_ROOT_COMPLEX; + +/* Values for AtsAttribute field above */ + +#define ACPI_IORT_ATS_SUPPORTED 0x00000001 /* The root complex supports ATS */ +#define ACPI_IORT_ATS_UNSUPPORTED 0x00000000 /* The root complex doesn't support ATS */ + + +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 */ + +/* Masks for Flags field above */ + +#define ACPI_IORT_SMMU_DVM_SUPPORTED (1) +#define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) + + +/******************************************************************************* + * * IVRS - I/O Virtualization Reporting Structure * Version 1 * @@ -952,7 +1103,7 @@ typedef struct acpi_ivrs_memory * * LPIT - Low Power Idle Table * - * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)" + * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014. * ******************************************************************************/ @@ -980,8 +1131,7 @@ typedef struct acpi_lpit_header enum AcpiLpitType { ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00, - ACPI_LPIT_TYPE_SIMPLE_IO = 0x01, - ACPI_LPIT_TYPE_RESERVED = 0x02 /* 2 and above are reserved */ + ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */ }; /* Masks for Flags field above */ @@ -1007,24 +1157,6 @@ typedef struct acpi_lpit_native } ACPI_LPIT_NATIVE; -/* 0x01: Simple I/O based LPI structure */ - -typedef struct acpi_lpit_io -{ - ACPI_LPIT_HEADER Header; - ACPI_GENERIC_ADDRESS EntryTrigger; - UINT32 TriggerAction; - UINT64 TriggerValue; - UINT64 TriggerMask; - ACPI_GENERIC_ADDRESS MinimumIdleState; - UINT32 Residency; - UINT32 Latency; - ACPI_GENERIC_ADDRESS ResidencyCounter; - UINT64 CounterFrequency; - -} ACPI_LPIT_IO; - - /******************************************************************************* * * MCFG - PCI Memory Mapped Configuration table and subtable diff --git a/source/include/actbl3.h b/source/include/actbl3.h index f7ae670..f575d08 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -70,7 +70,10 @@ #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ +#define ACPI_SIG_STAO "STAO" /* Status Override table */ #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ +#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ +#define ACPI_SIG_XENV "XENV" /* Xen Environment table */ #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ @@ -79,7 +82,6 @@ #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ -#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ /* * All tables must be byte-packed to match the ACPI specification, since @@ -123,6 +125,8 @@ typedef struct acpi_table_bgrt /******************************************************************************* * * DRTM - Dynamic Root of Trust for Measurement table + * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0 + * Table version 1 * ******************************************************************************/ @@ -141,29 +145,50 @@ typedef struct acpi_table_drtm } ACPI_TABLE_DRTM; -/* 1) Validated Tables List */ +/* 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) -typedef struct acpi_drtm_vtl_list + +/* 1) Validated Tables List (64-bit addresses) */ + +typedef struct acpi_drtm_vtable_list { - UINT32 ValidatedTableListCount; + UINT32 ValidatedTableCount; + UINT64 ValidatedTables[1]; + +} ACPI_DRTM_VTABLE_LIST; -} ACPI_DRTM_VTL_LIST; +/* 2) Resources List (of Resource Descriptors) */ -/* 2) Resources List */ +/* Resource Descriptor */ + +typedef struct acpi_drtm_resource +{ + UINT8 Size[7]; + UINT8 Type; + UINT64 Address; + +} ACPI_DRTM_RESOURCE; typedef struct acpi_drtm_resource_list { - UINT32 ResourceListCount; + UINT32 ResourceCount; + ACPI_DRTM_RESOURCE Resources[1]; } ACPI_DRTM_RESOURCE_LIST; /* 3) Platform-specific Identifiers List */ -typedef struct acpi_drtm_id_list +typedef struct acpi_drtm_dps_id { - UINT32 IdListCount; + UINT32 DpsIdLength; + UINT8 DpsId[16]; -} ACPI_DRTM_ID_LIST; +} ACPI_DRTM_DPS_ID; /******************************************************************************* @@ -805,6 +830,24 @@ enum AcpiRasfStatus /******************************************************************************* * + * STAO - Status Override Table (_STA override) - ACPI 6.0 + * Version 1 + * + * Conforms to "ACPI Specification for Status Override Table" + * 6 January 2015 + * + ******************************************************************************/ + +typedef struct acpi_table_stao +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT8 IgnoreUart; + +} ACPI_TABLE_STAO; + + +/******************************************************************************* + * * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table * Version 3 * @@ -838,6 +881,47 @@ typedef struct acpi_tpm2_control } ACPI_TPM2_CONTROL; +/******************************************************************************* + * + * WPBT - Windows Platform Environment Table (ACPI 6.0) + * Version 1 + * + * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011 + * + ******************************************************************************/ + +typedef struct acpi_table_wpbt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 HandoffSize; + UINT64 HandoffAddress; + UINT8 Layout; + UINT8 Type; + UINT16 ArgumentsLength; + +} ACPI_TABLE_WPBT; + + +/******************************************************************************* + * + * XENV - Xen Environment Table (ACPI 6.0) + * Version 1 + * + * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015 + * + ******************************************************************************/ + +typedef struct acpi_table_xenv +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT64 GrantTableAddress; + UINT64 GrantTableSize; + UINT32 EventInterrupt; + UINT8 EventFlags; + +} ACPI_TABLE_XENV; + + /* Reset to default packing */ #pragma pack() diff --git a/source/include/actypes.h b/source/include/actypes.h index 79ae310..0bee2a7 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -538,6 +538,7 @@ typedef UINT64 ACPI_INTEGER; #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 */ diff --git a/source/include/acutils.h b/source/include/acutils.h index e95fc38..1be82c7 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -339,7 +339,7 @@ extern const UINT8 _acpi_ctype[]; #define _ACPI_DI 0x04 /* '0'-'9' */ #define _ACPI_LO 0x02 /* 'a'-'z' */ #define _ACPI_PU 0x10 /* punctuation */ -#define _ACPI_SP 0x08 /* space */ +#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */ #define _ACPI_UP 0x01 /* 'A'-'Z' */ #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ diff --git a/source/include/acuuid.h b/source/include/acuuid.h new file mode 100644 index 0000000..cfc4363 --- /dev/null +++ b/source/include/acuuid.h @@ -0,0 +1,64 @@ +/****************************************************************************** + * + * Name: acuuid.h - ACPI-related UUID/GUID definitions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#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. + */ + +/* NFIT/NVDIMM */ + +#define UUID_VOLATILE_MEMORY "4F940573-DAFD-E344-B16C-3F22D252E5D0" +#define UUID_PERSISTENT_MEMORY "79D3F066-F3B4-7440-AC43-0D3318B78CDB" +#define UUID_CONTROL_REGION "F601F792-B413-5D40-910B-299367E8234C" +#define UUID_DATA_REGION "3005AF91-865D-0E47-A6B0-0A2DB9408249" +#define UUID_VOLATILE_VIRTUAL_DISK "5A53AB77-FC45-4B62-5560-F7B281D1F96E" +#define UUID_VOLATILE_VIRTUAL_CD "30BD5A3D-7541-CE87-6D64-D2ADE523C4BB" +#define UUID_PERSISTENT_VIRTUAL_DISK "C902EA5C-074D-69D3-269F-4496FBE096F9" +#define UUID_PERSISTENT_VIRTUAL_CD "88810108-CD42-48BB-100F-5387D53DED3D" + +#endif /* __AUUID_H__ */ diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index d390b85..6d144fc 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -175,6 +175,9 @@ #elif defined(_APPLE) || defined(__APPLE__) #include "acmacosx.h" +#elif defined(__DragonFly__) +#include "acdragonfly.h" + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "acfreebsd.h" diff --git a/source/include/platform/acenvex.h b/source/include/platform/acenvex.h index d08d03b..6e1130e 100644 --- a/source/include/platform/acenvex.h +++ b/source/include/platform/acenvex.h @@ -56,6 +56,9 @@ #if defined(_LINUX) || defined(__linux__) #include "aclinuxex.h" +#elif defined(__DragonFly__) +#include "acdragonflyex.h" + #endif /*! [End] no source code translation !*/ diff --git a/source/os_specific/service_layers/osbsdtbl.c b/source/os_specific/service_layers/osbsdtbl.c index 846eba2..095d70c 100644 --- a/source/os_specific/service_layers/osbsdtbl.c +++ b/source/os_specific/service_layers/osbsdtbl.c @@ -80,7 +80,7 @@ OslGetTableViaRoot ( /* Hints for RSDP */ -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #define SYSTEM_KENV "hint.acpi.0.rsdp" #define SYSTEM_SYSCTL "machdep.acpi_root" #elif defined(__NetBSD__) diff --git a/source/tools/acpihelp/acpihelp.h b/source/tools/acpihelp/acpihelp.h index 83a10ea..e1b061d 100644 --- a/source/tools/acpihelp/acpihelp.h +++ b/source/tools/acpihelp/acpihelp.h @@ -62,16 +62,22 @@ #include -#define AH_DECODE_DEFAULT 0 -#define AH_DECODE_ASL 1 -#define AH_DECODE_ASL_KEYWORD 2 -#define AH_DECODE_PREDEFINED_NAME 3 -#define AH_DECODE_AML 4 -#define AH_DECODE_AML_OPCODE 5 -#define AH_DISPLAY_DEVICE_IDS 6 -#define AH_DECODE_EXCEPTION 7 -#define AH_DECODE_ASL_AML 8 -#define AH_DISPLAY_UUIDS 9 +typedef enum +{ + AH_DECODE_DEFAULT = 0, + AH_DECODE_ASL, + AH_DECODE_ASL_KEYWORD, + AH_DECODE_PREDEFINED_NAME, + AH_DECODE_AML, + AH_DECODE_AML_OPCODE, + AH_DISPLAY_DEVICE_IDS, + AH_DECODE_EXCEPTION, + AH_DECODE_ASL_AML, + AH_DISPLAY_UUIDS, + AH_DISPLAY_TABLES, + AH_DISPLAY_DIRECTIVES + +} AH_OPTION_TYPES; #define AH_MAX_ASL_LINE_LENGTH 70 #define AH_MAX_AML_LINE_LENGTH 100 @@ -106,11 +112,19 @@ typedef struct ah_asl_keyword } AH_ASL_KEYWORD; +typedef struct ah_directive_info +{ + char *Name; + char *Operands; + +} AH_DIRECTIVE_INFO; extern const AH_AML_OPCODE AmlOpcodeInfo[]; extern const AH_ASL_OPERATOR AslOperatorInfo[]; extern const AH_ASL_KEYWORD AslKeywordInfo[]; extern const AH_UUID AcpiUuids[]; +extern const AH_DIRECTIVE_INFO PreprocessorDirectives[]; +extern const AH_TABLE AcpiSupportedTables[]; extern BOOLEAN AhDisplayAll; void @@ -150,7 +164,19 @@ AhDisplayDeviceIds ( char *Name); void +AhDisplayTables ( + void); + +const AH_TABLE * +AcpiAhGetTableInfo ( + char *Signature); + +void AhDisplayUuids ( void); +void +AhDisplayDirectives ( + void); + #endif /* __ACPIHELP_H */ diff --git a/source/tools/acpihelp/ahaslkey.c b/source/tools/acpihelp/ahaslkey.c index 5029094..e15d47c 100644 --- a/source/tools/acpihelp/ahaslkey.c +++ b/source/tools/acpihelp/ahaslkey.c @@ -1,6 +1,7 @@ /****************************************************************************** * - * Module Name: ahaslkey - Table of all known ASL non-operator keywords + * Module Name: ahaslkey - Table of all known ASL non-operator keywords and + * table of iASL Preprocessor directives * *****************************************************************************/ @@ -147,3 +148,31 @@ const AH_ASL_KEYWORD AslKeywordInfo[] = ":= Transfer8 | Transfer16 | Transfer8_16"}, {NULL, NULL, NULL} }; + +/* Preprocessor directives */ + +const AH_DIRECTIVE_INFO PreprocessorDirectives[] = +{ + {"#define", "OriginalName, DefinedName"}, + {"#elif", "Expression"}, + {"#else", ""}, + {"#endif", ""}, + {"#error", "Message"}, + {"#if", "Expression"}, + {"#ifdef", "DefinedName"}, + {"#ifndef", "DefinedName"}, + {"#include", "\"Filename\""}, + {"#include", ""}, + {"#includebuffer", "\"Filename\""}, + {"#includebuffer", ""}, + {"#line", ""}, + {"#pragma", "Disable error-number"}, + {"#pragma", "Message"}, + {"#undef", "DefinedName"}, + {"#warning", ""}, + {"__DATE__", "Returns current date"}, + {"__FILE__", "Returns name of current ASL file"}, + {"__LINE__", "Returns line number in ASL file"}, + {"__PATH__", "Returns full pathname of current ASL file"}, + {NULL, 0} +}; diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c index bb0f861..afd2400 100644 --- a/source/tools/acpihelp/ahdecode.c +++ b/source/tools/acpihelp/ahdecode.c @@ -60,6 +60,7 @@ static char Gbl_Buffer[BUFFER_LENGTH]; static char Gbl_LineBuffer[LINE_BUFFER_LENGTH]; + /* Local prototypes */ static BOOLEAN @@ -99,6 +100,22 @@ AhPrintOneField ( const char *Field); +void +AhDisplayDirectives ( + void) +{ + const AH_DIRECTIVE_INFO *Info; + + + printf ("iASL Preprocessor directives:\n\n"); + + for (Info = PreprocessorDirectives; Info->Name; Info++) + { + printf ("%16s : %s\n", Info->Name, Info->Operands); + } +} + + /******************************************************************************* * * FUNCTION: AhFindPredefinedNames (entry point for predefined name search) @@ -125,7 +142,7 @@ AhFindPredefinedNames ( if (!NamePrefix) { - Found = AhDisplayPredefinedName (Name, 0); + Found = AhDisplayPredefinedName (NULL, 0); return; } @@ -176,7 +193,7 @@ AhDisplayPredefinedName ( const AH_PREDEFINED_NAME *Info; BOOLEAN Found = FALSE; BOOLEAN Matched; - UINT32 i; + UINT32 i = 0; /* Find/display all names that match the input name prefix */ @@ -190,6 +207,7 @@ AhDisplayPredefinedName ( printf ("%*s%s\n", 6, " ", Info->Action); AhDisplayPredefinedInfo (Info->Name); + i++; continue; } @@ -213,6 +231,10 @@ AhDisplayPredefinedName ( } } + if (!Name) + { + printf ("\nFound %d Predefined ACPI Names\n", i); + } return (Found); } @@ -901,6 +923,38 @@ AhDisplayUuids ( /******************************************************************************* * + * FUNCTION: AhDisplayTables + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Display all known ACPI tables + * + ******************************************************************************/ + +void +AhDisplayTables ( + void) +{ + const AH_TABLE *Info; + UINT32 i = 0; + + + printf ("Known ACPI tables:\n"); + + for (Info = AcpiSupportedTables; Info->Signature; Info++) + { + printf ("%8s : %s\n", Info->Signature, Info->Description); + i++; + } + + printf ("\nTotal %u ACPI tables\n\n", i); +} + + +/******************************************************************************* + * * FUNCTION: AhDecodeException * * PARAMETERS: HexString - ACPI status string from command line, in diff --git a/source/tools/acpihelp/ahmain.c b/source/tools/acpihelp/ahmain.c index 7f65812..0416eec 100644 --- a/source/tools/acpihelp/ahmain.c +++ b/source/tools/acpihelp/ahmain.c @@ -51,7 +51,7 @@ AhDisplayUsage ( void); #define AH_UTILITY_NAME "ACPI Help Utility" -#define AH_SUPPORTED_OPTIONS "aehikmopsuv" +#define AH_SUPPORTED_OPTIONS "adehikmopstuv" /****************************************************************************** @@ -75,6 +75,10 @@ AhDisplayUsage ( ACPI_OPTION ("-a [Name/Prefix]", "Find/Display both ASL operator and AML opcode name(s)"); ACPI_OPTION ("-m [Name/Prefix]", "Find/Display AML opcode name(s)"); + ACPI_USAGE_TEXT ("\nACPI Values:\n"); + ACPI_OPTION ("-e [HexValue]", "Decode ACPICA exception code"); + ACPI_OPTION ("-o [HexValue]", "Decode hex AML opcode"); + ACPI_USAGE_TEXT ("\nASL (ACPI Source Language) Names and Symbols:\n"); ACPI_OPTION ("-k [Name/Prefix]", "Find/Display ASL non-operator keyword(s)"); ACPI_OPTION ("-p [Name/Prefix]", "Find/Display ASL predefined method name(s)"); @@ -82,12 +86,10 @@ AhDisplayUsage ( ACPI_USAGE_TEXT ("\nOther ACPI Names:\n"); ACPI_OPTION ("-i [Name/Prefix]", "Find/Display ACPI/PNP Hardware ID(s)"); + ACPI_OPTION ("-d", "Display iASL Preprocessor directives"); + ACPI_OPTION ("-t", "Display supported ACPI tables"); ACPI_OPTION ("-u", "Display ACPI-related UUIDs"); - ACPI_USAGE_TEXT ("\nACPI Values:\n"); - ACPI_OPTION ("-e [HexValue]", "Decode ACPICA exception code"); - ACPI_OPTION ("-o [HexValue]", "Decode hex AML opcode"); - ACPI_USAGE_TEXT ("\nName/Prefix or HexValue not specified means \"Display All\"\n"); ACPI_USAGE_TEXT ("\nDefault search with valid Name/Prefix and no options:\n"); ACPI_USAGE_TEXT (" Find ASL/AML operator names - if NamePrefix does not start with underscore\n"); @@ -133,6 +135,11 @@ main ( DecodeType = AH_DECODE_ASL_AML; break; + case 'd': + + DecodeType = AH_DISPLAY_DIRECTIVES; + break; + case 'e': DecodeType = AH_DECODE_EXCEPTION; @@ -168,6 +175,11 @@ main ( DecodeType = AH_DECODE_ASL; break; + case 't': + + DecodeType = AH_DISPLAY_TABLES; + break; + case 'u': DecodeType = AH_DISPLAY_UUIDS; @@ -235,7 +247,17 @@ main ( AhDisplayUuids (); break; - default: + case AH_DISPLAY_TABLES: + + AhDisplayTables (); + break; + + case AH_DISPLAY_DIRECTIVES: + + AhDisplayDirectives (); + break; + + default: if (!Name) { diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index d98b08e..073971f 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -167,6 +167,8 @@ ACPI_STRING_TABLE LinuxDataTypes[] = { {"INT16", "s16", REPLACE_WHOLE_WORD}, {"INT8", "s8", REPLACE_WHOLE_WORD}, + {"__FUNCTION__", "__func__", REPLACE_WHOLE_WORD}, + {NULL, NULL, 0} }; @@ -317,6 +319,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_PACKAGE_INFO", SRC_TYPE_STRUCT}, {"ACPI_PACKAGE_INFO2", SRC_TYPE_STRUCT}, {"ACPI_PACKAGE_INFO3", SRC_TYPE_STRUCT}, + {"ACPI_PACKAGE_INFO4", SRC_TYPE_STRUCT}, {"ACPI_PARSE_DOWNWARDS", SRC_TYPE_SIMPLE}, {"ACPI_PARSE_OBJ_ASL", SRC_TYPE_STRUCT}, {"ACPI_PARSE_OBJ_COMMON", SRC_TYPE_STRUCT}, @@ -518,6 +521,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_HEST", SRC_TYPE_STRUCT}, {"ACPI_TABLE_HPET", SRC_TYPE_STRUCT}, {"ACPI_TABLE_IBFT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_IORT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_IVRS", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MADT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MCFG", SRC_TYPE_STRUCT}, @@ -525,6 +529,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_MPST", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MSCT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MSDM", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_NFIT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_PCCT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDP", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDT", SRC_TYPE_STRUCT}, @@ -536,6 +541,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_SPCR", SRC_TYPE_STRUCT}, {"ACPI_TABLE_SPMI", SRC_TYPE_STRUCT}, {"ACPI_TABLE_SRAT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_STAO", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TCPA", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TPM2", SRC_TYPE_STRUCT}, {"ACPI_TABLE_UEFI", SRC_TYPE_STRUCT}, @@ -543,6 +549,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_WDAT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WDDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WDRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_WPBT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_XENV", SRC_TYPE_STRUCT}, {"ACPI_TABLE_XSDT", SRC_TYPE_STRUCT}, {"ACPI_ASF_ADDRESS", SRC_TYPE_STRUCT}, @@ -566,6 +574,10 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_DMAR_RHSA", SRC_TYPE_STRUCT}, {"ACPI_DMAR_HARDWARE_UNIT", SRC_TYPE_STRUCT}, {"ACPI_DMAR_RESERVED_MEMORY", SRC_TYPE_STRUCT}, + {"ACPI_DRTM_DPS_ID", SRC_TYPE_STRUCT}, + {"ACPI_DRTM_RESOURCE", SRC_TYPE_STRUCT}, + {"ACPI_DRTM_RESOURCE_LIST", SRC_TYPE_STRUCT}, + {"ACPI_DRTM_VTABLE_LIST", SRC_TYPE_STRUCT}, {"ACPI_EINJ_ENTRY", SRC_TYPE_STRUCT}, {"ACPI_EINJ_TRIGGER", SRC_TYPE_STRUCT}, {"ACPI_ERST_ENTRY", SRC_TYPE_STRUCT}, @@ -595,6 +607,13 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_IBFT_INITIATOR", SRC_TYPE_STRUCT}, {"ACPI_IBFT_NIC", SRC_TYPE_STRUCT}, {"ACPI_IBFT_TARGET", SRC_TYPE_STRUCT}, + {"ACPI_IORT_ID_MAPPING", SRC_TYPE_STRUCT}, + {"ACPI_IORT_ITS_GROUP", SRC_TYPE_STRUCT}, + {"ACPI_IORT_MEMORY_ACCESS", SRC_TYPE_STRUCT}, + {"ACPI_IORT_NAMED_COMPONENT", SRC_TYPE_STRUCT}, + {"ACPI_IORT_NODE", SRC_TYPE_STRUCT}, + {"ACPI_IORT_ROOT_COMPLEX", SRC_TYPE_STRUCT}, + {"ACPI_IORT_SMMU", SRC_TYPE_STRUCT}, {"ACPI_IVRS_HEADER", SRC_TYPE_STRUCT}, {"ACPI_IVRS_HARDWARE", SRC_TYPE_STRUCT}, {"ACPI_IVRS_DE_HEADER", SRC_TYPE_STRUCT}, @@ -628,6 +647,14 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_MPST_POWER_STATE", SRC_TYPE_STRUCT}, {"ACPI_MCFG_ALLOCATION", SRC_TYPE_STRUCT}, {"ACPI_MSCT_PROXIMITY", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_SYSTEM_ADDRESS", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_MEMORY_MAP", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_INTERLEAVE", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_SMBIOS", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_CONTROL_REGION", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_DATA_REGION", SRC_TYPE_STRUCT}, + {"ACPI_NFIT_FLUSH_ADDRESS", SRC_TYPE_STRUCT}, {"ACPI_PCCT_HW_REDUCED", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SUBSPACE", SRC_TYPE_STRUCT}, diff --git a/tests/misc/grammar.aml b/tests/misc/grammar.aml index 07c5a4c..893915c 100755 Binary files a/tests/misc/grammar.aml and b/tests/misc/grammar.aml differ