diff --git a/sys/external/bsd/acpica/dist/changes.txt b/sys/external/bsd/acpica/dist/changes.txt index 7be71e602afa..510a4ca24017 100644 --- a/sys/external/bsd/acpica/dist/changes.txt +++ b/sys/external/bsd/acpica/dist/changes.txt @@ -1,3 +1,205 @@ +---------------------------------------- +16 August 2019. Summary of changes for version 20190816: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Modified the OwnerId mechanism to allow for more Owner Ids. The previous +limit was 256 Ids, now it is 4096 Ids. This prevents OWNER_ID_LIMIT +exceptions on machines with a large number of initialization threads, +many CPU cores and nested initialization control methods. + +Introduced acpi_dispatch_gpe() as a wrapper around AcpiEvDetectGpe() for +checking if the given GPE (as represented by a GPE device handle and a +GPE number) is currently active and dispatching it (if that's the case) +outside of interrupt context. + +Table load: exit the interpreter before initializing objects within the +new table This prevents re-acquiring the interpreter lock when loading +tables + +Added the "Windows 2019" string to the _OSI support (version 1903). Jung- +uk Kim + +Macros: removed pointer math on a null pointer. Causes warnings on some +compilers and/or tools. Changed ACPI_TO_POINTER to use ACPI_CAST_PTR +instead of using arithmetic. + +Fully deployed the ACPI_PRINTF_LIKE macro. This macro was not being used +across all "printf-like" internal functions. Also, cleanup all calls to +such functions (both in 32-bit mode and 64-bit mode) now that they are +analyzed by the gcc compiler via ACPI_PRINTF_LIKE. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: implemented a new data table compiler flex/bison front-end. This +change is internal and is not intended to result in changes to the +compiled code. This new compiler front-end can be invoked using the -tp +option for now, until the old mechanism is removed. + +ASLTS: Implemented a new data table compiler test suite. This test suite +generates all table templates and compile/disassemble/re-compile/binary- +compare each file. + +iASL: return -1 if AML files were not generated due to compiler errors + +iASL: added a warning on use of the now-legacy ASL Processor () keyword. + +iASL: added an error on _UID object declaration that returns a String +within a Processor () declaration. A _UID for a processor must be an +Integer. + +iASL: added a null terminator to name strings that consist only of +multiple parent prefixes (^) + +iASL: added support to compile both ASL and data table files in a single +command. + +Updated the tool generation project files that were recently migrated to +MSVC 2017 to eliminate all new warnings. The new project files appear in +the directory \acpica\generate\msvc2017. This change effectively +deprecates the older project files in \acpica\generate\msvc9. + + +---------------------------------------- +03 July 2019. Summary of changes for version 20190703: + + +1) ACPICA kernel-resident subsystem: + +Remove legacy module-level support code. There were still some remnants +of the legacy module-level code executions. Since we no longer support +this option, this is essentially dead code and has been removed from the +ACPICA source. + +iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root +scope. If these named objects are declared outside the root scope, they +will not be invoked by any host Operating System. + +Clear status of GPEs on first direct enable. ACPI GPEs (other than the EC +one) can be enabled in two situations. First, the GPEs with existing _Lxx +and _Exx methods are enabled implicitly by ACPICA during system +initialization. Second, the GPEs without these methods (like GPEs listed +by _PRW objects for wakeup devices) need to be enabled directly by the +code that is going to use them (e.g. ACPI power management or device +drivers). + +In the former case, if the status of a given GPE is set to start with, +its handler method (either _Lxx or _Exx) needs to be invoked to take care +of the events (possibly) signaled before the GPE was enabled. In the +latter case, however, the first caller of AcpiEnableGpe() for a given GPE +should not be expected to care about any events that might be signaled +through it earlier. In that case, it is better to clear the status of +the GPE before enabling it, to prevent stale events from triggering +unwanted actions (like spurious system resume, for example). + +For this reason, modify AcpiEvAddGpeReference() to take an additional +boolean argument indicating whether or not the GPE status needs to be +cleared when its reference counter changes from zero to one and make +AcpiEnableGpe() pass TRUE to it through that new argument. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +The tool generation process has been migrated to MSVC 2017, and all +project files have been upgraded. The new project files appear in the +directory \acpica\generate\msvc2017. This change effectively deprecates +the older project files in \acpica\generate\msvc9. + +iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root +scope. If these named objects are declared outside the root scope, they +will not be invoked by any host Operating System + +---------------------------------------- +09 May 2019. Summary of changes for version 20190509: + + +1) ACPICA kernel-resident subsystem: + +Revert commit 6c43e1a ("ACPICA: Clear status of GPEs before enabling +them") that causes problems with Thunderbolt controllers to occur if a +dock device is connected at init time (the xhci_hcd and thunderbolt +modules crash which prevents peripherals connected through them from +working). Commit 6c43e1a effectively causes commit ecc1165b8b74 ("ACPICA: +Dispatch active GPEs at init time") to get undone, so the problem +addressed by commit ecc1165b8b74 appears again as a result of it. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +Reverted iASL: Additional forward reference detection. This change +reverts forward reference detection for field declarations. The feature +unintentionally emitted AML bytecode with incorrect package lengths for +some ASL code related to Fields and OperationRegions. This malformed AML +can cause systems to crash +during boot. The malformed AML bytecode is emitted in iASL version +20190329 and 20190405. + +iASL: improve forward reference detection. This change improves forward +reference detection for named objects inside of scopes. If a parse object +has the OP_NOT_FOUND_DURING_LOAD set, it means that Op is a reference to +a named object that is declared later in the AML bytecode. This is +allowed if the reference is inside of a method and the declaration is +outside of a method like so: + +DefinitionBlock(...) +{ + Method (TEST) + { + Return (NUM0) + } + Name (NUM0,0) +} + +However, if the declaration and reference are both in the same method or +outside any methods, this is a forward reference and should be marked as +an error because it would result in runtime errors. + +DefinitionBlock(...) +{ + Name (BUFF, Buffer (NUM0) {}) // Forward reference + Name (NUM0, 0x0) + + Method (TEST) + { + Local0 = NUM1 + Name (NUM1, 0x1) // Forward reference + return (Local0) + } +} + +iASL: Implemented additional buffer overflow analysis for BufferField +declarations. Check if a buffer index argument to a create buffer field +operation is beyond the end of the target buffer. + +This affects these AML operators: + + AML_CREATE_FIELD_OP + AML_CREATE_BIT_FIELD_OP + AML_CREATE_BYTE_FIELD_OP + AML_CREATE_WORD_FIELD_OP + AML_CREATE_DWORD_FIELD_OP + AML_CREATE_QWORD_FIELD_OP + + There are three conditions that must be satisfied in order to allow this +validation at compile time: + + 1) The length of the target buffer must be an integer constant + 2) The index specified in the create* must be an integer constant + 3) For CreateField, the bit length argument must be non-zero. + +Example: + Name (BUF1, Buffer() {1,2}) + CreateField (BUF1, 7, 9, CF03) // 3: ERR + +dsdt.asl 14: CreateField (BUF1, 7, 9, CF03) // 3: ERR +Error 6165 - ^ Buffer index beyond end of +target buffer + + ---------------------------------------- 05 April 2019. Summary of changes for version 20190405: diff --git a/sys/external/bsd/acpica/dist/common/adwalk.c b/sys/external/bsd/acpica/dist/common/adwalk.c index 1075128a3839..65aabecb0913 100644 --- a/sys/external/bsd/acpica/dist/common/adwalk.c +++ b/sys/external/bsd/acpica/dist/common/adwalk.c @@ -372,6 +372,7 @@ AcpiDmDumpDescending ( { ACPI_OP_WALK_INFO *Info = Context; char *Path; + ACPI_STATUS Status; if (!Op) @@ -414,10 +415,18 @@ AcpiDmDumpDescending ( if (Op->Common.Value.String) { - AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String, + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String, NULL, &Path); - AcpiOsPrintf ("%s %p", Path, Op->Common.Node); - ACPI_FREE (Path); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("%s %p", Path, Op->Common.Node); + ACPI_FREE (Path); + } + else + { + AcpiOsPrintf ("Could not externalize pathname for node [%4.4s]", + Op->Common.Node->Name.Ascii); + } } else { @@ -722,9 +731,9 @@ AcpiDmLoadDescendingOp ( * 2) Not the root node * 3) Not a node created by Scope */ - - if (!PreDefined && Node != AcpiGbl_RootNode && - Op->Common.AmlOpcode != AML_SCOPE_OP) + if (!PreDefined && + (Node != AcpiGbl_RootNode) && + (Op->Common.AmlOpcode != AML_SCOPE_OP)) { Node->OwnerId = WalkState->OwnerId; } diff --git a/sys/external/bsd/acpica/dist/common/dmrestag.c b/sys/external/bsd/acpica/dist/common/dmrestag.c index 4a0f0d2d8636..6508a117138f 100644 --- a/sys/external/bsd/acpica/dist/common/dmrestag.c +++ b/sys/external/bsd/acpica/dist/common/dmrestag.c @@ -725,8 +725,12 @@ AcpiGetTagPathname ( /* Internalize the namepath to AML format */ - AcpiNsInternalizeName (Pathname, &InternalPath); + Status = AcpiNsInternalizeName (Pathname, &InternalPath); ACPI_FREE (Pathname); + if (ACPI_FAILURE (Status)) + { + return (NULL); + } /* Update the Op with the symbol */ diff --git a/sys/external/bsd/acpica/dist/common/dmtables.c b/sys/external/bsd/acpica/dist/common/dmtables.c index 8cbc1556fae4..c18e5f53bb10 100644 --- a/sys/external/bsd/acpica/dist/common/dmtables.c +++ b/sys/external/bsd/acpica/dist/common/dmtables.c @@ -335,8 +335,8 @@ AdGetLocalTables ( /* Get the DSDT via table override */ ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT); - AcpiOsTableOverride (&TableHeader, &NewTable); - if (!NewTable) + Status = AcpiOsTableOverride (&TableHeader, &NewTable); + if (ACPI_FAILURE (Status) || !NewTable) { fprintf (stderr, "Could not obtain DSDT\n"); return (AE_NO_ACPI_TABLES); diff --git a/sys/external/bsd/acpica/dist/common/dmtbdump2.c b/sys/external/bsd/acpica/dist/common/dmtbdump2.c index af248cb941d9..fd1aba81c5f0 100644 --- a/sys/external/bsd/acpica/dist/common/dmtbdump2.c +++ b/sys/external/bsd/acpica/dist/common/dmtbdump2.c @@ -763,7 +763,7 @@ AcpiDmDumpMcfg ( if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length) { AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n", - sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); + (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); return; } diff --git a/sys/external/bsd/acpica/dist/compiler/aslcache.c b/sys/external/bsd/acpica/dist/compiler/aslcache.c index 3db90d9c2983..cb67507c9cb6 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslcache.c +++ b/sys/external/bsd/acpica/dist/compiler/aslcache.c @@ -313,7 +313,7 @@ UtDeleteLocalCaches ( DbgPrint (ASL_DEBUG_OUTPUT, "%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n", AslGbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE, - (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount); + ((UINT32) sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount); /* Reset cache globals */ @@ -337,7 +337,7 @@ UtDeleteLocalCaches ( DbgPrint (ASL_DEBUG_OUTPUT, "%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n", AslGbl_FieldCount, ASL_FIELD_CACHE_SIZE, - (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount); + ((UINT32) sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount); /* Reset cache globals */ @@ -360,7 +360,7 @@ UtDeleteLocalCaches ( DbgPrint (ASL_DEBUG_OUTPUT, "%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n", AslGbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE, - (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount); + ((UINT32) sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount); /* Reset cache globals */ diff --git a/sys/external/bsd/acpica/dist/compiler/aslcodegen.c b/sys/external/bsd/acpica/dist/compiler/aslcodegen.c index 4c84c30af8f7..b0c50b1188e0 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslcodegen.c +++ b/sys/external/bsd/acpica/dist/compiler/aslcodegen.c @@ -510,8 +510,8 @@ CgWriteTableHeader ( Op->Asl.AmlSubtreeLength += strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3; - CvDbgPrint (" Length: %lu\n", - strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3); + CvDbgPrint (" Length: %u\n", + (UINT32) strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3); if (Op->Asl.CommentList) { @@ -582,7 +582,8 @@ CgUpdateHeader ( { if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) { - printf ("EOF while reading checksum bytes\n"); + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, + "Table length is greater than size of the input file"); return; } diff --git a/sys/external/bsd/acpica/dist/compiler/asldebug.c b/sys/external/bsd/acpica/dist/compiler/asldebug.c index 562af01ee56d..f7f6e27db2da 100644 --- a/sys/external/bsd/acpica/dist/compiler/asldebug.c +++ b/sys/external/bsd/acpica/dist/compiler/asldebug.c @@ -131,7 +131,7 @@ UtDumpIntegerOp ( case 8: /* Dword */ DbgPrint (ASL_TREE_OUTPUT, - "%*.*X", IntegerLength, IntegerLength, Op->Asl.Value.Integer); + "%*.*X", IntegerLength, IntegerLength, (UINT32) Op->Asl.Value.Integer); break; case 16: /* Qword and Integer */ diff --git a/sys/external/bsd/acpica/dist/compiler/asldefine.h b/sys/external/bsd/acpica/dist/compiler/asldefine.h index 7de578748445..1645c552c764 100644 --- a/sys/external/bsd/acpica/dist/compiler/asldefine.h +++ b/sys/external/bsd/acpica/dist/compiler/asldefine.h @@ -182,7 +182,7 @@ #define ASL_PARSE_TREE_DEBUG2 \ " %08X %04X %04X %01X %04X %04X %05X %05X "\ - "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d" + "%8p %8p %8p %8p %08X %08X %04X %02d %5d %5d %5d %5d" /* * Macros for ASL/ASL+ converter @@ -190,4 +190,20 @@ #define COMMENT_CAPTURE_ON AslGbl_CommentState.CaptureComments = TRUE; #define COMMENT_CAPTURE_OFF AslGbl_CommentState.CaptureComments = FALSE; +/* + * Special name segments - these must only be declared at the root scope + */ +#define NAMESEG__PTS "_PTS" +#define NAMESEG__WAK "_WAK" +#define NAMESEG__S0 "_S0_" +#define NAMESEG__S1 "_S1_" +#define NAMESEG__S2 "_S2_" +#define NAMESEG__S3 "_S3_" +#define NAMESEG__S4 "_S4_" +#define NAMESEG__S5 "_S5_" +#define NAMESEG__TTS "_TTS" + +#define MAX_SPECIAL_NAMES 9 + + #endif /* ASLDEFINE.H */ diff --git a/sys/external/bsd/acpica/dist/compiler/aslglobal.h b/sys/external/bsd/acpica/dist/compiler/aslglobal.h index ce9d8c3af0a3..6b68b6165d29 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslglobal.h +++ b/sys/external/bsd/acpica/dist/compiler/aslglobal.h @@ -115,10 +115,24 @@ const char *AslGbl_OpFlagNames[ACPI_NUM_OP_FLAGS] = "OP_NOT_FOUND_DURING_LOAD" }; +const char *AslGbl_SpecialNamedObjects [MAX_SPECIAL_NAMES] = +{ + NAMESEG__PTS, + NAMESEG__WAK, + NAMESEG__S0, + NAMESEG__S1, + NAMESEG__S2, + NAMESEG__S3, + NAMESEG__S4, + NAMESEG__S5, + NAMESEG__TTS +}; + #else extern ASL_FILE_DESC AslGbl_FileDescs [ASL_NUM_FILES]; extern UINT32 AslGbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; extern const char *AslGbl_OpFlagNames[ACPI_NUM_OP_FLAGS]; +extern const char *AslGbl_SpecialNamedObjects[MAX_SPECIAL_NAMES]; #endif @@ -131,6 +145,7 @@ extern int DtParserdebug; extern int PrParserdebug; extern const ASL_MAPPING_ENTRY AslKeywordMapping[]; extern char *AslCompilertext; +extern char *DtCompilerParsertext; /* * Older versions of Bison won't emit this external in the generated header. diff --git a/sys/external/bsd/acpica/dist/compiler/aslhelp.c b/sys/external/bsd/acpica/dist/compiler/aslhelp.c index e9c3f565a22a..28f4c95c1331 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslhelp.c +++ b/sys/external/bsd/acpica/dist/compiler/aslhelp.c @@ -139,6 +139,7 @@ Usage ( ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)"); printf ("\nData Table Compiler:\n"); + ACPI_OPTION ("-tp", "Compile tables with flex/bison prototype"); ACPI_OPTION ("-G", "Compile custom table that contains generic operators"); ACPI_OPTION ("-T |ALL", "Create ACPI table template/example files"); ACPI_OPTION ("-T ", "Emit DSDT and SSDTs to same file"); diff --git a/sys/external/bsd/acpica/dist/compiler/asllength.c b/sys/external/bsd/acpica/dist/compiler/asllength.c index 4402b5c40b0b..6abd18d66523 100644 --- a/sys/external/bsd/acpica/dist/compiler/asllength.c +++ b/sys/external/bsd/acpica/dist/compiler/asllength.c @@ -371,12 +371,13 @@ CgGenerateAmlLengths ( Op->Asl.AmlLength = strlen (Buffer); /* - * Check for single backslash reference to root, - * make it a null terminated string in the AML + * Check for single backslash reference to root or reference to a name + * consisting of only prefix (^) characters. Make it a null terminated + * string in the AML. */ - if (Op->Asl.AmlLength == 1) + if (Op->Asl.AmlLength == 1 || UtNameContainsAllPrefix(Op)) { - Op->Asl.AmlLength = 2; + Op->Asl.AmlLength++; } break; diff --git a/sys/external/bsd/acpica/dist/compiler/asllistsup.c b/sys/external/bsd/acpica/dist/compiler/asllistsup.c index a28e2f1bdb57..a7297b274f9a 100644 --- a/sys/external/bsd/acpica/dist/compiler/asllistsup.c +++ b/sys/external/bsd/acpica/dist/compiler/asllistsup.c @@ -133,7 +133,7 @@ LsDumpAsciiInComment ( { /* Insert a space to break the sequence */ - FlPrintFile (FileId, ".", BufChar); + FlPrintFile (FileId, " "); } FlPrintFile (FileId, "%c", BufChar); diff --git a/sys/external/bsd/acpica/dist/compiler/aslmain.c b/sys/external/bsd/acpica/dist/compiler/aslmain.c index 27c0fdc35bf8..d2bde16505e3 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslmain.c +++ b/sys/external/bsd/acpica/dist/compiler/aslmain.c @@ -174,7 +174,6 @@ main ( if (ACPI_FAILURE (Status)) { ReturnStatus = -1; - goto CleanupAndExit; } Index2++; @@ -182,8 +181,10 @@ main ( /* * At this point, compilation of a data table or disassembly is complete. + * However, if there is a parse tree, perform compiler analysis and + * generate AML. */ - if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA || AcpiGbl_DisasmFlag) + if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || !AslGbl_ParseTreeRoot) { goto CleanupAndExit; } @@ -229,7 +230,6 @@ main ( } - CleanupAndExit: UtFreeLineBuffers (); @@ -241,7 +241,7 @@ CleanupAndExit: if (!AcpiGbl_DisasmFlag) { - CmCleanupAndExit (); + ReturnStatus = CmCleanupAndExit (); } @@ -291,18 +291,21 @@ AslSignalHandler ( * Close all open files * Note: the .pre file is the same as the input source file */ - AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; - - for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) + if (AslGbl_Files) { - FlCloseFile (i); - } + AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; - /* Delete any output files */ + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlCloseFile (i); + } - for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++) - { - FlDeleteFile (i); + /* Delete any output files */ + + for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlDeleteFile (i); + } } printf (ASL_PREFIX "Terminating\n"); diff --git a/sys/external/bsd/acpica/dist/compiler/aslmessages.c b/sys/external/bsd/acpica/dist/compiler/aslmessages.c index bba1da2ea15d..bcce4348fc33 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslmessages.c +++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.c @@ -175,7 +175,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NO_RETVAL */ "Called method returns no value", /* ASL_MSG_NO_WHILE */ "No enclosing While statement", /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", -/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_BUFFER_FIELD_LENGTH */ "Field length must be non-zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", /* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", @@ -234,7 +234,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Forward references are not supported by the ASL language", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", /* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", @@ -256,7 +256,11 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", /* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", /* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed", -/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist" +/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist", +/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer", +/* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal", +/* ASL_MSG_INVALID_PROCESSOR_UID */ "_UID inside processor declaration must be an integer", +/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead." }; /* Table compiler */ diff --git a/sys/external/bsd/acpica/dist/compiler/aslmessages.h b/sys/external/bsd/acpica/dist/compiler/aslmessages.h index a10ff894745c..84912a233fc6 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslmessages.h +++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.h @@ -177,7 +177,7 @@ typedef enum ASL_MSG_NO_RETVAL, ASL_MSG_NO_WHILE, ASL_MSG_NON_ASCII, - ASL_MSG_NON_ZERO, + ASL_MSG_BUFFER_FIELD_LENGTH, ASL_MSG_NOT_EXIST, ASL_MSG_NOT_FOUND, ASL_MSG_NOT_METHOD, @@ -259,6 +259,10 @@ typedef enum ASL_MSG_REGION_LENGTH, ASL_MSG_TEMPORARY_OBJECT, ASL_MSG_UNDEFINED_EXTERNAL, + ASL_MSG_BUFFER_FIELD_OVERFLOW, + ASL_MSG_INVALID_SPECIAL_NAME, + ASL_MSG_INVALID_PROCESSOR_UID, + ASL_MSG_LEGACY_PROCESSOR_OP, /* These messages are used by the Data Table compiler only */ diff --git a/sys/external/bsd/acpica/dist/compiler/aslnamesp.c b/sys/external/bsd/acpica/dist/compiler/aslnamesp.c index dc412e4db945..7494b1a027eb 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslnamesp.c +++ b/sys/external/bsd/acpica/dist/compiler/aslnamesp.c @@ -168,7 +168,7 @@ NsDoOneNamespaceObject ( FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s", AslGbl_NumNamespaceObjects, Level, (Level * 3), " ", - &Node->Name, AcpiUtGetTypeName (Node->Type)); + &Node->Name.Ascii[0], AcpiUtGetTypeName (Node->Type)); Op = Node->Op; ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object); @@ -321,7 +321,7 @@ NsDoOneNamespaceObject ( { FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, " [Initial Length 0x%.2X elements]", - Op->Asl.Value.Integer); + (UINT32) Op->Asl.Value.Integer); } break; @@ -344,7 +344,7 @@ NsDoOneNamespaceObject ( { FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, " [Initial Length 0x%.2X bytes]", - Op->Asl.Value.Integer); + (UINT32) Op->Asl.Value.Integer); } break; @@ -423,7 +423,8 @@ NsDoOnePathname ( return (Status); } - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", + ACPI_CAST_PTR (char, TargetPath.Pointer)); ACPI_FREE (TargetPath.Pointer); return (AE_OK); } diff --git a/sys/external/bsd/acpica/dist/compiler/asloperands.c b/sys/external/bsd/acpica/dist/compiler/asloperands.c index 1e0745ab206e..f1c062816d63 100644 --- a/sys/external/bsd/acpica/dist/compiler/asloperands.c +++ b/sys/external/bsd/acpica/dist/compiler/asloperands.c @@ -711,6 +711,7 @@ OpnDoBuffer ( BufferLengthOp->Asl.Value.Integer = BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); /* Remaining nodes are handled via the tree walk */ } @@ -797,6 +798,7 @@ OpnDoPackage ( */ Op->Asl.Child->Asl.ParseOpcode = PARSEOP_INTEGER; Op->Asl.Child->Asl.Value.Integer = PackageLength; + UtSetParseOpName (Op); /* Set the AML opcode */ diff --git a/sys/external/bsd/acpica/dist/compiler/aslparseop.c b/sys/external/bsd/acpica/dist/compiler/aslparseop.c index bd0e2cb9f296..3af71bb95f40 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslparseop.c +++ b/sys/external/bsd/acpica/dist/compiler/aslparseop.c @@ -295,22 +295,22 @@ TrCreateValuedLeafOp ( { case PARSEOP_STRING_LITERAL: - DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value); + DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Op->Asl.Value.String); break; case PARSEOP_NAMESEG: - DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value); + DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String); break; case PARSEOP_NAMESTRING: - DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value); + DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String); break; case PARSEOP_EISAID: - DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value); + DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Op->Asl.Value.String); break; case PARSEOP_METHOD: @@ -585,7 +585,8 @@ TrCreateConstantLeafOp ( time_t CurrentTime; char *StaticTimeString; char *TimeString; - char *Filename; + char *Filename = NULL; + ACPI_STATUS Status; switch (ParseOpcode) @@ -619,7 +620,12 @@ TrCreateConstantLeafOp ( /* Get the simple filename from the full path */ - FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename); + Status = FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename); + if (ACPI_FAILURE (Status)) + { + return (NULL); + } + Op->Asl.Value.String = Filename; break; diff --git a/sys/external/bsd/acpica/dist/compiler/aslstartup.c b/sys/external/bsd/acpica/dist/compiler/aslstartup.c index b74605b40da6..aacac487c740 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslstartup.c +++ b/sys/external/bsd/acpica/dist/compiler/aslstartup.c @@ -359,6 +359,7 @@ AslDoOneFile ( /* Determine input file type */ AslGbl_FileType = AslDetectSourceFileType (&AslGbl_Files[ASL_FILE_INPUT]); + FileNode->FileType = AslGbl_FileType; if (AslGbl_FileType == ASL_INPUT_TYPE_BINARY) { return (AE_ERROR); @@ -442,14 +443,10 @@ AslDoOneFile ( Status = CmDoCompile (); if (ACPI_FAILURE (Status)) { + PrTerminatePreprocessor (); return (Status); } - /* Cleanup (for next source file) and exit */ - - AeClearErrorLog (); - PrTerminatePreprocessor (); - /* * At this point, we know how many lines are in the input file. Save it * to display for post-compilation summary. diff --git a/sys/external/bsd/acpica/dist/compiler/aslstubs.c b/sys/external/bsd/acpica/dist/compiler/aslstubs.c index 5b0694e99d62..0fc8d876ee18 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslstubs.c +++ b/sys/external/bsd/acpica/dist/compiler/aslstubs.c @@ -58,12 +58,6 @@ * Things like Events, Global Lock, etc. are not used * by the compiler, so they are stubbed out here. */ -void -AcpiNsExecModuleCodeList ( - void) -{ -} - ACPI_STATUS AcpiNsInitializeObjects ( void) diff --git a/sys/external/bsd/acpica/dist/compiler/asltransform.c b/sys/external/bsd/acpica/dist/compiler/asltransform.c index 005524a6b9eb..4b78f1bffa9b 100644 --- a/sys/external/bsd/acpica/dist/compiler/asltransform.c +++ b/sys/external/bsd/acpica/dist/compiler/asltransform.c @@ -399,6 +399,12 @@ TrTransformSubtree ( } break; + case PARSEOP_PROCESSOR: + + AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName); + + break; + default: /* Nothing to do here for other opcodes */ diff --git a/sys/external/bsd/acpica/dist/compiler/asltypes.h b/sys/external/bsd/acpica/dist/compiler/asltypes.h index 9c40512eec26..7cbb5b05e221 100644 --- a/sys/external/bsd/acpica/dist/compiler/asltypes.h +++ b/sys/external/bsd/acpica/dist/compiler/asltypes.h @@ -397,9 +397,12 @@ typedef struct asl_files_node UINT32 TotalLineCount; UINT32 OriginalInputFileSize; UINT32 TotalKeywords; + UINT32 TotalFields; + UINT32 OutputByteLength; UINT32 TotalNamedObjects; UINT32 TotalExecutableOpcodes; BOOLEAN ParserErrorDetected; + UINT8 FileType; } ASL_GLOBAL_FILE_NODE; diff --git a/sys/external/bsd/acpica/dist/compiler/aslxrefout.c b/sys/external/bsd/acpica/dist/compiler/aslxrefout.c index 76f84361b6d0..52bc484addb2 100644 --- a/sys/external/bsd/acpica/dist/compiler/aslxrefout.c +++ b/sys/external/bsd/acpica/dist/compiler/aslxrefout.c @@ -691,7 +691,7 @@ OtXrefWalkPart3 ( else { FlPrintFile (ASL_FILE_XREF_OUTPUT, - " %u references to this object in this module\n", + " %u references to this object in this module [%s]\n", XrefInfo->ThisObjectReferences, ParentPath); } diff --git a/sys/external/bsd/acpica/dist/compiler/dtcompiler.h b/sys/external/bsd/acpica/dist/compiler/dtcompiler.h index dd926b882911..964c88f681aa 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtcompiler.h +++ b/sys/external/bsd/acpica/dist/compiler/dtcompiler.h @@ -86,7 +86,7 @@ typedef struct dt_field { char *Name; /* Field name (from name : value) */ char *Value; /* Field value (from name : value) */ - UINT32 StringLength;/* Length of Value */ + UINT32 StringLength; /* Length of Value */ struct dt_field *Next; /* Next field */ struct dt_field *NextLabel; /* If field is a label, next label */ UINT32 Line; /* Line number for this field */ @@ -148,6 +148,10 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_LabelList, NULL); DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_CurrentTableOffset, 0); +/* Data table compiler Flex/Bison prototype */ + +DT_EXTERN BOOLEAN DT_INIT_GLOBAL (AslGbl_DtLexBisonPrototype, FALSE); + /* Local caches */ DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_SubtableCount, 0); @@ -180,6 +184,14 @@ DtCompilePadding ( UINT32 Length, DT_SUBTABLE **RetSubtable); +void +DtCreateField ( + char *Name, + char *Value, + UINT32 Line, + UINT32 Offset, + UINT32 Column, + UINT32 NameColumn); /* dtio - binary and text input/output */ @@ -319,10 +331,23 @@ DtCompileFlag ( /* dtparser - lex/yacc files */ +UINT64 DtCompilerParserResult; /* Expression return value */ +int +DtCompilerParserparse ( + void); + UINT64 DtEvaluateExpression ( char *ExprString); +void +DtCompilerInitLexer ( + FILE *inFile); + +void +DtCompilerTerminateLexer ( + void); + int DtInitLexer ( char *String); diff --git a/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.l b/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.l new file mode 100644 index 000000000000..316bfb2fa715 --- /dev/null +++ b/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.l @@ -0,0 +1,180 @@ +%{ +/****************************************************************************** + * + * Module Name: dtcompilerparser.l - Flex input file for table compiler lexer + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2019, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#include "aslcompiler.h" +#include "dtcompilerparser.y.h" + +YYSTYPE DtCompilerlval; + +#define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("dtcompilerscanner") + +/* handle locations */ + +int DtCompilerParsercolumn = 1; +int DtCompilerParserByteOffset = 0; + +#define YY_USER_ACTION \ + DtCompilerParserlloc.first_line = DtCompilerParserlloc.last_line = DtCompilerParserlineno; \ + DtCompilerParserlloc.first_column = DtCompilerParsercolumn; \ + DtCompilerParserlloc.first_byte_offset = DtCompilerParserByteOffset; \ + DtCompilerParserlloc.last_column = DtCompilerParsercolumn + DtCompilerParserleng-1; \ + DtCompilerParsercolumn += DtCompilerParserleng; \ + DtCompilerParserByteOffset += DtCompilerParserleng; \ + DbgPrint (ASL_PARSE_OUTPUT,\ + "user action occurred. DtCompilerParserlloc.first_line: %u offset: %u\n",\ + DtCompilerParserlloc.first_line, DtCompilerParserlloc.first_byte_offset); +%} + +%option nounput noinput yylineno + + /* Indicates a state used for parsing multiline C comments */ +%x ML_COMMENT +%x DATA_STATE + +WhiteSpace [ \t\v\r]+ +NewLines [\n]+ + + /* Avoid ", \n, and [] as a part of label name. These are not valid characters of a label name */ +LabelName [^ ":\n\[\]]([^":\n\[\]]*[^" :\n\[\]])? + + /* Avoid ", \n, \\, and [] as a part of data. These are not valid characters of data */ +Data [^ \\":\n\[\]]([^":\n\[\]\\]*[^" :\n\[\]\\])? + +Text [^ ":\n][^":\n]* +Comment \[[^\n\[\]]*\] +CommentField {LabelName}{WhiteSpace}*:{WhiteSpace}{Comment}?$ + + +%% + +{WhiteSpace}"\\\n" { + DbgPrint(ASL_PARSE_OUTPUT,"Continuation matched\n"); + return (DT_PARSEOP_LINE_CONTINUATION); + } + +":" { + DbgPrint(ASL_PARSE_OUTPUT, ": Matched\n"); + BEGIN (DATA_STATE); + return (':'); + } + +{WhiteSpace} { DbgPrint(ASL_PARSE_OUTPUT,"Whitespace matched\n"); } + +{Comment} { DbgPrint(ASL_PARSE_OUTPUT,"Comment matched\n"); } + +"/*" { BEGIN (ML_COMMENT); } +"*/" { BEGIN (INITIAL); } +"*/\n" { BEGIN (INITIAL); } +([^*]|\n)+|. /* Ignore */ +"//".* /* Ignore */ + + +{Data} { + char *s; + int size = strlen (DtCompilerParsertext); + s=UtLocalCacheCalloc (size + 1); + AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1); + DtCompilerParserlval.s = s; + DbgPrint (ASL_PARSE_OUTPUT, "Data: %s\n", s); + return (DT_PARSEOP_DATA); +} + +{CommentField} /* ignore */ + +{LabelName} { + char *s; + int size = strlen (DtCompilerParsertext); + s=UtLocalCacheCalloc (size + 1); + AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1); + DtCompilerParserlval.s = s; + DbgPrint (ASL_PARSE_OUTPUT, "Label: %s\n", s); + return (DT_PARSEOP_LABEL); +} + + +\"{Text}?\" { // remove outer quotes from the string, they are unnecessary + char *s; + int size = strlen (DtCompilerParsertext); + s=UtLocalCacheCalloc (size - 1); + AcpiUtSafeStrncpy (s, DtCompilerParsertext + 1, size - 1); + DtCompilerParserlval.s = s; + DbgPrint (ASL_PARSE_OUTPUT, "String Data: %s\n", s); + BEGIN (INITIAL); + return (DT_PARSEOP_STRING_DATA); +} + + +{NewLines} { + DbgPrint(ASL_PARSE_OUTPUT, + "Newline matched (data state). Current line number: %u\n",DtCompilerParserlineno); + BEGIN (INITIAL); DtCompilerParsercolumn = 1; +} + + +%% + + +/* + * Local support functions + */ + +void +DtCompilerInitLexer ( + FILE *inFile) +{ + yyin = inFile; +} + +void +DtCompilerTerminateLexer ( + void) +{ + /* + * Flex/Bison increments the lineno for the EOF so decrement by 1 to get + * the correct number of lines. + */ + AslGbl_CurrentLineNumber = DtCompilerParserlineno - 1; + AslGbl_InputByteCount = DtCompilerParserByteOffset; +} diff --git a/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.y b/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.y new file mode 100644 index 000000000000..160b1c963db4 --- /dev/null +++ b/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.y @@ -0,0 +1,179 @@ +%{ +/****************************************************************************** + * + * Module Name: dtcompilerparser.y - Bison input file for table compiler parser + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2019, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#include "aslcompiler.h" + + +#define _COMPONENT DT_COMPILER + ACPI_MODULE_NAME ("dtcompilerparser") + +void * AslLocalAllocate (unsigned int Size); + +/* Bison/yacc configuration */ + +#undef alloca +#define alloca AslLocalAllocate + +int DtCompilerParserlex (void); +int DtCompilerParserparse (void); +void DtCompilerParsererror (char const *msg); +extern char *DtCompilerParsertext; +extern DT_FIELD *AslGbl_CurrentField; + +extern UINT64 DtCompilerParserResult; /* Expression return value */ +extern UINT64 DtCompilerParserlineno; /* Current line number */ + +/* Bison/yacc configuration */ + +#define yytname DtCompilerParsername +#define YYDEBUG 1 /* Enable debug output */ +#define YYERROR_VERBOSE 1 /* Verbose error messages */ +#define YYFLAG -32768 + +/* Define YYMALLOC/YYFREE to prevent redefinition errors */ + +#define YYMALLOC malloc +#define YYFREE free + +%} + +%code requires { + + typedef struct YYLTYPE { + int first_line; + int last_line; + int first_column; + int last_column; + int first_byte_offset; + } YYLTYPE; + + #define YYLTYPE_IS_DECLARED 1 +} + + +%union { + char *s; + DT_FIELD *f; +} + + +%type Table +%token DT_PARSEOP_DATA +%token DT_PARSEOP_LABEL +%token DT_PARSEOP_STRING_DATA +%token DT_PARSEOP_LINE_CONTINUATION +%type Data +%type Datum +%type MultiLineData +%type MultiLineDataList + + +%% + +Table + : + FieldList { DtCompilerParserResult = 5;} + ; + +FieldList + : Field FieldList + | Field + ; + +Field + : DT_PARSEOP_LABEL ':' Data { DtCreateField ($1, $3, (@3).first_line, (@1).first_byte_offset, (@1).first_column, (@3).first_column); } + ; + +Data + : MultiLineDataList { $$ = $1; } + | Datum { $$ = $1; } + | Datum MultiLineDataList { $$ = $1; } /* combine the string with strcat */ + ; + +MultiLineDataList + : MultiLineDataList MultiLineData { $$ = AcpiUtStrcat(AcpiUtStrcat($1, " "), $2); } /* combine the strings with strcat */ + | MultiLineData { $$ = $1; } + ; + +MultiLineData + : DT_PARSEOP_LINE_CONTINUATION Datum { DbgPrint (ASL_PARSE_OUTPUT, "line continuation detected\n"); $$ = $2; } + ; + +Datum + : DT_PARSEOP_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); } + | DT_PARSEOP_STRING_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser string data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); } + ; + + +%% + + +/* + * Local support functions, including parser entry point + */ +/****************************************************************************** + * + * FUNCTION: DtCompilerParsererror + * + * PARAMETERS: Message - Parser-generated error message + * + * RETURN: None + * + * DESCRIPTION: Handler for parser errors + * + *****************************************************************************/ + +void +DtCompilerParsererror ( + char const *Message) +{ + DtError (ASL_ERROR, ASL_MSG_SYNTAX, + AslGbl_CurrentField, (char *) Message); +} + +int +DtCompilerParserwrap(void) +{ + return (1); +} diff --git a/sys/external/bsd/acpica/dist/compiler/dtio.c b/sys/external/bsd/acpica/dist/compiler/dtio.c index a5422a2b2eaa..678657257d91 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtio.c +++ b/sys/external/bsd/acpica/dist/compiler/dtio.c @@ -385,6 +385,59 @@ DtParseLine ( } +/****************************************************************************** + * + * FUNCTION: DtCreateField + * + * PARAMETERS: Name + * Value + * Line + * Offset + * Column + * NameColumn + * + * RETURN: None + * + * DESCRIPTION: Create a field + * + *****************************************************************************/ + +void +DtCreateField ( + char *Name, + char *Value, + UINT32 Line, + UINT32 Offset, + UINT32 Column, + UINT32 NameColumn) +{ + DT_FIELD *Field = UtFieldCacheCalloc (); + + + Field->StringLength = 0; + if (Name) + { + Field->Name = + strcpy (UtLocalCacheCalloc (strlen (Name) + 1), Name); + } + + if (Value) + { + Field->StringLength = strlen (Value); + Field->Value = + strcpy (UtLocalCacheCalloc (Field->StringLength + 1), Value); + } + + Field->Line = Line; + Field->ByteOffset = Offset; + Field->NameColumn = NameColumn; + Field->Column = Column; + DtLinkField (Field); + + DtDumpFieldList (AslGbl_FieldList); +} + + /****************************************************************************** * * FUNCTION: DtGetNextLine @@ -1009,7 +1062,7 @@ DtDumpSubtableInfo ( { DbgPrint (ASL_DEBUG_OUTPUT, - "[%.04X] %24s %.08X %.08X %.08X %.08X %.08X %p %p %p\n", + "[%.04X] %24s %.08X %.08X %.08X %.08X %p %p %p %p\n", Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength, Subtable->SizeOfLengthField, Subtable->Flags, Subtable, Subtable->Parent, Subtable->Child, Subtable->Peer); @@ -1023,7 +1076,7 @@ DtDumpSubtableTree ( { DbgPrint (ASL_DEBUG_OUTPUT, - "[%.04X] %24s %*s%08X (%.02X) - (%.02X)\n", + "[%.04X] %24s %*s%p (%.02X) - (%.02X)\n", Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ", Subtable, Subtable->Length, Subtable->TotalLength); } @@ -1117,7 +1170,7 @@ DtWriteFieldToListing ( if (strlen (Field->Value) > 64) { FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n", - strlen (Field->Value)); + (UINT32) strlen (Field->Value)); } FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n"); diff --git a/sys/external/bsd/acpica/dist/compiler/dtparser.l b/sys/external/bsd/acpica/dist/compiler/dtparser.l index 6517e5249205..a2f1d2994e4b 100644 --- a/sys/external/bsd/acpica/dist/compiler/dtparser.l +++ b/sys/external/bsd/acpica/dist/compiler/dtparser.l @@ -119,7 +119,6 @@ int DtInitLexer ( char *String) { - LexBuffer = yy_scan_string (String); return (LexBuffer == NULL); } @@ -128,6 +127,5 @@ void DtTerminateLexer ( void) { - yy_delete_buffer (LexBuffer); } diff --git a/sys/external/bsd/acpica/dist/compiler/dttemplate.c b/sys/external/bsd/acpica/dist/compiler/dttemplate.c index 8fba6082775c..5aecc0adb81d 100644 --- a/sys/external/bsd/acpica/dist/compiler/dttemplate.c +++ b/sys/external/bsd/acpica/dist/compiler/dttemplate.c @@ -401,7 +401,7 @@ DtCreateOneTemplate ( AcpiUtStrlwr (DisasmFilename); if (!UtQueryForOverwrite (DisasmFilename)) { - return (AE_ERROR); + return (AE_OK); } File = fopen (DisasmFilename, "w+"); diff --git a/sys/external/bsd/acpica/dist/compiler/prmacros.c b/sys/external/bsd/acpica/dist/compiler/prmacros.c index 241dfae245b6..4d0252a3f568 100644 --- a/sys/external/bsd/acpica/dist/compiler/prmacros.c +++ b/sys/external/bsd/acpica/dist/compiler/prmacros.c @@ -115,7 +115,7 @@ PrAddDefine ( DefineInfo = PrMatchDefine (Identifier); if (DefineInfo) { - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID, + DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID "#define: name already exists: %s\n", AslGbl_CurrentLineNumber, Identifier); diff --git a/sys/external/bsd/acpica/dist/compiler/prscan.c b/sys/external/bsd/acpica/dist/compiler/prscan.c index dc8a84715c2e..39b781b3172d 100644 --- a/sys/external/bsd/acpica/dist/compiler/prscan.c +++ b/sys/external/bsd/acpica/dist/compiler/prscan.c @@ -742,7 +742,7 @@ PrDoDirective ( DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "Start #include file \"%s\"\n", AslGbl_CurrentLineNumber, - Token, AslGbl_CurrentLineNumber); + Token); PrDoIncludeFile (Token); break; @@ -1248,7 +1248,7 @@ PrDoIncludeBuffer ( { if (!(i % 8)) { - FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ", c); + FlPrintFile (ASL_FILE_PREPROCESSOR, "\n "); } FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c); @@ -1261,6 +1261,6 @@ PrDoIncludeBuffer ( /* Close the Name() operator */ - FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName); + FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n"); fclose (BinaryBufferFile); } diff --git a/sys/external/bsd/acpica/dist/debugger/dbhistry.c b/sys/external/bsd/acpica/dist/debugger/dbhistry.c index 82fbd75ca1a2..8ce374cdae83 100644 --- a/sys/external/bsd/acpica/dist/debugger/dbhistry.c +++ b/sys/external/bsd/acpica/dist/debugger/dbhistry.c @@ -176,7 +176,7 @@ AcpiDbDisplayHistory ( { if (AcpiGbl_HistoryBuffer[HistoryIndex].Command) { - AcpiOsPrintf ("%3ld %s\n", + AcpiOsPrintf ("%3u %s\n", AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum, AcpiGbl_HistoryBuffer[HistoryIndex].Command); } diff --git a/sys/external/bsd/acpica/dist/debugger/dbobject.c b/sys/external/bsd/acpica/dist/debugger/dbobject.c index 9541f9b4047e..502d5a98255f 100644 --- a/sys/external/bsd/acpica/dist/debugger/dbobject.c +++ b/sys/external/bsd/acpica/dist/debugger/dbobject.c @@ -459,7 +459,6 @@ AcpiDbDecodeLocals ( Node = WalkState->MethodNode; - ObjDesc = WalkState->MethodDesc; /* There are no locals for the module-level code case */ diff --git a/sys/external/bsd/acpica/dist/debugger/dbstats.c b/sys/external/bsd/acpica/dist/debugger/dbstats.c index ad6287a6f94c..ee06b0fec6b5 100644 --- a/sys/external/bsd/acpica/dist/debugger/dbstats.c +++ b/sys/external/bsd/acpica/dist/debugger/dbstats.c @@ -436,14 +436,14 @@ AcpiDbDisplayStatistics ( for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++) { - AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i), + AcpiOsPrintf ("%16.16s %10u %10u\n", AcpiUtGetTypeName (i), AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]); } - AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown", + AcpiOsPrintf ("%16.16s %10u %10u\n", "Misc/Unknown", AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc); - AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:", + AcpiOsPrintf ("%16.16s %10u %10u\n", "TOTALS:", AcpiGbl_NumNodes, AcpiGbl_NumObjects); break; @@ -469,17 +469,15 @@ AcpiDbDisplayStatistics ( case CMD_STAT_MISC: AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n"); - AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n", + AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiPsFind", AcpiGbl_PsFindCount); - AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n", + AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiNsLookup", AcpiGbl_NsLookupCount); - AcpiOsPrintf ("\n"); - - AcpiOsPrintf ("Mutex usage:\n\n"); + AcpiOsPrintf ("\nMutex usage:\n\n"); for (i = 0; i < ACPI_NUM_MUTEX; i++) { - AcpiOsPrintf ("%-28s: % 7ld\n", + AcpiOsPrintf ("%-28s: %7u\n", AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount); } break; @@ -488,50 +486,50 @@ AcpiDbDisplayStatistics ( AcpiOsPrintf ("\nInternal object sizes:\n\n"); - AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON)); - AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_INTEGER)); - AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING)); - AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER)); - AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE)); - AcpiOsPrintf ("BufferField %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD)); - AcpiOsPrintf ("Device %3d\n", sizeof (ACPI_OBJECT_DEVICE)); - AcpiOsPrintf ("Event %3d\n", sizeof (ACPI_OBJECT_EVENT)); - AcpiOsPrintf ("Method %3d\n", sizeof (ACPI_OBJECT_METHOD)); - AcpiOsPrintf ("Mutex %3d\n", sizeof (ACPI_OBJECT_MUTEX)); - AcpiOsPrintf ("Region %3d\n", sizeof (ACPI_OBJECT_REGION)); - AcpiOsPrintf ("PowerResource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE)); - AcpiOsPrintf ("Processor %3d\n", sizeof (ACPI_OBJECT_PROCESSOR)); - AcpiOsPrintf ("ThermalZone %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE)); - AcpiOsPrintf ("RegionField %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD)); - AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD)); - AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD)); - AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE)); - AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER)); - AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER)); - AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA)); - AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA)); + AcpiOsPrintf ("Common %3d\n", (UINT32) sizeof (ACPI_OBJECT_COMMON)); + AcpiOsPrintf ("Number %3d\n", (UINT32) sizeof (ACPI_OBJECT_INTEGER)); + AcpiOsPrintf ("String %3d\n", (UINT32) sizeof (ACPI_OBJECT_STRING)); + AcpiOsPrintf ("Buffer %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER)); + AcpiOsPrintf ("Package %3d\n", (UINT32) sizeof (ACPI_OBJECT_PACKAGE)); + AcpiOsPrintf ("BufferField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER_FIELD)); + AcpiOsPrintf ("Device %3d\n", (UINT32) sizeof (ACPI_OBJECT_DEVICE)); + AcpiOsPrintf ("Event %3d\n", (UINT32) sizeof (ACPI_OBJECT_EVENT)); + AcpiOsPrintf ("Method %3d\n", (UINT32) sizeof (ACPI_OBJECT_METHOD)); + AcpiOsPrintf ("Mutex %3d\n", (UINT32) sizeof (ACPI_OBJECT_MUTEX)); + AcpiOsPrintf ("Region %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION)); + AcpiOsPrintf ("PowerResource %3d\n", (UINT32) sizeof (ACPI_OBJECT_POWER_RESOURCE)); + AcpiOsPrintf ("Processor %3d\n", (UINT32) sizeof (ACPI_OBJECT_PROCESSOR)); + AcpiOsPrintf ("ThermalZone %3d\n", (UINT32) sizeof (ACPI_OBJECT_THERMAL_ZONE)); + AcpiOsPrintf ("RegionField %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION_FIELD)); + AcpiOsPrintf ("BankField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BANK_FIELD)); + AcpiOsPrintf ("IndexField %3d\n", (UINT32) sizeof (ACPI_OBJECT_INDEX_FIELD)); + AcpiOsPrintf ("Reference %3d\n", (UINT32) sizeof (ACPI_OBJECT_REFERENCE)); + AcpiOsPrintf ("Notify %3d\n", (UINT32) sizeof (ACPI_OBJECT_NOTIFY_HANDLER)); + AcpiOsPrintf ("AddressSpace %3d\n", (UINT32) sizeof (ACPI_OBJECT_ADDR_HANDLER)); + AcpiOsPrintf ("Extra %3d\n", (UINT32) sizeof (ACPI_OBJECT_EXTRA)); + AcpiOsPrintf ("Data %3d\n", (UINT32) sizeof (ACPI_OBJECT_DATA)); AcpiOsPrintf ("\n"); - AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON)); - AcpiOsPrintf ("ParseObjectNamed %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED)); - AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL)); - AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT)); - AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE)); - AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT)); + AcpiOsPrintf ("ParseObject %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_COMMON)); + AcpiOsPrintf ("ParseObjectNamed %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_NAMED)); + AcpiOsPrintf ("ParseObjectAsl %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_ASL)); + AcpiOsPrintf ("OperandObject %3d\n", (UINT32) sizeof (ACPI_OPERAND_OBJECT)); + AcpiOsPrintf ("NamespaceNode %3d\n", (UINT32) sizeof (ACPI_NAMESPACE_NODE)); + AcpiOsPrintf ("AcpiObject %3d\n", (UINT32) sizeof (ACPI_OBJECT)); AcpiOsPrintf ("\n"); - AcpiOsPrintf ("Generic State %3d\n", sizeof (ACPI_GENERIC_STATE)); - AcpiOsPrintf ("Common State %3d\n", sizeof (ACPI_COMMON_STATE)); - AcpiOsPrintf ("Control State %3d\n", sizeof (ACPI_CONTROL_STATE)); - AcpiOsPrintf ("Update State %3d\n", sizeof (ACPI_UPDATE_STATE)); - AcpiOsPrintf ("Scope State %3d\n", sizeof (ACPI_SCOPE_STATE)); - AcpiOsPrintf ("Parse Scope %3d\n", sizeof (ACPI_PSCOPE_STATE)); - AcpiOsPrintf ("Package State %3d\n", sizeof (ACPI_PKG_STATE)); - AcpiOsPrintf ("Thread State %3d\n", sizeof (ACPI_THREAD_STATE)); - AcpiOsPrintf ("Result Values %3d\n", sizeof (ACPI_RESULT_VALUES)); - AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO)); + AcpiOsPrintf ("Generic State %3d\n", (UINT32) sizeof (ACPI_GENERIC_STATE)); + AcpiOsPrintf ("Common State %3d\n", (UINT32) sizeof (ACPI_COMMON_STATE)); + AcpiOsPrintf ("Control State %3d\n", (UINT32) sizeof (ACPI_CONTROL_STATE)); + AcpiOsPrintf ("Update State %3d\n", (UINT32) sizeof (ACPI_UPDATE_STATE)); + AcpiOsPrintf ("Scope State %3d\n", (UINT32) sizeof (ACPI_SCOPE_STATE)); + AcpiOsPrintf ("Parse Scope %3d\n", (UINT32) sizeof (ACPI_PSCOPE_STATE)); + AcpiOsPrintf ("Package State %3d\n", (UINT32) sizeof (ACPI_PKG_STATE)); + AcpiOsPrintf ("Thread State %3d\n", (UINT32) sizeof (ACPI_THREAD_STATE)); + AcpiOsPrintf ("Result Values %3d\n", (UINT32) sizeof (ACPI_RESULT_VALUES)); + AcpiOsPrintf ("Notify Info %3d\n", (UINT32) sizeof (ACPI_NOTIFY_INFO)); break; case CMD_STAT_STACK: diff --git a/sys/external/bsd/acpica/dist/dispatcher/dsinit.c b/sys/external/bsd/acpica/dist/dispatcher/dsinit.c index 8db132d5ade8..6e3d84483175 100644 --- a/sys/external/bsd/acpica/dist/dispatcher/dsinit.c +++ b/sys/external/bsd/acpica/dist/dispatcher/dsinit.c @@ -254,7 +254,7 @@ AcpiDsInitializeObjects ( if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nInitializing Namespace objects:\n")); + "\nACPI table initialization:\n")); } /* Summary of objects initialized */ diff --git a/sys/external/bsd/acpica/dist/events/evgpe.c b/sys/external/bsd/acpica/dist/events/evgpe.c index b293aee34697..5908e593ce4a 100644 --- a/sys/external/bsd/acpica/dist/events/evgpe.c +++ b/sys/external/bsd/acpica/dist/events/evgpe.c @@ -132,14 +132,6 @@ AcpiEvEnableGpe ( ACPI_FUNCTION_TRACE (EvEnableGpe); - /* Clear the GPE (of stale events) */ - - Status = AcpiHwClearGpe(GpeEventInfo); - if (ACPI_FAILURE(Status)) - { - return_ACPI_STATUS(Status); - } - /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); @@ -216,6 +208,7 @@ AcpiEvMaskGpe ( * FUNCTION: AcpiEvAddGpeReference * * PARAMETERS: GpeEventInfo - Add a reference to this GPE + * ClearOnEnable - Clear GPE status before enabling it * * RETURN: Status * @@ -226,7 +219,8 @@ AcpiEvMaskGpe ( ACPI_STATUS AcpiEvAddGpeReference ( - ACPI_GPE_EVENT_INFO *GpeEventInfo) + ACPI_GPE_EVENT_INFO *GpeEventInfo, + BOOLEAN ClearOnEnable) { ACPI_STATUS Status = AE_OK; @@ -244,6 +238,11 @@ AcpiEvAddGpeReference ( { /* Enable on first reference */ + if (ClearOnEnable) + { + (void) AcpiHwClearGpe (GpeEventInfo); + } + Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo); if (ACPI_SUCCESS (Status)) { @@ -741,6 +740,15 @@ AcpiEvDetectGpe ( Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + if (!GpeEventInfo) + { + GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); + if (!GpeEventInfo) + { + goto ErrorExit; + } + } + /* Get the info block for the entire GPE register */ GpeRegisterInfo = GpeEventInfo->RegisterInfo; diff --git a/sys/external/bsd/acpica/dist/events/evgpeblk.c b/sys/external/bsd/acpica/dist/events/evgpeblk.c index 131eec8ccee5..b523bbf50a92 100644 --- a/sys/external/bsd/acpica/dist/events/evgpeblk.c +++ b/sys/external/bsd/acpica/dist/events/evgpeblk.c @@ -529,7 +529,7 @@ AcpiEvInitializeGpeBlock ( continue; } - Status = AcpiEvAddGpeReference (GpeEventInfo); + Status = AcpiEvAddGpeReference (GpeEventInfo, FALSE); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, diff --git a/sys/external/bsd/acpica/dist/events/evxfgpe.c b/sys/external/bsd/acpica/dist/events/evxfgpe.c index 161f3c79e155..f2946bc46c5a 100644 --- a/sys/external/bsd/acpica/dist/events/evxfgpe.c +++ b/sys/external/bsd/acpica/dist/events/evxfgpe.c @@ -159,7 +159,7 @@ AcpiEnableGpe ( if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_NONE) { - Status = AcpiEvAddGpeReference (GpeEventInfo); + Status = AcpiEvAddGpeReference (GpeEventInfo, TRUE); if (ACPI_SUCCESS (Status) && ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo)) { @@ -767,6 +767,33 @@ UnlockAndExit: ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus) +/******************************************************************************* + * + * FUNCTION: AcpiDispatchGpe + * + * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1 + * GpeNumber - GPE level within the GPE block + * + * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED + * + * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function + * (e.g. EC) or method (e.g. _Lxx/_Exx) handler. + * + ******************************************************************************/ + +UINT32 +AcpiDispatchGpe( + ACPI_HANDLE GpeDevice, + UINT32 GpeNumber) +{ + ACPI_FUNCTION_TRACE(acpi_dispatch_gpe); + + return (AcpiEvDetectGpe (GpeDevice, NULL, GpeNumber)); +} + +ACPI_EXPORT_SYMBOL (AcpiDispatchGpe) + + /******************************************************************************* * * FUNCTION: AcpiFinishGpe diff --git a/sys/external/bsd/acpica/dist/generate/unix/Makefile.config b/sys/external/bsd/acpica/dist/generate/unix/Makefile.config index a8f9fed04ebb..c28e8a9b1963 100644 --- a/sys/external/bsd/acpica/dist/generate/unix/Makefile.config +++ b/sys/external/bsd/acpica/dist/generate/unix/Makefile.config @@ -147,6 +147,14 @@ ACPICA_HEADERS = \ # OPT_CFLAGS ?= $(CWARNINGFLAGS) +# +# Debug flags +# +ifeq ($(DEBUG),TRUE) +CFLAGS +=-g +LDFLAGS +=-g +endif + # # Common compiler flags # The _GNU_SOURCE symbol is required for many hosts. @@ -272,3 +280,4 @@ MFLAGS= -P -I$(ASL_COMPILER) LEX= flex LFLAGS += -i -s +DLFLAGS += -i diff --git a/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile b/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile index 23ca16b39df5..47ea73caba99 100644 --- a/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile +++ b/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile @@ -33,12 +33,15 @@ vpath %.c \ HEADERS = \ $(wildcard $(ASL_COMPILER)/*.h)\ $(OBJDIR)/aslcompiler.y.h\ + $(OBJDIR)/dtcompilerparser.y.h\ $(OBJDIR)/dtparser.y.h\ $(OBJDIR)/prparser.y.h OBJECTS = \ $(OBJDIR)/aslcompilerlex.o\ $(OBJDIR)/aslcompilerparse.o\ + $(OBJDIR)/dtcompilerparserlex.o\ + $(OBJDIR)/dtcompilerparserparse.o\ $(OBJDIR)/dtparserlex.o\ $(OBJDIR)/dtparserparse.o\ $(OBJDIR)/prparserlex.o\ @@ -251,11 +254,14 @@ INTERMEDIATES = \ $(OBJDIR)/aslcompilerparse.c\ $(OBJDIR)/dtparserlex.c\ $(OBJDIR)/dtparserparse.c\ + $(OBJDIR)/dtcompilerparserlex.c\ + $(OBJDIR)/dtcompilerparserparse.c\ $(OBJDIR)/prparserlex.c\ $(OBJDIR)/prparserparse.c MISC = \ $(OBJDIR)/aslcompiler.y.h\ + $(OBJDIR)/dtcompilerparser.y.h\ $(OBJDIR)/dtparser.y.h\ $(OBJDIR)/prparser.y.h @@ -322,9 +328,17 @@ $(OBJDIR)/aslcompilerparse.c $(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y @echo "- " $(YACC) " "$< @$(call safe_yacc,AslCompiler,$<,$@) +$(OBJDIR)/dtcompilerparserlex.c : $(ASL_COMPILER)/dtcompilerparser.l $(OBJDIR)/dtcompilerparser.y.h + @echo "- " $(LEX) " "$< + @$(LEX) $(DLFLAGS) -PDtCompilerParser -o$@ $< + +$(OBJDIR)/dtcompilerparserparse.c $(OBJDIR)/dtcompilerparser.y.h : $(ASL_COMPILER)/dtcompilerparser.y + @echo "- " $(YACC) " "$< + @$(call safe_yacc,DtCompilerParser,$<,$@) + $(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h @echo "- " $(LEX) " "$< - @$(LEX) $(LFLAGS) -PDtParser -o$@ $< + @$(LEX) $(DLFLAGS) -PDtParser -o$@ $< $(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparser.y.h : $(ASL_COMPILER)/dtparser.y @echo "- " $(YACC) " "$< @@ -352,6 +366,14 @@ $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c @echo "- " "Intermediate" $< @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< +$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + +$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + $(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c @echo "- " "Intermediate" $< @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< diff --git a/sys/external/bsd/acpica/dist/include/acconfig.h b/sys/external/bsd/acpica/dist/include/acconfig.h index 4a95e203adda..530983ebee41 100644 --- a/sys/external/bsd/acpica/dist/include/acconfig.h +++ b/sys/external/bsd/acpica/dist/include/acconfig.h @@ -131,9 +131,9 @@ #define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */ -/* OwnerId tracking. 8 entries allows for 255 OwnerIds */ +/* OwnerId tracking. 128 entries allows for 4095 OwnerIds */ -#define ACPI_NUM_OWNERID_MASKS 8 +#define ACPI_NUM_OWNERID_MASKS 128 /* Size of the root table array is increased by this increment */ diff --git a/sys/external/bsd/acpica/dist/include/acevents.h b/sys/external/bsd/acpica/dist/include/acevents.h index c2f6140e74f6..8db2bd496752 100644 --- a/sys/external/bsd/acpica/dist/include/acevents.h +++ b/sys/external/bsd/acpica/dist/include/acevents.h @@ -137,7 +137,8 @@ AcpiEvMaskGpe ( ACPI_STATUS AcpiEvAddGpeReference ( - ACPI_GPE_EVENT_INFO *GpeEventInfo); + ACPI_GPE_EVENT_INFO *GpeEventInfo, + BOOLEAN ClearOnEnable); ACPI_STATUS AcpiEvRemoveGpeReference ( diff --git a/sys/external/bsd/acpica/dist/include/acobject.h b/sys/external/bsd/acpica/dist/include/acobject.h index 150f6fb236e8..45f09839b6d3 100644 --- a/sys/external/bsd/acpica/dist/include/acobject.h +++ b/sys/external/bsd/acpica/dist/include/acobject.h @@ -225,8 +225,8 @@ typedef struct acpi_object_method } Dispatch; UINT32 AmlLength; - UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; + UINT8 ThreadCount; } ACPI_OBJECT_METHOD; diff --git a/sys/external/bsd/acpica/dist/include/acstruct.h b/sys/external/bsd/acpica/dist/include/acstruct.h index 04123f307f13..ae168d757801 100644 --- a/sys/external/bsd/acpica/dist/include/acstruct.h +++ b/sys/external/bsd/acpica/dist/include/acstruct.h @@ -219,9 +219,9 @@ typedef struct acpi_evaluate_info UINT32 ReturnFlags; /* Used for return value analysis */ UINT32 ReturnBtype; /* Bitmapped type of the returned object */ UINT16 ParamCount; /* Count of the input argument list */ + UINT16 NodeFlags; /* Same as Node->Flags */ UINT8 PassNumber; /* Parser pass number */ UINT8 ReturnObjectType; /* Object type of the returned object */ - UINT8 NodeFlags; /* Same as Node->Flags */ UINT8 Flags; /* General flags */ } ACPI_EVALUATE_INFO; diff --git a/sys/external/bsd/acpica/dist/include/platform/aclinux.h b/sys/external/bsd/acpica/dist/include/platform/aclinux.h index 0e7fe9de002d..240d2196f7d0 100644 --- a/sys/external/bsd/acpica/dist/include/platform/aclinux.h +++ b/sys/external/bsd/acpica/dist/include/platform/aclinux.h @@ -97,6 +97,11 @@ #define ACPI_INIT_FUNCTION __init +/* Use a specific bugging default separate from ACPICA */ + +#undef ACPI_DEBUG_DEFAULT +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) + #ifndef CONFIG_ACPI /* External globals for __KERNEL__, stubs is needed */ @@ -113,11 +118,6 @@ #define ACPI_NO_ERROR_MESSAGES #undef ACPI_DEBUG_OUTPUT -/* Use a specific bugging default separate from ACPICA */ - -#undef ACPI_DEBUG_DEFAULT -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) - /* External interface for __KERNEL__, stub is needed */ #define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \ diff --git a/sys/external/bsd/acpica/dist/include/platform/acmsvc.h b/sys/external/bsd/acpica/dist/include/platform/acmsvc.h index ae279681ee33..a8dc52404c8c 100644 --- a/sys/external/bsd/acpica/dist/include/platform/acmsvc.h +++ b/sys/external/bsd/acpica/dist/include/platform/acmsvc.h @@ -148,6 +148,10 @@ #endif #endif +/* warn C4001: use of slash-slash comments */ +/* NOTE: MSVC 2015 headers use these extensively */ +#pragma warning(disable:4001) + /* warn C4100: unreferenced formal parameter */ #pragma warning(disable:4100) @@ -160,10 +164,20 @@ /* warn C4131: uses old-style declarator (iASL compiler only) */ #pragma warning(disable:4131) +/* warn C4131: uses old-style declarator (iASL compiler only) */ +#pragma warning(disable:4459) + #if _MSC_VER > 1200 /* Versions above VC++ 6 */ #pragma warning( disable : 4295 ) /* needed for acpredef.h array */ #endif +/* + * MSVC 2015+ + */ + + /* warn C4459: xxxx (identifier) hides global declaration */ +#pragma warning(disable:4459) + /* Debug support. */ diff --git a/sys/external/bsd/acpica/dist/include/platform/acwin.h b/sys/external/bsd/acpica/dist/include/platform/acwin.h index 0c4344eb4efc..b834347b78f7 100644 --- a/sys/external/bsd/acpica/dist/include/platform/acwin.h +++ b/sys/external/bsd/acpica/dist/include/platform/acwin.h @@ -44,9 +44,33 @@ #ifndef __ACWIN_H__ #define __ACWIN_H__ +#include + #define ACPI_USE_STANDARD_HEADERS #define ACPI_USE_SYSTEM_CLIBRARY + /* Note: do not include any C library headers here */ + + /* + * Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER + * as appropriate to enable editor functions like "Find all references". + * The editor isn't smart enough to dig through the include files to find + * out if these are actually defined. + */ + + /* Eliminate warnings for "old" (non-secure) versions of clib functions */ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +/* Eliminate warnings for POSIX clib function names (open, write, etc.) */ + +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE +#endif + + #define ACPI_MACHINE_WIDTH 32 #define ACPI_USE_NATIVE_DIVIDE #define ACPI_USE_NATIVE_MATH64 @@ -75,7 +99,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64; #define stat _stat #define fstat _fstat #define mkdir _mkdir -#define snprintf _snprintf +#define fileno _fileno +#define isatty _isatty + #if _MSC_VER <= 1200 /* Versions below VC++ 6 */ #define vsnprintf _vsnprintf #endif @@ -87,6 +113,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64; #define S_IREAD _S_IREAD #define S_IWRITE _S_IWRITE #define S_IFDIR _S_IFDIR +#if _MSC_VER < 1900 +#define snprintf _snprintf +#endif /* diff --git a/sys/external/bsd/acpica/dist/include/platform/acwin64.h b/sys/external/bsd/acpica/dist/include/platform/acwin64.h index 5dda0a5de8e8..33450d841c8d 100644 --- a/sys/external/bsd/acpica/dist/include/platform/acwin64.h +++ b/sys/external/bsd/acpica/dist/include/platform/acwin64.h @@ -47,6 +47,28 @@ #define ACPI_USE_STANDARD_HEADERS #define ACPI_USE_SYSTEM_CLIBRARY + /* Note: do not include any C library headers here */ + + /* + * Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER + * as appropriate to enable editor functions like "Find all references". + * The editor isn't smart enough to dig through the include files to find + * out if these are actually defined. + */ + + /* Eliminate warnings for "old" (non-secure) versions of clib functions */ + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + +/* Eliminate warnings for POSIX clib function names (open, write, etc.) */ + +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE +#endif + + #define ACPI_MACHINE_WIDTH 64 /* diff --git a/sys/external/bsd/acpica/dist/namespace/nsalloc.c b/sys/external/bsd/acpica/dist/namespace/nsalloc.c index fb5cc71d0072..b77725b915c0 100644 --- a/sys/external/bsd/acpica/dist/namespace/nsalloc.c +++ b/sys/external/bsd/acpica/dist/namespace/nsalloc.c @@ -315,7 +315,7 @@ AcpiNsInstallNode ( Node->Type = (UINT8) Type; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "%4.4s (%s) [Node %p Owner %X] added to %4.4s (%s) [Node %p]\n", + "%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), Node, OwnerId, AcpiUtGetNodeName (ParentNode), AcpiUtGetTypeName (ParentNode->Type), ParentNode)); diff --git a/sys/external/bsd/acpica/dist/namespace/nsload.c b/sys/external/bsd/acpica/dist/namespace/nsload.c index 07f5b6b70e39..dc1bb9a890e8 100644 --- a/sys/external/bsd/acpica/dist/namespace/nsload.c +++ b/sys/external/bsd/acpica/dist/namespace/nsload.c @@ -160,18 +160,6 @@ Unlock: ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Completed Table Object Initialization\n")); - /* - * This case handles the legacy option that groups all module-level - * code blocks together and defers execution until all of the tables - * are loaded. Execute all of these blocks at this time. - * Execute any module-level code that was detected during the table - * load phase. - * - * Note: this option is deprecated and will be eliminated in the - * future. Use of this option can cause problems with AML code that - * depends upon in-order immediate execution of module-level code. - */ - AcpiNsExecModuleCodeList (); return_ACPI_STATUS (Status); } diff --git a/sys/external/bsd/acpica/dist/namespace/nsutils.c b/sys/external/bsd/acpica/dist/namespace/nsutils.c index 2584dca6a2a8..6873ecd02966 100644 --- a/sys/external/bsd/acpica/dist/namespace/nsutils.c +++ b/sys/external/bsd/acpica/dist/namespace/nsutils.c @@ -694,24 +694,11 @@ AcpiNsTerminate ( void) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT *Prev; - ACPI_OPERAND_OBJECT *Next; ACPI_FUNCTION_TRACE (NsTerminate); - /* Delete any module-level code blocks */ - - Next = AcpiGbl_ModuleCodeList; - while (Next) - { - Prev = Next; - Next = Next->Method.Mutex; - Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */ - AcpiUtRemoveReference (Prev); - } - /* * Free the entire namespace -- all nodes and all objects * attached to the nodes diff --git a/sys/external/bsd/acpica/dist/tests/templates/Makefile b/sys/external/bsd/acpica/dist/tests/templates/Makefile index 1880dcc04184..bc08d6342e2e 100644 --- a/sys/external/bsd/acpica/dist/tests/templates/Makefile +++ b/sys/external/bsd/acpica/dist/tests/templates/Makefile @@ -1,9 +1,34 @@ +# Before running this file, we assume we have generated all tables by running +# the command `iasl -T ALL` +# +# Note: the NAME flag is required when running the test + +aml_obj=$(NAME).aml +dsl_obj=$(NAME).dsl +aml_obj2=$(NAME)_recomp.aml + + +all: $(aml_obj2) + +# recompile and binary compare +$(aml_obj2): %_recomp.aml: %.dsl + iasl -p `basename $@` $< > /dev/null 2> /dev/null + acpibin -c $@ $(patsubst %_recomp.aml,%.aml,$@) > /dev/null 2> /dev/null + printf "Data table %s PASS\n" $(basename $< .dsl) + +# disassemble +$(dsl_obj): %.dsl: %.aml + iasl -d $< > /dev/null 2> /dev/null + +# initial compile +$(aml_obj): %.aml: %.asl + iasl $< > /dev/null 2> /dev/null -PROG= templates templates : sh templates.sh -clean : +.PHONY: clean +clean: rm -f *.asl *.aml *.dsl *.hex diff.log diff --git a/sys/external/bsd/acpica/dist/tools/acpiexec/aeexec.c b/sys/external/bsd/acpica/dist/tools/acpiexec/aeexec.c index f4135ded33ae..c2ced976aefc 100644 --- a/sys/external/bsd/acpica/dist/tools/acpiexec/aeexec.c +++ b/sys/external/bsd/acpica/dist/tools/acpiexec/aeexec.c @@ -344,7 +344,7 @@ ExecuteOSI ( { AcpiOsPrintf ( "Return value from _OSI method too small, %.8X\n", - ReturnValue.Length); + (UINT32) ReturnValue.Length); goto ErrorExit; } diff --git a/sys/external/bsd/acpica/dist/tools/acpiexec/aetests.c b/sys/external/bsd/acpica/dist/tools/acpiexec/aetests.c index 4cb32808b5cc..28d91fce22d9 100644 --- a/sys/external/bsd/acpica/dist/tools/acpiexec/aetests.c +++ b/sys/external/bsd/acpica/dist/tools/acpiexec/aetests.c @@ -521,7 +521,7 @@ AeLateTest ( *****************************************************************************/ static void -AeGlobalAddressRangeCheck( +AeGlobalAddressRangeCheck ( void) { ACPI_STATUS Status; @@ -530,18 +530,18 @@ AeGlobalAddressRangeCheck( UINT32 i; - ReturnBuffer.Length = ACPI_ALLOCATE_BUFFER; - AcpiUtInitializeBuffer (&ReturnBuffer, ACPI_ALLOCATE_BUFFER); - for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) { Current = AcpiGbl_AddressRangeList[i]; while (Current) { + ReturnBuffer.Length = ACPI_ALLOCATE_BUFFER; + Status = AcpiGetName (Current->RegionNode, ACPI_SINGLE_NAME, &ReturnBuffer); ACPI_CHECK_OK (AcpiGetname, Status); + AcpiOsFree (ReturnBuffer.Pointer); Current = Current->Next; } } diff --git a/sys/external/bsd/acpica/dist/tools/acpinames/anstubs.c b/sys/external/bsd/acpica/dist/tools/acpinames/anstubs.c index fa70b94021f2..c140025d1a2d 100644 --- a/sys/external/bsd/acpica/dist/tools/acpinames/anstubs.c +++ b/sys/external/bsd/acpica/dist/tools/acpinames/anstubs.c @@ -193,13 +193,6 @@ AcpiNsEvaluate ( return (AE_NOT_IMPLEMENTED); } -void -AcpiNsExecModuleCodeList ( - void) -{ - return; -} - void AcpiExDoDebugObject ( ACPI_OPERAND_OBJECT *SourceDesc, diff --git a/sys/external/bsd/acpica/dist/tools/acpixtract/axmain.c b/sys/external/bsd/acpica/dist/tools/acpixtract/axmain.c index 92c2739a1235..cc378e20945d 100644 --- a/sys/external/bsd/acpica/dist/tools/acpixtract/axmain.c +++ b/sys/external/bsd/acpica/dist/tools/acpixtract/axmain.c @@ -88,7 +88,7 @@ DisplayUsage ( * ******************************************************************************/ -int +int ACPI_SYSTEM_XFACE main ( int argc, char *argv[]) diff --git a/sys/external/bsd/acpica/dist/tools/examples/examples.c b/sys/external/bsd/acpica/dist/tools/examples/examples.c index 3a76d9a43ea1..e7bcefb40338 100644 --- a/sys/external/bsd/acpica/dist/tools/examples/examples.c +++ b/sys/external/bsd/acpica/dist/tools/examples/examples.c @@ -468,7 +468,7 @@ ExecuteOSI ( if (ReturnValue.Length < sizeof (ACPI_OBJECT)) { AcpiOsPrintf ("Return value from _OSI method too small, %.8X\n", - ReturnValue.Length); + (UINT32) ReturnValue.Length); goto ErrorExit; } diff --git a/sys/external/bsd/acpica/dist/utilities/uterror.c b/sys/external/bsd/acpica/dist/utilities/uterror.c index 76778943a5a1..52edc68994a4 100644 --- a/sys/external/bsd/acpica/dist/utilities/uterror.c +++ b/sys/external/bsd/acpica/dist/utilities/uterror.c @@ -80,7 +80,7 @@ AcpiUtPredefinedWarning ( const char *ModuleName, UINT32 LineNumber, char *Pathname, - UINT8 NodeFlags, + UINT16 NodeFlags, const char *Format, ...) { @@ -129,7 +129,7 @@ AcpiUtPredefinedInfo ( const char *ModuleName, UINT32 LineNumber, char *Pathname, - UINT8 NodeFlags, + UINT16 NodeFlags, const char *Format, ...) { @@ -178,7 +178,7 @@ AcpiUtPredefinedBiosError ( const char *ModuleName, UINT32 LineNumber, char *Pathname, - UINT8 NodeFlags, + UINT16 NodeFlags, const char *Format, ...) { diff --git a/sys/external/bsd/acpica/dist/utilities/utinit.c b/sys/external/bsd/acpica/dist/utilities/utinit.c index 5b2fc1c8ce6e..4dfb8e585dee 100644 --- a/sys/external/bsd/acpica/dist/utilities/utinit.c +++ b/sys/external/bsd/acpica/dist/utilities/utinit.c @@ -234,7 +234,6 @@ AcpiUtInitGlobals ( /* Namespace */ - AcpiGbl_ModuleCodeList = NULL; AcpiGbl_RootNode = NULL; AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; diff --git a/sys/external/bsd/acpica/dist/utilities/utownerid.c b/sys/external/bsd/acpica/dist/utilities/utownerid.c index ea98b81d5902..8e723fabdc74 100644 --- a/sys/external/bsd/acpica/dist/utilities/utownerid.c +++ b/sys/external/bsd/acpica/dist/utilities/utownerid.c @@ -82,7 +82,7 @@ AcpiUtAllocateOwnerId ( if (*OwnerId) { ACPI_ERROR ((AE_INFO, - "Owner ID [0x%2.2X] already exists", *OwnerId)); + "Owner ID [0x%3.3X] already exists", *OwnerId)); return_ACPI_STATUS (AE_ALREADY_EXISTS); } @@ -138,13 +138,13 @@ AcpiUtAllocateOwnerId ( /* * Construct encoded ID from the index and bit position * - * Note: Last [j].k (bit 255) is never used and is marked + * Note: Last [j].k (bit 4095) is never used and is marked * permanently allocated (prevents +1 overflow) */ *OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j)); ACPI_DEBUG_PRINT ((ACPI_DB_VALUES, - "Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId)); + "Allocated OwnerId: 0x%3.3X\n", (unsigned int) *OwnerId)); goto Exit; } } @@ -164,7 +164,7 @@ AcpiUtAllocateOwnerId ( */ Status = AE_OWNER_ID_LIMIT; ACPI_ERROR ((AE_INFO, - "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT")); + "Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT")); Exit: (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); @@ -207,7 +207,7 @@ AcpiUtReleaseOwnerId ( if (OwnerId == 0) { - ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId)); + ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%3.3X", OwnerId)); return_VOID; } @@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId ( else { ACPI_ERROR ((AE_INFO, - "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); + "Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1)); } (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); diff --git a/sys/external/bsd/acpica/dist/utilities/utxfinit.c b/sys/external/bsd/acpica/dist/utilities/utxfinit.c index 40b06e4eca76..97c9525bec33 100644 --- a/sys/external/bsd/acpica/dist/utilities/utxfinit.c +++ b/sys/external/bsd/acpica/dist/utilities/utxfinit.c @@ -273,24 +273,17 @@ AcpiInitializeObjects ( ACPI_FUNCTION_TRACE (AcpiInitializeObjects); +#ifdef ACPI_OBSOLETE_BEHAVIOR /* - * This case handles the legacy option that groups all module-level - * code blocks together and defers execution until all of the tables - * are loaded. Execute all of these blocks at this time. - * Execute any module-level code that was detected during the table - * load phase. - * - * Note: this option is deprecated and will be eliminated in the - * future. Use of this option can cause problems with AML code that - * depends upon in-order immediate execution of module-level code. + * 05/2019: Removed, initialization now happens at both object + * creation and table load time */ - AcpiNsExecModuleCodeList (); /* * Initialize the objects that remain uninitialized. This * runs the executable AML that may be part of the - * declaration of these objects: - * OperationRegions, BufferFields, Buffers, and Packages. + * declaration of these objects: OperationRegions, BufferFields, + * BankFields, Buffers, and Packages. */ if (!(Flags & ACPI_NO_OBJECT_INIT)) { @@ -300,6 +293,7 @@ AcpiInitializeObjects ( return_ACPI_STATUS (Status); } } +#endif /* * Initialize all device/region objects in the namespace. This runs