diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2018-03-14 19:17:38 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2018-03-14 19:17:38 +0000 |
| commit | e44d3d8ceb12ae786d331468fe4acf41a4af5424 (patch) | |
| tree | a0c9c4018920a4690d41c0de4de76527c5f4f090 /source/components/parser | |
| parent | 04f27355c01cb894338c3382792c0c2b75c86239 (diff) | |
Notes
Diffstat (limited to 'source/components/parser')
| -rw-r--r-- | source/components/parser/psargs.c | 3 | ||||
| -rw-r--r-- | source/components/parser/psloop.c | 24 | ||||
| -rw-r--r-- | source/components/parser/psobject.c | 6 |
3 files changed, 27 insertions, 6 deletions
diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index c9c173717e38..fba20f08e5a8 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -1051,6 +1051,9 @@ AcpiPsGetNextArg ( if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Common.Value.Arg); AcpiPsFreeOp (Arg); Arg = NULL; WalkState->ArgCount = 1; diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index 74e8f0d6ebda..28d17962bafb 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -287,10 +287,18 @@ AcpiPsGetArguments ( WalkState->ArgCount, WalkState->PassNumber)); /* - * Handle executable code at "module-level". This refers to - * executable opcodes that appear outside of any control method. + * 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. */ - if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && + if (AcpiGbl_GroupModuleLevelCode && + (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0)) { /* @@ -440,6 +448,16 @@ AcpiPsGetArguments ( * object to the global list. Note, the mutex field of the method * object is used to link multiple module-level code objects. * + * NOTE: In this legacy option, each block of detected executable AML + * code that is outside of any control method is wrapped with a temporary + * control method object and placed on a global list below. + * + * This function executes the module-level code for all tables only after + * all of the tables have been loaded. It is a legacy option and is + * not compatible with other ACPI implementations. See AcpiNsLoadTable. + * + * This function will be removed when the legacy option is removed. + * ******************************************************************************/ static void diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index b07b99f6a121..63e2b3b1ab8a 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -182,7 +182,7 @@ static ACPI_STATUS AcpiPsGetAmlOpcode ( ACPI_WALK_STATE *WalkState) { - UINT32 AmlOffset; + ACPI_ERROR_ONLY (UINT32 AmlOffset); ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState); @@ -217,8 +217,8 @@ AcpiPsGetAmlOpcode ( if (WalkState->PassNumber == 2) { - AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, - WalkState->ParserState.AmlStart); + ACPI_ERROR_ONLY(AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, + WalkState->ParserState.AmlStart)); ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", |
