diff -Nru acpica-unix-20181003/changes.txt acpica-unix-20181213/changes.txt --- acpica-unix-20181003/changes.txt 2018-10-03 14:13:48.000000000 +0000 +++ acpica-unix-20181213/changes.txt 2018-12-13 16:16:44.000000000 +0000 @@ -1,4 +1,115 @@ ---------------------------------------- +13 December 2018. Summary of changes for version 20181213: + + +1) ACPICA Kernel-resident Subsystem: + +Fixed some buffer length issues with the GenericSerialBus, related to two +of the bidirectional protocols: AttribRawProcessBytes and AttribRawBytes, +which are rarely seen in the field. For these, the LEN field of the ASL +buffer is now ignored. Hans de Goede + +Implemented a new object evaluation trace mechanism for control methods +and data objects. This includes nested control methods. It is +particularly useful for examining the ACPI execution during system +initialization since the output is relatively terse. The flag below +enables the output of the trace via the ACPI_DEBUG_PRINT_RAW interface: + #define ACPI_LV_EVALUATION 0x00080000 + +Examples: + Enter evaluation : _SB.PCI0._INI (Method) + Exit evaluation : _SB.PCI0._INI + Enter evaluation : _OSI (Method) + Exit evaluation : _OSI + Enter evaluation : _SB.PCI0.TEST (Method) + Nested method call : _SB.PCI0.NST1 + Exit nested method : _SB.PCI0.NST1 + Exit evaluation : _SB.PCI0.TEST + +Added two recently-defined _OSI strings. See +https://docs.microsoft.com/en-us/windows-hardware/drivers/acpi/winacpi- +osi. + "Windows 2018" + "Windows 2018.2" + +Update for buffer-to-string conversions via the ToHexString ASL operator. +A "0x" is now prepended to each of the hex values in the output string. +This provides compatibility with other ACPI implementations. The ACPI +specification is somewhat vague on this issue. + Example output string after conversion: +"0x01,0x02,0x03,0x04,0x05,0x06" + +Return a run-time error for TermArg expressions within individual package +elements. Although this is technically supported by the ASL grammar, +other ACPI implementations do not support this either. Also, this fixes a +fault if this type of construct is ever encountered (it never has been). + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented a new compile option (-ww) that will promote individual +warnings and remarks to errors. This is intended to enhance the firmware +build process. + +AcpiExec: Implemented a new command-line option (-eo) to support the new +object evaluation trace mechanism described above. + +Disassembler: Added support to disassemble OEMx tables as AML/ASL tables +instead of a "unknown table" message. + +AcpiHelp: Improved support for the "special" predefined names such as +_Lxx, _Exx, _EJx, _T_x, etc. For these, any legal hex value can now be +used for "xx" and "x". + +---------------------------------------- +31 October 2018. Summary of changes for version 20181031: + + +An Operation Region regression was fixed by properly adding address +ranges to a global list during initialization. This allows OS to +accurately check for overlapping regions between native devices (such as +PCI) and Operation regions as well as checking for region conflicts +between two Operation Regions. + +Added support for the 2-byte extended opcodes in the code/feature that +attempts to continue parsing during the table load phase. Skip parsing +Device declarations (and other extended opcodes) when an error occurs +during parsing. Previously, only single-byte opcodes were supported. + +Cleanup: Simplified the module-level code support by eliminating a +useless global variable (AcpiGbl_GroupModuleLeveCode). + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Preprocessor: Fixed a regression where an incorrect use of ACPI_FREE +could cause a fault in the preprocessor. This was an inadvertent side- +effect from moving more allocations/frees to the local cache/memory +mechanism. + +iASL: Enhanced error detection by validating that all NameSeg elements +within a NamePatch actually exist. The previous behavior was spotty at +best, and such errors could be improperly ignored at compiler time (never +at runtime, however. There are two new error messages, as shown in the +examples below: + +dsdt.asl 33: CreateByteField (TTTT.BXXX, 1, CBF1) +Error 6161 - ^ One or more objects within +the Pathname do not exist (TTTT.BXXX) + +dsdt.asl 34: CreateByteField (BUF1, UUUU.INT1, BBBB.CBF1) +Error 6160 - One or more prefix Scopes do not exist ^ +(BBBB.CBF1) + +iASL: Disassembler/table-compiler: Added support for the static data +table TPM2 revision 3 (an older version of TPM2). The support has been +added for the compiler and the disassembler. + +Fixed compilation of DOS format data table file on Unix/Linux systems. +iASL now properly detects line continuations (\) for DOS format data +table definition language files on when executing on Unix/Linux. + +---------------------------------------- 03 October 2018. Summary of changes for version 20181003: diff -Nru acpica-unix-20181003/debian/changelog acpica-unix-20181213/debian/changelog --- acpica-unix-20181003/debian/changelog 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/changelog 2018-12-14 00:26:26.000000000 +0000 @@ -1,3 +1,17 @@ +acpica-unix (20181213-1) unstable; urgency=medium + + * Upgrade to 20181213 upstream + * Refresh patches as needed + + -- Al Stone Thu, 13 Dec 2018 17:26:26 -0700 + +acpica-unix (20181031-1) unstable; urgency=medium + + * Upgrade to 20181031 upstream + * Refresh patches as needed + + -- Al Stone Thu, 13 Dec 2018 17:02:48 -0700 + acpica-unix (20181003-1) unstable; urgency=medium * Upgrade to 20181003 upstream diff -Nru acpica-unix-20181003/debian/patches/add-testing.patch acpica-unix-20181213/debian/patches/add-testing.patch --- acpica-unix-20181003/debian/patches/add-testing.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/add-testing.patch 2018-12-14 00:26:26.000000000 +0000 @@ -12,7 +12,7 @@ + $(CURDIR)/tests/aslts.sh $(CURDIR)/tests/aslts $(CURDIR)/generate/unix + + # misc tests -+ $(CURDIR)/debian/run-misc-tests.sh $(CURDIR) 20181003 ++ $(CURDIR)/debian/run-misc-tests.sh $(CURDIR) 20181213 + + # Template tests + cd $(CURDIR)/tests/templates diff -Nru acpica-unix-20181003/debian/patches/be-tpm2.patch acpica-unix-20181213/debian/patches/be-tpm2.patch --- acpica-unix-20181003/debian/patches/be-tpm2.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/be-tpm2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -Index: acpica-unix-20180508/source/compiler/dttable2.c -=================================================================== ---- acpica-unix-20180508.orig/source/compiler/dttable2.c -+++ acpica-unix-20180508/source/compiler/dttable2.c -@@ -1797,6 +1797,7 @@ DtCompileTpm2 ( - ACPI_TABLE_TPM2 *Tpm2Header; - DT_SUBTABLE *ParentTable; - ACPI_STATUS Status = AE_OK; -+ UINT32 Tmp32; - - - /* Compile the main table */ -@@ -1831,7 +1832,8 @@ DtCompileTpm2 ( - - /* Subtable type depends on the StartMethod */ - -- switch (Tpm2Header->StartMethod) -+ ACPI_MOVE_32_TO_32(&Tmp32, &Tpm2Header->StartMethod); -+ switch (Tmp32) - { - case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC: - -@@ -1861,16 +1863,14 @@ DtCompileTpm2 ( - case ACPI_TPM2_RESERVED9: - case ACPI_TPM2_RESERVED10: - -- AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n", -- Tpm2Header->StartMethod); -+ AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n", Tmp32); - Status = AE_ERROR; - break; - - case ACPI_TPM2_NOT_ALLOWED: - default: - -- AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n", -- Tpm2Header->StartMethod); -+ AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n", Tmp32); - Status = AE_ERROR; - break; - } diff -Nru acpica-unix-20181003/debian/patches/big-endian.patch acpica-unix-20181213/debian/patches/big-endian.patch --- acpica-unix-20181003/debian/patches/big-endian.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/big-endian.patch 2018-12-14 00:26:26.000000000 +0000 @@ -23,10 +23,10 @@ source/include/platform/aclinux.h | 8 ++ 12 files changed, 487 insertions(+), 283 deletions(-) -Index: acpica-unix2-20181003/source/compiler/aslcodegen.c +Index: acpica-unix2-20181213/source/compiler/aslcodegen.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslcodegen.c -+++ acpica-unix2-20181003/source/compiler/aslcodegen.c +--- acpica-unix2-20181213.orig/source/compiler/aslcodegen.c ++++ acpica-unix2-20181213/source/compiler/aslcodegen.c @@ -240,16 +240,12 @@ CgWriteAmlOpcode ( ACPI_PARSE_OBJECT *Op) { @@ -240,7 +240,7 @@ /* Write all comments here. */ -@@ -676,13 +686,24 @@ CgWriteNode ( +@@ -670,13 +680,24 @@ CgWriteNode ( switch (Op->Asl.AmlOpcode) { case AML_RAW_DATA_BYTE: @@ -268,10 +268,10 @@ case AML_RAW_DATA_BUFFER: -Index: acpica-unix2-20181003/source/compiler/aslopcodes.c +Index: acpica-unix2-20181213/source/compiler/aslopcodes.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslopcodes.c -+++ acpica-unix2-20181003/source/compiler/aslopcodes.c +--- acpica-unix2-20181213.orig/source/compiler/aslopcodes.c ++++ acpica-unix2-20181213/source/compiler/aslopcodes.c @@ -485,6 +485,7 @@ OpcDoUnicode ( UINT32 i; UINT8 *AsciiString; @@ -290,10 +290,10 @@ } /* -Index: acpica-unix2-20181003/source/compiler/aslrestype1.c +Index: acpica-unix2-20181213/source/compiler/aslrestype1.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype1.c -+++ acpica-unix2-20181003/source/compiler/aslrestype1.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype1.c ++++ acpica-unix2-20181213/source/compiler/aslrestype1.c @@ -142,6 +142,11 @@ RsDoMemory24Descriptor ( ACPI_PARSE_OBJECT *LengthOp = NULL; ASL_RESOURCE_NODE *Rnode; @@ -490,10 +490,10 @@ RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength)); break; -Index: acpica-unix2-20181003/source/compiler/aslrestype1i.c +Index: acpica-unix2-20181213/source/compiler/aslrestype1i.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype1i.c -+++ acpica-unix2-20181003/source/compiler/aslrestype1i.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype1i.c ++++ acpica-unix2-20181213/source/compiler/aslrestype1i.c @@ -198,6 +198,8 @@ RsDoFixedDmaDescriptor ( ACPI_PARSE_OBJECT *InitializerOp; ASL_RESOURCE_NODE *Rnode; @@ -630,10 +630,10 @@ + ACPI_MOVE_16_TO_16(&Descriptor->Irq.IrqMask, &IrqMask); return (Rnode); } -Index: acpica-unix2-20181003/source/compiler/aslrestype2.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2.c @@ -76,6 +76,7 @@ RsDoGeneralRegisterDescriptor ( ACPI_PARSE_OBJECT *InitializerOp; ASL_RESOURCE_NODE *Rnode; @@ -774,10 +774,10 @@ /* Point to end-of-descriptor for vendor data */ -Index: acpica-unix2-20181003/source/compiler/aslrestype2d.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2d.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2d.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2d.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2d.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2d.c @@ -79,7 +79,13 @@ RsDoDwordIoDescriptor ( ACPI_PARSE_OBJECT *GranOp = NULL; ASL_RESOURCE_NODE *Rnode; @@ -1133,10 +1133,10 @@ Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + OptionIndex + StringLength; return (Rnode); -Index: acpica-unix2-20181003/source/compiler/aslrestype2e.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2e.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2e.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2e.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2e.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2e.c @@ -78,6 +78,13 @@ RsDoExtendedIoDescriptor ( ACPI_PARSE_OBJECT *GranOp = NULL; ASL_RESOURCE_NODE *Rnode; @@ -1242,10 +1242,10 @@ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength; return (Rnode); -Index: acpica-unix2-20181003/source/compiler/aslrestype2q.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2q.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2q.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2q.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2q.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2q.c @@ -80,7 +80,13 @@ RsDoQwordIoDescriptor ( ASL_RESOURCE_NODE *Rnode; UINT8 *OptionalFields; @@ -1584,10 +1584,10 @@ Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) + OptionIndex + StringLength; return (Rnode); -Index: acpica-unix2-20181003/source/compiler/aslrestype2s.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2s.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2s.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2s.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2s.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2s.c @@ -340,9 +340,14 @@ RsDoGpioIntDescriptor ( UINT16 VendorLength; UINT16 InterruptLength; @@ -2053,10 +2053,10 @@ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource); return (Rnode); } -Index: acpica-unix2-20181003/source/compiler/aslrestype2w.c +Index: acpica-unix2-20181213/source/compiler/aslrestype2w.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslrestype2w.c -+++ acpica-unix2-20181003/source/compiler/aslrestype2w.c +--- acpica-unix2-20181213.orig/source/compiler/aslrestype2w.c ++++ acpica-unix2-20181213/source/compiler/aslrestype2w.c @@ -81,6 +81,12 @@ RsDoWordIoDescriptor ( UINT8 *OptionalFields; UINT16 StringLength = 0; @@ -2400,10 +2400,10 @@ Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) + OptionIndex + StringLength; return (Rnode); -Index: acpica-unix2-20181003/source/include/acmacros.h +Index: acpica-unix2-20181213/source/include/acmacros.h =================================================================== ---- acpica-unix2-20181003.orig/source/include/acmacros.h -+++ acpica-unix2-20181003/source/include/acmacros.h +--- acpica-unix2-20181213.orig/source/include/acmacros.h ++++ acpica-unix2-20181213/source/include/acmacros.h @@ -98,9 +98,12 @@ ((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\ ((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];} @@ -2482,10 +2482,10 @@ #define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -Index: acpica-unix2-20181003/source/include/platform/aclinux.h +Index: acpica-unix2-20181213/source/include/platform/aclinux.h =================================================================== ---- acpica-unix2-20181003.orig/source/include/platform/aclinux.h -+++ acpica-unix2-20181003/source/include/platform/aclinux.h +--- acpica-unix2-20181213.orig/source/include/platform/aclinux.h ++++ acpica-unix2-20181213/source/include/platform/aclinux.h @@ -193,6 +193,7 @@ #ifdef ACPI_USE_STANDARD_HEADERS @@ -2505,10 +2505,10 @@ #endif /* __KERNEL__ */ #endif /* __ACLINUX_H__ */ -Index: acpica-unix2-20181003/source/compiler/aslanalyze.c +Index: acpica-unix2-20181213/source/compiler/aslanalyze.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslanalyze.c -+++ acpica-unix2-20181003/source/compiler/aslanalyze.c +--- acpica-unix2-20181213.orig/source/compiler/aslanalyze.c ++++ acpica-unix2-20181213/source/compiler/aslanalyze.c @@ -461,7 +461,7 @@ ApCheckForGpeNameConflict ( /* Need a null-terminated string version of NameSeg */ @@ -2527,10 +2527,10 @@ /* Inject opposite letter ("L" versus "E") */ -Index: acpica-unix2-20181003/source/compiler/asllookup.c +Index: acpica-unix2-20181213/source/compiler/asllookup.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/asllookup.c -+++ acpica-unix2-20181003/source/compiler/asllookup.c +--- acpica-unix2-20181213.orig/source/compiler/asllookup.c ++++ acpica-unix2-20181213/source/compiler/asllookup.c @@ -119,6 +119,7 @@ LkIsObjectUsed ( { ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); @@ -2561,10 +2561,10 @@ AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), AslGbl_MsgBuffer); return (AE_OK); -Index: acpica-unix2-20181003/source/compiler/aslmain.c +Index: acpica-unix2-20181213/source/compiler/aslmain.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslmain.c -+++ acpica-unix2-20181003/source/compiler/aslmain.c +--- acpica-unix2-20181213.orig/source/compiler/aslmain.c ++++ acpica-unix2-20181213/source/compiler/aslmain.c @@ -101,18 +101,6 @@ main ( signal (SIGINT, AslSignalHandler); @@ -2584,10 +2584,10 @@ AcpiOsInitialize (); ACPI_DEBUG_INITIALIZE (); /* For debug version only */ -Index: acpica-unix2-20181003/source/common/acfileio.c +Index: acpica-unix2-20181213/source/common/acfileio.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/acfileio.c -+++ acpica-unix2-20181003/source/common/acfileio.c +--- acpica-unix2-20181213.orig/source/common/acfileio.c ++++ acpica-unix2-20181213/source/common/acfileio.c @@ -280,6 +280,7 @@ AcGetOneTableFromFile ( ACPI_TABLE_HEADER *Table; INT32 Count; @@ -2654,10 +2654,10 @@ (UINT32) (FileSize - TableOffset)); return (AE_BAD_HEADER); } -Index: acpica-unix2-20181003/source/common/dmtable.c +Index: acpica-unix2-20181213/source/common/dmtable.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtable.c -+++ acpica-unix2-20181003/source/common/dmtable.c +--- acpica-unix2-20181213.orig/source/common/dmtable.c ++++ acpica-unix2-20181213/source/common/dmtable.c @@ -550,7 +550,7 @@ AcpiDmDumpDataTable ( */ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) @@ -2756,10 +2756,10 @@ AcpiDmNfitSubnames[Temp16]); break; -Index: acpica-unix2-20181003/source/common/dmtables.c +Index: acpica-unix2-20181213/source/common/dmtables.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtables.c -+++ acpica-unix2-20181003/source/common/dmtables.c +--- acpica-unix2-20181213.orig/source/common/dmtables.c ++++ acpica-unix2-20181213/source/common/dmtables.c @@ -142,7 +142,9 @@ AdCreateTableHeader ( ACPI_TABLE_HEADER *Table) { @@ -2825,10 +2825,10 @@ AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)); ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength); -Index: acpica-unix2-20181003/source/common/dmtbdump.c +Index: acpica-unix2-20181213/source/common/dmtbdump.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtbdump.c -+++ acpica-unix2-20181003/source/common/dmtbdump.c +--- acpica-unix2-20181213.orig/source/common/dmtbdump.c ++++ acpica-unix2-20181213/source/common/dmtbdump.c @@ -277,6 +277,8 @@ AcpiDmDumpRsdt ( UINT32 Entries; UINT32 Offset; @@ -2987,10 +2987,10 @@ - Revision, Length, ExpectedLength); + Revision, Tmp32, ExpectedLength); } -Index: acpica-unix2-20181003/source/common/dmtbdump1.c +Index: acpica-unix2-20181213/source/common/dmtbdump1.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtbdump1.c -+++ acpica-unix2-20181003/source/common/dmtbdump1.c +--- acpica-unix2-20181213.orig/source/common/dmtbdump1.c ++++ acpica-unix2-20181213/source/common/dmtbdump1.c @@ -79,17 +79,21 @@ AcpiDmDumpAsf ( UINT32 DataOffset = 0; UINT32 i; @@ -3624,10 +3624,10 @@ { case ACPI_HEST_TYPE_IA32_CHECK: -Index: acpica-unix2-20181003/source/common/dmtbdump2.c +Index: acpica-unix2-20181213/source/common/dmtbdump2.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtbdump2.c -+++ acpica-unix2-20181003/source/common/dmtbdump2.c +--- acpica-unix2-20181213.orig/source/common/dmtbdump2.c ++++ acpica-unix2-20181213/source/common/dmtbdump2.c @@ -75,15 +75,21 @@ AcpiDmDumpIort ( ACPI_IORT_SMMU *IortSmmu = NULL; UINT32 Offset; @@ -4510,10 +4510,10 @@ Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { -Index: acpica-unix2-20181003/source/common/dmtbdump3.c +Index: acpica-unix2-20181213/source/common/dmtbdump3.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmtbdump3.c -+++ acpica-unix2-20181003/source/common/dmtbdump3.c +--- acpica-unix2-20181213.orig/source/common/dmtbdump3.c ++++ acpica-unix2-20181213/source/common/dmtbdump3.c @@ -68,9 +68,11 @@ void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table) @@ -4672,7 +4672,7 @@ break; default: -@@ -455,11 +468,13 @@ AcpiDmDumpVrtc ( +@@ -507,11 +520,13 @@ AcpiDmDumpVrtc ( ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_VRTC); ACPI_VRTC_ENTRY *Subtable; @@ -4687,7 +4687,7 @@ if (ACPI_FAILURE (Status)) { return; -@@ -468,12 +483,12 @@ AcpiDmDumpVrtc ( +@@ -520,12 +535,12 @@ AcpiDmDumpVrtc ( /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset); @@ -4702,7 +4702,7 @@ sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0); if (ACPI_FAILURE (Status)) { -@@ -508,11 +523,13 @@ AcpiDmDumpWdat ( +@@ -560,11 +575,13 @@ AcpiDmDumpWdat ( ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_WDAT); ACPI_WDAT_ENTRY *Subtable; @@ -4717,7 +4717,7 @@ if (ACPI_FAILURE (Status)) { return; -@@ -521,12 +538,12 @@ AcpiDmDumpWdat ( +@@ -573,12 +590,12 @@ AcpiDmDumpWdat ( /* Subtables */ Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset); @@ -4732,7 +4732,7 @@ sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0); if (ACPI_FAILURE (Status)) { -@@ -561,12 +578,13 @@ AcpiDmDumpWpbt ( +@@ -613,12 +630,13 @@ AcpiDmDumpWpbt ( { ACPI_STATUS Status; ACPI_TABLE_WPBT *Subtable; @@ -4747,7 +4747,7 @@ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt); if (ACPI_FAILURE (Status)) { -@@ -576,10 +594,10 @@ AcpiDmDumpWpbt ( +@@ -628,10 +646,10 @@ AcpiDmDumpWpbt ( /* Extract the arguments buffer length from the main table */ Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table); @@ -4760,10 +4760,10 @@ + (void) AcpiDmDumpTable (Length, 0, Table, ArgumentsLength, AcpiDmTableInfoWpbt0); } -Index: acpica-unix2-20181003/source/compiler/dtfield.c +Index: acpica-unix2-20181213/source/compiler/dtfield.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/dtfield.c -+++ acpica-unix2-20181003/source/compiler/dtfield.c +--- acpica-unix2-20181213.orig/source/compiler/dtfield.c ++++ acpica-unix2-20181213/source/compiler/dtfield.c @@ -359,7 +359,27 @@ DtCompileInteger ( DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, AslGbl_MsgBuffer); } @@ -4793,10 +4793,10 @@ return; } -Index: acpica-unix2-20181003/source/compiler/dtsubtable.c +Index: acpica-unix2-20181213/source/compiler/dtsubtable.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/dtsubtable.c -+++ acpica-unix2-20181003/source/compiler/dtsubtable.c +--- acpica-unix2-20181213.orig/source/compiler/dtsubtable.c ++++ acpica-unix2-20181213/source/compiler/dtsubtable.c @@ -378,6 +378,21 @@ DtSetSubtableLength ( return; } @@ -4821,10 +4821,10 @@ + Subtable->SizeOfLengthField); + } } -Index: acpica-unix2-20181003/source/compiler/dttable1.c +Index: acpica-unix2-20181213/source/compiler/dttable1.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/dttable1.c -+++ acpica-unix2-20181003/source/compiler/dttable1.c +--- acpica-unix2-20181213.orig/source/compiler/dttable1.c ++++ acpica-unix2-20181213/source/compiler/dttable1.c @@ -281,6 +281,8 @@ DtCompileCsrt ( DT_FIELD **PFieldList = (DT_FIELD **) List; UINT32 DescriptorCount; @@ -5196,10 +5196,10 @@ return (AE_OK); } -Index: acpica-unix2-20181003/source/compiler/dttable2.c +Index: acpica-unix2-20181213/source/compiler/dttable2.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/dttable2.c -+++ acpica-unix2-20181003/source/compiler/dttable2.c +--- acpica-unix2-20181213.orig/source/compiler/dttable2.c ++++ acpica-unix2-20181213/source/compiler/dttable2.c @@ -345,7 +345,7 @@ DtCompileMpst ( DtPushSubtable (Subtable); @@ -5328,7 +5328,43 @@ { case ACPI_TCPA_CLIENT_TABLE: -@@ -2039,6 +2047,9 @@ DtCompileWpbt ( +@@ -1788,6 +1796,7 @@ DtCompileTpm2Rev3 ( + ACPI_TABLE_TPM23 *Tpm23Header; + DT_SUBTABLE *ParentTable; + ACPI_STATUS Status = AE_OK; ++ UINT32 Tmp32; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23, +@@ -1799,7 +1808,8 @@ DtCompileTpm2Rev3 ( + + /* Subtable type depends on the StartMethod */ + +- switch (Tpm23Header->StartMethod) ++ ACPI_MOVE_32_TO_32(&Tmp32, &Tpm23Header->StartMethod); ++ switch (Tmp32) + { + case ACPI_TPM23_ACPI_START_METHOD: + +@@ -1846,6 +1856,7 @@ DtCompileTpm2 ( + DT_SUBTABLE *ParentTable; + ACPI_STATUS Status = AE_OK; + ACPI_TABLE_HEADER *Header; ++ UINT32 Tmp32; + + + ParentTable = DtPeekSubtable (); +@@ -1889,7 +1900,8 @@ DtCompileTpm2 ( + + /* Subtable type depends on the StartMethod */ + +- switch (Tpm2Header->StartMethod) ++ ACPI_MOVE_32_TO_32(&Tmp32, &Tpm2Header->StartMethod); ++ switch (Tmp32) + { + case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC: + +@@ -2105,6 +2117,9 @@ DtCompileWpbt ( ACPI_TABLE_WPBT *Table; ACPI_STATUS Status; UINT16 Length; @@ -5338,7 +5374,7 @@ /* Compile the main table */ -@@ -2066,7 +2077,16 @@ DtCompileWpbt ( +@@ -2132,7 +2147,16 @@ DtCompileWpbt ( Length = (UINT16) Subtable->TotalLength; Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer); @@ -5356,10 +5392,10 @@ ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); -Index: acpica-unix2-20181003/source/components/disassembler/dmbuffer.c +Index: acpica-unix2-20181213/source/components/disassembler/dmbuffer.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/disassembler/dmbuffer.c -+++ acpica-unix2-20181003/source/components/disassembler/dmbuffer.c +--- acpica-unix2-20181213.orig/source/components/disassembler/dmbuffer.c ++++ acpica-unix2-20181213/source/components/disassembler/dmbuffer.c @@ -204,7 +204,7 @@ AcpiDmByteList ( @@ -5435,10 +5471,10 @@ NextOp = AcpiPsGetDepthNext (NULL, Op); if (!NextOp) -Index: acpica-unix2-20181003/source/components/disassembler/dmopcode.c +Index: acpica-unix2-20181213/source/components/disassembler/dmopcode.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/disassembler/dmopcode.c -+++ acpica-unix2-20181003/source/components/disassembler/dmopcode.c +--- acpica-unix2-20181213.orig/source/components/disassembler/dmopcode.c ++++ acpica-unix2-20181213/source/components/disassembler/dmopcode.c @@ -244,6 +244,7 @@ AcpiDmPredefinedDescription ( char *NameString; int LastCharIsDigit; @@ -5509,10 +5545,10 @@ Info->Level += 1; Info->MappingOp = Op; -Index: acpica-unix2-20181003/source/components/disassembler/dmresrcl.c +Index: acpica-unix2-20181213/source/components/disassembler/dmresrcl.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/disassembler/dmresrcl.c -+++ acpica-unix2-20181003/source/components/disassembler/dmresrcl.c +--- acpica-unix2-20181213.orig/source/components/disassembler/dmresrcl.c ++++ acpica-unix2-20181213/source/components/disassembler/dmresrcl.c @@ -141,7 +141,8 @@ AcpiDmMemoryFields ( UINT32 Level) { @@ -5661,10 +5697,10 @@ } AcpiDmIndent (Level); -Index: acpica-unix2-20181003/source/components/disassembler/dmresrcl2.c +Index: acpica-unix2-20181213/source/components/disassembler/dmresrcl2.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/disassembler/dmresrcl2.c -+++ acpica-unix2-20181003/source/components/disassembler/dmresrcl2.c +--- acpica-unix2-20181213.orig/source/components/disassembler/dmresrcl2.c ++++ acpica-unix2-20181213/source/components/disassembler/dmresrcl2.c @@ -191,22 +191,24 @@ AcpiDmGpioCommon ( char *DeviceName = NULL; UINT32 PinCount; @@ -5888,10 +5924,10 @@ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset); AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); -Index: acpica-unix2-20181003/source/components/disassembler/dmresrcs.c +Index: acpica-unix2-20181213/source/components/disassembler/dmresrcs.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/disassembler/dmresrcs.c -+++ acpica-unix2-20181003/source/components/disassembler/dmresrcs.c +--- acpica-unix2-20181213.orig/source/components/disassembler/dmresrcs.c ++++ acpica-unix2-20181213/source/components/disassembler/dmresrcs.c @@ -72,6 +72,7 @@ AcpiDmIrqDescriptor ( UINT32 Length, UINT32 Level) @@ -5948,10 +5984,10 @@ AcpiDmIndent (Level + 1); AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length"); -Index: acpica-unix2-20181003/source/components/dispatcher/dsfield.c +Index: acpica-unix2-20181213/source/components/dispatcher/dsfield.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/dispatcher/dsfield.c -+++ acpica-unix2-20181003/source/components/dispatcher/dsfield.c +--- acpica-unix2-20181213.orig/source/components/dispatcher/dsfield.c ++++ acpica-unix2-20181213/source/components/dispatcher/dsfield.c @@ -325,6 +325,7 @@ AcpiDsGetFieldNames ( ACPI_STATUS Status; UINT64 Position; @@ -5996,10 +6032,10 @@ if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, -Index: acpica-unix2-20181003/source/components/events/evgpeblk.c +Index: acpica-unix2-20181213/source/components/events/evgpeblk.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/events/evgpeblk.c -+++ acpica-unix2-20181003/source/components/events/evgpeblk.c +--- acpica-unix2-20181213.orig/source/components/events/evgpeblk.c ++++ acpica-unix2-20181213/source/components/events/evgpeblk.c @@ -376,6 +376,7 @@ AcpiEvCreateGpeBlock ( ACPI_STATUS Status; ACPI_GPE_BLOCK_INFO *GpeBlock; @@ -6032,10 +6068,10 @@ InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : "")); /* Update global count of currently available GPEs */ -Index: acpica-unix2-20181003/source/components/hardware/hwregs.c +Index: acpica-unix2-20181213/source/components/hardware/hwregs.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/hardware/hwregs.c -+++ acpica-unix2-20181003/source/components/hardware/hwregs.c +--- acpica-unix2-20181213.orig/source/components/hardware/hwregs.c ++++ acpica-unix2-20181213/source/components/hardware/hwregs.c @@ -197,7 +197,7 @@ AcpiHwValidateRegister ( * Address must not be null. A null address also indicates an optional * ACPI register that is not supported, so no error message. @@ -6045,10 +6081,10 @@ if (!(*Address)) { return (AE_BAD_ADDRESS); -Index: acpica-unix2-20181003/source/components/hardware/hwvalid.c +Index: acpica-unix2-20181213/source/components/hardware/hwvalid.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/hardware/hwvalid.c -+++ acpica-unix2-20181003/source/components/hardware/hwvalid.c +--- acpica-unix2-20181213.orig/source/components/hardware/hwvalid.c ++++ acpica-unix2-20181213/source/components/hardware/hwvalid.c @@ -135,6 +135,8 @@ AcpiHwValidateIoRequest ( UINT32 ByteWidth; ACPI_IO_ADDRESS LastAddress; @@ -6070,19 +6106,19 @@ { ACPI_ERROR ((AE_INFO, "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X", -Index: acpica-unix2-20181003/source/components/namespace/nsaccess.c +Index: acpica-unix2-20181213/source/components/namespace/nsaccess.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/namespace/nsaccess.c -+++ acpica-unix2-20181003/source/components/namespace/nsaccess.c -@@ -313,6 +313,7 @@ AcpiNsLookup ( - ACPI_OBJECT_TYPE ThisSearchType; +--- acpica-unix2-20181213.orig/source/components/namespace/nsaccess.c ++++ acpica-unix2-20181213/source/components/namespace/nsaccess.c +@@ -314,6 +314,7 @@ AcpiNsLookup ( UINT32 SearchParentFlag = ACPI_NS_SEARCH_PARENT; UINT32 LocalFlags; + ACPI_INTERPRETER_MODE LocalInterpreterMode; + UINT32 Tmp32; ACPI_FUNCTION_TRACE (NsLookup); -@@ -704,9 +705,10 @@ AcpiNsLookup ( +@@ -723,9 +724,10 @@ AcpiNsLookup ( { /* Complain about a type mismatch */ @@ -6094,11 +6130,11 @@ AcpiUtGetTypeName (ThisNode->Type), AcpiUtGetTypeName (TypeToCheckFor))); } -Index: acpica-unix2-20181003/source/components/namespace/nsparse.c +Index: acpica-unix2-20181213/source/components/namespace/nsparse.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/namespace/nsparse.c -+++ acpica-unix2-20181003/source/components/namespace/nsparse.c -@@ -206,13 +206,14 @@ AcpiNsOneCompleteParse ( +--- acpica-unix2-20181213.orig/source/components/namespace/nsparse.c ++++ acpica-unix2-20181213/source/components/namespace/nsparse.c +@@ -216,13 +216,14 @@ AcpiNsOneCompleteParse ( /* Table must consist of at least a complete header */ @@ -6115,10 +6151,10 @@ Status = AcpiTbGetOwnerId (TableIndex, &OwnerId); if (ACPI_FAILURE (Status)) -Index: acpica-unix2-20181003/source/components/tables/tbdata.c +Index: acpica-unix2-20181213/source/components/tables/tbdata.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbdata.c -+++ acpica-unix2-20181003/source/components/tables/tbdata.c +--- acpica-unix2-20181213.orig/source/components/tables/tbdata.c ++++ acpica-unix2-20181213/source/components/tables/tbdata.c @@ -552,6 +552,7 @@ AcpiTbVerifyTempTable ( UINT32 *TableIndex) { @@ -6137,10 +6173,10 @@ if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, -Index: acpica-unix2-20181003/source/components/tables/tbfadt.c +Index: acpica-unix2-20181213/source/components/tables/tbfadt.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbfadt.c -+++ acpica-unix2-20181003/source/components/tables/tbfadt.c +--- acpica-unix2-20181213.orig/source/components/tables/tbfadt.c ++++ acpica-unix2-20181213/source/components/tables/tbfadt.c @@ -424,18 +424,20 @@ AcpiTbCreateLocalFadt ( ACPI_TABLE_HEADER *Table, UINT32 Length) @@ -6252,10 +6288,10 @@ "PmRegisters", 0); } } -Index: acpica-unix2-20181003/source/components/tables/tbfind.c +Index: acpica-unix2-20181213/source/components/tables/tbfind.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbfind.c -+++ acpica-unix2-20181003/source/components/tables/tbfind.c +--- acpica-unix2-20181213.orig/source/components/tables/tbfind.c ++++ acpica-unix2-20181213/source/components/tables/tbfind.c @@ -108,8 +108,11 @@ AcpiTbFindTable ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) @@ -6269,10 +6305,10 @@ { /* Not the requested table */ -Index: acpica-unix2-20181003/source/components/tables/tbprint.c +Index: acpica-unix2-20181213/source/components/tables/tbprint.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbprint.c -+++ acpica-unix2-20181003/source/components/tables/tbprint.c +--- acpica-unix2-20181213.orig/source/components/tables/tbprint.c ++++ acpica-unix2-20181213/source/components/tables/tbprint.c @@ -143,15 +143,18 @@ AcpiTbPrintTableHeader ( ACPI_TABLE_HEADER *Header) { @@ -6314,10 +6350,10 @@ } } -Index: acpica-unix2-20181003/source/components/tables/tbutils.c +Index: acpica-unix2-20181213/source/components/tables/tbutils.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbutils.c -+++ acpica-unix2-20181003/source/components/tables/tbutils.c +--- acpica-unix2-20181213.orig/source/components/tables/tbutils.c ++++ acpica-unix2-20181213/source/components/tables/tbutils.c @@ -238,7 +238,7 @@ AcpiTbGetRootTableEntry ( * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, * return 64-bit @@ -6377,10 +6413,10 @@ { AcpiGbl_FadtIndex = TableIndex; AcpiTbParseFadt (); -Index: acpica-unix2-20181003/source/components/tables/tbxface.c +Index: acpica-unix2-20181213/source/components/tables/tbxface.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbxface.c -+++ acpica-unix2-20181003/source/components/tables/tbxface.c +--- acpica-unix2-20181213.orig/source/components/tables/tbxface.c ++++ acpica-unix2-20181213/source/components/tables/tbxface.c @@ -293,8 +293,11 @@ AcpiGetTableHeader ( for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) @@ -6394,10 +6430,10 @@ { continue; } -Index: acpica-unix2-20181003/source/components/tables/tbxfload.c +Index: acpica-unix2-20181213/source/components/tables/tbxfload.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbxfload.c -+++ acpica-unix2-20181003/source/components/tables/tbxfload.c +--- acpica-unix2-20181213.orig/source/components/tables/tbxfload.c ++++ acpica-unix2-20181213/source/components/tables/tbxfload.c @@ -159,6 +159,7 @@ AcpiTbLoadNamespace ( ACPI_TABLE_DESC *Table; UINT32 TablesLoaded = 0; @@ -6417,10 +6453,10 @@ ACPI_FAILURE (AcpiTbValidateTable (Table))) { Status = AE_NO_ACPI_TABLES; -Index: acpica-unix2-20181003/source/tools/acpiexec/aetables.c +Index: acpica-unix2-20181213/source/tools/acpiexec/aetables.c =================================================================== ---- acpica-unix2-20181003.orig/source/tools/acpiexec/aetables.c -+++ acpica-unix2-20181003/source/tools/acpiexec/aetables.c +--- acpica-unix2-20181213.orig/source/tools/acpiexec/aetables.c ++++ acpica-unix2-20181213/source/tools/acpiexec/aetables.c @@ -146,21 +146,25 @@ AeInitializeTableHeader ( char *Signature, UINT32 Length) @@ -6572,10 +6608,10 @@ } return (AE_OK); -Index: acpica-unix2-20181003/source/common/dmswitch.c +Index: acpica-unix2-20181213/source/common/dmswitch.c =================================================================== ---- acpica-unix2-20181003.orig/source/common/dmswitch.c -+++ acpica-unix2-20181003/source/common/dmswitch.c +--- acpica-unix2-20181213.orig/source/common/dmswitch.c ++++ acpica-unix2-20181213/source/common/dmswitch.c @@ -88,13 +88,15 @@ AcpiDmProcessSwitch ( ACPI_PARSE_OBJECT_LIST *Current; ACPI_PARSE_OBJECT_LIST *Previous; diff -Nru acpica-unix-20181003/debian/patches/cve-2017-13693.patch acpica-unix-20181213/debian/patches/cve-2017-13693.patch --- acpica-unix-20181003/debian/patches/cve-2017-13693.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/cve-2017-13693.patch 2018-12-14 00:26:26.000000000 +0000 @@ -63,11 +63,11 @@ source/components/dispatcher/dsutils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -Index: acpica-unix-20180508/source/components/dispatcher/dsutils.c +Index: acpica-unix2-20181213/source/components/dispatcher/dsutils.c =================================================================== ---- acpica-unix-20180508.orig/source/components/dispatcher/dsutils.c -+++ acpica-unix-20180508/source/components/dispatcher/dsutils.c -@@ -761,6 +761,8 @@ AcpiDsCreateOperands ( +--- acpica-unix2-20181213.orig/source/components/dispatcher/dsutils.c ++++ acpica-unix2-20181213/source/components/dispatcher/dsutils.c +@@ -759,6 +759,8 @@ AcpiDsCreateOperands ( ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS]; UINT32 ArgCount = 0; UINT32 Index = WalkState->NumOperands; @@ -76,7 +76,7 @@ UINT32 i; -@@ -793,6 +795,7 @@ AcpiDsCreateOperands ( +@@ -791,6 +793,7 @@ AcpiDsCreateOperands ( /* Create the interpreter arguments, in reverse order */ @@ -84,7 +84,7 @@ Index--; for (i = 0; i < ArgCount; i++) { -@@ -820,7 +823,11 @@ Cleanup: +@@ -818,7 +821,11 @@ Cleanup: * pop everything off of the operand stack and delete those * objects */ diff -Nru acpica-unix-20181003/debian/patches/cve-2017-13695.patch acpica-unix-20181213/debian/patches/cve-2017-13695.patch --- acpica-unix-20181003/debian/patches/cve-2017-13695.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/cve-2017-13695.patch 2018-12-14 00:26:26.000000000 +0000 @@ -67,11 +67,11 @@ source/components/namespace/nseval.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -Index: acpica-unix-20180508/source/components/namespace/nseval.c +Index: acpica-unix2-20181213/source/components/namespace/nseval.c =================================================================== ---- acpica-unix-20180508.orig/source/components/namespace/nseval.c -+++ acpica-unix-20180508/source/components/namespace/nseval.c -@@ -330,6 +330,16 @@ AcpiNsEvaluate ( +--- acpica-unix2-20181213.orig/source/components/namespace/nseval.c ++++ acpica-unix2-20181213/source/components/namespace/nseval.c +@@ -336,6 +336,16 @@ AcpiNsEvaluate ( Info->ReturnObject = NULL; } } diff -Nru acpica-unix-20181003/debian/patches/int-format.patch acpica-unix-20181213/debian/patches/int-format.patch --- acpica-unix-20181003/debian/patches/int-format.patch 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/int-format.patch 2018-12-14 00:26:26.000000000 +0000 @@ -4,10 +4,8 @@ --- - source/compiler/aslcompile.c | 2 +- source/compiler/aslerror.c | 4 ++-- source/compiler/aslopt.c | 2 +- - source/compiler/aslpredef.c | 2 +- source/compiler/aslprepkg.c | 2 +- source/components/debugger/dbexec.c | 2 +- source/components/dispatcher/dsmthdat.c | 4 ++-- @@ -21,28 +19,14 @@ source/components/tables/tbfadt.c | 6 +++--- source/components/tables/tbxfroot.c | 6 +++--- source/components/utilities/utownerid.c | 2 +- - source/tools/acpiexec/aemain.c | 2 +- 18 files changed, 28 insertions(+), 28 deletions(-) -Index: acpica-unix2-20181003/source/compiler/aslcompile.c +Index: acpica-unix2-20181213/source/compiler/aslerror.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslcompile.c -+++ acpica-unix2-20181003/source/compiler/aslcompile.c -@@ -750,7 +750,7 @@ CmCleanupAndExit ( - - if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) - { -- printf ("\nMaximum error count (%u) exceeded\n", -+ printf ("\nMaximum error count (%d) exceeded\n", - ASL_MAX_ERROR_COUNT); - } - -Index: acpica-unix2-20181003/source/compiler/aslerror.c -=================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslerror.c -+++ acpica-unix2-20181003/source/compiler/aslerror.c -@@ -880,7 +880,7 @@ AslLogNewError ( - AslGbl_ExceptionCount[Level]++; +--- acpica-unix2-20181213.orig/source/compiler/aslerror.c ++++ acpica-unix2-20181213/source/compiler/aslerror.c +@@ -886,7 +886,7 @@ AslLogNewError ( + AslGbl_ExceptionCount[ModifiedLevel]++; if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT); @@ -50,19 +34,10 @@ AslGbl_SourceLine = 0; AslGbl_NextError = AslGbl_ErrorLog; -@@ -1036,7 +1036,7 @@ AslDisableException ( - - if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) - { -- printf ("Too many messages have been disabled (max %u)\n", -+ printf ("Too many messages have been disabled (max %d)\n", - ASL_MAX_DISABLED_MESSAGES); - return (AE_LIMIT); - } -Index: acpica-unix2-20181003/source/compiler/aslopt.c +Index: acpica-unix2-20181213/source/compiler/aslopt.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslopt.c -+++ acpica-unix2-20181003/source/compiler/aslopt.c +--- acpica-unix2-20181213.orig/source/compiler/aslopt.c ++++ acpica-unix2-20181213/source/compiler/aslopt.c @@ -583,7 +583,7 @@ OptOptimizeNamePath ( } @@ -72,23 +47,10 @@ Op->Asl.LogicalLineNumber, AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), AcpiPsGetOpcodeName (Op->Common.AmlOpcode))); -Index: acpica-unix2-20181003/source/compiler/aslpredef.c +Index: acpica-unix2-20181213/source/compiler/aslprepkg.c =================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslpredef.c -+++ acpica-unix2-20181003/source/compiler/aslpredef.c -@@ -114,7 +114,7 @@ ApCheckForPredefinedMethod ( - - if (MethodInfo->NumArguments != 0) - { -- sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); -+ sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); - - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, - AslGbl_MsgBuffer); -Index: acpica-unix2-20181003/source/compiler/aslprepkg.c -=================================================================== ---- acpica-unix2-20181003.orig/source/compiler/aslprepkg.c -+++ acpica-unix2-20181003/source/compiler/aslprepkg.c +--- acpica-unix2-20181213.orig/source/compiler/aslprepkg.c ++++ acpica-unix2-20181213/source/compiler/aslprepkg.c @@ -309,7 +309,7 @@ ApCheckPackage ( if (Count & 1) @@ -98,10 +60,10 @@ Predefined->Info.Name, Count); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, -Index: acpica-unix2-20181003/source/components/debugger/dbexec.c +Index: acpica-unix2-20181213/source/components/debugger/dbexec.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/debugger/dbexec.c -+++ acpica-unix2-20181003/source/components/debugger/dbexec.c +--- acpica-unix2-20181213.orig/source/components/debugger/dbexec.c ++++ acpica-unix2-20181213/source/components/debugger/dbexec.c @@ -230,7 +230,7 @@ AcpiDbExecuteMethod ( ACPI_ERROR ((AE_INFO, "Possible overflow of internal debugger " @@ -111,10 +73,10 @@ } } -Index: acpica-unix2-20181003/source/components/dispatcher/dsmthdat.c +Index: acpica-unix2-20181213/source/components/dispatcher/dsmthdat.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/dispatcher/dsmthdat.c -+++ acpica-unix2-20181003/source/components/dispatcher/dsmthdat.c +--- acpica-unix2-20181213.orig/source/components/dispatcher/dsmthdat.c ++++ acpica-unix2-20181213/source/components/dispatcher/dsmthdat.c @@ -291,7 +291,7 @@ AcpiDsMethodDataGetNode ( if (Index > ACPI_METHOD_MAX_LOCAL) { @@ -133,11 +95,11 @@ Index, ACPI_METHOD_MAX_ARG)); return_ACPI_STATUS (AE_AML_INVALID_INDEX); } -Index: acpica-unix2-20181003/source/components/dispatcher/dsutils.c +Index: acpica-unix2-20181213/source/components/dispatcher/dsutils.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/dispatcher/dsutils.c -+++ acpica-unix2-20181003/source/components/dispatcher/dsutils.c -@@ -788,7 +788,7 @@ AcpiDsCreateOperands ( +--- acpica-unix2-20181213.orig/source/components/dispatcher/dsutils.c ++++ acpica-unix2-20181213/source/components/dispatcher/dsutils.c +@@ -786,7 +786,7 @@ AcpiDsCreateOperands ( } ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -146,10 +108,10 @@ WalkState->NumOperands, ArgCount, Index)); /* Create the interpreter arguments, in reverse order */ -Index: acpica-unix2-20181003/source/components/dispatcher/dswscope.c +Index: acpica-unix2-20181213/source/components/dispatcher/dswscope.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/dispatcher/dswscope.c -+++ acpica-unix2-20181003/source/components/dispatcher/dswscope.c +--- acpica-unix2-20181213.orig/source/components/dispatcher/dswscope.c ++++ acpica-unix2-20181213/source/components/dispatcher/dswscope.c @@ -149,7 +149,7 @@ AcpiDsScopeStackPush ( WalkState->ScopeDepth++; @@ -168,10 +130,10 @@ (UINT32) WalkState->ScopeDepth, AcpiUtGetNodeName (ScopeInfo->Scope.Node), AcpiUtGetTypeName (ScopeInfo->Common.Value))); -Index: acpica-unix2-20181003/source/components/events/evgpe.c +Index: acpica-unix2-20181213/source/components/events/evgpe.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/events/evgpe.c -+++ acpica-unix2-20181003/source/components/events/evgpe.c +--- acpica-unix2-20181213.orig/source/components/events/evgpe.c ++++ acpica-unix2-20181213/source/components/events/evgpe.c @@ -481,7 +481,7 @@ AcpiEvGpeDetect ( "Ignore disabled registers for GPE %02X-%02X: " "RunEnable=%02X, WakeEnable=%02X\n", @@ -181,10 +143,10 @@ GpeRegisterInfo->EnableForRun, GpeRegisterInfo->EnableForWake)); continue; -Index: acpica-unix2-20181003/source/components/executer/exdump.c +Index: acpica-unix2-20181213/source/components/executer/exdump.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/executer/exdump.c -+++ acpica-unix2-20181003/source/components/executer/exdump.c +--- acpica-unix2-20181213.orig/source/components/executer/exdump.c ++++ acpica-unix2-20181213/source/components/executer/exdump.c @@ -678,7 +678,7 @@ AcpiExDumpOperand ( if (Depth > 0) { @@ -194,10 +156,10 @@ } else { -Index: acpica-unix2-20181003/source/components/executer/exfldio.c +Index: acpica-unix2-20181213/source/components/executer/exfldio.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/executer/exfldio.c -+++ acpica-unix2-20181003/source/components/executer/exfldio.c +--- acpica-unix2-20181213.orig/source/components/executer/exfldio.c ++++ acpica-unix2-20181213/source/components/executer/exfldio.c @@ -681,8 +681,8 @@ AcpiExWriteWithUpdateRule ( ACPI_ERROR ((AE_INFO, @@ -209,10 +171,10 @@ return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } } -Index: acpica-unix2-20181003/source/components/executer/exnames.c +Index: acpica-unix2-20181213/source/components/executer/exnames.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/executer/exnames.c -+++ acpica-unix2-20181003/source/components/executer/exnames.c +--- acpica-unix2-20181213.orig/source/components/executer/exnames.c ++++ acpica-unix2-20181213/source/components/executer/exnames.c @@ -237,7 +237,7 @@ AcpiExNameSegment ( */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, @@ -231,10 +193,10 @@ } *InAmlAddress = ACPI_CAST_PTR (UINT8, AmlAddress); -Index: acpica-unix2-20181003/source/components/hardware/hwregs.c +Index: acpica-unix2-20181213/source/components/hardware/hwregs.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/hardware/hwregs.c -+++ acpica-unix2-20181003/source/components/hardware/hwregs.c +--- acpica-unix2-20181213.orig/source/components/hardware/hwregs.c ++++ acpica-unix2-20181213/source/components/hardware/hwregs.c @@ -460,7 +460,7 @@ AcpiHwClearAcpiStatus ( @@ -244,10 +206,10 @@ ACPI_FORMAT_UINT64 (AcpiGbl_XPm1aStatus.Address))); LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); -Index: acpica-unix2-20181003/source/components/tables/tbfadt.c +Index: acpica-unix2-20181213/source/components/tables/tbfadt.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbfadt.c -+++ acpica-unix2-20181003/source/components/tables/tbfadt.c +--- acpica-unix2-20181213.orig/source/components/tables/tbfadt.c ++++ acpica-unix2-20181213/source/components/tables/tbfadt.c @@ -233,7 +233,7 @@ AcpiTbInitGenericAddress ( if (!(Flags & ACPI_FADT_GPE_REGISTER)) { @@ -275,10 +237,10 @@ Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address), AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); -Index: acpica-unix2-20181003/source/components/tables/tbxfroot.c +Index: acpica-unix2-20181213/source/components/tables/tbxfroot.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/tables/tbxfroot.c -+++ acpica-unix2-20181003/source/components/tables/tbxfroot.c +--- acpica-unix2-20181213.orig/source/components/tables/tbxfroot.c ++++ acpica-unix2-20181213/source/components/tables/tbxfroot.c @@ -177,7 +177,7 @@ AcpiFindRootPointer ( { ACPI_ERROR ((AE_INFO, @@ -306,10 +268,10 @@ return_ACPI_STATUS (AE_NO_MEMORY); } -Index: acpica-unix2-20181003/source/components/utilities/utownerid.c +Index: acpica-unix2-20181213/source/components/utilities/utownerid.c =================================================================== ---- acpica-unix2-20181003.orig/source/components/utilities/utownerid.c -+++ acpica-unix2-20181003/source/components/utilities/utownerid.c +--- acpica-unix2-20181213.orig/source/components/utilities/utownerid.c ++++ acpica-unix2-20181213/source/components/utilities/utownerid.c @@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId ( else { @@ -319,16 +281,3 @@ } (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); -Index: acpica-unix2-20181003/source/tools/acpiexec/aemain.c -=================================================================== ---- acpica-unix2-20181003.orig/source/tools/acpiexec/aemain.c -+++ acpica-unix2-20181003/source/tools/acpiexec/aemain.c -@@ -211,7 +211,7 @@ AeDoOptions ( - - if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1)) - { -- printf ("**** The length of command line (%u) exceeded maximum (%u)\n", -+ printf ("**** The length of command line (%u) exceeded maximum (%d)\n", - (UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1)); - return (-1); - } diff -Nru acpica-unix-20181003/debian/patches/series acpica-unix-20181213/debian/patches/series --- acpica-unix-20181003/debian/patches/series 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/patches/series 2018-12-14 00:26:26.000000000 +0000 @@ -12,7 +12,6 @@ arm7hl.patch big-endian-v2.patch simple-64bit.patch -be-tpm2.patch mips-be-fix.patch cve-2017-13693.patch cve-2017-13694.patch diff -Nru acpica-unix-20181003/debian/rules acpica-unix-20181213/debian/rules --- acpica-unix-20181003/debian/rules 2018-10-24 22:01:02.000000000 +0000 +++ acpica-unix-20181213/debian/rules 2018-12-14 00:26:26.000000000 +0000 @@ -15,7 +15,7 @@ DESTDIR ?= debian/acpica-tools -VERSION = 20181003 +VERSION = 20181213 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) diff -Nru acpica-unix-20181003/source/common/ahpredef.c acpica-unix-20181213/source/common/ahpredef.c --- acpica-unix-20181003/source/common/ahpredef.c 2018-10-03 14:13:48.000000000 +0000 +++ acpica-unix-20181213/source/common/ahpredef.c 2018-12-13 16:16:44.000000000 +0000 @@ -63,7 +63,7 @@ */ const AH_PREDEFINED_NAME AslPredefinedInfo[] = { - AH_PREDEF ("_ACx", "Active Cooling", "Returns the active cooling policy threshold values"), + AH_PREDEF ("_ACx", "Active Cooling, x=0-9", "Returns the active cooling policy threshold values"), AH_PREDEF ("_ADR", "Address", "Returns address of a device on parent bus, and resource field"), AH_PREDEF ("_AEI", "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"), AH_PREDEF ("_ALC", "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"), @@ -72,7 +72,7 @@ AH_PREDEF ("_ALP", "Ambient Light Polling", "Returns the ambient light sensor polling frequency"), AH_PREDEF ("_ALR", "Ambient Light Response", "Returns the ambient light brightness to display brightness mappings"), AH_PREDEF ("_ALT", "Ambient Light Temperature", "Returns the ambient light color temperature"), - AH_PREDEF ("_ALx", "Active List", "Returns a list of active cooling device objects"), + AH_PREDEF ("_ALx", "Active List, x=0-9", "Returns a list of active cooling device objects"), AH_PREDEF ("_ART", "Active Cooling Relationship Table", "Returns thermal relationship information between platform devices and fan devices"), AH_PREDEF ("_ASI", "Address Space Id", "Resource Descriptor field"), AH_PREDEF ("_ASZ", "Access Size", "Resource Descriptor field"), @@ -129,11 +129,11 @@ AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"), AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"), AH_PREDEF ("_DTI", "Device Temperature Indication", "Conveys native device temperature to the platform"), - AH_PREDEF ("_Exx", "Edge-Triggered GPE", "Method executed as a result of a general-purpose event"), + AH_PREDEF ("_Exx", "Edge-Triggered GPE, xx=0x00-0xFF", "Method executed as a result of a general-purpose event"), AH_PREDEF ("_EC_", "Embedded Controller", "returns EC offset and query information"), AH_PREDEF ("_EDL", "Eject Device List", "Returns a list of devices that are dependent on a device (docking)"), AH_PREDEF ("_EJD", "Ejection Dependent Device", "Returns the name of dependent (parent) device (docking)"), - AH_PREDEF ("_EJx", "Eject Device", "Begin or cancel a device ejection request (docking)"), + AH_PREDEF ("_EJx", "Eject Device, x=0-9", "Begin or cancel a device ejection request (docking)"), AH_PREDEF ("_END", "Endianness", "Endian orientation, Resource Descriptor field"), AH_PREDEF ("_EVT", "Event", "Event method for GPIO events"), AH_PREDEF ("_FDE", "Floppy Disk Enumerate", "Returns floppy disk configuration information"), @@ -173,7 +173,7 @@ AH_PREDEF ("_INT", "Interrupts", "Interrupt mask bits, Resource Descriptor field"), AH_PREDEF ("_IOR", "I/O Restriction", "Restriction type, Resource Descriptor field"), AH_PREDEF ("_IRC", "Inrush Current", "Presence indicates that a device has a significant inrush current draw"), - AH_PREDEF ("_Lxx", "Level-Triggered GPE", "Control method executed as a result of a general-purpose event"), + AH_PREDEF ("_Lxx", "Level-Triggered GPE, xx=0x00-0xFF", "Control method executed as a result of a general-purpose event"), AH_PREDEF ("_LCK", "Lock Device", "Locks or unlocks a device (docking)"), AH_PREDEF ("_LEN", "Length", "Range length, Resource Descriptor field"), AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"), @@ -250,7 +250,7 @@ AH_PREDEF ("_PTS", "Prepare To Sleep", "Inform the platform of an impending sleep transition"), AH_PREDEF ("_PUR", "Processor Utilization Request", "Returns the number of processors that the platform would like to idle"), AH_PREDEF ("_PXM", "Device Proximity", "Returns a device's proximity domain identifier"), - AH_PREDEF ("_Qxx", "EC Query", "Embedded Controller query and SMBus Alarm control method"), + AH_PREDEF ("_Qxx", "EC Query, xx=0x00-0xFF", "Embedded Controller query and SMBus Alarm control method"), AH_PREDEF ("_RBO", "Register Bit Offset", "Resource Descriptor field"), AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), @@ -305,7 +305,7 @@ AH_PREDEF ("_SUB", "Subsystem ID", "Returns the subsystem ID for a device"), AH_PREDEF ("_SUN", "Slot User Number", "Returns the slot unique ID number"), AH_PREDEF ("_SWS", "System Wake Source", "Returns the source event that caused the system to wake"), - AH_PREDEF ("_T_x", "Emitted by ASL Compiler", "Reserved for use by ASL compilers"), + AH_PREDEF ("_T_x", "Emitted by ASL Compiler, x=0-9, A-Z", "Reserved for use by ASL compilers"), AH_PREDEF ("_TC1", "Thermal Constant 1", "Returns TC1 for the passive cooling formula"), AH_PREDEF ("_TC2", "Thermal Constant 2", "Returns TC2 for the passive cooling formula"), AH_PREDEF ("_TDL", "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"), @@ -339,7 +339,7 @@ AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), - AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), + AH_PREDEF ("_Wxx", "Wake Event, xx=0x00-0xFF", "Method executed as a result of a wake event"), AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), AH_PREDEF ("_WPC", "Wireless Power Calibration", "Calibrate power and notify wireless device"), AH_PREDEF ("_WPP", "Wireless Power Polling", "Get recommended polling interval"), diff -Nru acpica-unix-20181003/source/common/dmswitch.c acpica-unix-20181213/source/common/dmswitch.c --- acpica-unix-20181003/source/common/dmswitch.c 2018-10-03 14:13:48.000000000 +0000 +++ acpica-unix-20181213/source/common/dmswitch.c 2018-12-13 16:16:44.000000000 +0000 @@ -217,6 +217,8 @@ * FUNCTION: AcpiDmIsSwitchBlock * * PARAMETERS: Op - While Object + * Temp - Where the compiler temp name is returned + * (_T_x) * * RETURN: TRUE if While block can be converted to a Switch/Case block * @@ -442,6 +444,10 @@ if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) { CurrentOp = CurrentOp->Common.Next; + if (!CurrentOp) + { + return (FALSE); + } } /* Ignore the Break Op */ diff -Nru acpica-unix-20181003/source/common/dmtbdump3.c acpica-unix-20181213/source/common/dmtbdump3.c --- acpica-unix-20181003/source/common/dmtbdump3.c 2018-10-03 14:13:48.000000000 +0000 +++ acpica-unix-20181213/source/common/dmtbdump3.c 2018-12-13 16:16:44.000000000 +0000 @@ -389,6 +389,51 @@ * DESCRIPTION: Format the contents of a TPM2. * ******************************************************************************/ +static void +AcpiDmDumpTpm2Rev3 ( + ACPI_TABLE_HEADER *Table) +{ + UINT32 Offset = sizeof (ACPI_TABLE_TPM23); + ACPI_TABLE_TPM23 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table); + ACPI_TPM23_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset); + ACPI_STATUS Status; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Optional subtable if start method is ACPI start method */ + + switch (CommonHeader->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Table->Length - Offset, AcpiDmTableInfoTpm23a); + break; + + default: + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpTpm2 + * + * PARAMETERS: Table - A TPM2 table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a TPM2. + * + ******************************************************************************/ void AcpiDmDumpTpm2 ( @@ -401,9 +446,16 @@ ACPI_STATUS Status; + if (Table->Revision == 3) + { + AcpiDmDumpTpm2Rev3(Table); + return; + } + /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2); + if (ACPI_FAILURE (Status)) { return; diff -Nru acpica-unix-20181003/source/common/dmtbinfo3.c acpica-unix-20181213/source/common/dmtbinfo3.c --- acpica-unix-20181003/source/common/dmtbinfo3.c 2018-10-03 14:13:48.000000000 +0000 +++ acpica-unix-20181213/source/common/dmtbinfo3.c 2018-12-13 16:16:44.000000000 +0000 @@ -338,6 +338,26 @@ * ******************************************************************************/ +/* TPM2 revision 3 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_TPM23_OFFSET (ControlAddress), "Control Address", 0}, + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (StartMethod), "Start Method", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Trailer in the case that StartMethod == 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23A_OFFSET (Reserved), "Reserved", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +/* TPM2 revision 4 */ + ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, diff -Nru acpica-unix-20181003/source/compiler/aslcodegen.c acpica-unix-20181213/source/compiler/aslcodegen.c --- acpica-unix-20181003/source/compiler/aslcodegen.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslcodegen.c 2018-12-13 16:16:44.000000000 +0000 @@ -665,12 +665,6 @@ return; } - if ((Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) && - AslGbl_DoExternals == FALSE) - { - return; - } - Op->Asl.FinalAmlLength = 0; switch (Op->Asl.AmlOpcode) diff -Nru acpica-unix-20181003/source/compiler/aslcompile.c acpica-unix-20181213/source/compiler/aslcompile.c --- acpica-unix-20181003/source/compiler/aslcompile.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslcompile.c 2018-12-13 16:16:44.000000000 +0000 @@ -280,23 +280,20 @@ /* Resolve External Declarations */ - if (AslGbl_DoExternals) - { - Event = UtBeginEvent ("Resolve all Externals"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); + Event = UtBeginEvent ("Resolve all Externals"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); - if (AslGbl_DoExternalsInPlace) - { - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, - ExAmlExternalWalkBegin, NULL, NULL); - } - else - { - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, - ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); - } - UtEndEvent (Event); + if (AslGbl_DoExternalsInPlace) + { + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, + ExAmlExternalWalkBegin, NULL, NULL); } + else + { + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); + } + UtEndEvent (Event); /* * Semantic analysis. This can happen only after the @@ -750,7 +747,7 @@ if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } diff -Nru acpica-unix-20181003/source/compiler/aslcompiler.h acpica-unix-20181213/source/compiler/aslcompiler.h --- acpica-unix-20181003/source/compiler/aslcompiler.h 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslcompiler.h 2018-12-13 16:16:44.000000000 +0000 @@ -367,6 +367,10 @@ char *MessageIdString); ACPI_STATUS +AslElevateException ( + char *MessageIdString); + +ACPI_STATUS AslDisableException ( char *MessageIdString); diff -Nru acpica-unix-20181003/source/compiler/aslerror.c acpica-unix-20181213/source/compiler/aslerror.c --- acpica-unix-20181003/source/compiler/aslerror.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslerror.c 2018-12-13 16:16:44.000000000 +0000 @@ -93,6 +93,11 @@ FILE *OutputFile, ASL_ERROR_MSG *Enode); +static UINT8 +GetModifiedLevel ( + UINT8 Level, + UINT16 MessageId); + /******************************************************************************* * @@ -860,11 +865,12 @@ ASL_ERROR_MSG *SubError) { ASL_ERROR_MSG *Enode = NULL; + UINT8 ModifiedLevel = GetModifiedLevel (Level, MessageId); - AslInitEnode (&Enode, Level, MessageId, LineNumber, LogicalLineNumber, - LogicalByteOffset, Column, Filename, Message, SourceLine, - SubError); + AslInitEnode (&Enode, ModifiedLevel, MessageId, LineNumber, + LogicalLineNumber, LogicalByteOffset, Column, Filename, Message, + SourceLine, SubError); /* Add the new node to the error node list */ @@ -877,7 +883,7 @@ AePrintException (ASL_FILE_STDERR, Enode, NULL); } - AslGbl_ExceptionCount[Level]++; + AslGbl_ExceptionCount[ModifiedLevel]++; if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT); @@ -891,6 +897,44 @@ return; } + +/******************************************************************************* + * + * FUNCTION: GetModifiedLevel + * + * PARAMETERS: Level - Seriousness (Warning/error, etc.) + * MessageId - Index into global message buffer + * + * RETURN: UINT8 - modified level + * + * DESCRIPTION: Get the modified level of exception codes that are reported as + * errors from the -ww option. + * + ******************************************************************************/ + +static UINT8 +GetModifiedLevel ( + UINT8 Level, + UINT16 MessageId) +{ + UINT16 i; + UINT16 ExceptionCode; + + + ExceptionCode = AeBuildFullExceptionCode (Level, MessageId); + + for (i = 0; i < AslGbl_ElevatedMessagesIndex; i++) + { + if (ExceptionCode == AslGbl_ElevatedMessages[i]) + { + return (ASL_ERROR); + } + } + + return (Level); +} + + /******************************************************************************* * * FUNCTION: AslIsExceptionIgnored @@ -989,7 +1033,7 @@ if (AslGbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES) { - printf ("Too many messages have been registered as expected (max %u)\n", + printf ("Too many messages have been registered as expected (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } @@ -1036,7 +1080,7 @@ if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) { - printf ("Too many messages have been disabled (max %u)\n", + printf ("Too many messages have been disabled (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } @@ -1049,6 +1093,51 @@ /******************************************************************************* * + * FUNCTION: AslElevateException + * + * PARAMETERS: MessageIdString - ID of excepted exception during compile + * + * RETURN: Status + * + * DESCRIPTION: Enter a message ID into the global elevated exceptions table. + * These messages will be considered as compilation errors. + * + ******************************************************************************/ + +ACPI_STATUS +AslElevateException ( + char *MessageIdString) +{ + UINT32 MessageId; + + + /* Convert argument to an integer and validate it */ + + MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); + + if (MessageId > 6999) + { + printf ("\"%s\" is not a valid warning/remark/erro ID\n", + MessageIdString); + return (AE_BAD_PARAMETER); + } + + /* Insert value into the global expected message array */ + + if (AslGbl_ElevatedMessagesIndex >= ASL_MAX_ELEVATED_MESSAGES) + { + printf ("Too many messages have been registered as elevated (max %d)\n", + ASL_MAX_DISABLED_MESSAGES); + return (AE_LIMIT); + } + + AslGbl_ElevatedMessages[AslGbl_ExpectedMessagesIndex] = MessageId; + AslGbl_ElevatedMessagesIndex++; + return (AE_OK); +} + +/******************************************************************************* + * * FUNCTION: AslIsExceptionDisabled * * PARAMETERS: Level - Seriousness (Warning/error, etc.) diff -Nru acpica-unix-20181003/source/compiler/aslglobal.h acpica-unix-20181213/source/compiler/aslglobal.h --- acpica-unix-20181003/source/compiler/aslglobal.h 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslglobal.h 2018-12-13 16:16:44.000000000 +0000 @@ -147,6 +147,7 @@ #define ASL_STRING_BUFFER_SIZE (1024 * 32) /* 32k */ #define ASL_MAX_DISABLED_MESSAGES 32 #define ASL_MAX_EXPECTED_MESSAGES 32 +#define ASL_MAX_ELEVATED_MESSAGES 32 #define HEX_TABLE_LINE_SIZE 8 #define HEX_LISTING_LINE_SIZE 8 @@ -211,7 +212,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_PruneParseTree, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoTypechecking, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_EnableReferenceTypechecking, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternals, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternalsInPlace, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoAslConversion, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_OptimizeTrivialParseNodes, TRUE); @@ -286,6 +286,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_CurrentLine, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_DisabledMessagesIndex, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ExpectedMessagesIndex, 0); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ElevatedMessagesIndex, 0); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (AslGbl_HexBytesWereWritten, FALSE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_NumNamespaceObjects, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ReservedMethods, 0); @@ -327,6 +328,7 @@ ASL_EXTERN char AslGbl_StringBuffer2[ASL_STRING_BUFFER_SIZE]; ASL_EXTERN UINT32 AslGbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES]; ASL_EXTERN ASL_EXPECTED_MESSAGE AslGbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES]; +ASL_EXTERN UINT32 AslGbl_ElevatedMessages[ASL_MAX_ELEVATED_MESSAGES]; #endif /* __ASLGLOBAL_H */ diff -Nru acpica-unix-20181003/source/compiler/aslhelp.c acpica-unix-20181213/source/compiler/aslhelp.c --- acpica-unix-20181003/source/compiler/aslhelp.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslhelp.c 2018-12-13 16:16:44.000000000 +0000 @@ -101,6 +101,7 @@ ACPI_OPTION ("-vx ", "Expect a specific warning, remark, or error"); ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); + ACPI_OPTION ("-ww ", "Report specific warning or remark as error"); printf ("\nAML Bytecode Generation (*.aml):\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); diff -Nru acpica-unix-20181003/source/compiler/asllength.c acpica-unix-20181213/source/compiler/asllength.c --- acpica-unix-20181003/source/compiler/asllength.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/asllength.c 2018-12-13 16:16:44.000000000 +0000 @@ -411,10 +411,7 @@ case PARSEOP_EXTERNAL: - if (AslGbl_DoExternals == TRUE) - { - CgGenerateAmlOpcodeLength (Op); - } + CgGenerateAmlOpcodeLength (Op); break; default: diff -Nru acpica-unix-20181003/source/compiler/aslload.c acpica-unix-20181213/source/compiler/aslload.c --- acpica-unix-20181003/source/compiler/aslload.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslload.c 2018-12-13 16:16:44.000000000 +0000 @@ -309,10 +309,8 @@ { Status = AcpiNsLookup (WalkState->ScopeInfo, InitializerOp->Asl.ExternalName, - ACPI_TYPE_LOCAL_RESOURCE_FIELD, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + ACPI_TYPE_LOCAL_RESOURCE_FIELD, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) { return (Status); @@ -579,8 +577,7 @@ * handle this case. Perhaps someday this case can go away. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, - WalkState, &(Node)); + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -588,23 +585,26 @@ /* The name was not found, go ahead and create it */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_LOCAL_SCOPE, - ACPI_IMODE_LOAD_PASS1, Flags, - WalkState, &(Node)); + ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1, + Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* - * However, this is an error -- primarily because the MS - * interpreter can't handle a forward reference from the - * Scope() operator. - */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); - AslError (ASL_ERROR, ASL_MSG_SCOPE_FWD_REF, Op, - Op->Asl.ExternalName); + /* However, this is an error -- operand to Scope must exist */ + + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + goto FinishNode; } @@ -716,7 +716,6 @@ break; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n", Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); @@ -725,6 +724,18 @@ Flags |= ACPI_NS_ERROR_IF_FOUND; /* + * For opcodes that enter new names into the namespace, + * all prefix NameSegs must exist. + */ + WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (((WalkState->OpInfo->Flags & AML_NAMED) || + (WalkState->OpInfo->Flags & AML_CREATE)) && + (Op->Asl.AmlOpcode != AML_EXTERNAL_OP)) + { + Flags |= ACPI_NS_PREFIX_MUST_EXIST; + } + + /* * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the @@ -807,8 +818,20 @@ return_ACPI_STATUS (AE_OK); } } + else if (AE_NOT_FOUND) + { + /* + * One or more prefix NameSegs of the NamePath do not exist + * (all of them must exist). Attempt to continue compilation + * by setting the current scope to the root. + */ + Node = AcpiGbl_RootNode; + Status = AE_OK; + } else { + /* Flag all other errors as coming from the ACPICA core */ + AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); return_ACPI_STATUS (Status); @@ -935,10 +958,10 @@ if (Op->Asl.ParseOpcode == PARSEOP_ALIAS) { - /* Complete the alias node by getting and saving the target node */ - - /* First child is the alias target */ - + /* + * Complete the alias node by getting and saving the target node. + * First child is the alias target + */ Arg = Op->Asl.Child; /* Get the target pathname */ @@ -962,18 +985,34 @@ { if (Status == AE_NOT_FOUND) { - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + /* Standalone NameSeg vs. NamePath */ + if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Arg->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Arg->Asl.ExternalName); + } + +#if 0 +/* + * NOTE: Removed 10/2018 to enhance compiler error reporting. No + * regressions seen. + */ /* * The name was not found, go ahead and create it. * This prevents more errors later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_ANY, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, - WalkState, &(Node)); - return (AE_OK); + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH, WalkState, &Node); +#endif + return (Status); +/* Removed: return (AE_OK)*/ } AslCoreSubsystemError (Op, Status, diff -Nru acpica-unix-20181003/source/compiler/aslmain.c acpica-unix-20181213/source/compiler/aslmain.c --- acpica-unix-20181003/source/compiler/aslmain.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslmain.c 2018-12-13 16:16:44.000000000 +0000 @@ -221,7 +221,7 @@ default: - printf (ASL_PREFIX "Unknown interrupt signal (%u)\n", Sig); + printf (ASL_PREFIX "Unknown interrupt signal (%d)\n", Sig); break; } diff -Nru acpica-unix-20181003/source/compiler/aslmessages.c acpica-unix-20181213/source/compiler/aslmessages.c --- acpica-unix-20181003/source/compiler/aslmessages.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslmessages.c 2018-12-13 16:16:44.000000000 +0000 @@ -177,7 +177,7 @@ /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", /* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", -/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", +/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", /* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", /* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", @@ -251,7 +251,9 @@ /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", -/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second" +/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", +/* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" }; /* Table compiler */ diff -Nru acpica-unix-20181003/source/compiler/aslmessages.h acpica-unix-20181213/source/compiler/aslmessages.h --- acpica-unix-20181003/source/compiler/aslmessages.h 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslmessages.h 2018-12-13 16:16:44.000000000 +0000 @@ -254,6 +254,8 @@ ASL_MSG_UNLOAD, ASL_MSG_OFFSET, ASL_MSG_LONG_SLEEP, + ASL_MSG_PREFIX_NOT_EXIST, + ASL_MSG_NAMEPATH_NOT_EXIST, /* These messages are used by the Data Table compiler only */ diff -Nru acpica-unix-20181003/source/compiler/aslopcodes.c acpica-unix-20181213/source/compiler/aslopcodes.c --- acpica-unix-20181003/source/compiler/aslopcodes.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslopcodes.c 2018-12-13 16:16:44.000000000 +0000 @@ -819,15 +819,6 @@ AslGbl_HasIncludeFiles = TRUE; break; - case PARSEOP_EXTERNAL: - - if (AslGbl_DoExternals == FALSE) - { - Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - } - break; - case PARSEOP_TIMER: if (AcpiGbl_IntegerBitWidth == 32) diff -Nru acpica-unix-20181003/source/compiler/asloptions.c acpica-unix-20181213/source/compiler/asloptions.c --- acpica-unix-20181003/source/compiler/asloptions.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/asloptions.c 2018-12-13 16:16:44.000000000 +0000 @@ -874,6 +874,23 @@ AslGbl_WarningsAsErrors = TRUE; break; + case 'w': + + /* Get the required argument */ + + if (AcpiGetoptArgument (argc, argv)) + { + return (-1); + } + + Status = AslElevateException (AcpiGbl_Optarg); + if (ACPI_FAILURE (Status)) + { + return (-1); + } + break; + + default: printf ("Unknown option: -w%s\n", AcpiGbl_Optarg); diff -Nru acpica-unix-20181003/source/compiler/aslpredef.c acpica-unix-20181213/source/compiler/aslpredef.c --- acpica-unix-20181003/source/compiler/aslpredef.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslpredef.c 2018-12-13 16:16:44.000000000 +0000 @@ -114,7 +114,7 @@ if (MethodInfo->NumArguments != 0) { - sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); diff -Nru acpica-unix-20181003/source/compiler/asltransform.c acpica-unix-20181213/source/compiler/asltransform.c --- acpica-unix-20181003/source/compiler/asltransform.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/asltransform.c 2018-12-13 16:16:44.000000000 +0000 @@ -352,11 +352,7 @@ case PARSEOP_EXTERNAL: - if (AslGbl_DoExternals == TRUE) - { - ExDoExternal (Op); - } - + ExDoExternal (Op); break; case PARSEOP___METHOD__: diff -Nru acpica-unix-20181003/source/compiler/aslxref.c acpica-unix-20181213/source/compiler/aslxref.c --- acpica-unix-20181003/source/compiler/aslxref.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/aslxref.c 2018-12-13 16:16:45.000000000 +0000 @@ -610,11 +610,34 @@ } else { - /* Check for a fully qualified path */ + /* The NamePath contains multiple NameSegs */ - if (Path[0] == AML_ROOT_PREFIX) + if ((OpInfo->Flags & AML_CREATE) || + (OpInfo->ObjectType == ACPI_TYPE_LOCAL_ALIAS)) { - /* Gave full path, the object does not exist */ + /* + * The new name is the last parameter. For the + * CreateXXXXField and Alias operators + */ + NextOp = Op->Asl.Child; + while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) + { + NextOp = NextOp->Asl.Next; + } + + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, NextOp, + NextOp->Asl.ExternalName); + } + else if (OpInfo->Flags & AML_NAMED) + { + /* The new name is the first parameter */ + + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + else if (Path[0] == AML_ROOT_PREFIX) + { + /* Full namepath from root, the object does not exist */ AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, Op->Asl.ExternalName); @@ -622,11 +645,20 @@ else { /* - * We can't tell whether it doesn't exist or just - * can't be reached. + * Generic "not found" error. Cannot determine whether it + * doesn't exist or just can't be reached. However, we + * can differentiate between a NameSeg vs. NamePath. */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } } } diff -Nru acpica-unix-20181003/source/compiler/dtio.c acpica-unix-20181213/source/compiler/dtio.c --- acpica-unix-20181003/source/compiler/dtio.c 2018-10-03 14:13:49.000000000 +0000 +++ acpica-unix-20181213/source/compiler/dtio.c 2018-12-13 16:16:45.000000000 +0000 @@ -128,7 +128,7 @@ /* Skip lines that start with a space */ - if (!strcmp (String, " ")) + if (*String == 0 || !strcmp (String, " ")) { ReturnString = UtLocalCacheCalloc (1); return (ReturnString); @@ -150,7 +150,7 @@ while (End >= Start) { - if (*End == '\r' || *End == '\n') + if (*End == '\n') { End--; continue; @@ -414,6 +414,7 @@ UINT32 CurrentLineOffset; UINT32 i; int c; + int c1; memset (AslGbl_CurrentLineBuffer, 0, AslGbl_LineBufferSize); @@ -461,6 +462,29 @@ c = '\n'; State = DT_NORMAL_TEXT; } + else if (c == '\r') + { + c1 = getc (Handle); + if (c1 == '\n') + { + /* + * Skip the carriage return as if it didn't exist. This is + * onlt meant for input files in DOS format in unix. fopen in + * unix may not support "text mode" and leaves CRLF intact. + */ + c = '\n'; + } + else + { + /* This was not a CRLF. Only a CR */ + + ungetc(c1, Handle); + + DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, + "Carriage return without linefeed detected"); + return (ASL_EOF); + } + } switch (State) { diff -Nru acpica-unix-20181003/source/compiler/dttable2.c acpica-unix-20181213/source/compiler/dttable2.c --- acpica-unix-20181003/source/compiler/dttable2.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/compiler/dttable2.c 2018-12-13 16:16:45.000000000 +0000 @@ -1770,6 +1770,62 @@ /****************************************************************************** * + * FUNCTION: DtCompileTpm2Rev3 + * + * PARAMETERS: PFieldList - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile TPM2 revision 3 + * + *****************************************************************************/ +static ACPI_STATUS +DtCompileTpm2Rev3 ( + void **List) +{ + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_SUBTABLE *Subtable; + ACPI_TABLE_TPM23 *Tpm23Header; + DT_SUBTABLE *ParentTable; + ACPI_STATUS Status = AE_OK; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23, + &Subtable); + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + Tpm23Header = ACPI_CAST_PTR (ACPI_TABLE_TPM23, ParentTable->Buffer); + + /* Subtable type depends on the StartMethod */ + + switch (Tpm23Header->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + /* Subtable specific to to ARM_SMC */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23a, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + break; + + default: + break; + } + + return (Status); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileTpm2 * * PARAMETERS: PFieldList - Current field list pointer @@ -1789,7 +1845,17 @@ ACPI_TABLE_TPM2 *Tpm2Header; DT_SUBTABLE *ParentTable; ACPI_STATUS Status = AE_OK; + ACPI_TABLE_HEADER *Header; + + + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + if (Header->Revision == 3) + { + return (DtCompileTpm2Rev3 (List)); + } /* Compile the main table */ diff -Nru acpica-unix-20181003/source/compiler/prscan.c acpica-unix-20181213/source/compiler/prscan.c --- acpica-unix-20181003/source/compiler/prscan.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/compiler/prscan.c 2018-12-13 16:16:45.000000000 +0000 @@ -1151,7 +1151,6 @@ AslGbl_DirectiveInfo[Info->Directive].Name, Info->Argument, AslGbl_IgnoringThisCodeBlock ? "TRUE" : "FALSE"); - ACPI_FREE (Info); return (AE_OK); } diff -Nru acpica-unix-20181003/source/components/debugger/dbxface.c acpica-unix-20181213/source/components/debugger/dbxface.c --- acpica-unix-20181003/source/components/debugger/dbxface.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/debugger/dbxface.c 2018-12-13 16:16:45.000000000 +0000 @@ -66,6 +66,12 @@ ACPI_WALK_STATE *WalkState); #endif +#ifdef ACPI_DISASSEMBLER +static ACPI_PARSE_OBJECT * +AcpiDbGetDisplayOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op); +#endif /******************************************************************************* * @@ -165,6 +171,74 @@ } +#ifdef ACPI_DISASSEMBLER +/******************************************************************************* + * + * FUNCTION: AcpiDbGetDisplayOp + * + * PARAMETERS: WalkState - Current walk + * Op - Current executing op (from aml interpreter) + * + * RETURN: Opcode to display + * + * DESCRIPTION: Find the opcode to display during single stepping + * + ******************************************************************************/ + +static ACPI_PARSE_OBJECT * +AcpiDbGetDisplayOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *DisplayOp; + ACPI_PARSE_OBJECT *ParentOp; + + DisplayOp = Op; + ParentOp = Op->Common.Parent; + if (ParentOp) + { + if ((WalkState->ControlState) && + (WalkState->ControlState->Common.State == + ACPI_CONTROL_PREDICATE_EXECUTING)) + { + /* + * We are executing the predicate of an IF or WHILE statement + * Search upwards for the containing IF or WHILE so that the + * entire predicate can be displayed. + */ + while (ParentOp) + { + if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || + (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) + { + DisplayOp = ParentOp; + break; + } + ParentOp = ParentOp->Common.Parent; + } + } + else + { + while (ParentOp) + { + if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || + (ParentOp->Common.AmlOpcode == AML_ELSE_OP) || + (ParentOp->Common.AmlOpcode == AML_SCOPE_OP) || + (ParentOp->Common.AmlOpcode == AML_METHOD_OP) || + (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) + { + break; + } + DisplayOp = ParentOp; + ParentOp = ParentOp->Common.Parent; + } + } + } + return DisplayOp; +} +#endif + + /******************************************************************************* * * FUNCTION: AcpiDbSingleStep @@ -188,8 +262,6 @@ ACPI_PARSE_OBJECT *Next; ACPI_STATUS Status = AE_OK; UINT32 OriginalDebugLevel; - ACPI_PARSE_OBJECT *DisplayOp; - ACPI_PARSE_OBJECT *ParentOp; UINT32 AmlOffset; @@ -285,53 +357,11 @@ Next = Op->Common.Next; Op->Common.Next = NULL; - - DisplayOp = Op; - ParentOp = Op->Common.Parent; - if (ParentOp) - { - if ((WalkState->ControlState) && - (WalkState->ControlState->Common.State == - ACPI_CONTROL_PREDICATE_EXECUTING)) - { - /* - * We are executing the predicate of an IF or WHILE statement - * Search upwards for the containing IF or WHILE so that the - * entire predicate can be displayed. - */ - while (ParentOp) - { - if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || - (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) - { - DisplayOp = ParentOp; - break; - } - ParentOp = ParentOp->Common.Parent; - } - } - else - { - while (ParentOp) - { - if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || - (ParentOp->Common.AmlOpcode == AML_ELSE_OP) || - (ParentOp->Common.AmlOpcode == AML_SCOPE_OP) || - (ParentOp->Common.AmlOpcode == AML_METHOD_OP) || - (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) - { - break; - } - DisplayOp = ParentOp; - ParentOp = ParentOp->Common.Parent; - } - } - } - /* Now we can disassemble and display it */ #ifdef ACPI_DISASSEMBLER - AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); + AcpiDmDisassemble (WalkState, AcpiDbGetDisplayOp (WalkState, Op), + ACPI_UINT32_MAX); #else /* * The AML Disassembler is not configured - at least we can diff -Nru acpica-unix-20181003/source/components/dispatcher/dsmethod.c acpica-unix-20181213/source/components/dispatcher/dsmethod.c --- acpica-unix-20181003/source/components/dispatcher/dsmethod.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dsmethod.c 2018-12-13 16:16:45.000000000 +0000 @@ -612,6 +612,8 @@ goto Cleanup; } + NextWalkState->MethodNestingDepth = ThisWalkState->MethodNestingDepth + 1; + /* * Delete the operands on the previous walkstate operand stack * (they were copied to new objects) @@ -630,6 +632,16 @@ "**** Begin nested execution of [%4.4s] **** WalkState=%p\n", MethodNode->Name.Ascii, NextWalkState)); + ThisWalkState->MethodPathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE); + ThisWalkState->MethodIsNested = TRUE; + + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, + "%-26s: %*s%s\n", " Nested method call", + NextWalkState->MethodNestingDepth * 3, " ", + &ThisWalkState->MethodPathname[1])); + /* Invoke an internal method if necessary */ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY) diff -Nru acpica-unix-20181003/source/components/dispatcher/dsobject.c acpica-unix-20181213/source/components/dispatcher/dsobject.c --- acpica-unix-20181003/source/components/dispatcher/dsobject.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dsobject.c 2018-12-13 16:16:45.000000000 +0000 @@ -53,7 +53,6 @@ ACPI_MODULE_NAME ("dsobject") -#ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* * * FUNCTION: AcpiDsBuildInternalObject @@ -352,7 +351,6 @@ return_ACPI_STATUS (Status); } -#endif /* ACPI_NO_METHOD_EXECUTION */ /******************************************************************************* @@ -463,9 +461,7 @@ /* Truncate value if we are executing from a 32-bit ACPI table */ -#ifndef ACPI_NO_METHOD_EXECUTION (void) AcpiExTruncateFor32bitTable (ObjDesc); -#endif break; case AML_REVISION_OP: @@ -486,7 +482,6 @@ ObjDesc->Integer.Value = Op->Common.Value.Integer; -#ifndef ACPI_NO_METHOD_EXECUTION if (AcpiExTruncateFor32bitTable (ObjDesc)) { /* Warn if we found a 64-bit constant in a 32-bit table */ @@ -496,7 +491,6 @@ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), (UINT32) ObjDesc->Integer.Value)); } -#endif break; default: @@ -534,12 +528,10 @@ ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP; ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL; -#ifndef ACPI_NO_METHOD_EXECUTION Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL, ObjDesc->Reference.Value, WalkState, ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc->Reference.Object)); -#endif break; case AML_TYPE_METHOD_ARGUMENT: @@ -549,12 +541,10 @@ ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP; ObjDesc->Reference.Class = ACPI_REFCLASS_ARG; -#ifndef ACPI_NO_METHOD_EXECUTION Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG, ObjDesc->Reference.Value, WalkState, ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc->Reference.Object)); -#endif break; default: /* Object name or Debug object */ diff -Nru acpica-unix-20181003/source/components/dispatcher/dsopcode.c acpica-unix-20181213/source/components/dispatcher/dsopcode.c --- acpica-unix-20181003/source/components/dispatcher/dsopcode.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dsopcode.c 2018-12-13 16:16:45.000000000 +0000 @@ -478,6 +478,9 @@ ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), ObjDesc->Region.Length)); + Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId, + ObjDesc->Region.Address, ObjDesc->Region.Length, Node); + /* Now the address and length are valid for this opregion */ ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID; diff -Nru acpica-unix-20181003/source/components/dispatcher/dspkginit.c acpica-unix-20181213/source/components/dispatcher/dspkginit.c --- acpica-unix-20181003/source/components/dispatcher/dspkginit.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dspkginit.c 2018-12-13 16:16:45.000000000 +0000 @@ -200,6 +200,32 @@ { if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) { + if (!Arg->Common.Node) + { + /* + * This is the case where an expression has returned a value. + * The use of expressions (TermArgs) within individual + * package elements is not supported by the AML interpreter, + * even though the ASL grammar supports it. Example: + * + * Name (INT1, 0x1234) + * + * Name (PKG3, Package () { + * Add (INT1, 0xAAAA0000) + * }) + * + * 1) No known AML interpreter supports this type of construct + * 2) This fixes a fault if the construct is encountered + */ + ACPI_EXCEPTION ((AE_INFO, AE_SUPPORT, + "Expressions within package elements are not supported")); + + /* Cleanup the return object, it is not needed */ + + AcpiUtRemoveReference (WalkState->Results->Results.ObjDesc[0]); + return_ACPI_STATUS (AE_SUPPORT); + } + if (Arg->Common.Node->Type == ACPI_TYPE_METHOD) { /* diff -Nru acpica-unix-20181003/source/components/dispatcher/dsutils.c acpica-unix-20181213/source/components/dispatcher/dsutils.c --- acpica-unix-20181003/source/components/dispatcher/dsutils.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dsutils.c 2018-12-13 16:16:45.000000000 +0000 @@ -101,7 +101,6 @@ } -#ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* * * FUNCTION: AcpiDsDoImplicitReturn @@ -475,7 +474,6 @@ WalkState->NumOperands = 0; return_VOID; } -#endif /******************************************************************************* diff -Nru acpica-unix-20181003/source/components/dispatcher/dswload2.c acpica-unix-20181213/source/components/dispatcher/dswload2.c --- acpica-unix-20181003/source/components/dispatcher/dswload2.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dswload2.c 2018-12-13 16:16:45.000000000 +0000 @@ -340,6 +340,15 @@ } #endif + /* + * For name creation opcodes, the full namepath prefix must + * exist, except for the final (new) nameseg. + */ + if (WalkState->OpInfo->Flags & AML_NAMED) + { + Flags |= ACPI_NS_PREFIX_MUST_EXIST; + } + /* Add new entry or lookup existing entry */ Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, @@ -412,10 +421,8 @@ ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *Arg; ACPI_NAMESPACE_NODE *NewNode; -#ifndef ACPI_NO_METHOD_EXECUTION UINT32 i; UINT8 RegionSpace; -#endif ACPI_FUNCTION_TRACE (DsLoad2EndOp); @@ -505,7 +512,6 @@ switch (WalkState->OpInfo->Type) { -#ifndef ACPI_NO_METHOD_EXECUTION case AML_TYPE_CREATE_FIELD: /* @@ -601,13 +607,11 @@ } break; -#endif /* ACPI_NO_METHOD_EXECUTION */ case AML_TYPE_NAMED_COMPLEX: switch (Op->Common.AmlOpcode) { -#ifndef ACPI_NO_METHOD_EXECUTION case AML_REGION_OP: case AML_DATA_REGION_OP: @@ -692,7 +696,6 @@ } break; -#endif /* ACPI_NO_METHOD_EXECUTION */ default: diff -Nru acpica-unix-20181003/source/components/dispatcher/dswload.c acpica-unix-20181213/source/components/dispatcher/dswload.c --- acpica-unix-20181003/source/components/dispatcher/dswload.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dswload.c 2018-12-13 16:16:45.000000000 +0000 @@ -113,12 +113,10 @@ /* Execution pass */ -#ifndef ACPI_NO_METHOD_EXECUTION WalkState->ParseFlags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE; WalkState->DescendingCallback = AcpiDsExecBeginOp; WalkState->AscendingCallback = AcpiDsExecEndOp; -#endif break; default: @@ -409,7 +407,7 @@ /* Initialize the op */ -#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)) +#ifdef ACPI_CONSTANT_EVAL_ONLY Op->Named.Path = Path; #endif @@ -472,7 +470,6 @@ ObjectType = WalkState->OpInfo->ObjectType; -#ifndef ACPI_NO_METHOD_EXECUTION if (WalkState->OpInfo->Flags & AML_FIELD) { /* @@ -518,7 +515,6 @@ } } } -#endif if (Op->Common.AmlOpcode == AML_NAME_OP) { diff -Nru acpica-unix-20181003/source/components/dispatcher/dswstate.c acpica-unix-20181213/source/components/dispatcher/dswstate.c --- acpica-unix-20181003/source/components/dispatcher/dswstate.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/dispatcher/dswstate.c 2018-12-13 16:16:45.000000000 +0000 @@ -625,7 +625,7 @@ /* Init the method args/local */ -#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) +#ifndef ACPI_CONSTANT_EVAL_ONLY AcpiDsMethodDataInit (WalkState); #endif diff -Nru acpica-unix-20181003/source/components/executer/exconvrt.c acpica-unix-20181213/source/components/executer/exconvrt.c --- acpica-unix-20181003/source/components/executer/exconvrt.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/executer/exconvrt.c 2018-12-13 16:16:45.000000000 +0000 @@ -388,7 +388,7 @@ /* HexLength: 2 ascii hex chars per data byte */ - HexLength = ACPI_MUL_2 (DataWidth); + HexLength = (DataWidth * 2); for (i = 0, j = (HexLength-1); i < HexLength; i++, j--) { /* Get one hex digit, most significant digits first */ @@ -431,7 +431,8 @@ * * RETURN: Status * - * DESCRIPTION: Convert an ACPI Object to a string + * DESCRIPTION: Convert an ACPI Object to a string. Supports both implicit + * and explicit conversions and related rules. * ******************************************************************************/ @@ -466,9 +467,11 @@ switch (Type) { case ACPI_EXPLICIT_CONVERT_DECIMAL: - - /* Make room for maximum decimal number */ - + /* + * From ToDecimalString, integer source. + * + * Make room for the maximum decimal number size + */ StringLength = ACPI_MAX_DECIMAL_DIGITS; Base = 10; break; @@ -512,8 +515,10 @@ { case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by ToDecimalString */ /* - * From ACPI: "If Data is a buffer, it is converted to a string of - * decimal values separated by commas." + * Explicit conversion from the ToDecimalString ASL operator. + * + * From ACPI: "If the input is a buffer, it is converted to a + * a string of decimal values separated by commas." */ Base = 10; @@ -540,20 +545,29 @@ case ACPI_IMPLICIT_CONVERT_HEX: /* + * Implicit buffer-to-string conversion + * * From the ACPI spec: - *"The entire contents of the buffer are converted to a string of + * "The entire contents of the buffer are converted to a string of * two-character hexadecimal numbers, each separated by a space." + * + * Each hex number is prefixed with 0x (11/2018) */ Separator = ' '; - StringLength = (ObjDesc->Buffer.Length * 3); + StringLength = (ObjDesc->Buffer.Length * 5); break; - case ACPI_EXPLICIT_CONVERT_HEX: /* Used by ToHexString */ + case ACPI_EXPLICIT_CONVERT_HEX: /* + * Explicit conversion from the ToHexString ASL operator. + * * From ACPI: "If Data is a buffer, it is converted to a string of * hexadecimal values separated by commas." + * + * Each hex number is prefixed with 0x (11/2018) */ - StringLength = (ObjDesc->Buffer.Length * 3); + Separator = ','; + StringLength = (ObjDesc->Buffer.Length * 5); break; default: @@ -584,9 +598,20 @@ */ for (i = 0; i < ObjDesc->Buffer.Length; i++) { + if (Base == 16) + { + /* Emit 0x prefix for explict/implicit hex conversion */ + + *NewBuf++ = '0'; + *NewBuf++ = 'x'; + } + NewBuf += AcpiExConvertToAscii ( (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1); - *NewBuf++ = Separator; /* each separated by a comma or space */ + + /* Each digit is separated by either a comma or space */ + + *NewBuf++ = Separator; } /* diff -Nru acpica-unix-20181003/source/components/executer/excreate.c acpica-unix-20181213/source/components/executer/excreate.c --- acpica-unix-20181003/source/components/executer/excreate.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/executer/excreate.c 2018-12-13 16:16:45.000000000 +0000 @@ -52,7 +52,6 @@ ACPI_MODULE_NAME ("excreate") -#ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* * * FUNCTION: AcpiExCreateAlias @@ -464,7 +463,6 @@ AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } -#endif /******************************************************************************* diff -Nru acpica-unix-20181003/source/components/executer/exoparg2.c acpica-unix-20181213/source/components/executer/exoparg2.c --- acpica-unix-20181003/source/components/executer/exoparg2.c 2018-10-03 14:13:50.000000000 +0000 +++ acpica-unix-20181213/source/components/executer/exoparg2.c 2018-12-13 16:16:45.000000000 +0000 @@ -352,9 +352,9 @@ * NOTE: A length of zero is ok, and will create a zero-length, null * terminated string. */ - while ((Length < Operand[0]->Buffer.Length) && - (Length < Operand[1]->Integer.Value) && - (Operand[0]->Buffer.Pointer[Length])) + while ((Length < Operand[0]->Buffer.Length) && /* Length of input buffer */ + (Length < Operand[1]->Integer.Value) && /* Length operand */ + (Operand[0]->Buffer.Pointer[Length])) /* Null terminator */ { Length++; } diff -Nru acpica-unix-20181003/source/components/executer/exserial.c acpica-unix-20181213/source/components/executer/exserial.c --- acpica-unix-20181003/source/components/executer/exserial.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/executer/exserial.c 2018-12-13 16:16:46.000000000 +0000 @@ -337,14 +337,12 @@ case ACPI_ADR_SPACE_SMBUS: BufferLength = ACPI_SMBUS_BUFFER_SIZE; - DataLength = ACPI_SMBUS_DATA_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); break; case ACPI_ADR_SPACE_IPMI: BufferLength = ACPI_IPMI_BUFFER_SIZE; - DataLength = ACPI_IPMI_DATA_SIZE; Function = ACPI_WRITE; break; @@ -363,7 +361,6 @@ /* Add header length to get the full size of the buffer */ BufferLength += ACPI_SERIAL_HEADER_SIZE; - DataLength = SourceDesc->Buffer.Pointer[1]; Function = ACPI_WRITE | (AccessorType << 16); break; @@ -371,21 +368,6 @@ return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } -#if 0 -OBSOLETE? - /* Check for possible buffer overflow */ - - if (DataLength > SourceDesc->Buffer.Length) - { - ACPI_ERROR ((AE_INFO, - "Length in buffer header (%u)(%u) is greater than " - "the physical buffer length (%u) and will overflow", - DataLength, BufferLength, SourceDesc->Buffer.Length)); - - return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); - } -#endif - /* Create the transfer/bidirectional/return buffer */ BufferDesc = AcpiUtCreateBufferObject (BufferLength); @@ -397,6 +379,8 @@ /* Copy the input buffer data to the transfer buffer */ Buffer = BufferDesc->Buffer.Pointer; + DataLength = (BufferLength < SourceDesc->Buffer.Length ? + BufferLength : SourceDesc->Buffer.Length); memcpy (Buffer, SourceDesc->Buffer.Pointer, DataLength); /* Lock entire transaction if requested */ diff -Nru acpica-unix-20181003/source/components/executer/exutils.c acpica-unix-20181213/source/components/executer/exutils.c --- acpica-unix-20181003/source/components/executer/exutils.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/executer/exutils.c 2018-12-13 16:16:46.000000000 +0000 @@ -73,7 +73,6 @@ UINT32 Base); -#ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* * * FUNCTION: AcpiExEnterInterpreter @@ -507,4 +506,3 @@ return (TRUE); } -#endif diff -Nru acpica-unix-20181003/source/components/namespace/nsaccess.c acpica-unix-20181213/source/components/namespace/nsaccess.c --- acpica-unix-20181003/source/components/namespace/nsaccess.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/namespace/nsaccess.c 2018-12-13 16:16:46.000000000 +0000 @@ -313,6 +313,7 @@ ACPI_OBJECT_TYPE ThisSearchType; UINT32 SearchParentFlag = ACPI_NS_SEARCH_PARENT; UINT32 LocalFlags; + ACPI_INTERPRETER_MODE LocalInterpreterMode; ACPI_FUNCTION_TRACE (NsLookup); @@ -562,6 +563,7 @@ */ ThisSearchType = ACPI_TYPE_ANY; CurrentNode = ThisNode; + while (NumSegments && CurrentNode) { NumSegments--; @@ -596,6 +598,16 @@ } } + /* Handle opcodes that create a new NameSeg via a full NamePath */ + + LocalInterpreterMode = InterpreterMode; + if ((Flags & ACPI_NS_PREFIX_MUST_EXIST) && (NumSegments > 0)) + { + /* Every element of the path must exist (except for the final NameSeg) */ + + LocalInterpreterMode = ACPI_IMODE_EXECUTE; + } + /* Extract one ACPI name from the front of the pathname */ ACPI_MOVE_32_TO_32 (&SimpleName, Path); @@ -603,11 +615,18 @@ /* Try to find the single (4 character) ACPI name */ Status = AcpiNsSearchAndEnter (SimpleName, WalkState, CurrentNode, - InterpreterMode, ThisSearchType, LocalFlags, &ThisNode); + LocalInterpreterMode, ThisSearchType, LocalFlags, &ThisNode); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) { +#if !defined ACPI_ASL_COMPILER /* Note: iASL reports this error by itself, not needed here */ + if (Flags & ACPI_NS_PREFIX_MUST_EXIST) + { + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR + "Object does not exist: %4.4s\n", &SimpleName); + } +#endif /* Name not found in ACPI namespace */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, diff -Nru acpica-unix-20181003/source/components/namespace/nseval.c acpica-unix-20181213/source/components/namespace/nseval.c --- acpica-unix-20181003/source/components/namespace/nseval.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/namespace/nseval.c 2018-12-13 16:16:46.000000000 +0000 @@ -150,6 +150,12 @@ return_ACPI_STATUS (AE_NO_MEMORY); } + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, + "%-26s: %s (%s)\n", " Enter evaluation", + &Info->FullPathname[1], AcpiUtGetTypeName (Info->Node->Type))); + /* Count the number of arguments being passed in */ Info->ParamCount = 0; @@ -336,6 +342,12 @@ Info->RelativePathname)); Cleanup: + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, + "%-26s: %s\n", " Exit evaluation", + &Info->FullPathname[1])); + /* * Namespace was unlocked by the handling AcpiNs* function, so we * just free the pathname and return diff -Nru acpica-unix-20181003/source/components/namespace/nsload.c acpica-unix-20181213/source/components/namespace/nsload.c --- acpica-unix-20181003/source/components/namespace/nsload.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/namespace/nsload.c 2018-12-13 16:16:46.000000000 +0000 @@ -65,7 +65,6 @@ #endif -#ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* * * FUNCTION: AcpiNsLoadTable @@ -369,4 +368,3 @@ return_ACPI_STATUS (Status); } #endif -#endif diff -Nru acpica-unix-20181003/source/components/namespace/nsparse.c acpica-unix-20181213/source/components/namespace/nsparse.c --- acpica-unix-20181003/source/components/namespace/nsparse.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/namespace/nsparse.c 2018-12-13 16:16:46.000000000 +0000 @@ -153,8 +153,18 @@ goto Cleanup; } + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, + "%-26s: (Definition Block level)\n", "Module-level evaluation")); + Status = AcpiPsExecuteTable (Info); + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, + "%-26s: (Definition Block level)\n", "Module-level complete")); + Cleanup: if (Info) { diff -Nru acpica-unix-20181003/source/components/parser/psloop.c acpica-unix-20181213/source/components/parser/psloop.c --- acpica-unix-20181003/source/components/parser/psloop.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/parser/psloop.c 2018-12-13 16:16:46.000000000 +0000 @@ -190,7 +190,7 @@ * future. Use of this option can cause problems with AML code that * depends upon in-order immediate execution of module-level code. */ - if (AcpiGbl_GroupModuleLevelCode && + if (!AcpiGbl_ExecuteTablesAsMethods && (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0)) { @@ -458,6 +458,7 @@ ACPI_PARSE_OBJECT *Op = NULL; /* current op */ ACPI_PARSE_STATE *ParserState; UINT8 *AmlOpStart = NULL; + UINT8 OpcodeLength; ACPI_FUNCTION_TRACE_PTR (PsParseLoop, WalkState); @@ -471,7 +472,7 @@ ParserState = &WalkState->ParserState; WalkState->ArgTypes = 0; -#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) +#ifndef ACPI_CONSTANT_EVAL_ONLY if (WalkState->WalkType & ACPI_WALK_METHOD_RESTART) { @@ -546,7 +547,7 @@ * status to AE_OK to proceed with the table load. */ if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && - Status == AE_ALREADY_EXISTS) + ((Status == AE_ALREADY_EXISTS) || (Status == AE_NOT_FOUND))) { Status = AE_OK; } @@ -578,9 +579,20 @@ * the scope op because the parse failure indicates that * the device may not exist. */ - ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s", - AcpiPsGetOpcodeName (WalkState->Opcode))); - WalkState->ParserState.Aml = WalkState->Aml + 1; + ACPI_INFO (("Skipping parse of AML opcode: %s (0x%4.4X)", + AcpiPsGetOpcodeName (WalkState->Opcode), WalkState->Opcode)); + + /* + * Determine the opcode length before skipping the opcode. + * An opcode can be 1 byte or 2 bytes in length. + */ + OpcodeLength = 1; + if ((WalkState->Opcode & 0xFF00) == AML_EXTENDED_OPCODE) + { + OpcodeLength = 2; + } + WalkState->ParserState.Aml = WalkState->Aml + OpcodeLength; + WalkState->ParserState.Aml = AcpiPsGetNextPackageEnd(&WalkState->ParserState); WalkState->Aml = WalkState->ParserState.Aml; diff -Nru acpica-unix-20181003/source/components/parser/psobject.c acpica-unix-20181213/source/components/parser/psobject.c --- acpica-unix-20181003/source/components/parser/psobject.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/parser/psobject.c 2018-12-13 16:16:46.000000000 +0000 @@ -665,7 +665,7 @@ * because there could be correct AML beyond the parts that caused * the runtime error. */ - ACPI_ERROR ((AE_INFO, "Ignore error and continue table load")); + ACPI_INFO (("Ignoring error and continuing table load")); return_ACPI_STATUS (AE_OK); } return_ACPI_STATUS (Status); diff -Nru acpica-unix-20181003/source/components/parser/psparse.c acpica-unix-20181213/source/components/parser/psparse.c --- acpica-unix-20181003/source/components/parser/psparse.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/parser/psparse.c 2018-12-13 16:16:46.000000000 +0000 @@ -529,6 +529,18 @@ "Completed one call to walk loop, %s State=%p\n", AcpiFormatException (Status), WalkState)); + if (WalkState->MethodPathname && WalkState->MethodIsNested) + { + /* Optional object evaluation log */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, "%-26s: %*s%s\n", + " Exit nested method", + (WalkState->MethodNestingDepth + 1) * 3, " ", + &WalkState->MethodPathname[1])); + + ACPI_FREE (WalkState->MethodPathname); + WalkState->MethodIsNested = FALSE; + } if (Status == AE_CTRL_TRANSFER) { /* diff -Nru acpica-unix-20181003/source/components/parser/psxface.c acpica-unix-20181213/source/components/parser/psxface.c --- acpica-unix-20181003/source/components/parser/psxface.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/parser/psxface.c 2018-12-13 16:16:46.000000000 +0000 @@ -199,6 +199,9 @@ goto Cleanup; } + WalkState->MethodPathname = Info->FullPathname; + WalkState->MethodIsNested = FALSE; + if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL; @@ -329,6 +332,9 @@ goto Cleanup; } + WalkState->MethodPathname = Info->FullPathname; + WalkState->MethodIsNested = FALSE; + if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL; diff -Nru acpica-unix-20181003/source/components/tables/tbxfload.c acpica-unix-20181213/source/components/tables/tbxfload.c --- acpica-unix-20181003/source/components/tables/tbxfload.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/tables/tbxfload.c 2018-12-13 16:16:46.000000000 +0000 @@ -111,7 +111,7 @@ "While loading namespace from ACPI tables")); } - if (AcpiGbl_ExecuteTablesAsMethods || !AcpiGbl_GroupModuleLevelCode) + if (AcpiGbl_ExecuteTablesAsMethods) { /* * If the module-level code support is enabled, initialize the objects diff -Nru acpica-unix-20181003/source/components/utilities/utglobal.c acpica-unix-20181213/source/components/utilities/utglobal.c --- acpica-unix-20181003/source/components/utilities/utglobal.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/utilities/utglobal.c 2018-12-13 16:16:46.000000000 +0000 @@ -127,10 +127,7 @@ {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)}, - -#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)}, -#endif /* Table terminator */ diff -Nru acpica-unix-20181003/source/components/utilities/utmisc.c acpica-unix-20181213/source/components/utilities/utmisc.c --- acpica-unix-20181003/source/components/utilities/utmisc.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/utilities/utmisc.c 2018-12-13 16:16:46.000000000 +0000 @@ -109,7 +109,8 @@ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) || ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) || ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) || - ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT)) + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT) || + ACPI_IS_OEM_SIG (Table->Signature)) { return (TRUE); } diff -Nru acpica-unix-20181003/source/components/utilities/utosi.c acpica-unix-20181213/source/components/utilities/utosi.c --- acpica-unix-20181003/source/components/utilities/utosi.c 2018-10-03 14:13:51.000000000 +0000 +++ acpica-unix-20181213/source/components/utilities/utosi.c 2018-12-13 16:16:46.000000000 +0000 @@ -109,6 +109,8 @@ {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */ {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */ + {"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */ + {"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */ /* Feature Group Strings */ diff -Nru acpica-unix-20181003/source/include/acdisasm.h acpica-unix-20181213/source/include/acdisasm.h --- acpica-unix-20181003/source/include/acdisasm.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acdisasm.h 2018-12-13 16:16:46.000000000 +0000 @@ -453,6 +453,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm211[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[]; diff -Nru acpica-unix-20181003/source/include/acglobal.h acpica-unix-20181213/source/include/acglobal.h --- acpica-unix-20181003/source/include/acglobal.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acglobal.h 2018-12-13 16:16:46.000000000 +0000 @@ -209,11 +209,7 @@ * ****************************************************************************/ -#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) #define NUM_PREDEFINED_NAMES 10 -#else -#define NUM_PREDEFINED_NAMES 9 -#endif ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct); ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode); diff -Nru acpica-unix-20181003/source/include/acnamesp.h acpica-unix-20181213/source/include/acnamesp.h --- acpica-unix-20181003/source/include/acnamesp.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acnamesp.h 2018-12-13 16:16:47.000000000 +0000 @@ -69,6 +69,7 @@ #define ACPI_NS_TEMPORARY 0x0040 #define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 #define ACPI_NS_EARLY_INIT 0x0100 +#define ACPI_NS_PREFIX_MUST_EXIST 0x0200 /* Flags for AcpiNsWalkNamespace */ diff -Nru acpica-unix-20181003/source/include/acoutput.h acpica-unix-20181213/source/include/acoutput.h --- acpica-unix-20181003/source/include/acoutput.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acoutput.h 2018-12-13 16:16:47.000000000 +0000 @@ -108,7 +108,8 @@ #define ACPI_LV_RESOURCES 0x00010000 #define ACPI_LV_USER_REQUESTS 0x00020000 #define ACPI_LV_PACKAGE 0x00040000 -#define ACPI_LV_VERBOSITY1 0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS +#define ACPI_LV_EVALUATION 0x00080000 +#define ACPI_LV_VERBOSITY1 0x000FFF40 | ACPI_LV_ALL_EXCEPTIONS /* Trace verbosity level 2 [Function tracing and memory allocation] */ @@ -177,6 +178,7 @@ #define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS) #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) +#define ACPI_DB_EVALUATION ACPI_DEBUG_LEVEL (ACPI_LV_EVALUATION) #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) #define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS) @@ -184,7 +186,7 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_EVALUATION | ACPI_LV_REPAIR) #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) diff -Nru acpica-unix-20181003/source/include/acpixf.h acpica-unix-20181213/source/include/acpixf.h --- acpica-unix-20181003/source/include/acpixf.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acpixf.h 2018-12-13 16:16:47.000000000 +0000 @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20181003 +#define ACPI_CA_VERSION 0x20181213 #include "acconfig.h" #include "actypes.h" @@ -193,13 +193,6 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); /* - * Optionally support group module level code. - * NOTE, this is essentially obsolete and will be removed soon - * (01/2018). - */ -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE); - -/* * Optionally support module level code by parsing an entire table as * a method as it is loaded. Default is TRUE. * NOTE, this is essentially obsolete and will be removed soon diff -Nru acpica-unix-20181003/source/include/acstruct.h acpica-unix-20181213/source/include/acstruct.h --- acpica-unix-20181003/source/include/acstruct.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/acstruct.h 2018-12-13 16:16:47.000000000 +0000 @@ -97,6 +97,8 @@ ACPI_PARSE_STATE ParserState; /* Current state of parser */ UINT32 PrevArgTypes; UINT32 ArgCount; /* push for fixed or var args */ + UINT16 MethodNestingDepth; + UINT8 MethodIsNested; struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ @@ -111,7 +113,8 @@ struct acpi_namespace_node *MethodCallNode; /* Called method Node*/ ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */ union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */ - struct acpi_namespace_node *MethodNode; /* Method node if running a method. */ + struct acpi_namespace_node *MethodNode; /* Method node if running a method */ + char *MethodPathname; /* Full pathname of running method */ ACPI_PARSE_OBJECT *Op; /* Current parser op */ const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */ ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */ diff -Nru acpica-unix-20181003/source/include/actbinfo.h acpica-unix-20181213/source/include/actbinfo.h --- acpica-unix-20181003/source/include/actbinfo.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/actbinfo.h 2018-12-13 16:16:47.000000000 +0000 @@ -86,6 +86,7 @@ #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) #define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) +#define ACPI_TPM23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM23,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) @@ -229,6 +230,7 @@ #define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f) #define ACPI_TPM2A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_TRAILER,f) #define ACPI_TPM211_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_ARM_SMC,f) +#define ACPI_TPM23A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM23_TRAILER,f) #define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f) #define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) diff -Nru acpica-unix-20181003/source/include/actbl3.h acpica-unix-20181213/source/include/actbl3.h --- acpica-unix-20181003/source/include/actbl3.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/actbl3.h 2018-12-13 16:16:47.000000000 +0000 @@ -444,6 +444,34 @@ * ******************************************************************************/ +/* Revision 3 */ + +typedef struct acpi_table_tpm23 +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Reserved; + UINT64 ControlAddress; + UINT32 StartMethod; + +} ACPI_TABLE_TPM23; + +/* Value for StartMethod above */ + +#define ACPI_TPM23_ACPI_START_METHOD 2 + +/* + * Optional trailer for revision 3. If start method is 2, there is a 4 byte + * reserved area of all zeros. + */ +typedef struct acpi_tmp23_trailer +{ + UINT32 Reserved; + +} ACPI_TPM23_TRAILER; + + +/* Revision 4 */ + typedef struct acpi_table_tpm2 { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ diff -Nru acpica-unix-20181003/source/include/actbl.h acpica-unix-20181213/source/include/actbl.h --- acpica-unix-20181003/source/include/actbl.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/actbl.h 2018-12-13 16:16:47.000000000 +0000 @@ -74,6 +74,7 @@ #define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */ #define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */ #define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */ +#define ACPI_OEM_NAME "OEM" /* Short name for OEM, not signature */ /* diff -Nru acpica-unix-20181003/source/include/actypes.h acpica-unix-20181213/source/include/actypes.h --- acpica-unix-20181003/source/include/actypes.h 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/include/actypes.h 2018-12-13 16:16:47.000000000 +0000 @@ -570,6 +570,10 @@ #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) +/* Support for OEMx signature (x can be any character) */ +#define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\ + strnlen (a, ACPI_NAME_SIZE) == ACPI_NAME_SIZE) + /* * Algorithm to obtain access bit width. * Can be used with AccessWidth of ACPI_GENERIC_ADDRESS and AccessSize of @@ -1404,6 +1408,8 @@ #define ACPI_OSI_WIN_10_RS1 0x0E #define ACPI_OSI_WIN_10_RS2 0x0F #define ACPI_OSI_WIN_10_RS3 0x10 +#define ACPI_OSI_WIN_10_RS4 0x11 +#define ACPI_OSI_WIN_10_RS5 0x12 /* Definitions of getopt */ diff -Nru acpica-unix-20181003/source/tools/acpibin/abcompare.c acpica-unix-20181213/source/tools/acpibin/abcompare.c --- acpica-unix-20181003/source/tools/acpibin/abcompare.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpibin/abcompare.c 2018-12-13 16:16:47.000000000 +0000 @@ -429,7 +429,11 @@ printf ("Compare offset: %u\n", AbGbl_CompareOffset); if (AbGbl_CompareOffset) { - fseek (File2, AbGbl_CompareOffset, SEEK_CUR); + if (fseek (File2, AbGbl_CompareOffset, SEEK_CUR)) + { + printf ("Seek error on file %s\n", File2Path); + goto Exit2; + } } Actual1 = fread (&Char1, 1, 1, File1); diff -Nru acpica-unix-20181003/source/tools/acpidump/apmain.c acpica-unix-20181213/source/tools/acpidump/apmain.c --- acpica-unix-20181003/source/tools/acpidump/apmain.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpidump/apmain.c 2018-12-13 16:16:47.000000000 +0000 @@ -160,7 +160,7 @@ CurrentAction++; if (CurrentAction > AP_MAX_ACTIONS) { - fprintf (stderr, "Too many table options (max %u)\n", AP_MAX_ACTIONS); + fprintf (stderr, "Too many table options (max %d)\n", AP_MAX_ACTIONS); return (-1); } diff -Nru acpica-unix-20181003/source/tools/acpiexec/aemain.c acpica-unix-20181213/source/tools/acpiexec/aemain.c --- acpica-unix-20181003/source/tools/acpiexec/aemain.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpiexec/aemain.c 2018-12-13 16:16:47.000000000 +0000 @@ -147,7 +147,8 @@ ACPI_OPTION ("-df", "Disable Local fault handler"); ACPI_OPTION ("-di", "Disable execution of STA/INI methods during init"); ACPI_OPTION ("-do", "Disable Operation Region address simulation"); - ACPI_OPTION ("-dp", "Disable TermList parsing for scope objects"); + ACPI_OPTION ("-dp", "Disable loading DSDT/SSDT as a control method\n" + " (enable legacy grouping of module-level code)"); ACPI_OPTION ("-dr", "Disable repair of method return values"); ACPI_OPTION ("-ds", "Disable method auto-serialization"); ACPI_OPTION ("-dt", "Disable allocation tracking (performance)"); @@ -157,7 +158,7 @@ ACPI_OPTION ("-ef", "Enable display of final memory statistics"); ACPI_OPTION ("-ei", "Enable additional tests for ACPICA interfaces"); ACPI_OPTION ("-el", "Enable loading of additional test tables"); - ACPI_OPTION ("-em", "Enable (legacy) grouping of module-level code"); + ACPI_OPTION ("-eo", "Enable object evaluation log"); ACPI_OPTION ("-es", "Enable Interpreter Slack Mode"); ACPI_OPTION ("-et", "Enable debug semaphore timeout"); printf ("\n"); @@ -211,7 +212,7 @@ if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1)) { - printf ("**** The length of command line (%u) exceeded maximum (%u)\n", + printf ("**** The length of command line (%u) exceeded maximum (%d)\n", (UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1)); return (-1); } @@ -298,9 +299,10 @@ AcpiGbl_LoadTestTables = TRUE; break; - case 'm': + case 'o': - AcpiGbl_GroupModuleLevelCode = TRUE; + AcpiDbgLevel |= ACPI_LV_EVALUATION; + AcpiGbl_DbConsoleDebugLevel |= ACPI_LV_EVALUATION; break; case 's': @@ -517,7 +519,6 @@ /* Module-level code. Use new architecture */ AcpiGbl_ExecuteTablesAsMethods = TRUE; - AcpiGbl_GroupModuleLevelCode = FALSE; /* * Initialize ACPICA and start debugger thread. diff -Nru acpica-unix-20181003/source/tools/acpiexec/aetables.c acpica-unix-20181213/source/tools/acpiexec/aetables.c --- acpica-unix-20181003/source/tools/acpiexec/aetables.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpiexec/aetables.c 2018-12-13 16:16:47.000000000 +0000 @@ -567,18 +567,10 @@ * for an existing name. */ Status = AcpiInstallMethod (MethodCode); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("%s, Could not install method\n", - AcpiFormatException (Status)); - } + ACPI_CHECK_OK (AcpiInstallMethod, Status); Status = AcpiInstallMethod (MethodCode); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("%s, Could not install method\n", - AcpiFormatException (Status)); - } + ACPI_CHECK_OK (AcpiInstallMethod, Status); return (AE_OK); } diff -Nru acpica-unix-20181003/source/tools/acpihelp/ahdecode.c acpica-unix-20181213/source/tools/acpihelp/ahdecode.c --- acpica-unix-20181003/source/tools/acpihelp/ahdecode.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpihelp/ahdecode.c 2018-12-13 16:16:47.000000000 +0000 @@ -60,6 +60,10 @@ char *Name); static void +AhDoSpecialNames ( + char *Name); + +static void AhDisplayResourceName ( const ACPI_PREDEFINED_INFO *ThisName); @@ -185,15 +189,23 @@ { UINT32 Length; BOOLEAN Found; - char Name[9]; + char Name[ACPI_NAME_SIZE + 1]; - if (!NamePrefix || (NamePrefix[0] == '*')) + if (!NamePrefix || (*NamePrefix == '*')) { Found = AhDisplayPredefinedName (NULL, 0); return; } + Length = strlen (NamePrefix); + if (Length > ACPI_NAME_SIZE) + { + printf ("%.8s: Predefined name must be 4 characters maximum\n", + NamePrefix); + return; + } + /* Contruct a local name or name prefix */ AcpiUtStrupr (NamePrefix); @@ -203,14 +215,13 @@ } Name[0] = '_'; - AcpiUtSafeStrncpy (&Name[1], NamePrefix, 7); + AcpiUtSafeStrncpy (&Name[1], NamePrefix, 4); - Length = strlen (Name); - if (Length > ACPI_NAME_SIZE) - { - printf ("%.8s: Predefined name must be 4 characters maximum\n", Name); - return; - } + /* Check for special names such as _Exx, _ACx, etc. */ + + AhDoSpecialNames (Name); + + /* Lookup and display the name(s) */ Found = AhDisplayPredefinedName (Name, Length); if (!Found) @@ -222,6 +233,95 @@ /******************************************************************************* * + * FUNCTION: AhDoSpecialNames + * + * PARAMETERS: Name - Name or prefix to find + * + * RETURN: None + * + * DESCRIPTION: Detect and handle the "special" names such as _Exx, _ACx, etc. + * + * Current support: + * _EJx + * _Exx + * _Lxx + * _Qxx + * _Wxx + * _ACx + * _ALx + * _T_x + * + ******************************************************************************/ + +static void +AhDoSpecialNames ( + char *Name) +{ + + /* + * Check for the special names that have one or more numeric + * suffixes. For example, _Lxx can have 256 different flavors, + * from _L00 to _LFF. + */ + switch (Name[1]) + { + case 'E': + if (Name[2] == 'J') + { + if (isdigit (Name[3]) || (Name[3] == 'X')) + { + /* _EJx */ + + Name[3] = 'x'; + break; + } + } + + /* Fallthrough */ + + case 'L': + case 'Q': + case 'W': + if ((isxdigit (Name[2]) && isxdigit (Name[3])) + || + ((Name[2] == 'X') && (Name[3] == 'X'))) + { + /* _Exx, _Lxx, _Qxx, or _Wxx */ + + Name[2] = 'x'; + Name[3] = 'x'; + } + break; + + case 'A': + if ((Name[2] == 'C') || (Name[2] == 'L')) + { + if (isdigit (Name[3]) || (Name[3] == 'X')) + { + /* _ACx or _ALx */ + + Name[3] = 'x'; + } + } + break; + + case 'T': + if (Name[2] == '_') + { + /* _T_x (Reserved for iASL compiler */ + + Name[3] = 'x'; + } + break; + + default: + break; + } +} + + +/******************************************************************************* + * * FUNCTION: AhDisplayPredefinedName * * PARAMETERS: Name - Name or name prefix @@ -312,7 +412,7 @@ /* NOTE: we check both tables always because there are some dupes */ - /* Check against the predefine methods first */ + /* Check against the predefined methods first */ ThisName = AcpiUtMatchPredefinedMethod (Name); if (ThisName) diff -Nru acpica-unix-20181003/source/tools/acpinames/anmain.c acpica-unix-20181213/source/tools/acpinames/anmain.c --- acpica-unix-20181003/source/tools/acpinames/anmain.c 2018-10-03 14:13:52.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpinames/anmain.c 2018-12-13 16:16:47.000000000 +0000 @@ -132,7 +132,6 @@ /* Set flags so that the interpreter is not used */ AcpiGbl_ExecuteTablesAsMethods = FALSE; - AcpiGbl_GroupModuleLevelCode = TRUE; Status = AcpiInitializeSubsystem (); ACPI_CHECK_OK (AcpiInitializeSubsystem, Status); diff -Nru acpica-unix-20181003/source/tools/acpisrc/astable.c acpica-unix-20181213/source/tools/acpisrc/astable.c --- acpica-unix-20181003/source/tools/acpisrc/astable.c 2018-10-03 14:13:53.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpisrc/astable.c 2018-12-13 16:16:47.000000000 +0000 @@ -572,6 +572,7 @@ {"ACPI_TABLE_STAO", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TCPA", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TPM2", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_TPM23", SRC_TYPE_STRUCT}, {"ACPI_TABLE_UEFI", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WAET", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WDAT", SRC_TYPE_STRUCT}, @@ -725,6 +726,7 @@ {"ACPI_TABLE_TCPA_CLIENT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TCPA_SERVER", SRC_TYPE_STRUCT}, {"ACPI_TPM2_TRAILER", SRC_TYPE_STRUCT}, + {"ACPI_TPM23_TRAILER", SRC_TYPE_STRUCT}, {"ACPI_TPM2_ARM_SMC", SRC_TYPE_STRUCT}, {"ACPI_WDAT_ENTRY", SRC_TYPE_STRUCT}, diff -Nru acpica-unix-20181003/source/tools/acpixtract/acpixtract.c acpica-unix-20181213/source/tools/acpixtract/acpixtract.c --- acpica-unix-20181003/source/tools/acpixtract/acpixtract.c 2018-10-03 14:13:53.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpixtract/acpixtract.c 2018-12-13 16:16:47.000000000 +0000 @@ -68,8 +68,8 @@ { FILE *InputFile; FILE *OutputFile = NULL; - unsigned int BytesConverted; - unsigned int ThisTableBytesWritten = 0; + int BytesConverted; + int ThisTableBytesWritten = 0; unsigned int FoundTable = 0; unsigned int Instances = 0; unsigned int ThisInstance; @@ -215,8 +215,7 @@ /* Empty line or non-data line terminates the data block */ - BytesConverted = AxConvertAndWrite (OutputFile, ThisSignature, - ThisTableBytesWritten); + BytesConverted = AxConvertAndWrite (OutputFile, ThisSignature); switch (BytesConverted) { case 0: @@ -226,6 +225,7 @@ case -1: + Status = -1; goto CleanupAndExit; /* There was a write error */ default: /* Normal case, get next line */ @@ -289,8 +289,8 @@ FILE *InputFile; FILE *OutputFile; int Status = 0; - unsigned int TotalBytesWritten = 0; - unsigned int ThisTableBytesWritten = 0; + int TotalBytesWritten = 0; + int ThisTableBytesWritten = 0; unsigned int BytesConverted; char ThisSignature[4]; unsigned int State = AX_STATE_FIND_HEADER; @@ -386,8 +386,7 @@ /* Empty line or non-data line terminates the data block */ - BytesConverted = AxConvertAndWrite ( - OutputFile, ThisSignature, ThisTableBytesWritten); + BytesConverted = AxConvertAndWrite (OutputFile, ThisSignature); switch (BytesConverted) { case 0: @@ -397,6 +396,7 @@ case -1: + Status = -1; goto CleanupAndExit; /* There was a write error */ default: /* Normal case, get next line */ @@ -453,6 +453,7 @@ FILE *InputFile; unsigned char Header[48]; UINT32 ByteCount = 0; + UINT32 ThisLineByteCount; unsigned int State = AX_STATE_FIND_HEADER; @@ -525,7 +526,15 @@ /* Convert header to hex and display it */ - ByteCount += AxConvertToBinary (Gbl_LineBuffer, &Header[ByteCount]); + ThisLineByteCount = AxConvertToBinary (Gbl_LineBuffer, + &Header[ByteCount]); + if (ThisLineByteCount == EOF) + { + fclose (InputFile); + return (-1); + } + + ByteCount += ThisLineByteCount; if (ByteCount >= sizeof (ACPI_TABLE_HEADER)) { AxDumpTableHeader (Header); diff -Nru acpica-unix-20181003/source/tools/acpixtract/acpixtract.h acpica-unix-20181213/source/tools/acpixtract/acpixtract.h --- acpica-unix-20181003/source/tools/acpixtract/acpixtract.h 2018-10-03 14:13:53.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpixtract/acpixtract.h 2018-12-13 16:16:47.000000000 +0000 @@ -168,13 +168,12 @@ AxIsDataBlockHeader ( void); -long +int AxConvertAndWrite ( FILE *OutputFile, - char *ThisSignature, - unsigned int ThisTableBytesWritten); + char *ThisSignature); -size_t +int AxConvertToBinary ( char *InputLine, unsigned char *OutputData); diff -Nru acpica-unix-20181003/source/tools/acpixtract/axutils.c acpica-unix-20181213/source/tools/acpixtract/axutils.c --- acpica-unix-20181003/source/tools/acpixtract/axutils.c 2018-10-03 14:13:53.000000000 +0000 +++ acpica-unix-20181213/source/tools/acpixtract/axutils.c 2018-12-13 16:16:47.000000000 +0000 @@ -319,7 +319,7 @@ * ******************************************************************************/ -size_t +int AxConvertToBinary ( char *InputLine, unsigned char *OutputData) @@ -360,14 +360,22 @@ &Converted[8], &Converted[9], &Converted[10], &Converted[11], &Converted[12], &Converted[13], &Converted[14], &Converted[15]); - /* Pack converted data into a byte array */ + if (BytesConverted == EOF) + { + printf ("EOF while converting ASCII line to binary\n"); + return (-1); + } + /* + * Pack converted data into a byte array. + * Note: BytesConverted == 0 is acceptable. + */ for (i = 0; i < BytesConverted; i++) { OutputData[i] = (unsigned char) Converted[i]; } - return ((size_t) BytesConverted); + return (BytesConverted); } @@ -495,7 +503,6 @@ * * PARAMETERS: OutputFile - Where to write the binary data * ThisSignature - Signature of current ACPI table - * ThisTableBytesWritten - Total count of data written * * RETURN: Length of the converted line * @@ -508,27 +515,29 @@ * ******************************************************************************/ -long +int AxConvertAndWrite ( FILE *OutputFile, - char *ThisSignature, - unsigned int ThisTableBytesWritten) + char *ThisSignature) { - size_t BytesWritten; - size_t BytesConverted; + int BytesWritten; + int BytesConverted; /* Convert one line of ascii hex data to binary */ BytesConverted = AxConvertToBinary (Gbl_LineBuffer, Gbl_BinaryData); - - /* Write the binary data */ - + if (BytesConverted == EOF) + { + return (EOF); + } if (!BytesConverted) { return (0); } + /* Write the binary data */ + BytesWritten = fwrite (Gbl_BinaryData, 1, BytesConverted, OutputFile); if (BytesWritten != BytesConverted) { diff -Nru acpica-unix-20181003/tests/aslts/src/runtime/collections/functional/region/regionfield.asl acpica-unix-20181213/tests/aslts/src/runtime/collections/functional/region/regionfield.asl --- acpica-unix-20181003/tests/aslts/src/runtime/collections/functional/region/regionfield.asl 2018-10-03 14:14:21.000000000 +0000 +++ acpica-unix-20181213/tests/aslts/src/runtime/collections/functional/region/regionfield.asl 2018-12-13 16:17:11.000000000 +0000 @@ -1867,11 +1867,11 @@ // // Name (TBUF, Buffer (0x10) // { -// /* 0000 */ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, // ........ -// /* 0008 */ 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF // ........ +// 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, +// 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF // }) -// BUFF = TBUF /* \M764.TBUF */ -// Local0 = BUFF /* \M764.BUFF */ +// BUFF = TBUF +// Local0 = BUFF // If ((Local0 != TBUF)) // { // ERR (Arg0, Z143, __LINE__, 0x00, 0x00, Local0, TBUF) Binary files /tmp/tmpVWRfQq/uvUvl1MDGY/acpica-unix-20181003/tests/misc/grammar.aml and /tmp/tmpVWRfQq/ZA3I6cipUE/acpica-unix-20181213/tests/misc/grammar.aml differ