diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2025-01-03 21:49:36 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2025-01-03 21:49:36 +0000 |
commit | e690145f81b961a622efa7bc04fd83caba2a769d (patch) | |
tree | 4b8a893d9d971026929e9a8230c062ffe7a2b44a | |
parent | b6246dbb668a788f8022fc34f5577de42b386a0f (diff) |
Import ACPICA 20240827vendor/acpica/20240827
62 files changed, 1591 insertions, 268 deletions
diff --git a/changes.txt b/changes.txt index edcc674d90ab..b7bd376893c3 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,54 @@ ---------------------------------------- +27 August 2024. Summary of changes for version 20240827: + +Major changes: + +Fix the PHAT table working: ensure that the PHAT firmware health record offset works correctly, fix various sub-table offsets, prevent segmentation faults when encountering invalid device paths. Contributed by: Armin Wolf <W_Armin@gmx.de> + +Fix the optional table 4-byte signature. Contributed by: Daniil Tatianin <99danilt@gmail.com> + +Correct the dumping of SLIC and DBG2 tables. Contributed by: Al Stone (Fedora) <ahs3@ahs3.net> + +Add support for QWordPCC and DWordPCC by Jose Marinho (ARM) + +Fix the integer to hex string conversions by Armin Wolf + +Detecting FACS in reduced HW mode and allowing setting waking vector thereby waking up from S3 state + +Fixing issues with crossing page boundaries when mapping operation regions by Raju Rangoju, Sanath S and Mario Limonciello (AMD) + +Update the support for IORT, HMAT, MPAM, AEST, CEDT, SPCR etc. tables + +Fix multiple issues with table parsing, compilation and disassembly by Myra DeMere (Google) + +Allow for more flexibility in _DSM usage. + + +---------------------------------------- +22 March 2024. Summary of changes for version 20240322: + +Major changes: + +Update all the license header year from 2023 to 2024. + +Fix table argument ordering to work properly with iasl. + +Get rid of the annoying repeated warning types in MSVC and Windows. + +Fix a test in ASLTS with edge case failure. + +Fix a couple of issues with how GPEs are counted and enabled. + +Add new tables for various architectures/OS, mainly RISC-V and also update many more. + +Add an option to either make the output deterministic or non-deterministic. + +Remove redundant checks, duplicated code and fix spellings in various files. + +Fix flex arrays for C++ compilers and also make ACPICA overall more compatible with different compilers which throw warnings related to memory sanitization etc. + + +---------------------------------------- 28 June 2023. Summary of changes for version 20230628: 0) Global changes: @@ -7075,7 +7125,6 @@ features become unavailable: General Purpose Events (GPEs) Global Lock ACPI PM timer - FACS table (Waking vectors and Global Lock) Updated the unix tarball directory structure to match the ACPICA git source diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 0deeb14115c1..ae80ccf2eff2 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -71,14 +71,25 @@ ifeq ($(UNAME_S), QNX) ACPI_HOST = _QNX endif +ifeq ($(UNAME_S), Haiku) +ACPI_HOST = _HAIKU +endif + ifeq ($(ACPI_HOST), _APPLE) INSTALL = cp INSTALLFLAGS ?= -f else INSTALL = install + +# Do not strip debug info when in debug mode +ifeq ($(DEBUG),TRUE) +INSTALLFLAGS ?= -m 555 +else INSTALLFLAGS ?= -m 555 -s endif +endif + INSTALLPROG = \ mkdir -p $(DESTDIR)$(INSTALLDIR); \ $(INSTALL) $(INSTALLFLAGS) ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG) diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile index 389455a6f750..9e5852614227 100644 --- a/generate/unix/acpiexec/Makefile +++ b/generate/unix/acpiexec/Makefile @@ -262,9 +262,11 @@ endif ifneq ($(ACPI_HOST),_APPLE) ifneq ($(ACPI_HOST),_QNX) +ifneq ($(ACPI_HOST),_HAIKU) LDFLAGS += -lrt endif endif +endif # # Common Rules diff --git a/source/common/dmtable.c b/source/common/dmtable.c index e9714d2e893d..31fd9aeb2ba1 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -190,6 +190,8 @@ static const char *AcpiDmAestSubnames[] = "SMMU Error Node", "Vendor-defined Error Node", "GIC Error Node", + "PCIE Error Node", + "PROXY Error Node", "Unknown Subtable Type" /* Reserved */ }; @@ -214,6 +216,7 @@ static const char *AcpiDmAestXfaceNames[] = { "System Register Interface", "Memory Mapped Interface", + "Single Record Memory Mapped Interface", "Unknown Interface Type" /* Reserved */ }; @@ -257,6 +260,7 @@ static const char *AcpiDmCedtSubnames[] = { "CXL Host Bridge Structure", "CXL Fixed Memory Window Structure", + "CXL XOR Interleave Math Structure", "Unknown Subtable Type" /* Reserved */ }; @@ -1082,7 +1086,7 @@ AcpiDmDumpTable ( { AcpiOsPrintf ( "/**** ACPI table terminates " - "in the middle of a data structure! (dump table) \n" + "in the middle of a data structure! (dump table)\n" "CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength); return (AE_BAD_DATA); } @@ -1197,6 +1201,16 @@ AcpiDmDumpTable ( ByteLength = 18; break; + case ACPI_DMT_BUF32: + + ByteLength = 32; + break; + + case ACPI_DMT_BUF112: + + ByteLength = 112; + break; + case ACPI_DMT_BUF128: ByteLength = 128; @@ -1408,6 +1422,8 @@ AcpiDmDumpTable ( case ACPI_DMT_BUF12: case ACPI_DMT_BUF16: case ACPI_DMT_BUF18: + case ACPI_DMT_BUF32: + case ACPI_DMT_BUF112: case ACPI_DMT_BUF128: /* * Buffer: Size depends on the opcode and was set above. diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c index 2feb7644f931..a84dc98a47ea 100644 --- a/source/common/dmtbdump.c +++ b/source/common/dmtbdump.c @@ -562,7 +562,7 @@ AcpiDmDumpFadt ( /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ - if (Table->Length > ACPI_FADT_V3_SIZE) + if (Table->Length > ACPI_FADT_V5_SIZE) { Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6); @@ -635,6 +635,11 @@ AcpiDmValidateFadtLength ( ExpectedLength = ACPI_FADT_V5_SIZE; break; + case 6: + + ExpectedLength = ACPI_FADT_V6_SIZE; + break; + default: return; diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c index d5b6e04fd6cc..56d959fd04a7 100644 --- a/source/common/dmtbdump1.c +++ b/source/common/dmtbdump1.c @@ -195,6 +195,9 @@ AcpiDmDumpAest ( ACPI_DMTABLE_INFO *InfoTable; ACPI_SIZE Length; UINT8 Type; + UINT8 Revision = Table->Revision; + UINT32 Count; + ACPI_AEST_NODE_INTERFACE_HEADER *InterfaceHeader; /* Very small, generic main table. AEST consists of mostly subtables */ @@ -234,8 +237,22 @@ AcpiDmDumpAest ( break; case ACPI_AEST_VENDOR_ERROR_NODE: - InfoTable = AcpiDmTableInfoAestVendorError; - Length = sizeof (ACPI_AEST_VENDOR); + switch (Revision) + { + case 1: + InfoTable = AcpiDmTableInfoAestVendorError; + Length = sizeof (ACPI_AEST_VENDOR); + break; + + case 2: + InfoTable = AcpiDmTableInfoAestVendorV2Error; + Length = sizeof (ACPI_AEST_VENDOR_V2); + break; + + default: + AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n", Revision); + return; + } break; case ACPI_AEST_GIC_ERROR_NODE: @@ -243,6 +260,16 @@ AcpiDmDumpAest ( Length = sizeof (ACPI_AEST_GIC); break; + case ACPI_AEST_PCIE_ERROR_NODE: + InfoTable = AcpiDmTableInfoAestPCIeError; + Length = sizeof (ACPI_AEST_PCIE); + break; + + case ACPI_AEST_PROXY_ERROR_NODE: + InfoTable = AcpiDmTableInfoAestProxyError; + Length = sizeof (ACPI_AEST_PROXY); + break; + /* Error case below */ default: @@ -335,8 +362,57 @@ AcpiDmDumpAest ( return; } - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - sizeof (ACPI_AEST_NODE_INTERFACE), AcpiDmTableInfoAestXface); + if (Revision == 1) + { + InfoTable = AcpiDmTableInfoAestXface; + Length = sizeof (ACPI_AEST_NODE_INTERFACE); + } + else if (Revision == 2) + { + InfoTable = AcpiDmTableInfoAestXfaceHeader; + Length = sizeof (ACPI_AEST_NODE_INTERFACE_HEADER); + + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + Offset += Length; + + InterfaceHeader = ACPI_CAST_PTR (ACPI_AEST_NODE_INTERFACE_HEADER, Subtable); + switch (InterfaceHeader->GroupFormat) + { + case ACPI_AEST_NODE_GROUP_FORMAT_4K: + InfoTable = AcpiDmTableInfoAestXface4k; + Length = sizeof (ACPI_AEST_NODE_INTERFACE_4K); + break; + + case ACPI_AEST_NODE_GROUP_FORMAT_16K: + InfoTable = AcpiDmTableInfoAestXface16k; + Length = sizeof (ACPI_AEST_NODE_INTERFACE_16K); + break; + + case ACPI_AEST_NODE_GROUP_FORMAT_64K: + InfoTable = AcpiDmTableInfoAestXface64k; + Length = sizeof (ACPI_AEST_NODE_INTERFACE_64K); + break; + + default: + AcpiOsPrintf ("\n**** Unknown AEST Interface Group Format 0x%X\n", + InterfaceHeader->GroupFormat); + return; + } + + Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); + } + else + { + AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n", Revision); + return; + } + + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -345,22 +421,36 @@ AcpiDmDumpAest ( /* Point past the interface structure */ AcpiOsPrintf ("\n"); - Offset += sizeof (ACPI_AEST_NODE_INTERFACE); + Offset += Length; /* Dump the entire interrupt structure array, if present */ if (NodeHeader->NodeInterruptOffset) { - Length = NodeHeader->NodeInterruptCount; + Count = NodeHeader->NodeInterruptCount; Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); - while (Length) + while (Count) { /* Dump the interrupt structure */ + switch (Revision) { + case 1: + InfoTable = AcpiDmTableInfoAestXrupt; + Length = sizeof (ACPI_AEST_NODE_INTERRUPT); + break; + + case 2: + InfoTable = AcpiDmTableInfoAestXruptV2; + Length = sizeof (ACPI_AEST_NODE_INTERRUPT_V2); + break; + default: + AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n", + Revision); + return; + } Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - sizeof (ACPI_AEST_NODE_INTERRUPT), - AcpiDmTableInfoAestXrupt); + Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -368,9 +458,9 @@ AcpiDmDumpAest ( /* Point to the next interrupt structure */ - Offset += sizeof (ACPI_AEST_NODE_INTERRUPT); + Offset += Length; Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset); - Length--; + Count--; AcpiOsPrintf ("\n"); } } @@ -936,9 +1026,14 @@ AcpiDmDumpCedt ( case ACPI_CEDT_TYPE_CFMWS: { ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; - unsigned int i, max = 0x01 << (ptr->InterleaveWays); + unsigned int i, max; + + if (ptr->InterleaveWays < 8) + max = 1 << (ptr->InterleaveWays); + else + max = 3 << (ptr->InterleaveWays - 8); - /* print out table with first "Interleave target" */ + /* print out table with first "Interleave target" */ Status = AcpiDmDumpTable (Length, Offset, Subtable, Subtable->Length, AcpiDmTableInfoCedt1); @@ -964,6 +1059,37 @@ AcpiDmDumpCedt ( break; } + case ACPI_CEDT_TYPE_CXIMS: + { + ACPI_CEDT_CXIMS *ptr = (ACPI_CEDT_CXIMS *) Subtable; + unsigned int i, max = ptr->NrXormaps; + + /* print out table with first "XOR Map" */ + + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedt2); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Now, print out any XOR Map beyond the first. */ + + for (i = 1; i < max; i++) + { + unsigned int loc_offset = Offset + (i * 1) + ACPI_OFFSET (ACPI_CEDT_CXIMS, XormapList); + UINT64 *trg = &(ptr->XormapList[i]); + + Status = AcpiDmDumpTable (Length, loc_offset, trg, + Subtable->Length, AcpiDmTableInfoCedt2_te); + if (ACPI_FAILURE (Status)) + { + return; + } + } + break; + } + default: AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", Subtable->Type); @@ -1245,8 +1371,8 @@ AcpiDmDumpDbg2 ( if (Subtable->OemDataOffset) { - Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, - Table, Subtable->OemDataLength, + Status = AcpiDmDumpTable (Length, Subtable->OemDataOffset, + Subtable, Subtable->OemDataLength, AcpiDmTableInfoDbg2OemData); if (ACPI_FAILURE (Status)) { diff --git a/source/common/dmtbdump2.c b/source/common/dmtbdump2.c index 71198f74a1b0..deff9c333906 100644 --- a/source/common/dmtbdump2.c +++ b/source/common/dmtbdump2.c @@ -1213,8 +1213,10 @@ AcpiDmDumpMpam ( ACPI_STATUS Status; ACPI_MPAM_MSC_NODE *MpamMscNode; ACPI_MPAM_RESOURCE_NODE *MpamResourceNode; + ACPI_MPAM_FUNC_DEPS *MpamFunctionalDependency; ACPI_DMTABLE_INFO *InfoTable; UINT32 Offset = sizeof(ACPI_TABLE_HEADER); + UINT32 TempOffset; UINT32 MpamResourceNodeLength = 0; while (Offset < Table->Length) @@ -1222,8 +1224,8 @@ AcpiDmDumpMpam ( MpamMscNode = ACPI_ADD_PTR (ACPI_MPAM_MSC_NODE, Table, Offset); /* Subtable: MSC */ - Status = AcpiDmDumpTable (MpamMscNode->Length, 0, MpamMscNode, 0, - AcpiDmTableInfoMpam0); + Status = AcpiDmDumpTable (Table->Length, Offset, MpamMscNode, + MpamMscNode->Length, AcpiDmTableInfoMpam0); if (ACPI_FAILURE (Status)) { return; @@ -1233,18 +1235,19 @@ AcpiDmDumpMpam ( Offset += sizeof(ACPI_MPAM_MSC_NODE); /* Subtable: MSC RIS(es) */ - for (UINT32 ResourceIdx = 0; ResourceIdx < MpamMscNode->NumResouceNodes; ResourceIdx++) + for (UINT32 ResourceIdx = 0; ResourceIdx < MpamMscNode->NumResourceNodes; ResourceIdx++) { + AcpiOsPrintf ("\n"); MpamResourceNode = ACPI_ADD_PTR (ACPI_MPAM_RESOURCE_NODE, Table, Offset); MpamResourceNodeLength = sizeof(ACPI_MPAM_RESOURCE_NODE) + MpamResourceNode->NumFunctionalDeps * sizeof(ACPI_MPAM_FUNC_DEPS); - + TempOffset = Offset; Offset += MpamResourceNodeLength; /* Subtable: MSC RIS */ - Status = AcpiDmDumpTable (MpamResourceNodeLength, 0, MpamResourceNode, 0, - AcpiDmTableInfoMpam1); + Status = AcpiDmDumpTable (Table->Length, TempOffset, MpamResourceNode, + sizeof(ACPI_MPAM_RESOURCE_NODE), AcpiDmTableInfoMpam1); if (ACPI_FAILURE (Status)) { return; @@ -1279,30 +1282,40 @@ AcpiDmDumpMpam ( } /* Subtable: MSC Resource Locator(s) */ - Status = AcpiDmDumpTable (sizeof(ACPI_MPAM_RESOURCE_LOCATOR), 0, - &MpamResourceNode->Locator, 0, InfoTable); + TempOffset += ACPI_OFFSET(ACPI_MPAM_RESOURCE_NODE, Locator); + Status = AcpiDmDumpTable (Table->Length, TempOffset, &MpamResourceNode->Locator, + sizeof(ACPI_MPAM_RESOURCE_LOCATOR), InfoTable); if (ACPI_FAILURE (Status)) { return; } /* Get the number of functional dependencies of an RIS */ - Status = AcpiDmDumpTable (sizeof(UINT32), 0, &MpamResourceNode->NumFunctionalDeps, 0, - AcpiDmTableInfoMpam1Deps); + TempOffset += sizeof(ACPI_MPAM_RESOURCE_LOCATOR); + Status = AcpiDmDumpTable (Table->Length, TempOffset, &MpamResourceNode->NumFunctionalDeps, + sizeof(UINT32), AcpiDmTableInfoMpam1Deps); if (ACPI_FAILURE (Status)) { return; } + TempOffset += sizeof(UINT32); + MpamFunctionalDependency = ACPI_ADD_PTR (ACPI_MPAM_FUNC_DEPS, MpamResourceNode, + sizeof(ACPI_MPAM_RESOURCE_NODE)); /* Subtable: MSC functional dependencies */ for (UINT32 funcDep = 0; funcDep < MpamResourceNode->NumFunctionalDeps; funcDep++) { + AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (sizeof(ACPI_MPAM_FUNC_DEPS), 0, &MpamResourceNode->NumFunctionalDeps, 0, AcpiDmTableInfoMpam2); + Status = AcpiDmDumpTable (Table->Length, TempOffset, MpamFunctionalDependency, + sizeof(ACPI_MPAM_FUNC_DEPS), AcpiDmTableInfoMpam2); if (ACPI_FAILURE (Status)) { return; } + TempOffset += sizeof(ACPI_MPAM_FUNC_DEPS); + MpamFunctionalDependency++; } AcpiOsPrintf ("\n\n"); @@ -1881,6 +1894,7 @@ AcpiDmDumpPhat ( ACPI_DMTABLE_INFO *InfoTable; ACPI_PHAT_HEADER *Subtable; ACPI_PHAT_VERSION_DATA *VersionData; + ACPI_PHAT_HEALTH_DATA *HealthData; UINT32 RecordCount; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_PHAT); @@ -1889,7 +1903,6 @@ AcpiDmDumpPhat ( UINT32 PathLength; UINT32 VendorLength; UINT16 RecordType; - const wchar_t *WideString; Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, sizeof (ACPI_TABLE_PHAT)); @@ -1914,13 +1927,13 @@ AcpiDmDumpPhat ( case ACPI_PHAT_TYPE_FW_VERSION_DATA: InfoTable = AcpiDmTableInfoPhat0; - SubtableLength = Offset += sizeof (ACPI_PHAT_VERSION_DATA); + SubtableLength = sizeof (ACPI_PHAT_VERSION_DATA); break; case ACPI_PHAT_TYPE_FW_HEALTH_DATA: InfoTable = AcpiDmTableInfoPhat1; - SubtableLength = Offset += sizeof (ACPI_PHAT_TYPE_FW_HEALTH_DATA); + SubtableLength = sizeof (ACPI_PHAT_HEALTH_DATA); break; default: @@ -1931,13 +1944,15 @@ AcpiDmDumpPhat ( return; } - Status = AcpiDmDumpTable (Length, SubtableLength, Subtable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, SubtableLength, InfoTable); if (ACPI_FAILURE (Status)) { return; } + Offset += SubtableLength; + OriginalOffset = Offset; switch (Subtable->Type) { @@ -1993,39 +2008,55 @@ AcpiDmDumpPhat ( case ACPI_PHAT_TYPE_FW_HEALTH_DATA: - /* - * Get the length of the Device Path (UEFI wide string). - * Include the wide null terminator (+2), - */ - WideString = ACPI_ADD_PTR (wchar_t, Subtable, - sizeof (ACPI_PHAT_HEALTH_DATA)); - - PathLength = (wcslen (WideString) * 2) + 2; - DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, PathLength %X, Offset %X, Table->Length %X */\n", - __LINE__, PathLength, Offset, Length); + HealthData = ACPI_CAST_PTR (ACPI_PHAT_HEALTH_DATA, Subtable); + PathLength = Subtable->Length - sizeof (ACPI_PHAT_HEALTH_DATA); + VendorLength = 0; - Status = AcpiDmDumpTable (Length, Offset, - ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)), - PathLength, AcpiDmTableInfoPhat1a); - Offset += PathLength; - if (ACPI_FAILURE (Status)) + /* An offset of 0 should be ignored */ + if (HealthData->DeviceSpecificOffset != 0) { - return; + if (HealthData->DeviceSpecificOffset > Subtable->Length) + { + AcpiOsPrintf ("\n/* Warning: Oversized device-specific data offset %X */\n" + "/* (maximum is %X -- ignoring device-specific data) */\n", + HealthData->DeviceSpecificOffset, Subtable->Length); + } + else if (HealthData->DeviceSpecificOffset < sizeof (ACPI_PHAT_HEALTH_DATA)) + { + AcpiOsPrintf ("\n/* Warning: Undersized device-specific data offset %X */\n" + "/* (minimum is %X -- ignoring device-specific data) */\n", + HealthData->DeviceSpecificOffset, (UINT8) sizeof (ACPI_PHAT_HEALTH_DATA)); + } + else + { + PathLength = HealthData->DeviceSpecificOffset - sizeof (ACPI_PHAT_HEALTH_DATA); + VendorLength = Subtable->Length - HealthData->DeviceSpecificOffset; + } } - /* Get Device-Specific Data - length of which is the remaining subtable length. */ + DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, PathLength %X, Offset %X */\n", + __LINE__, PathLength, Offset); - VendorLength = - Subtable->Length - sizeof (ACPI_PHAT_HEALTH_DATA) - PathLength; - DbgPrint (ASL_DEBUG_OUTPUT, "%u, Subtable->Length %X, VendorLength %X, Offset %X PathLength: %X\n", - __LINE__, Subtable->Length, VendorLength, Offset, PathLength); + if (PathLength) + { + Status = AcpiDmDumpTable (Length, Offset, + ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)), + PathLength, AcpiDmTableInfoPhat1a); + if (ACPI_FAILURE (Status)) + { + return; + } + + Offset += PathLength; + } + + DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, VendorLength %X, Offset %X */\n", + __LINE__, VendorLength, Offset); if (VendorLength) { - /* Point past the Device Path, Compile the Device-Specific Data */ - Status = AcpiDmDumpTable (Length, Offset, - ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength), + ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, HealthData->DeviceSpecificOffset), VendorLength, AcpiDmTableInfoPhat1b); if (ACPI_FAILURE (Status)) { diff --git a/source/common/dmtbdump3.c b/source/common/dmtbdump3.c index 6e5f5d7ff1b5..9a5b5ecd54d3 100644 --- a/source/common/dmtbdump3.c +++ b/source/common/dmtbdump3.c @@ -177,7 +177,8 @@ AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table) { - (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table, + (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), + (void *) (Table + sizeof (*Table)), Table->Length - sizeof (*Table), AcpiDmTableInfoSlic); } diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c index 0199d1d151a5..961ba8c9876f 100644 --- a/source/common/dmtbinfo1.c +++ b/source/common/dmtbinfo1.c @@ -287,6 +287,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorError[] = ACPI_DMT_TERMINATOR }; +/* 3: Vendor Defined V2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorV2Error[] = +{ + {ACPI_DMT_UINT64, ACPI_AEST3A_OFFSET (AcpiHid), "ACPI HID", 0}, + {ACPI_DMT_UINT32, ACPI_AEST3A_OFFSET (AcpiUid), "ACPI UID", 0}, + {ACPI_DMT_BUF16, ACPI_AEST3A_OFFSET (VendorSpecificData), "Vendor Specific Data", 0}, + ACPI_DMT_TERMINATOR +}; + /* 4: Gic Error */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestGicError[] = @@ -296,6 +306,31 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAestGicError[] = ACPI_DMT_TERMINATOR }; +/* 5: PCIe Error */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestPCIeError[] = +{ + {ACPI_DMT_UINT32, ACPI_AEST5_OFFSET (IortNodeReference), "Iort Node Reference", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 6: Proxy Error */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestProxyError[] = +{ + {ACPI_DMT_UINT64, ACPI_AEST6_OFFSET (NodeAddress), "Proxy Node Address", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Common AEST structures for subtables */ + +#define ACPI_DM_AEST_INTERFACE_COMMON(a) \ + {ACPI_DMT_UINT32, ACPI_AEST0D##a##_OFFSET (Common.ErrorNodeDevice), "Arm Error Node Device", 0},\ + {ACPI_DMT_UINT32, ACPI_AEST0D##a##_OFFSET (Common.ProcessorAffinity), "Processor Affinity", 0}, \ + {ACPI_DMT_UINT64, ACPI_AEST0D##a##_OFFSET (Common.ErrorGroupRegisterBase), "Err-Group Register Addr", 0}, \ + {ACPI_DMT_UINT64, ACPI_AEST0D##a##_OFFSET (Common.FaultInjectRegisterBase), "Err-Inject Register Addr", 0}, \ + {ACPI_DMT_UINT64, ACPI_AEST0D##a##_OFFSET (Common.InterruptConfigRegisterBase), "IRQ-Config Register Addr", 0}, + /* AestXface: Node Interface Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface[] = @@ -314,6 +349,60 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface[] = ACPI_DMT_TERMINATOR }; +/* AestXface: Node Interface Structure V2 Header */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestXfaceHeader[] = +{ + {ACPI_DMT_AEST_XFACE, ACPI_AEST0DH_OFFSET (Type), "Interface Type", 0}, + {ACPI_DMT_UINT8, ACPI_AEST0DH_OFFSET (GroupFormat), "Group Format", 0}, + {ACPI_DMT_UINT16, ACPI_AEST0DH_OFFSET (Reserved[0]), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_AEST0DH_OFFSET (Flags), "Flags (decoded below)", 0}, + {ACPI_DMT_FLAG0, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Shared Interface", 0}, + {ACPI_DMT_FLAG1, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Clear MISCx Registers", 0}, + {ACPI_DMT_FLAG2, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Error Node Device Valid", 0}, + {ACPI_DMT_FLAG3, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Affinity Type", 0}, + {ACPI_DMT_FLAG4, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Error group Address Valid", 0}, + {ACPI_DMT_FLAG5, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Fault Injection Address Valid", 0}, + {ACPI_DMT_FLAG7, ACPI_AEST0D_FLAG_OFFSET (Flags, 0), "Interrupt Config Address valid", 0}, + {ACPI_DMT_UINT64, ACPI_AEST0DH_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT32, ACPI_AEST0DH_OFFSET (ErrorRecordIndex), "Error Record Index", 0}, + {ACPI_DMT_UINT32, ACPI_AEST0DH_OFFSET (ErrorRecordCount), "Error Record Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* AestXface: Node Interface Structure V2 4K Group Format */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface4k[] = +{ + {ACPI_DMT_UINT64, ACPI_AEST0D4_OFFSET (ErrorRecordImplemented),"Error Record Implemented", 0}, + {ACPI_DMT_UINT64, ACPI_AEST0D4_OFFSET (ErrorStatusReporting), "Error Status Reporting", 0}, + {ACPI_DMT_UINT64, ACPI_AEST0D4_OFFSET (AddressingMode), "Addressing Mode", 0}, + ACPI_DM_AEST_INTERFACE_COMMON(4) + ACPI_DMT_TERMINATOR +}; + +/* AestXface: Node Interface Structure V2 16K Group Format */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface16k[] = +{ + {ACPI_DMT_BUF32, ACPI_AEST0D16_OFFSET (ErrorRecordImplemented[0]),"Error Record Implemented", 0}, + {ACPI_DMT_BUF32, ACPI_AEST0D16_OFFSET (ErrorStatusReporting[0]), "Error Status Reporting", 0}, + {ACPI_DMT_BUF32, ACPI_AEST0D16_OFFSET (AddressingMode[0]), "Addressing Mode", 0}, + ACPI_DM_AEST_INTERFACE_COMMON(16) + ACPI_DMT_TERMINATOR +}; + +/* AestXface: Node Interface Structure V2 64K Group Format */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface64k[] = +{ + {ACPI_DMT_BUF112, ACPI_AEST0D64_OFFSET (ErrorRecordImplemented[0]),"Error Record Implemented", 0}, + {ACPI_DMT_BUF112, ACPI_AEST0D64_OFFSET (ErrorStatusReporting[0]), "Error Status Reporting", 0}, + {ACPI_DMT_BUF112, ACPI_AEST0D64_OFFSET (AddressingMode[0]), "Addressing Mode", 0}, + ACPI_DM_AEST_INTERFACE_COMMON(64) + ACPI_DMT_TERMINATOR +}; + /* AestXrupt: Node Interrupt Structure */ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXrupt[] = @@ -329,6 +418,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAestXrupt[] = }; +/* AestXrupt: Node Interrupt Structure V2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoAestXruptV2[] = +{ + {ACPI_DMT_AEST_XRUPT, ACPI_AEST0EA_OFFSET (Type), "Interrupt Type", 0}, + {ACPI_DMT_UINT16, ACPI_AEST0EA_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_AEST0EA_OFFSET (Flags), "Flags (decoded below)", 0}, + {ACPI_DMT_FLAG0, ACPI_AEST0EA_FLAG_OFFSET (Flags, 0), "Level Triggered", 0}, + {ACPI_DMT_UINT32, ACPI_AEST0EA_OFFSET (Gsiv), "Gsiv", 0}, + {ACPI_DMT_UINT32, ACPI_AEST0EA_OFFSET (Reserved1[0]), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + + /******************************************************************************* * * ASF - Alert Standard Format table (Signature "ASF!") @@ -689,7 +792,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] = {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0}, {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0}, - {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members", 0}, {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0}, {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0}, @@ -705,6 +808,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] = ACPI_DMT_TERMINATOR }; +/* 2: CXL XOR Interleave Math Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedt2[] = +{ + {ACPI_DMT_UINT16, ACPI_CEDT2_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT2_OFFSET (Hbig), "Interleave Granularity", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT2_OFFSET (NrXormaps), "Xormap List Count", 0}, + {ACPI_DMT_UINT64, ACPI_CEDT2_OFFSET (XormapList), "First Xormap", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedt2_te[] = +{ + {ACPI_DMT_UINT64, ACPI_CEDT2_TE_OFFSET (Xormap), "Next Xormap", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * * CPEP - Corrected Platform Error Polling table @@ -1548,7 +1668,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[] = {ACPI_DMT_FLAGS4_8, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Associativity", 0}, {ACPI_DMT_FLAGS4_12, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Write Policy", 0}, {ACPI_DMT_FLAGS16_16, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Line Size", 0}, - {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (Reserved2), "Reserved2", 0}, + {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (AddressMode), "Address Mode", 0}, {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (NumberOfSMBIOSHandles), "SMBIOS Handle #", 0}, ACPI_DMT_TERMINATOR }; diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c index 834d1ef0c47c..8242b3299cb1 100644 --- a/source/common/dmtbinfo2.c +++ b/source/common/dmtbinfo2.c @@ -313,6 +313,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[] = {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_FLAG2, ACPI_IORTA_FLAG_OFFSET (MemoryFlags, 0), "Ensured Coherency of Accesses", 0}, ACPI_DMT_TERMINATOR }; @@ -1230,7 +1231,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam0[] = {ACPI_DMT_UINT32, ACPI_MPAM0_OFFSET (MaxNrdyUsec), "MAX_NRDY_USEC", 0}, {ACPI_DMT_NAME8, ACPI_MPAM0_OFFSET (HardwareIdLinkedDevice), "Hardware ID of linked device", 0}, {ACPI_DMT_UINT32, ACPI_MPAM0_OFFSET (InstanceIdLinkedDevice), "Instance ID of linked device", 0}, - {ACPI_DMT_UINT32, ACPI_MPAM0_OFFSET (NumResouceNodes), "Number of resource nodes", 0}, + {ACPI_DMT_UINT32, ACPI_MPAM0_OFFSET (NumResourceNodes), "Number of resource nodes", 0}, ACPI_DMT_TERMINATOR }; @@ -1261,6 +1262,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1A[] = { {ACPI_DMT_UINT64, ACPI_MPAM1A_OFFSET (CacheReference), "Cache reference", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1A_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR }; /* 1B: MPAM Memory locator descriptor. A subtable of RIS. @@ -1270,6 +1272,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1B[] = { {ACPI_DMT_UINT64, ACPI_MPAM1B_OFFSET (ProximityDomain), "Proximity domain", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1B_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR }; /* 1C: MPAM SMMU locator descriptor. A subtable of RIS. @@ -1279,6 +1282,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1C[] = { {ACPI_DMT_UINT64, ACPI_MPAM1C_OFFSET (SmmuInterface), "SMMU Interface", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1C_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR }; /* 1D: MPAM Memory-side cache locator descriptor. A subtable of RIS. @@ -1286,9 +1290,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1C[] = */ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1D[] = { - {ACPI_DMT_UINT56, ACPI_MPAM1D_OFFSET (Level), "Reserved", 0}, + {ACPI_DMT_UINT56, ACPI_MPAM1D_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_MPAM1D_OFFSET (Level), "Level", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1D_OFFSET (Reference), "Reference", 0}, + ACPI_DMT_TERMINATOR }; /* 1E: MPAM ACPI device locator descriptor. A subtable of RIS. @@ -1298,6 +1303,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1E[] = { {ACPI_DMT_UINT64, ACPI_MPAM1E_OFFSET (AcpiHwId), "ACPI Hardware ID", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1E_OFFSET (AcpiUniqueId), "ACPI Unique ID", 0}, + ACPI_DMT_TERMINATOR }; /* 1F: MPAM Interconnect locator descriptor. A subtable of RIS. @@ -1307,6 +1313,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1F[] = { {ACPI_DMT_UINT64, ACPI_MPAM1F_OFFSET (InterConnectDescTblOff), "Interconnect descriptor table offset", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1F_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR }; /* 1G: MPAM Locator structure. @@ -1316,6 +1323,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam1G[] = { {ACPI_DMT_UINT64, ACPI_MPAM1G_OFFSET (Descriptor1), "Descriptor1", 0}, {ACPI_DMT_UINT32, ACPI_MPAM1G_OFFSET (Descriptor2), "Descriptor2", 0}, + ACPI_DMT_TERMINATOR }; /* 2: MPAM Functional dependency descriptor. @@ -1325,6 +1333,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpam2[] = { {ACPI_DMT_UINT32, ACPI_MPAM2_OFFSET (Producer), "Producer", 0}, {ACPI_DMT_UINT32, ACPI_MPAM2_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR }; diff --git a/source/common/dmtbinfo3.c b/source/common/dmtbinfo3.c index b06edb8277e6..2f67e5e70da1 100644 --- a/source/common/dmtbinfo3.c +++ b/source/common/dmtbinfo3.c @@ -255,7 +255,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] = {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (StopBits), "Stop Bits", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (FlowControl), "Flow Control", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (TerminalType), "Terminal Type", 0}, - {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Language), "Language", 0}, {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciDeviceId), "PCI Device ID", 0}, {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciVendorId), "PCI Vendor ID", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciBus), "PCI Bus", 0}, @@ -263,7 +263,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] = {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciFunction), "PCI Function", 0}, {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (PciFlags), "PCI Flags", 0}, {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciSegment), "PCI Segment", 0}, - {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (UartClkFreq), "Uart Clock Freq", 0}, + {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (PreciseBaudrate), "Precise Baud rate", 0}, + {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (NameSpaceStringLength), "NameSpaceStringLength", 0}, + {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (NameSpaceStringOffset), "NameSpaceStringOffset", 0}, + {ACPI_DMT_STRING, ACPI_SPCR_OFFSET (NameSpaceString), "NamespaceString", 0}, ACPI_DMT_TERMINATOR }; diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index 36683e4a7016..45c12fb2c6eb 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -1582,9 +1582,12 @@ RsDoDwordMemoryDescriptor ( ASL_RESOURCE_INFO *Info); ASL_RESOURCE_NODE * -RsDoDwordSpaceDescriptor ( +RsDoDwordPccDescriptor ( ASL_RESOURCE_INFO *Info); +ASL_RESOURCE_NODE * +RsDoDwordSpaceDescriptor ( + ASL_RESOURCE_INFO *Info); /* * aslrestype2e - Extended address descriptors @@ -1614,6 +1617,10 @@ RsDoQwordMemoryDescriptor ( ASL_RESOURCE_INFO *Info); ASL_RESOURCE_NODE * +RsDoQwordPccDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * RsDoQwordSpaceDescriptor ( ASL_RESOURCE_INFO *Info); @@ -1626,6 +1633,10 @@ RsDoWordIoDescriptor ( ASL_RESOURCE_INFO *Info); ASL_RESOURCE_NODE * +RsDoWordPccDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * RsDoWordSpaceDescriptor ( ASL_RESOURCE_INFO *Info); diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index 6345cdfb36ba..25e2d9abe378 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -438,6 +438,7 @@ NamePathTail [.]{NameSeg} "DMA" { count (1); return (PARSEOP_DMA); } "DWordIO" { count (1); return (PARSEOP_DWORDIO); } "DWordMemory" { count (1); return (PARSEOP_DWORDMEMORY); } +"DWordPcc" { count (1); return (PARSEOP_DWORDPCC); } "DWordSpace" { count (1); return (PARSEOP_DWORDSPACE); } "EndDependentFn" { count (1); return (PARSEOP_ENDDEPENDENTFN); } "ExtendedIO" { count (1); return (PARSEOP_EXTENDEDIO); } @@ -464,6 +465,7 @@ NamePathTail [.]{NameSeg} "ClockInput" { count (1); return (PARSEOP_CLOCKINPUT); } "QWordIO" { count (1); return (PARSEOP_QWORDIO); } "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); } +"QWordPcc" { count (1); return (PARSEOP_DWORDPCC); } "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); } "Register" { count (1); return (PARSEOP_REGISTER); } "SpiSerialBus" { count (1); return (PARSEOP_SPI_SERIALBUS); } @@ -476,6 +478,7 @@ NamePathTail [.]{NameSeg} "VendorShort" { count (1); return (PARSEOP_VENDORSHORT); } "WordBusNumber" { count (1); return (PARSEOP_WORDBUSNUMBER); } "WordIO" { count (1); return (PARSEOP_WORDIO); } +"WordPcc" { count (1); return (PARSEOP_DWORDPCC); } "WordSpace" { count (1); return (PARSEOP_WORDSPACE); } diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 43673d37fa99..ab08c5f4c1a5 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -162,7 +162,7 @@ #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" #define ASL_PREFIX "iASL: " -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.3" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.5" /* Configuration constants */ diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 0ad71160cf9b..d3b9ecac6217 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -319,6 +319,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* DWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_DWORD, 0, 0, ACPI_BTYPE_INTEGER), /* DWORDIO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DWORDMEMORY */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* DWORDPCC */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DWORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* EISAID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, 0, ACPI_BTYPE_INTEGER), /* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, OP_AML_PACKAGE, 0), @@ -473,6 +474,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), /* QWORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* QWORDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* QWORDPCC */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* QWORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* RANGE_TYPE_ENTIRE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* RANGE_TYPE_ISAONLY */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), @@ -560,6 +562,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* WORDBUSNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* WORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_WORD, 0, 0, ACPI_BTYPE_INTEGER), /* WORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* WORDPCC */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* WORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* XFERSIZE_8 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* XFERSIZE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), diff --git a/source/compiler/aslparseop.c b/source/compiler/aslparseop.c index 78a207f03529..e415e101f906 100644 --- a/source/compiler/aslparseop.c +++ b/source/compiler/aslparseop.c @@ -790,7 +790,7 @@ TrCreateConstantLeafOp ( DbgPrint (ASL_PARSE_OUTPUT, "\nCreateConstantLeafOp Ln/Col %u/%u NewOp %p " - "Op %s Value %8.8X%8.8X \n", + "Op %s Value %8.8X%8.8X\n", Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode), ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index 19a34ea8d126..0161c6cad9b3 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -208,7 +208,7 @@ AslLocalAllocate ( * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 128 +%expect 134 /*! [Begin] no source code translation */ diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 0a24d608e7e1..4fed02ae7a0e 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -788,6 +788,11 @@ RsDoOneResourceDescriptor ( Rnode = RsDoDwordMemoryDescriptor (Info); break; + case PARSEOP_DWORDPCC: + + Rnode = RsDoDwordPccDescriptor (Info); + break; + case PARSEOP_DWORDSPACE: Rnode = RsDoDwordSpaceDescriptor (Info); @@ -889,6 +894,11 @@ RsDoOneResourceDescriptor ( Rnode = RsDoQwordMemoryDescriptor (Info); break; + case PARSEOP_QWORDPCC: + + Rnode = RsDoQwordPccDescriptor (Info); + break; + case PARSEOP_QWORDSPACE: Rnode = RsDoQwordSpaceDescriptor (Info); @@ -963,6 +973,11 @@ RsDoOneResourceDescriptor ( Rnode = RsDoWordIoDescriptor (Info); break; + case PARSEOP_WORDPCC: + + Rnode = RsDoWordPccDescriptor (Info); + break; + case PARSEOP_WORDSPACE: Rnode = RsDoWordSpaceDescriptor (Info); diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index 46ecfa254247..16a70b900297 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -194,6 +194,7 @@ ResourceMacroTerm | DMATerm {} | DWordIOTerm {} | DWordMemoryTerm {} + | DWordPccTerm {} | DWordSpaceTerm {} | EndDependentFnTerm {} | ExtendedIOTerm {} @@ -220,6 +221,7 @@ ResourceMacroTerm | PinGroupFunctionTerm {} | QWordIOTerm {} | QWordMemoryTerm {} + | QWordPccTerm {} | QWordSpaceTerm {} | RegisterTerm {} | SpiSerialBusTerm {} @@ -232,6 +234,7 @@ ResourceMacroTerm | VendorShortTerm {} | WordBusNumberTerm {} | WordIOTerm {} + | WordPccTerm {} | WordSpaceTerm {} ; @@ -317,6 +320,20 @@ DWordMemoryTerm error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; +DWordPccTerm + : PARSEOP_DWORDPCC + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDPCC);} + ByteConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4, + $4,$5,$6,$7);} + | PARSEOP_DWORDPCC + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + DWordSpaceTerm : PARSEOP_DWORDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDSPACE);} @@ -784,6 +801,20 @@ QWordMemoryTerm error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; +QWordPccTerm + : PARSEOP_QWORDPCC + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDPCC);} + ByteConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4, + $4,$5,$6,$7);} + | PARSEOP_QWORDPCC + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + QWordSpaceTerm : PARSEOP_QWORDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDSPACE);} @@ -1012,6 +1043,20 @@ WordIOTerm error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; +WordPccTerm + : PARSEOP_WORDPCC + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDPCC);} + ByteConstExpr + OptionalByteConstExpr + OptionalStringData + OptionalNameString_Last + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4, + $4,$5,$6,$7);} + | PARSEOP_WORDPCC + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + WordSpaceTerm : PARSEOP_WORDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDSPACE);} diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c index e9efac186a07..b7eb085e2fef 100644 --- a/source/compiler/aslrestype2d.c +++ b/source/compiler/aslrestype2d.c @@ -158,11 +158,168 @@ /* * This module contains the Dword (32-bit) address space descriptors: * + * DWordPcc * DwordIO * DwordMemory * DwordSpace */ + +/******************************************************************************* + * + * FUNCTION: RsDoDwordPccDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "DWordPcc" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoDwordPccDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ACPI_PARSE_OBJECT *MinOp = NULL; + ACPI_PARSE_OBJECT *MaxOp = NULL; + ACPI_PARSE_OBJECT *LengthOp = NULL; + ACPI_PARSE_OBJECT *GranOp = NULL; + ASL_RESOURCE_NODE *Rnode; + UINT16 StringLength = 0; + UINT32 OptionIndex = 0; + UINT8 *OptionalFields; + UINT32 i; + BOOLEAN ResSourceIndex = FALSE; + + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + StringLength = RsGetStringDataLength (InitializerOp); + + Rnode = RsAllocateResourceNode ( + sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); + + Descriptor = Rnode->Buffer; + Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; + Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_PCC_NUMBER; + + /* + * Initial descriptor length -- may be enlarged if there are + * optional fields present + */ + OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32); + Descriptor->Address32.ResourceLength = (UINT16) + (sizeof (AML_RESOURCE_ADDRESS32) - + sizeof (AML_RESOURCE_LARGE_HEADER)); + + + /* + * Bit [3] Max Address Fixed, _MAF: 1 (max address is fixed) + * Bit [2] Min Address Fixed,_MIF: 1 (min address is fixed) + * Bit [1] Decode Type, _DEC: 0 (do not care) + * BIT [0] Ignored (must be zero) + */ + Descriptor->Address32.Flags = 0b1100; + + // No type specific flags. Set to 0. + Descriptor->Address32.SpecificFlags = 0; + + // must be set to zero if _MAX == _MIN. + Descriptor->Address32.Granularity = 0x0; + /* Process all child initialization nodes */ + + // No translation offset. + Descriptor->Address32.TranslationOffset = 0; + + // Pcc is unique address. + Descriptor->Address32.AddressLength = 1; + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + + case 0: /* Address Min = Max */ + + Descriptor->Address32.Minimum = + (UINT32) InitializerOp->Asl.Value.Integer; + Descriptor->Address32.Maximum = + (UINT32) InitializerOp->Asl.Value.Integer; + + break; + + case 1: /* ResSourceIndex [Optional Field - BYTE] */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + /* Found a valid ResourceSourceIndex */ + + OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; + OptionIndex++; + Descriptor->Address32.ResourceLength++; + ResSourceIndex = TRUE; + } + break; + + case 2: /* ResSource [Optional Field - STRING] */ + + if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) && + (InitializerOp->Asl.Value.String)) + { + if (StringLength) + { + /* Found a valid ResourceSource */ + + Descriptor->Address32.ResourceLength = (UINT16) + (Descriptor->Address32.ResourceLength + StringLength); + + strcpy ((char *) + &OptionalFields[OptionIndex], + InitializerOp->Asl.Value.String); + + /* ResourceSourceIndex must also be valid */ + + if (!ResSourceIndex) + { + AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, + InitializerOp, NULL); + } + } + } + + break; + + case 3: // DescriptorName + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + default: + + AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL); + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + /* Validate the Min/Max/Len/Gran values */ + + RsLargeAddressCheck ( + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, + Descriptor->Address32.Flags, + MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp); + + Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + + OptionIndex + StringLength; + return (Rnode); +} + + /******************************************************************************* * * FUNCTION: RsDoDwordIoDescriptor diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c index 2f564499b443..1b0334f137ad 100644 --- a/source/compiler/aslrestype2q.c +++ b/source/compiler/aslrestype2q.c @@ -160,6 +160,7 @@ * * QWordIO * QWordMemory + * QwordPcc * QWordSpace */ @@ -615,6 +616,161 @@ RsDoQwordMemoryDescriptor ( /******************************************************************************* * + * FUNCTION: RsDoQwordPccDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "QWordPcc" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoQwordPccDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ACPI_PARSE_OBJECT *MinOp = NULL; + ACPI_PARSE_OBJECT *MaxOp = NULL; + ACPI_PARSE_OBJECT *LengthOp = NULL; + ACPI_PARSE_OBJECT *GranOp = NULL; + ASL_RESOURCE_NODE *Rnode; + UINT16 StringLength = 0; + UINT32 OptionIndex = 0; + UINT8 *OptionalFields; + UINT32 i; + BOOLEAN ResSourceIndex = FALSE; + + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + StringLength = RsGetStringDataLength (InitializerOp); + + Rnode = RsAllocateResourceNode ( + sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); + + Descriptor = Rnode->Buffer; + Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; + Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_PCC_NUMBER; + + /* + * Initial descriptor length -- may be enlarged if there are + * optional fields present + */ + OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32); + Descriptor->Address32.ResourceLength = (UINT16) + (sizeof (AML_RESOURCE_ADDRESS32) - + sizeof (AML_RESOURCE_LARGE_HEADER)); + + + /* + * Bit [3] Max Address Fixed, _MAF: 1 (max address is fixed) + * Bit [2] Min Address Fixed,_MIF: 1 (min address is fixed) + * Bit [1] Decode Type, _DEC: 0 (do not care) + * BIT [0] Ignored (must be zero) + */ + Descriptor->Address32.Flags = 0b1100; + + // No type specific flags. Set to 0. + Descriptor->Address32.SpecificFlags = 0; + + // must be set to zero if _MAX == _MIN. + Descriptor->Address32.Granularity = 0x0; + /* Process all child initialization nodes */ + + // No translation offset. + Descriptor->Address32.TranslationOffset = 0; + + // Pcc is unique address. + Descriptor->Address32.AddressLength = 1; + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + + case 0: /* Address Min = Max */ + + Descriptor->Address32.Minimum = + (UINT32) InitializerOp->Asl.Value.Integer; + Descriptor->Address32.Maximum = + (UINT32) InitializerOp->Asl.Value.Integer; + + break; + + case 1: /* ResSourceIndex [Optional Field - BYTE] */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + /* Found a valid ResourceSourceIndex */ + + OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; + OptionIndex++; + Descriptor->Address32.ResourceLength++; + ResSourceIndex = TRUE; + } + break; + + case 2: /* ResSource [Optional Field - STRING] */ + + if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) && + (InitializerOp->Asl.Value.String)) + { + if (StringLength) + { + /* Found a valid ResourceSource */ + + Descriptor->Address32.ResourceLength = (UINT16) + (Descriptor->Address32.ResourceLength + StringLength); + + strcpy ((char *) + &OptionalFields[OptionIndex], + InitializerOp->Asl.Value.String); + + /* ResourceSourceIndex must also be valid */ + + if (!ResSourceIndex) + { + AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, + InitializerOp, NULL); + } + } + } + + break; + + case 3: // DescriptorName + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + default: + + AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL); + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + /* Validate the Min/Max/Len/Gran values */ + + RsLargeAddressCheck ( + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, + Descriptor->Address32.Flags, + MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp); + + Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + + OptionIndex + StringLength; + return (Rnode); +} + + +/******************************************************************************* + * * FUNCTION: RsDoQwordSpaceDescriptor * * PARAMETERS: Info - Parse Op and resource template offset diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c index f7ff8f811c1b..1173b676e752 100644 --- a/source/compiler/aslrestype2w.c +++ b/source/compiler/aslrestype2w.c @@ -160,6 +160,7 @@ * * WordIO * WordMemory + * WordPcc * WordSpace */ @@ -591,6 +592,161 @@ RsDoWordBusNumberDescriptor ( /******************************************************************************* * + * FUNCTION: RsDoWordPccDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "WordPcc" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoWordPccDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ACPI_PARSE_OBJECT *MinOp = NULL; + ACPI_PARSE_OBJECT *MaxOp = NULL; + ACPI_PARSE_OBJECT *LengthOp = NULL; + ACPI_PARSE_OBJECT *GranOp = NULL; + ASL_RESOURCE_NODE *Rnode; + UINT16 StringLength = 0; + UINT32 OptionIndex = 0; + UINT8 *OptionalFields; + UINT32 i; + BOOLEAN ResSourceIndex = FALSE; + + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + StringLength = RsGetStringDataLength (InitializerOp); + + Rnode = RsAllocateResourceNode ( + sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); + + Descriptor = Rnode->Buffer; + Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; + Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_PCC_NUMBER; + + /* + * Initial descriptor length -- may be enlarged if there are + * optional fields present + */ + OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32); + Descriptor->Address32.ResourceLength = (UINT16) + (sizeof (AML_RESOURCE_ADDRESS32) - + sizeof (AML_RESOURCE_LARGE_HEADER)); + + + /* + * Bit [3] Max Address Fixed, _MAF: 1 (max address is fixed) + * Bit [2] Min Address Fixed,_MIF: 1 (min address is fixed) + * Bit [1] Decode Type, _DEC: 0 (do not care) + * BIT [0] Ignored (must be zero) + */ + Descriptor->Address32.Flags = 0b1100; + + // No type specific flags. Set to 0. + Descriptor->Address32.SpecificFlags = 0; + + // must be set to zero if _MAX == _MIN. + Descriptor->Address32.Granularity = 0x0; + /* Process all child initialization nodes */ + + // No translation offset. + Descriptor->Address32.TranslationOffset = 0; + + // Pcc is unique address. + Descriptor->Address32.AddressLength = 1; + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + + case 0: /* Address Min = Max */ + + Descriptor->Address32.Minimum = + (UINT32) InitializerOp->Asl.Value.Integer; + Descriptor->Address32.Maximum = + (UINT32) InitializerOp->Asl.Value.Integer; + + break; + + case 1: /* ResSourceIndex [Optional Field - BYTE] */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + /* Found a valid ResourceSourceIndex */ + + OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; + OptionIndex++; + Descriptor->Address32.ResourceLength++; + ResSourceIndex = TRUE; + } + break; + + case 2: /* ResSource [Optional Field - STRING] */ + + if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) && + (InitializerOp->Asl.Value.String)) + { + if (StringLength) + { + /* Found a valid ResourceSource */ + + Descriptor->Address32.ResourceLength = (UINT16) + (Descriptor->Address32.ResourceLength + StringLength); + + strcpy ((char *) + &OptionalFields[OptionIndex], + InitializerOp->Asl.Value.String); + + /* ResourceSourceIndex must also be valid */ + + if (!ResSourceIndex) + { + AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, + InitializerOp, NULL); + } + } + } + + break; + + case 3: // DescriptorName + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + default: + + AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL); + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + /* Validate the Min/Max/Len/Gran values */ + + RsLargeAddressCheck ( + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, + Descriptor->Address32.Flags, + MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp); + + Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + + OptionIndex + StringLength; + return (Rnode); +} + + +/******************************************************************************* + * * FUNCTION: RsDoWordSpaceDescriptor * * PARAMETERS: Info - Parse Op and resource template offset diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index e47bdb79dd32..b7a4c2d96144 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -256,6 +256,7 @@ NoEcho(' %token <i> PARSEOP_DWORDCONST %token <i> PARSEOP_DWORDIO %token <i> PARSEOP_DWORDMEMORY +%token <i> PARSEOP_DWORDPCC %token <i> PARSEOP_DWORDSPACE %token <i> PARSEOP_EISAID %token <i> PARSEOP_ELSE @@ -410,6 +411,7 @@ NoEcho(' %token <i> PARSEOP_QWORDCONST %token <i> PARSEOP_QWORDIO %token <i> PARSEOP_QWORDMEMORY +%token <i> PARSEOP_QWORDPCC %token <i> PARSEOP_QWORDSPACE %token <i> PARSEOP_RANGETYPE_ENTIRE %token <i> PARSEOP_RANGETYPE_ISAONLY @@ -497,6 +499,7 @@ NoEcho(' %token <i> PARSEOP_WORDBUSNUMBER %token <i> PARSEOP_WORDCONST %token <i> PARSEOP_WORDIO +%token <i> PARSEOP_WORDPCC %token <i> PARSEOP_WORDSPACE %token <i> PARSEOP_XFERSIZE_8 %token <i> PARSEOP_XFERSIZE_16 diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index 920cdf51807e..5e104d828334 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -419,6 +419,7 @@ NoEcho(' %type <n> DMATerm %type <n> DWordIOTerm %type <n> DWordMemoryTerm +%type <n> DWordPccTerm %type <n> DWordSpaceTerm %type <n> EndDependentFnTerm %type <n> ExtendedIOTerm @@ -446,6 +447,7 @@ NoEcho(' %type <n> PinGroupFunctionTerm %type <n> QWordIOTerm %type <n> QWordMemoryTerm +%type <n> QWordPccTerm %type <n> QWordSpaceTerm %type <n> RegisterTerm %type <n> SpiSerialBusTerm @@ -458,6 +460,7 @@ NoEcho(' %type <n> VendorShortTerm %type <n> WordBusNumberTerm %type <n> WordIOTerm +%type <n> WordPccTerm %type <n> WordSpaceTerm /* Local types that help construct the AML, not in ACPI spec */ diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c index dc63a4e83318..7d1df16bae39 100644 --- a/source/compiler/dtfield.c +++ b/source/compiler/dtfield.c @@ -281,8 +281,8 @@ DtCompileString ( if (Length > ByteLength) { sprintf (AslGbl_MsgBuffer, - "Maximum %u characters, found %u characters [%s]", - ByteLength, Length, Field->Value); + "Maximum %u characters, found %u characters [%.*s]", + ByteLength, Length, (ASL_MSG_BUFFER_SIZE / 2), Field->Value); DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, AslGbl_MsgBuffer); Length = ByteLength; } diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c index 998bda33ed5b..0f68f61e831d 100644 --- a/source/compiler/dttable1.c +++ b/source/compiler/dttable1.c @@ -206,7 +206,14 @@ DtCompileAest ( UINT32 i; UINT32 Offset; DT_FIELD **PFieldList = (DT_FIELD **) List; + ACPI_AEST_NODE_INTERFACE_HEADER *AestNodeHeader; + UINT8 Revision; + ACPI_TABLE_HEADER *Header; + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + Revision = Header->Revision; while (*PFieldList) { @@ -257,8 +264,21 @@ DtCompileAest ( break; case ACPI_AEST_VENDOR_ERROR_NODE: + switch (Revision) + { + case 1: + InfoTable = AcpiDmTableInfoAestVendorError; + break; - InfoTable = AcpiDmTableInfoAestVendorError; + case 2: + InfoTable = AcpiDmTableInfoAestVendorV2Error; + break; + + default: + AcpiOsPrintf ("Unknown AEST Vendor Error Revision: %X\n", + Revision); + return (AE_ERROR); + } break; case ACPI_AEST_GIC_ERROR_NODE: @@ -266,6 +286,16 @@ DtCompileAest ( InfoTable = AcpiDmTableInfoAestGicError; break; + case ACPI_AEST_PCIE_ERROR_NODE: + + InfoTable = AcpiDmTableInfoAestPCIeError; + break; + + case ACPI_AEST_PROXY_ERROR_NODE: + + InfoTable = AcpiDmTableInfoAestProxyError; + break; + /* Error case below */ default: AcpiOsPrintf ("Unknown AEST Subtable Type: %X\n", @@ -341,9 +371,57 @@ DtCompileAest ( } /* Compile the (required) node interface structure */ + if (Revision == 1) + { + InfoTable = AcpiDmTableInfoAestXface; + } + else if (Revision == 2) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestXfaceHeader, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestXface, - &Subtable); + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Offset += Subtable->Length; + + AestNodeHeader = ACPI_CAST_PTR (ACPI_AEST_NODE_INTERFACE_HEADER, + Subtable->Buffer); + + switch (AestNodeHeader->GroupFormat) + { + case ACPI_AEST_NODE_GROUP_FORMAT_4K: + + InfoTable = AcpiDmTableInfoAestXface4k; + break; + + case ACPI_AEST_NODE_GROUP_FORMAT_16K: + + InfoTable = AcpiDmTableInfoAestXface16k; + break; + + case ACPI_AEST_NODE_GROUP_FORMAT_64K: + + InfoTable = AcpiDmTableInfoAestXface64k; + break; + + /* Error case below */ + default: + AcpiOsPrintf ("Unknown AEST Interface Group Format: %X\n", + AestNodeHeader->GroupFormat); + return (AE_ERROR); + } + } + else + { + AcpiOsPrintf ("Unknown AEST Revision: %X\n", Revision); + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); @@ -367,8 +445,22 @@ DtCompileAest ( for (i = 0; i < ErrorNodeHeader->NodeInterruptCount; i++) { - Status = DtCompileTable (PFieldList, AcpiDmTableInfoAestXrupt, - &Subtable); + switch (Revision) { + case 1: + + InfoTable = AcpiDmTableInfoAestXrupt; + break; + + case 2: + + InfoTable = AcpiDmTableInfoAestXruptV2; + break; + + default: + AcpiOsPrintf ("Unknown AEST Revision: %X\n", Revision); + return (AE_ERROR); + } + Status = DtCompileTable (PFieldList, InfoTable, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); @@ -974,6 +1066,53 @@ DtCompileCedt ( ParentTable = DtPeekSubtable (); break; } + case ACPI_CEDT_TYPE_CXIMS: { + unsigned char *dump; + unsigned int idx, offset, max = 0; + + /* Compile table with first "Xor map" */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt2, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Look in buffer for the number of Xor maps */ + offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CXIMS, NrXormaps); + dump = (unsigned char *) Subtable->Buffer - 4; /* place at beginning of cedt2 */ + max = dump[offset]; + + /* We need to add more XOR maps, so write the current Subtable. */ + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); /* Insert AcpiDmTableInfoCedt2 table so we can put in */ + DtPushSubtable (Subtable); + + /* Now, find out all Xor maps beyond the first. */ + + for (idx = 1; idx < max; idx++) { + ParentTable = DtPeekSubtable (); + + if (*PFieldList) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt2_te, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (Subtable) + { + DtInsertSubtable (ParentTable, Subtable); /* got an Xor map, so insert table. */ + InsertFlag = 0; + } + } + } + + DtPopSubtable (); + ParentTable = DtPeekSubtable (); + break; + } default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 5fd922879b70..394187293237 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -550,7 +550,7 @@ DtCompileMpam ( RisLength = 0; /* Iterate over RIS subtables per MSC node */ - for (UINT32 ris = 0; ris < MpamMscNode->NumResouceNodes; ris++) + for (UINT32 ris = 0; ris < MpamMscNode->NumResourceNodes; ris++) { /* Compile RIS subtable */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpam1, diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index 62b610b3924c..9e1a8cca3229 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -157,13 +157,13 @@ const unsigned char TemplateAest[] = { - 0x41,0x45,0x53,0x54,0xCC,0x02,0x00,0x00, /* 00000000 "AEST...." */ - 0x01,0x2A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".*INTEL " */ + 0x41,0x45,0x53,0x54,0x90,0x03,0x00,0x00, /* 00000000 "AEST...." */ + 0x02,0xE6,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x04,0x06,0x21,0x20,0x00,0x80,0x00,0x00, /* 00000020 "..! ...." */ + 0x28,0x06,0x23,0x20,0x00,0xA0,0x00,0x00, /* 00000020 "(.# ...." */ 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000028 ",...D..." */ - 0x74,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "t......." */ + 0x94,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000038 "....gE#." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ @@ -177,76 +177,100 @@ const unsigned char TemplateAest[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 00000098 ".......x" */ - 0x56,0x00,0x00,0x00,0x00,0x74,0x00,0x00, /* 000000A0 "V....t.." */ - 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 000000A8 ",...D..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ - 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000B8 "....gE#." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ - 0x11,0x11,0x00,0x00,0x01,0x00,0x01,0x00, /* 000000D0 "........" */ - 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000D8 "....gE#." */ - 0x67,0x67,0x67,0x67,0x00,0x00,0x00,0x00, /* 000000E0 "gggg...." */ - 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 000000E8 "........" */ - 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000F0 "....gE#." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */ - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ - 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000110 "........" */ - 0x01,0x60,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000118 ".`..,..." */ - 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "0......." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000a0 "....gE#." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000a8 "....gE#." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000b0 "....gE#." */ + 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 000000b8 ".......x" */ + 0x00,0x00,0x00,0x00,0x00,0x94,0x00,0x00, /* 000000c0 "........" */ + 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 000000c8 ",...D..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000d8 "....gE#." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */ + 0x11,0x11,0x00,0x00,0x01,0x00,0x01,0x00, /* 000000f0 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000000f8 "....gE#." */ + 0x67,0x67,0x67,0x67,0x00,0x00,0x00,0x00, /* 00000100 "gggg...." */ + 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000108 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000110 "....gE#." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000118 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ - 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000138 "........" */ - 0x67,0x45,0x23,0x01,0xAA,0xAA,0x00,0x00, /* 00000140 "gE#....." */ - 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000148 "........" */ + 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 00000138 ".......x" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000140 "....gE#." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000148 "....gE#." */ 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000150 "....gE#." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ + 0x01,0x80,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000158 "....,..." */ + 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "0......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ - 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000170 "........" */ - 0x02,0x64,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000178 ".d..,..." */ - 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "4......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000190 "........" */ - 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000198 "........" */ - 0x67,0x45,0x23,0x01,0x55,0x55,0x55,0x55, /* 000001A0 "gE#.UUUU" */ - 0x66,0x66,0x66,0x66,0x01,0x00,0x00,0x00, /* 000001A8 "ffff...." */ - 0x03,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 000001B0 "........" */ - 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 000001B8 "gE#....." */ - 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001C0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ - 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 000001D0 "........" */ - 0x00,0x00,0x00,0x00,0x03,0x74,0x00,0x00, /* 000001D8 ".....t.." */ - 0x2C,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 000001E0 ",...D..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ - 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000200 "....gE#." */ - 0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000208 "3333DDDD" */ - 0x12,0x23,0x34,0x45,0x56,0x67,0x78,0x89, /* 00000210 ".#4EVgx." */ - 0x9A,0xAB,0xBC,0xCD,0xDE,0xEF,0xFF,0x55, /* 00000218 ".......U" */ - 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000220 "........" */ - 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000228 "....gE#." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000230 "........" */ - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000238 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ - 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000248 "........" */ - 0x04,0x7C,0x00,0x00,0x2C,0x00,0x00,0x00, /* 00000250 ".|..,..." */ - 0x34,0x00,0x00,0x00,0x64,0x00,0x00,0x00, /* 00000258 "4...d..." */ - 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000178 "........" */ + 0x67,0x45,0x23,0x01,0xAA,0xAA,0x00,0x00, /* 00000180 "gE#....." */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000188 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000190 "....gE#." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000198 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001a0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001a8 "........" */ + 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 000001b0 "........" */ + 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 000001b8 ".......x" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000001c0 "....gE#." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 000001c8 "....gE#." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001d0 "........" */ + 0x02,0x84,0x00,0x00,0x2C,0x00,0x00,0x00, /* 000001d8 "....,..." */ + 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001e0 "4......." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001e8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001f0 "........" */ + 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 000001f8 "........" */ + 0x67,0x45,0x23,0x01,0x55,0x55,0x55,0x55, /* 00000200 "gE#.UUUU" */ + 0x66,0x66,0x66,0x66,0x01,0x00,0x00,0x00, /* 00000208 "ffff...." */ + 0x03,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000210 "........" */ + 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 00000218 "gE#....." */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000220 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */ + 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 00000230 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000238 "........" */ + 0xEF,0xCD,0xAB,0x78,0xEF,0xCD,0xAB,0x89, /* 00000240 "...x...." */ + 0x67,0x45,0x23,0x01,0xEF,0xCD,0xAB,0x89, /* 00000248 "gE#....." */ + 0x67,0x45,0x23,0x01,0xEF,0xCD,0xAB,0x89, /* 00000250 "gE#....." */ + 0x67,0x45,0x23,0x01,0x03,0x98,0x00,0x00, /* 00000258 "gE#....." */ + 0x2C,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 00000260 ",...H..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000268 "........" */ - 0x00,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000270 "........" */ - 0x67,0x45,0x23,0x01,0x03,0x00,0x00,0x00, /* 00000278 "gE#....." */ - 0x88,0x88,0x77,0x77,0x00,0x00,0x00,0x00, /* 00000280 "..ww...." */ - 0x03,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 00000288 "........" */ - 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 00000290 "gE#....." */ - 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000298 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002A0 "........" */ - 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 000002A8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002B0 "........" */ - 0xBB,0xBB,0xAA,0xAA,0xCC,0x00,0x00,0x00, /* 000002B8 "........" */ - 0x01,0x00,0x00,0x01,0xEF,0xCD,0xAB,0x78, /* 000002C0 ".......x" */ - 0x56,0x00,0x00,0x00 /* 000002C8 "V..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000270 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000278 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000280 "....gE#." */ + 0x33,0x33,0x33,0x33,0x22,0x22,0x22,0x22, /* 00000288 "3333""""" */ + 0x44,0x44,0x44,0x44,0x12,0x23,0x34,0x45, /* 00000290 "DDDD.#4E" */ + 0x56,0x67,0x78,0x89,0x9A,0xAB,0xBC,0xCD, /* 00000298 "Vgx....." */ + 0xDE,0xEF,0xFF,0x55,0x01,0x00,0x00,0x00, /* 000002a0 "...U...." */ + 0x02,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x89, /* 000002a8 "........" */ + 0x67,0x45,0x23,0x01,0x00,0x00,0x00,0x00, /* 000002b0 "gE#....." */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000002b8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000002c0 "........" */ + 0x00,0x00,0x00,0x00,0x11,0x11,0x11,0x01, /* 000002c8 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000002d0 "........" */ + 0xEF,0xCD,0xAB,0x78,0xEF,0xCD,0xAB,0x89, /* 000002d8 "...x...." */ + 0x67,0x45,0x23,0x01,0xEF,0xCD,0xAB,0x89, /* 000002e0 "gE#....." */ + 0x67,0x45,0x23,0x01,0xEF,0xCD,0xAB,0x89, /* 000002e8 "gE#....." */ + 0x67,0x45,0x23,0x01,0x04,0x9C,0x00,0x00, /* 000002f0 "gE#....." */ + 0x2C,0x00,0x00,0x00,0x34,0x00,0x00,0x00, /* 000002f8 ",...4..." */ + 0x84,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000300 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000308 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000310 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000318 "....gE#." */ + 0x03,0x00,0x00,0x00,0x88,0x88,0x77,0x77, /* 00000320 "......ww" */ + 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000328 "........" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000330 "....gE#." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000338 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000340 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000348 "........" */ + 0x11,0x11,0x11,0x01,0x00,0x00,0x00,0x00, /* 00000350 "........" */ + 0x01,0x00,0x00,0x00,0xEF,0xCD,0xAB,0x78, /* 00000358 ".......x" */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000360 "....gE#." */ + 0xEF,0xCD,0xAB,0x89,0x67,0x45,0x23,0x01, /* 00000368 "....gE#." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000370 "........" */ + 0x00,0x00,0x00,0x00,0xBB,0xBB,0xAA,0xAA, /* 00000378 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01, /* 00000380 "........" */ + 0xEF,0xCD,0xAB,0x78,0x00,0x00,0x00,0x00, /* 00000388 "...x...." */ }; const unsigned char TemplateAgdi[] = @@ -1252,10 +1276,10 @@ const unsigned char TemplateMsdm[] = const unsigned char TemplateMpam[] = { 0x4D,0x50,0x41,0x4D,0xFC,0x00,0x00,0x00, /* 00000000 "MPAM...." */ - 0x02,0x34,0x48,0x49,0x53,0x49,0x20,0x20, /* 00000008 ".4HISI " */ + 0x02,0x35,0x48,0x49,0x53,0x49,0x20,0x20, /* 00000008 ".5HISI " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x20,0x10,0x22,0x20,0x60,0x00,0x00,0x00, /* 00000020 " ." `..." */ + 0x28,0x06,0x23,0x20,0x60,0x00,0x00,0x00, /* 00000020 "(.# `..." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -1896,8 +1920,8 @@ const unsigned char TemplateSlit[] = const unsigned char TemplateSpcr[] = { - 0x53,0x50,0x43,0x52,0x50,0x00,0x00,0x00, /* 00000000 "SPCRP..." */ - 0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x53,0x50,0x43,0x52,0x5A,0x00,0x00,0x00, /* 00000000 "SPCRZ..." */ + 0x04,0x4E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ @@ -1905,7 +1929,9 @@ const unsigned char TemplateSpcr[] = 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, /* 00000048 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x00,0x58,0x00, /* 00000050 "......X." */ + 0x2E,0x00 /* 00000058 ".." */ }; const unsigned char TemplateSpmi[] = diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c index 82a51cb896fb..a3dcb507b25b 100644 --- a/source/compiler/dtutils.c +++ b/source/compiler/dtutils.c @@ -439,6 +439,8 @@ DtGetFieldType ( case ACPI_DMT_BUF12: case ACPI_DMT_BUF16: case ACPI_DMT_BUF18: + case ACPI_DMT_BUF32: + case ACPI_DMT_BUF112: case ACPI_DMT_BUF128: case ACPI_DMT_PCI_PATH: case ACPI_DMT_PMTT_VENDOR: @@ -746,6 +748,16 @@ DtGetFieldLength ( ByteLength = 18; break; + case ACPI_DMT_BUF32: + + ByteLength = 32; + break; + + case ACPI_DMT_BUF112: + + ByteLength = 112; + break; + case ACPI_DMT_BUF128: ByteLength = 128; diff --git a/source/compiler/prmacros.c b/source/compiler/prmacros.c index f3368de5f554..4610ccc2290c 100644 --- a/source/compiler/prmacros.c +++ b/source/compiler/prmacros.c @@ -455,7 +455,7 @@ PrAddMacro ( } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Macro param: %s \n", + "Macro param: %s\n", AslGbl_CurrentLineNumber, Token); Args[i].Name = UtLocalCalloc (strlen (Token) + 1); @@ -497,7 +497,7 @@ PrAddMacro ( DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Macro Arg #%u: %s UseCount %u Offset %u \n", + "Macro Arg #%u: %s UseCount %u Offset %u\n", AslGbl_CurrentLineNumber, i, Token, UseCount+1, Args[i].Offset[UseCount]); @@ -544,7 +544,7 @@ AddMacroToList: } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Macro body: %s \n", + "Macro body: %s\n", AslGbl_CurrentLineNumber, BodyInSource); /* Add macro to the #define list */ @@ -668,7 +668,7 @@ PrDoMacroInvocation ( PrReplaceResizeSubstring (Args, Diff1, Diff2, i, Token); DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "ExpandArg: %s \n", + "ExpandArg: %s\n", AslGbl_CurrentLineNumber, AslGbl_MacroTokenBuffer); } @@ -696,7 +696,7 @@ BadInvocation: THIS_TOKEN_OFFSET (MacroStart)); DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Bad macro invocation: %s \n", + "Bad macro invocation: %s\n", AslGbl_CurrentLineNumber, AslGbl_MacroTokenBuffer); return; } diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c index 6a41000036a5..32ad5be179a2 100644 --- a/source/components/debugger/dbconvert.c +++ b/source/components/debugger/dbconvert.c @@ -354,6 +354,8 @@ AcpiDbConvertToPackage ( Elements = ACPI_ALLOCATE_ZEROED ( DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT)); + if (!Elements) + return (AE_NO_MEMORY); This = String; for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 90e4a06cbb03..a4d18cad8ef2 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -969,8 +969,6 @@ AcpiDmDescendingOp ( AcpiDmPredefinedDescription (Op->Asl.Parent); } - AcpiDmPredefinedDescription (Op->Asl.Parent); - AcpiOsPrintf ("\n"); AcpiDmIndent (Info->Level); AcpiOsPrintf ("{\n"); diff --git a/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c index ec38892b54de..360f16cc1708 100644 --- a/source/components/executer/exconvrt.c +++ b/source/components/executer/exconvrt.c @@ -165,7 +165,8 @@ AcpiExConvertToAscii ( UINT64 Integer, UINT16 Base, UINT8 *String, - UINT8 MaxLength); + UINT8 MaxLength, + BOOLEAN LeadingZeros); /******************************************************************************* @@ -412,6 +413,7 @@ AcpiExConvertToBuffer ( * Base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX * String - Where the string is returned * DataWidth - Size of data item to be converted, in bytes + * LeadingZeros - Allow leading zeros * * RETURN: Actual string length * @@ -424,7 +426,8 @@ AcpiExConvertToAscii ( UINT64 Integer, UINT16 Base, UINT8 *String, - UINT8 DataWidth) + UINT8 DataWidth, + BOOLEAN LeadingZeros) { UINT64 Digit; UINT32 i; @@ -433,7 +436,8 @@ AcpiExConvertToAscii ( UINT32 HexLength; UINT32 DecimalLength; UINT32 Remainder; - BOOLEAN SupressZeros; + BOOLEAN SupressZeros = !LeadingZeros; + UINT8 HexChar; ACPI_FUNCTION_ENTRY (); @@ -464,7 +468,6 @@ AcpiExConvertToAscii ( break; } - SupressZeros = TRUE; /* No leading zeros */ Remainder = 0; for (i = DecimalLength; i > 0; i--) @@ -501,8 +504,18 @@ AcpiExConvertToAscii ( { /* Get one hex digit, most significant digits first */ - String[k] = (UINT8) + HexChar = (UINT8) AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j)); + + /* Supress leading zeros until the first non-zero character */ + + if (HexChar == ACPI_ASCII_ZERO && SupressZeros) + { + continue; + } + + SupressZeros = FALSE; + String[k] = HexChar; k++; } break; @@ -556,6 +569,7 @@ AcpiExConvertToString ( UINT32 StringLength = 0; UINT16 Base = 16; UINT8 Separator = ','; + BOOLEAN LeadingZeros; ACPI_FUNCTION_TRACE_PTR (ExConvertToString, ObjDesc); @@ -581,14 +595,25 @@ AcpiExConvertToString ( * Make room for the maximum decimal number size */ StringLength = ACPI_MAX_DECIMAL_DIGITS; + LeadingZeros = FALSE; Base = 10; break; + case ACPI_EXPLICIT_CONVERT_HEX: + /* + * From ToHexString. + * + * Supress leading zeros and append "0x" + */ + StringLength = ACPI_MUL_2 (AcpiGbl_IntegerByteWidth) + 2; + LeadingZeros = FALSE; + break; default: /* Two hex string characters for each integer byte */ StringLength = ACPI_MUL_2 (AcpiGbl_IntegerByteWidth); + LeadingZeros = TRUE; break; } @@ -603,15 +628,29 @@ AcpiExConvertToString ( } NewBuf = ReturnDesc->Buffer.Pointer; + if (Type == ACPI_EXPLICIT_CONVERT_HEX) + { + /* Append "0x" prefix for explicit hex conversion */ + + *NewBuf++ = '0'; + *NewBuf++ = 'x'; + } /* Convert integer to string */ StringLength = AcpiExConvertToAscii ( - ObjDesc->Integer.Value, Base, NewBuf, AcpiGbl_IntegerByteWidth); + ObjDesc->Integer.Value, Base, NewBuf, AcpiGbl_IntegerByteWidth, LeadingZeros); /* Null terminate at the correct place */ ReturnDesc->String.Length = StringLength; + if (Type == ACPI_EXPLICIT_CONVERT_HEX) + { + /* Take "0x" prefix into account */ + + ReturnDesc->String.Length += 2; + } + NewBuf [StringLength] = 0; break; @@ -628,6 +667,7 @@ AcpiExConvertToString ( * From ACPI: "If the input is a buffer, it is converted to a * a string of decimal values separated by commas." */ + LeadingZeros = FALSE; Base = 10; /* @@ -661,6 +701,7 @@ AcpiExConvertToString ( * * Each hex number is prefixed with 0x (11/2018) */ + LeadingZeros = TRUE; Separator = ' '; StringLength = (ObjDesc->Buffer.Length * 5); break; @@ -674,6 +715,7 @@ AcpiExConvertToString ( * * Each hex number is prefixed with 0x (11/2018) */ + LeadingZeros = TRUE; Separator = ','; StringLength = (ObjDesc->Buffer.Length * 5); break; @@ -715,7 +757,7 @@ AcpiExConvertToString ( } NewBuf += AcpiExConvertToAscii ( - (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1); + (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1, LeadingZeros); /* Each digit is separated by either a comma or space */ diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c index 545ca0c33c51..f2164fe8cf5f 100644 --- a/source/components/executer/exprep.c +++ b/source/components/executer/exprep.c @@ -611,6 +611,10 @@ AcpiExPrepFieldValue ( if (Info->ConnectionNode) { SecondDesc = Info->ConnectionNode->Object; + if (SecondDesc == NULL) + { + break; + } if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetBufferArguments (SecondDesc); diff --git a/source/components/executer/exregion.c b/source/components/executer/exregion.c index c625b66850e7..5da929412df2 100644 --- a/source/components/executer/exregion.c +++ b/source/components/executer/exregion.c @@ -191,7 +191,6 @@ AcpiExSystemMemorySpaceHandler ( ACPI_MEM_MAPPING *Mm = MemInfo->CurMm; UINT32 Length; ACPI_SIZE MapLength; - ACPI_SIZE PageBoundaryMapLength; #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED UINT32 Remainder; #endif @@ -298,27 +297,9 @@ AcpiExSystemMemorySpaceHandler ( MapLength = (ACPI_SIZE) ((MemInfo->Address + MemInfo->Length) - Address); - /* - * If mapping the entire remaining portion of the region will cross - * a page boundary, just map up to the page boundary, do not cross. - * On some systems, crossing a page boundary while mapping regions - * can cause warnings if the pages have different attributes - * due to resource management. - * - * This has the added benefit of constraining a single mapping to - * one page, which is similar to the original code that used a 4k - * maximum window. - */ - PageBoundaryMapLength = (ACPI_SIZE) - (ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address); - if (PageBoundaryMapLength == 0) - { - PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE; - } - - if (MapLength > PageBoundaryMapLength) + if (MapLength > ACPI_DEFAULT_PAGE_SIZE) { - MapLength = PageBoundaryMapLength; + MapLength = ACPI_DEFAULT_PAGE_SIZE; } /* Create a new mapping starting at the address given */ diff --git a/source/components/executer/exsystem.c b/source/components/executer/exsystem.c index 16fb5ea16316..bc134172b0fb 100644 --- a/source/components/executer/exsystem.c +++ b/source/components/executer/exsystem.c @@ -296,7 +296,7 @@ AcpiExSystemDoStall ( * (ACPI specifies 100 usec as max, but this gives some slack in * order to support existing BIOSs) */ - ACPI_ERROR ((AE_INFO, + ACPI_ERROR_ONCE ((AE_INFO, "Time parameter is too large (%u)", HowLongUs)); Status = AE_AML_OPERAND_VALUE; } @@ -304,7 +304,7 @@ AcpiExSystemDoStall ( { if (HowLongUs > 100) { - ACPI_WARNING ((AE_INFO, + ACPI_WARNING_ONCE ((AE_INFO, "Time parameter %u us > 100 us violating ACPI spec, please fix the firmware.", HowLongUs)); } AcpiOsStall (HowLongUs); diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 66118a4e4c68..6605a58e34e4 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -159,13 +159,11 @@ /* Local prototypes */ -#if (!ACPI_REDUCED_HARDWARE) static ACPI_STATUS AcpiHwSetFirmwareWakingVector ( ACPI_TABLE_FACS *Facs, ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_PHYSICAL_ADDRESS PhysicalAddress64); -#endif static ACPI_STATUS AcpiHwSleepDispatch ( @@ -199,13 +197,6 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] = }; -/* - * These functions are removed for the ACPI_REDUCED_HARDWARE case: - * AcpiSetFirmwareWakingVector - * AcpiEnterSleepStateS4bios - */ - -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiHwSetFirmwareWakingVector @@ -298,6 +289,12 @@ AcpiSetFirmwareWakingVector ( ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) +/* + * These functions are removed for the ACPI_REDUCED_HARDWARE case: + * AcpiEnterSleepStateS4bios + */ + +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiEnterSleepStateS4bios diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index 728ac559df04..24cf6f849ea7 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -170,6 +170,10 @@ static ACPI_PARSE_OBJECT * AcpiPsGetNextField ( ACPI_PARSE_STATE *ParserState); +static void +AcpiPsFreeFieldList ( + ACPI_PARSE_OBJECT *Start); + /******************************************************************************* * @@ -872,6 +876,43 @@ AcpiPsGetNextField ( return_PTR (Field); } +/******************************************************************************* + * + * FUNCTION: AcpiPsFreeFieldList + * + * PARAMETERS: Start - First Op in field list + * + * RETURN: None. + * + * DESCRIPTION: Free all Op objects inside a field list. + * + ******************************************************************************/ + +static void +AcpiPsFreeFieldList ( + ACPI_PARSE_OBJECT *Start) +{ + ACPI_PARSE_OBJECT *Current = Start; + ACPI_PARSE_OBJECT *Next; + ACPI_PARSE_OBJECT *Arg; + + while (Current) + { + Next = Current->Common.Next; + + /* AML_INT_CONNECTION_OP can have a single argument */ + + Arg = AcpiPsGetArg (Current, 0); + if (Arg) + { + AcpiPsFreeOp (Arg); + } + + AcpiPsFreeOp(Current); + Current = Next; + } +} + /******************************************************************************* * @@ -948,6 +989,11 @@ AcpiPsGetNextArg ( Field = AcpiPsGetNextField (ParserState); if (!Field) { + if (Arg) + { + AcpiPsFreeFieldList(Arg); + } + return_ACPI_STATUS (AE_NO_MEMORY); } @@ -1016,6 +1062,11 @@ AcpiPsGetNextArg ( Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, ACPI_NOT_METHOD_CALL); + if (ACPI_FAILURE(Status)) + { + AcpiPsFreeOp (Arg); + return_ACPI_STATUS (Status); + } } else { @@ -1048,6 +1099,11 @@ AcpiPsGetNextArg ( Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, ACPI_POSSIBLE_METHOD_CALL); + if (ACPI_FAILURE(Status)) + { + AcpiPsFreeOp (Arg); + return_ACPI_STATUS (Status); + } if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { diff --git a/source/components/resources/rsaddr.c b/source/components/resources/rsaddr.c index ec97ab8ee77d..2289f2ddb6fd 100644 --- a/source/components/resources/rsaddr.c +++ b/source/components/resources/rsaddr.c @@ -441,7 +441,8 @@ AcpiRsGetAddressCommon ( /* Validate the Resource Type */ if ((Address.ResourceType > 2) && - (Address.ResourceType < 0xC0)) + (Address.ResourceType < 0xC0) && + (Address.ResourceType != 0x0A)) { return (FALSE); } diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index b12d72dfab85..2a4d178cb1fd 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -230,6 +230,7 @@ AcpiRsDumpDescriptor ( ACPI_RSDUMP_INFO *Table); +#ifdef ACPI_DEBUGGER /******************************************************************************* * * FUNCTION: AcpiRsDumpResourceList @@ -359,7 +360,7 @@ AcpiRsDumpIrqList ( PrtElement, PrtElement->Length); } } - +#endif /******************************************************************************* * diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index df19488d45c2..feb698f85dbd 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -489,24 +489,19 @@ AcpiTbParseFadt ( ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &AcpiGbl_DsdtIndex); - /* If Hardware Reduced flag is set, there is no FACS */ - - if (!AcpiGbl_ReducedHardware) + if (AcpiGbl_FADT.Facs) { - if (AcpiGbl_FADT.Facs) - { - AcpiTbInstallStandardTable ( - (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, - ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, - &AcpiGbl_FacsIndex); - } - if (AcpiGbl_FADT.XFacs) - { - AcpiTbInstallStandardTable ( - (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, - ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, - &AcpiGbl_XFacsIndex); - } + AcpiTbInstallStandardTable ( + (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, + &AcpiGbl_FacsIndex); + } + if (AcpiGbl_FADT.XFacs) + { + AcpiTbInstallStandardTable ( + (ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, + &AcpiGbl_XFacsIndex); } } diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index 3e288971caf8..2c5f68be6b11 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -165,7 +165,6 @@ AcpiTbGetRootTableEntry ( UINT32 TableEntrySize); -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiTbInitializeFacs @@ -185,15 +184,7 @@ AcpiTbInitializeFacs ( { ACPI_TABLE_FACS *Facs; - - /* If Hardware Reduced flag is set, there is no FACS */ - - if (AcpiGbl_ReducedHardware) - { - AcpiGbl_FACS = NULL; - return (AE_OK); - } - else if (AcpiGbl_FADT.XFacs && + if (AcpiGbl_FADT.XFacs && (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses)) { (void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex, @@ -211,7 +202,6 @@ AcpiTbInitializeFacs ( return (AE_OK); } -#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c index e194dd404508..922358d71d99 100644 --- a/source/components/utilities/utdelete.c +++ b/source/components/utilities/utdelete.c @@ -293,7 +293,7 @@ AcpiUtDeleteInternalObj ( /* Global Lock has extra semaphore */ (void) AcpiOsDeleteSemaphore (AcpiGbl_GlobalLockSemaphore); - AcpiGbl_GlobalLockSemaphore = NULL; + AcpiGbl_GlobalLockSemaphore = ACPI_SEMAPHORE_NULL; AcpiOsDeleteMutex (Object->Mutex.OsMutex); AcpiGbl_GlobalLockMutex = NULL; @@ -312,7 +312,7 @@ AcpiUtDeleteInternalObj ( Object, Object->Event.OsSemaphore)); (void) AcpiOsDeleteSemaphore (Object->Event.OsSemaphore); - Object->Event.OsSemaphore = NULL; + Object->Event.OsSemaphore = ACPI_SEMAPHORE_NULL; break; case ACPI_TYPE_METHOD: diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 4d8d0e13ee0a..e100e0f38ca4 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -316,7 +316,7 @@ AcpiUtInitGlobals ( /* Global Lock support */ - AcpiGbl_GlobalLockSemaphore = NULL; + AcpiGbl_GlobalLockSemaphore = ACPI_SEMAPHORE_NULL; AcpiGbl_GlobalLockMutex = NULL; AcpiGbl_GlobalLockAcquired = FALSE; AcpiGbl_GlobalLockHandle = 0; diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c index 789fe0fecbef..ebf04d27c382 100644 --- a/source/components/utilities/utosi.c +++ b/source/components/utilities/utosi.c @@ -222,6 +222,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] = {"Windows 2019", NULL, 0, ACPI_OSI_WIN_10_19H1}, /* Windows 10 version 1903 - Added 08/2019 */ {"Windows 2020", NULL, 0, ACPI_OSI_WIN_10_20H1}, /* Windows 10 version 2004 - Added 08/2021 */ {"Windows 2021", NULL, 0, ACPI_OSI_WIN_11}, /* Windows 11 - Added 01/2022 */ + {"Windows 2022", NULL, 0, ACPI_OSI_WIN_11_22H2}, /* Windows 11 version 22H2 - Added 04/2024 */ /* Feature Group Strings */ diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c index adf7429f08c1..c8bb0ceaf392 100644 --- a/source/components/utilities/utxfinit.c +++ b/source/components/utilities/utxfinit.c @@ -276,6 +276,20 @@ AcpiEnableSubsystem ( */ AcpiGbl_EarlyInitialization = FALSE; + /* + * Obtain a permanent mapping for the FACS. This is required for the + * Global Lock and the Firmware Waking Vector + */ + if (!(Flags & ACPI_NO_FACS_INIT)) + { + Status = AcpiTbInitializeFacs (); + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); + return_ACPI_STATUS (Status); + } + } + #if (!ACPI_REDUCED_HARDWARE) /* Enable ACPI mode */ @@ -295,20 +309,6 @@ AcpiEnableSubsystem ( } /* - * Obtain a permanent mapping for the FACS. This is required for the - * Global Lock and the Firmware Waking Vector - */ - if (!(Flags & ACPI_NO_FACS_INIT)) - { - Status = AcpiTbInitializeFacs (); - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); - return_ACPI_STATUS (Status); - } - } - - /* * Initialize ACPI Event handling (Fixed and General Purpose) * * Note1: We must have the hardware and events initialized before we can diff --git a/source/include/acconfig.h b/source/include/acconfig.h index f795b19efc76..7af986fce75a 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -210,7 +210,6 @@ * General Purpose Events (GPEs) * Global Lock * ACPI PM timer - * FACS table (Waking vectors and Global Lock) */ #ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 91ec294325d0..01acb57fcf40 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -226,6 +226,8 @@ typedef enum ACPI_DMT_BUF12, ACPI_DMT_BUF16, ACPI_DMT_BUF18, + ACPI_DMT_BUF32, + ACPI_DMT_BUF112, ACPI_DMT_BUF128, ACPI_DMT_SIG, ACPI_DMT_STRING, @@ -382,9 +384,17 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestGenRsrc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestMemError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestSmmuError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorError[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestVendorV2Error[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestGicError[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestPCIeError[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestProxyError[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXfaceHeader[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface4k[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface16k[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXface64k[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXrupt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoAestXruptV2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAgdi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoApmtNode[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[]; @@ -418,6 +428,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt2_te[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 7a87d125107d..fa14d6e50602 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -172,11 +172,7 @@ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_IN ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX); - -#if (!ACPI_REDUCED_HARDWARE) -ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); - -#endif /* !ACPI_REDUCED_HARDWARE */ +ACPI_INIT_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS, NULL); /* These addresses are calculated from the FADT Event Block addresses */ diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 477034fbf4f7..c8beb6f1b8b5 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -1412,6 +1412,8 @@ typedef struct acpi_port_info #define ACPI_ADDRESS_TYPE_IO_RANGE 1 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 +#define ACPI_ADDRESS_TYPE_PCC_NUMBER 0xA + /* Resource descriptor types and masks */ #define ACPI_RESOURCE_NAME_LARGE 0x80 diff --git a/source/include/acoutput.h b/source/include/acoutput.h index 6e1b317d8ce7..c270d2c83277 100644 --- a/source/include/acoutput.h +++ b/source/include/acoutput.h @@ -336,6 +336,7 @@ */ #ifndef ACPI_NO_ERROR_MESSAGES #define AE_INFO _AcpiModuleName, __LINE__ +#define ACPI_ONCE(_fn, _plist) { static char _done; if (!_done) { _done = 1; _fn _plist; } } /* * Error reporting. Callers module and line number are inserted by AE_INFO, @@ -344,8 +345,10 @@ */ #define ACPI_INFO(plist) AcpiInfo plist #define ACPI_WARNING(plist) AcpiWarning plist +#define ACPI_WARNING_ONCE(plist) ACPI_ONCE(AcpiWarning, plist) #define ACPI_EXCEPTION(plist) AcpiException plist #define ACPI_ERROR(plist) AcpiError plist +#define ACPI_ERROR_ONCE(plist) ACPI_ONCE(AcpiError, plist) #define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist #define ACPI_BIOS_EXCEPTION(plist) AcpiBiosException plist #define ACPI_BIOS_ERROR(plist) AcpiBiosError plist @@ -357,8 +360,10 @@ #define ACPI_INFO(plist) #define ACPI_WARNING(plist) +#define ACPI_WARNING_ONCE(plist) #define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) +#define ACPI_ERROR_ONCE(plist) #define ACPI_BIOS_WARNING(plist) #define ACPI_BIOS_EXCEPTION(plist) #define ACPI_BIOS_ERROR(plist) diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 4b96cc74965f..53d56a95b65e 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20230628 +#define ACPI_CA_VERSION 0x20240827 #include "acconfig.h" #include "actypes.h" @@ -1295,7 +1295,7 @@ ACPI_STATUS AcpiLeaveSleepState ( UINT8 SleepState)) -ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS AcpiSetFirmwareWakingVector ( ACPI_PHYSICAL_ADDRESS PhysicalAddress, diff --git a/source/include/acpredef.h b/source/include/acpredef.h index c8ac10b2c043..144aedf0bf9a 100644 --- a/source/include/acpredef.h +++ b/source/include/acpredef.h @@ -587,7 +587,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = 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), - {{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE), + {{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_ANY) | ARG_COUNT_IS_MINIMUM, METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */ {{"_DSS", METHOD_1ARGS (ACPI_TYPE_INTEGER), diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h index 4f2bfd1f446f..19692837f11d 100644 --- a/source/include/actbinfo.h +++ b/source/include/actbinfo.h @@ -225,9 +225,17 @@ #define ACPI_AEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_MEMORY,f) #define ACPI_AEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_SMMU,f) #define ACPI_AEST3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_VENDOR,f) +#define ACPI_AEST3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_VENDOR_V2,f) #define ACPI_AEST4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_GIC,f) +#define ACPI_AEST5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PCIE,f) +#define ACPI_AEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_PROXY,f) #define ACPI_AEST0D_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE,f) +#define ACPI_AEST0DH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE_HEADER,f) +#define ACPI_AEST0D4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE_4K,f) +#define ACPI_AEST0D16_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE_16K,f) +#define ACPI_AEST0D64_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERFACE_64K,f) #define ACPI_AEST0E_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERRUPT,f) +#define ACPI_AEST0EA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_AEST_NODE_INTERRUPT_V2,f) #define ACPI_APMTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_APMT_NODE,f) #define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f) #define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f) @@ -253,6 +261,8 @@ #define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) #define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f) #define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, f) +#define ACPI_CEDT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CXIMS, f) +#define ACPI_CEDT2_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CXIMS_TARGET_ELEMENT, f) #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) @@ -446,6 +456,7 @@ #define ACPI_AEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_PROCESSOR,f,o) #define ACPI_AEST0D_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_NODE_INTERFACE,f,o) #define ACPI_AEST0E_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_NODE_INTERRUPT,f,o) +#define ACPI_AEST0EA_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_AEST_NODE_INTERRUPT_V2,f,o) #define ACPI_AGDI_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_AGDI,f,o) #define ACPI_APMTN_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_APMT_NODE,f,o) #define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o) diff --git a/source/include/actbl1.h b/source/include/actbl1.h index 5816a812dff0..71cbc36d3fe7 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -822,13 +822,20 @@ typedef struct acpi_cedt_cfmws_target_element /* 2: CXL XOR Interleave Math Structure */ -struct acpi_cedt_cxims { +typedef struct acpi_cedt_cxims { ACPI_CEDT_HEADER Header; UINT16 Reserved1; UINT8 Hbig; UINT8 NrXormaps; UINT64 XormapList[]; -}; +} ACPI_CEDT_CXIMS; + +typedef struct acpi_cedt_cxims_target_element +{ + UINT64 Xormap; + +} ACPI_CEDT_CXIMS_TARGET_ELEMENT; + /* 3: CXL RCEC Downstream Port Association Structure */ @@ -1038,6 +1045,7 @@ typedef struct acpi_dbg2_device #define ACPI_DBG2_16550_WITH_GAS 0x0012 #define ACPI_DBG2_SDM845_7_372MHZ 0x0013 #define ACPI_DBG2_INTEL_LPSS 0x0014 +#define ACPI_DBG2_RISCV_SBI_CON 0x0015 #define ACPI_DBG2_1394_STANDARD 0x0000 @@ -2262,7 +2270,7 @@ typedef struct acpi_hmat_cache UINT32 Reserved1; UINT64 CacheSize; UINT32 CacheAttributes; - UINT16 Reserved2; + UINT16 AddressMode; UINT16 NumberOfSMBIOSHandles; } ACPI_HMAT_CACHE; @@ -2275,6 +2283,9 @@ typedef struct acpi_hmat_cache #define ACPI_HMAT_WRITE_POLICY (0x0000F000) #define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000) +#define ACPI_HMAT_CACHE_MODE_UNKNOWN (0) +#define ACPI_HMAT_CACHE_MODE_EXTENDED_LINEAR (1) + /* Values for cache associativity flag */ #define ACPI_HMAT_CA_NONE (0) diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 99076bbc460c..cc09702b8a3f 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -259,7 +259,9 @@ typedef struct acpi_aest_hdr #define ACPI_AEST_SMMU_ERROR_NODE 2 #define ACPI_AEST_VENDOR_ERROR_NODE 3 #define ACPI_AEST_GIC_ERROR_NODE 4 -#define ACPI_AEST_NODE_TYPE_RESERVED 5 /* 5 and above are reserved */ +#define ACPI_AEST_PCIE_ERROR_NODE 5 +#define ACPI_AEST_PROXY_ERROR_NODE 6 +#define ACPI_AEST_NODE_TYPE_RESERVED 7 /* 7 and above are reserved */ /* @@ -346,6 +348,16 @@ typedef struct acpi_aest_vendor } ACPI_AEST_VENDOR; +/* 3: Vendor Defined V2 */ + +typedef struct acpi_aest_vendor_v2 +{ + UINT64 AcpiHid; + UINT32 AcpiUid; + UINT8 VendorSpecificData[16]; + +} ACPI_AEST_VENDOR_V2; + /* 4: Gic Error */ typedef struct acpi_aest_gic @@ -363,6 +375,22 @@ typedef struct acpi_aest_gic #define ACPI_AEST_GIC_ITS 3 #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */ +/* 5: PCIe Error */ + +typedef struct acpi_aest_pcie +{ + UINT32 IortNodeReference; + +} ACPI_AEST_PCIE; + + +/* 6: Proxy Error */ + +typedef struct acpi_aest_proxy +{ + UINT64 NodeAddress; + +} ACPI_AEST_PROXY; /* Node Interface Structure */ @@ -380,11 +408,67 @@ typedef struct acpi_aest_node_interface } ACPI_AEST_NODE_INTERFACE; +/* Node Interface Structure V2*/ + +typedef struct acpi_aest_node_interface_header +{ + UINT8 Type; + UINT8 GroupFormat; + UINT8 Reserved[2]; + UINT32 Flags; + UINT64 Address; + UINT32 ErrorRecordIndex; + UINT32 ErrorRecordCount; + +} ACPI_AEST_NODE_INTERFACE_HEADER; + +#define ACPI_AEST_NODE_GROUP_FORMAT_4K 0 +#define ACPI_AEST_NODE_GROUP_FORMAT_16K 1 +#define ACPI_AEST_NODE_GROUP_FORMAT_64K 2 + +typedef struct acpi_aest_node_interface_common +{ + UINT32 ErrorNodeDevice; + UINT32 ProcessorAffinity; + UINT64 ErrorGroupRegisterBase; + UINT64 FaultInjectRegisterBase; + UINT64 InterruptConfigRegisterBase; + +} ACPI_AEST_NODE_INTERFACE_COMMON; + +typedef struct acpi_aest_node_interface_4k +{ + UINT64 ErrorRecordImplemented; + UINT64 ErrorStatusReporting; + UINT64 AddressingMode; + ACPI_AEST_NODE_INTERFACE_COMMON Common; + +} ACPI_AEST_NODE_INTERFACE_4K; + +typedef struct acpi_aest_node_interface_16k +{ + UINT64 ErrorRecordImplemented[4]; + UINT64 ErrorStatusReporting[4]; + UINT64 AddressingMode[4]; + ACPI_AEST_NODE_INTERFACE_COMMON Common; + +} ACPI_AEST_NODE_INTERFACE_16K; + +typedef struct acpi_aest_node_interface_64k +{ + INT64 ErrorRecordImplemented[14]; + UINT64 ErrorStatusReporting[14]; + UINT64 AddressingMode[14]; + ACPI_AEST_NODE_INTERFACE_COMMON Common; + +} ACPI_AEST_NODE_INTERFACE_64K; + /* Values for Type field above */ -#define ACPI_AEST_NODE_SYSTEM_REGISTER 0 -#define ACPI_AEST_NODE_MEMORY_MAPPED 1 -#define ACPI_AEST_XFACE_RESERVED 2 /* 2 and above are reserved */ +#define ACPI_AEST_NODE_SYSTEM_REGISTER 0 +#define ACPI_AEST_NODE_MEMORY_MAPPED 1 +#define ACPI_AEST_NODE_SINGLE_RECORD_MEMORY_MAPPED 2 +#define ACPI_AEST_XFACE_RESERVED 3 /* 2 and above are reserved */ /* Node Interrupt Structure */ @@ -399,6 +483,18 @@ typedef struct acpi_aest_node_interrupt } ACPI_AEST_NODE_INTERRUPT; +/* Node Interrupt Structure V2 */ + +typedef struct acpi_aest_node_interrupt_v2 +{ + UINT8 Type; + UINT8 Reserved[2]; + UINT8 Flags; + UINT32 Gsiv; + UINT8 Reserved1[4]; + +} ACPI_AEST_NODE_INTERRUPT_V2; + /* Values for Type field above */ #define ACPI_AEST_NODE_FAULT_HANDLING 0 @@ -548,7 +644,7 @@ typedef struct acpi_table_ccel * IORT - IO Remapping Table * * Conforms to "IO Remapping Table System Software on ARM Platforms", - * Document number: ARM DEN 0049E.e, Sep 2022 + * Document number: ARM DEN 0049E.f, Apr 2024 * ******************************************************************************/ @@ -631,6 +727,7 @@ typedef struct acpi_iort_memory_access #define ACPI_IORT_MF_COHERENCY (1) #define ACPI_IORT_MF_ATTRIBUTES (1<<1) +#define ACPI_IORT_MF_CANWBS (1<<2) /* @@ -1835,7 +1932,7 @@ typedef struct acpi_mpam_msc_node UINT32 MaxNrdyUsec; UINT64 HardwareIdLinkedDevice; UINT32 InstanceIdLinkedDevice; - UINT32 NumResouceNodes; + UINT32 NumResourceNodes; } ACPI_MPAM_MSC_NODE; typedef struct acpi_table_mpam diff --git a/source/include/actbl3.h b/source/include/actbl3.h index 477d70af2c65..316197927fb5 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -243,10 +243,10 @@ typedef struct acpi_table_slit /******************************************************************************* * * SPCR - Serial Port Console Redirection table - * Version 2 + * Version 4 * * Conforms to "Serial Port Console Redirection Table", - * Version 1.03, August 10, 2015 + * Version 1.10, Jan 5, 2023 * ******************************************************************************/ @@ -264,7 +264,7 @@ typedef struct acpi_table_spcr UINT8 StopBits; UINT8 FlowControl; UINT8 TerminalType; - UINT8 Reserved1; + UINT8 Language; UINT16 PciDeviceId; UINT16 PciVendorId; UINT8 PciBus; @@ -272,7 +272,11 @@ typedef struct acpi_table_spcr UINT8 PciFunction; UINT32 PciFlags; UINT8 PciSegment; - UINT32 Reserved2; + UINT32 UartClkFreq; + UINT32 PreciseBaudrate; + UINT16 NameSpaceStringLength; + UINT16 NameSpaceStringOffset; + char NameSpaceString[]; } ACPI_TABLE_SPCR; diff --git a/source/include/actypes.h b/source/include/actypes.h index 695dbb14d7eb..5e1012d86e5a 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -1561,6 +1561,7 @@ typedef enum #define ACPI_OSI_WIN_10_19H1 0x14 #define ACPI_OSI_WIN_10_20H1 0x15 #define ACPI_OSI_WIN_11 0x16 +#define ACPI_OSI_WIN_11_22H2 0x17 /* Definitions of getopt */ diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index e7c8678d2280..cc198c01a134 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -403,6 +403,12 @@ #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0 #endif +/* NULL/invalid value to use for destroyed or not-yet-created semaphores. */ + +#ifndef ACPI_SEMAPHORE_NULL +#define ACPI_SEMAPHORE_NULL NULL +#endif + /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ #ifndef ACPI_FLUSH_CPU_CACHE diff --git a/source/include/platform/achaiku.h b/source/include/platform/achaiku.h index 64b59819bfde..044e0b62a2b2 100644 --- a/source/include/platform/achaiku.h +++ b/source/include/platform/achaiku.h @@ -191,11 +191,14 @@ struct mutex; /* ACPICA cache implementation is adequate. */ #define ACPI_USE_LOCAL_CACHE +/* On other platform the default definition (do nothing) is fine. */ +#if defined(__i386__) || defined(__x86_64__) #define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd"); +#endif /* Based on FreeBSD's due to lack of documentation */ -int AcpiOsAcquireGlobalLock(uint32 *lock); -int AcpiOsReleaseGlobalLock(uint32 *lock); +extern int AcpiOsAcquireGlobalLock(volatile uint32_t *lock); +extern int AcpiOsReleaseGlobalLock(volatile uint32_t *lock); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) do { \ (Acq) = AcpiOsAcquireGlobalLock(&((GLptr)->GlobalLock)); \ @@ -205,6 +208,8 @@ int AcpiOsReleaseGlobalLock(uint32 *lock); (Acq) = AcpiOsReleaseGlobalLock(&((GLptr)->GlobalLock)); \ } while (0) +#define ACPI_SEMAPHORE_NULL -1 + #else /* _KERNEL_MODE */ /* Host-dependent types and defines for user-space ACPICA */ diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 8dc47902b767..61beefb4ff70 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -727,12 +727,14 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_AEST_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_AEST_NODE_INTERFACE", SRC_TYPE_STRUCT}, {"ACPI_AEST_NODE_INTERRUPT", SRC_TYPE_STRUCT}, + {"ACPI_AEST_NODE_INTERRUPT_V2", SRC_TYPE_STRUCT}, {"ACPI_AEST_PROCESSOR", SRC_TYPE_STRUCT}, {"ACPI_AEST_PROCESSOR_CACHE", SRC_TYPE_STRUCT}, {"ACPI_AEST_PROCESSOR_GENERIC", SRC_TYPE_STRUCT}, {"ACPI_AEST_PROCESSOR_TLB", SRC_TYPE_STRUCT}, {"ACPI_AEST_SMMU", SRC_TYPE_STRUCT}, {"ACPI_AEST_VENDOR", SRC_TYPE_STRUCT}, + {"ACPI_AEST_VENDOR_V2", SRC_TYPE_STRUCT}, {"ACPI_ASF_ADDRESS", SRC_TYPE_STRUCT}, {"ACPI_ASF_ALERT", SRC_TYPE_STRUCT}, {"ACPI_ASF_ALERT_DATA", SRC_TYPE_STRUCT}, diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c index 4d80a8095643..6cfd81118e5a 100644 --- a/source/tools/acpixtract/acpixtract.c +++ b/source/tools/acpixtract/acpixtract.c @@ -186,6 +186,7 @@ AxExtractTables ( int Status = 0; unsigned int State = AX_STATE_FIND_HEADER; + memset (UpperSignature, 0, sizeof(UpperSignature)); /* Open input in text mode, output is in binary mode */ @@ -212,7 +213,7 @@ AxExtractTables ( AxNormalizeSignature (UpperSignature); Instances = AxCountTableInstances (InputPathname, UpperSignature); - if (Instances < MinimumInstances) + if (Instances < MinimumInstances || MinimumInstances == AX_OPTIONAL_TABLES) { printf ("Table [%s] was not found in %s\n", UpperSignature, InputPathname); |