summaryrefslogtreecommitdiff
path: root/source/components/parser/psloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/parser/psloop.c')
-rw-r--r--source/components/parser/psloop.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c
index fd6773c149c3..ef517b54d0bf 100644
--- a/source/components/parser/psloop.c
+++ b/source/components/parser/psloop.c
@@ -164,6 +164,7 @@
#include "acdispat.h"
#include "amlcode.h"
#include "acconvert.h"
+#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psloop")
@@ -645,6 +646,18 @@ AcpiPsParseLoop (
Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op);
if (ACPI_FAILURE (Status))
{
+ /*
+ * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
+ * executing it as a control method. However, if we encounter
+ * an error while loading the table, we need to keep trying to
+ * load the table rather than aborting the table load. Set the
+ * status to AE_OK to proceed with the table load.
+ */
+ if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) &&
+ Status == AE_ALREADY_EXISTS)
+ {
+ Status = AE_OK;
+ }
if (Status == AE_CTRL_PARSE_CONTINUE)
{
continue;
@@ -665,18 +678,20 @@ AcpiPsParseLoop (
{
return_ACPI_STATUS (Status);
}
- if (WalkState->Opcode == AML_SCOPE_OP)
+ if (AcpiNsOpensScope (
+ AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType))
{
/*
- * 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.
+ * If the scope/device op fails to parse, skip the body of
+ * the scope op because the parse failure indicates that
+ * the device may not exist.
*/
+ ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s",
+ AcpiPsGetOpcodeName (WalkState->Opcode)));
WalkState->ParserState.Aml = WalkState->Aml + 1;
WalkState->ParserState.Aml =
AcpiPsGetNextPackageEnd(&WalkState->ParserState);
WalkState->Aml = WalkState->ParserState.Aml;
- ACPI_ERROR ((AE_INFO, "Skipping Scope block"));
}
continue;
@@ -834,6 +849,22 @@ AcpiPsParseLoop (
{
Status = AE_OK;
}
+ else if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) &&
+ (ACPI_AML_EXCEPTION(Status) || Status == AE_ALREADY_EXISTS ||
+ Status == AE_NOT_FOUND))
+ {
+ /*
+ * ACPI_PARSE_MODULE_LEVEL flag means that we are currently
+ * loading a table by executing it as a control method.
+ * However, if we encounter an error while loading the table,
+ * we need to keep trying to load the table rather than
+ * aborting the table load (setting the status to AE_OK
+ * continues the table load). If we get a failure at this
+ * point, it means that the dispatcher got an error while
+ * trying to execute the Op.
+ */
+ Status = AE_OK;
+ }
}
Status = AcpiPsCompleteOp (WalkState, &Op, Status);