diff options
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/debugger/dbnames.c | 1 | ||||
-rw-r--r-- | source/components/debugger/dbobject.c | 26 | ||||
-rw-r--r-- | source/components/dispatcher/dsdebug.c | 10 | ||||
-rw-r--r-- | source/components/executer/exconfig.c | 11 | ||||
-rw-r--r-- | source/components/namespace/nsdump.c | 4 | ||||
-rw-r--r-- | source/components/parser/psloop.c | 40 | ||||
-rw-r--r-- | source/components/parser/psobject.c | 29 | ||||
-rw-r--r-- | source/components/parser/pswalk.c | 29 | ||||
-rw-r--r-- | source/components/utilities/uterror.c | 10 |
9 files changed, 149 insertions, 11 deletions
diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index c151a3efa6120..900a9abebab5d 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -522,6 +522,7 @@ AcpiDbWalkAndMatchName ( } else { + Info.Count = 0; Info.OwnerId = ACPI_OWNER_ID_MAX; Info.DebugLevel = ACPI_UINT32_MAX; Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT; diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index 989adef03ab98..a3b515a7d5009 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -187,7 +187,17 @@ AcpiDbDumpMethodInfo ( ACPI_WALK_STATE *WalkState) { ACPI_THREAD_STATE *Thread; + ACPI_NAMESPACE_NODE *Node; + + + Node = WalkState->MethodNode; + + /* There are no locals or arguments for the module-level code case */ + if (Node == AcpiGbl_RootNode) + { + return; + } /* Ignore control codes, they are not errors */ @@ -556,8 +566,15 @@ AcpiDbDecodeLocals ( BOOLEAN DisplayLocals = FALSE; + Node = WalkState->MethodNode; ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; + + /* There are no locals for the module-level code case */ + + if (Node == AcpiGbl_RootNode) + { + return; + } if (!Node) { @@ -635,6 +652,13 @@ AcpiDbDecodeArguments ( Node = WalkState->MethodNode; ObjDesc = WalkState->MethodDesc; + /* There are no arguments for the module-level code case */ + + if (Node == AcpiGbl_RootNode) + { + return; + } + if (!Node) { AcpiOsPrintf ( diff --git a/source/components/dispatcher/dsdebug.c b/source/components/dispatcher/dsdebug.c index 52208f8177a51..10bd84f97c4e1 100644 --- a/source/components/dispatcher/dsdebug.c +++ b/source/components/dispatcher/dsdebug.c @@ -251,6 +251,7 @@ AcpiDsDumpMethodStack ( ACPI_FUNCTION_TRACE (DsDumpMethodStack); + /* Ignore control codes, they are not errors */ if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) @@ -320,8 +321,13 @@ AcpiDsDumpMethodStack ( Op->Common.Next = NULL; #ifdef ACPI_DISASSEMBLER - AcpiOsPrintf ("Failed at "); - AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); + if (WalkState->MethodNode != AcpiGbl_RootNode) + { + /* More verbose if not module-level code */ + + AcpiOsPrintf ("Failed at "); + AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); + } #endif Op->Common.Next = Next; } diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 590d83661a2d8..f876653070d64 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -678,6 +678,17 @@ AcpiExUnloadTable ( "Received request to unload an ACPI table")); /* + * May 2018: Unload is no longer supported for the following reasons: + * 1) A correct implementation on some hosts may not be possible. + * 2) Other ACPI implementations do not correctly/fully support it. + * 3) It requires host device driver support which does not exist. + * (To properly support namespace unload out from underneath.) + * 4) This AML operator has never been seen in the field. + */ + ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, + "AML Unload operator is not supported")); + + /* * Validate the handle * Although the handle is partially validated in AcpiExReconfiguration() * when it calls AcpiExResolveOperands(), the handle is more completely diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index b1e72f5db68b7..f87ca2b15ca71 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -293,6 +293,7 @@ AcpiNsDumpPathname ( } #endif + /******************************************************************************* * * FUNCTION: AcpiNsDumpOneObject @@ -351,6 +352,7 @@ AcpiNsDumpOneObject ( } Type = ThisNode->Type; + Info->Count++; /* Check if the owner matches */ @@ -815,6 +817,7 @@ AcpiNsDumpObjects ( return; } + Info.Count = 0; Info.DebugLevel = ACPI_LV_TABLES; Info.OwnerId = OwnerId; Info.DisplayType = DisplayType; @@ -823,6 +826,7 @@ AcpiNsDumpObjects ( ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, AcpiNsDumpOneObject, NULL, (void *) &Info, NULL); + AcpiOsPrintf ("\nNamespace node count: %u\n\n", Info.Count); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); } diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index 28d17962bafba..fd6773c149c30 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -665,6 +665,19 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } + if (WalkState->Opcode == AML_SCOPE_OP) + { + /* + * If the scope op fails to parse, skip the body of the + * scope op because the parse failure indicates that the + * device may not exist. + */ + WalkState->ParserState.Aml = WalkState->Aml + 1; + WalkState->ParserState.Aml = + AcpiPsGetNextPackageEnd(&WalkState->ParserState); + WalkState->Aml = WalkState->ParserState.Aml; + ACPI_ERROR ((AE_INFO, "Skipping Scope block")); + } continue; } @@ -707,7 +720,32 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } - + if ((WalkState->ControlState) && + ((WalkState->ControlState->Control.Opcode == AML_IF_OP) || + (WalkState->ControlState->Control.Opcode == AML_WHILE_OP))) + { + /* + * If the if/while op fails to parse, we will skip parsing + * the body of the op. + */ + ParserState->Aml = + WalkState->ControlState->Control.AmlPredicateStart + 1; + ParserState->Aml = + AcpiPsGetNextPackageEnd (ParserState); + WalkState->Aml = ParserState->Aml; + + ACPI_ERROR ((AE_INFO, "Skipping While/If block")); + if (*WalkState->Aml == AML_ELSE_OP) + { + ACPI_ERROR ((AE_INFO, "Skipping Else block")); + WalkState->ParserState.Aml = WalkState->Aml + 1; + WalkState->ParserState.Aml = + AcpiPsGetNextPackageEnd (ParserState); + WalkState->Aml = ParserState->Aml; + } + ACPI_FREE(AcpiUtPopGenericState (&WalkState->ControlState)); + } + Op = NULL; continue; } } diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index 63e2b3b1ab8a0..8d6f81bd68b31 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -154,6 +154,7 @@ #include "acparser.h" #include "amlcode.h" #include "acconvert.h" +#include "acnamesp.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psobject") @@ -722,6 +723,20 @@ AcpiPsCompleteOp ( { if (*Op) { + /* + * These Opcodes need to be removed from the namespace because they + * get created even if these opcodes cannot be created due to + * errors. + */ + if (((*Op)->Common.AmlOpcode == AML_REGION_OP) || + ((*Op)->Common.AmlOpcode == AML_DATA_REGION_OP)) + { + AcpiNsDeleteChildren ((*Op)->Common.Node); + AcpiNsRemoveNode ((*Op)->Common.Node); + (*Op)->Common.Node = NULL; + AcpiPsDeleteParseTree (*Op); + } + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); if (ACPI_FAILURE (Status2)) { @@ -747,6 +762,20 @@ AcpiPsCompleteOp ( #endif WalkState->PrevOp = NULL; WalkState->PrevArgTypes = WalkState->ArgTypes; + + if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) + { + /* + * There was something that went wrong while executing code at the + * module-level. We need to skip parsing whatever caused the + * error and keep going. One runtime error during the table load + * should not cause the entire table to not be loaded. This is + * because there could be correct AML beyond the parts that caused + * the runtime error. + */ + ACPI_ERROR ((AE_INFO, "Ignore error and continue table load")); + return_ACPI_STATUS (AE_OK); + } return_ACPI_STATUS (Status); } diff --git a/source/components/parser/pswalk.c b/source/components/parser/pswalk.c index eb57e36a9cef1..db4999e08de59 100644 --- a/source/components/parser/pswalk.c +++ b/source/components/parser/pswalk.c @@ -169,6 +169,8 @@ * ******************************************************************************/ +#include "amlcode.h" + void AcpiPsDeleteParseTree ( ACPI_PARSE_OBJECT *SubtreeRoot) @@ -176,19 +178,40 @@ AcpiPsDeleteParseTree ( ACPI_PARSE_OBJECT *Op = SubtreeRoot; ACPI_PARSE_OBJECT *Next = NULL; ACPI_PARSE_OBJECT *Parent = NULL; + UINT32 Level = 0; ACPI_FUNCTION_TRACE_PTR (PsDeleteParseTree, SubtreeRoot); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE_TREES, + " root %p\n", SubtreeRoot)); /* Visit all nodes in the subtree */ while (Op) { - /* Check if we are not ascending */ - if (Op != Parent) { + /* This is the descending case */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_PARSE_TREES, _COMPONENT)) + { + /* This debug option will print the entire parse tree */ + + AcpiOsPrintf (" %*.s%s %p", (Level * 4), " ", + AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Op); + + if (Op->Named.AmlOpcode == AML_INT_NAMEPATH_OP) + { + AcpiOsPrintf (" %4.4s", Op->Common.Value.String); + } + if (Op->Named.AmlOpcode == AML_STRING_OP) + { + AcpiOsPrintf (" %s", Op->Common.Value.String); + } + AcpiOsPrintf ("\n"); + } + /* Look for an argument or child of the current op */ Next = AcpiPsGetArg (Op, 0); @@ -197,6 +220,7 @@ AcpiPsDeleteParseTree ( /* Still going downward in tree (Op is not completed yet) */ Op = Next; + Level++; continue; } } @@ -221,6 +245,7 @@ AcpiPsDeleteParseTree ( } else { + Level--; Op = Parent; } } diff --git a/source/components/utilities/uterror.c b/source/components/utilities/uterror.c index a44c106fea4df..eca92f3b1b5c3 100644 --- a/source/components/utilities/uterror.c +++ b/source/components/utilities/uterror.c @@ -352,20 +352,20 @@ AcpiUtPrefixedNamespaceError ( { case AE_ALREADY_EXISTS: - AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); Message = "Failure creating"; break; case AE_NOT_FOUND: - AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); - Message = "Failure looking up"; + AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + Message = "Could not resolve"; break; default: - AcpiOsPrintf (ACPI_MSG_ERROR); - Message = "Failure looking up"; + AcpiOsPrintf ("\n" ACPI_MSG_ERROR); + Message = "Failure resolving"; break; } |