Print this page
acpica-unix2-20130823
PANKOVs restructure
@@ -3,11 +3,11 @@
* Module Name: dswload2 - Dispatcher second pass namespace load callbacks
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2013, 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:
@@ -234,27 +234,41 @@
* Name (DEB, 0)
* Scope (DEB) { ... }
*/
ACPI_WARNING ((AE_INFO,
"Type override - [%4.4s] had invalid type (%s) "
- "for Scope operator, changed to type ANY\n",
+ "for Scope operator, changed to type ANY",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
Node->Type = ACPI_TYPE_ANY;
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
break;
+ case ACPI_TYPE_METHOD:
+
+ /*
+ * Allow scope change to root during execution of module-level
+ * code. Root is typed METHOD during this time.
+ */
+ if ((Node == AcpiGbl_RootNode) &&
+ (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
+ {
+ break;
+ }
+
+ /*lint -fallthrough */
+
default:
/* All other types are an error */
ACPI_ERROR ((AE_INFO,
"Invalid type (%s) for target of "
"Scope operator [%4.4s] (Cannot override)",
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
- return (AE_AML_OPERAND_TYPE);
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
break;
default:
@@ -480,11 +494,10 @@
* be evaluated later during the execution phase
*/
Status = AcpiDsCreateBufferField (Op, WalkState);
break;
-
case AML_TYPE_NAMED_FIELD:
/*
* If we are executing a method, initialize the field
*/
if (WalkState->MethodNode)
@@ -509,16 +522,16 @@
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
break;
default:
+
/* All NAMED_FIELD opcodes must be handled above */
break;
}
break;
-
case AML_TYPE_NAMED_SIMPLE:
Status = AcpiDsCreateOperands (WalkState, Arg);
if (ACPI_FAILURE (Status))
{
@@ -545,17 +558,17 @@
case AML_EVENT_OP:
Status = AcpiExCreateEvent (WalkState);
break;
-
case AML_ALIAS_OP:
Status = AcpiExCreateAlias (WalkState);
break;
default:
+
/* Unknown opcode */
Status = AE_OK;
goto Cleanup;
}
@@ -609,11 +622,11 @@
*/
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
RegionSpace, WalkState);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
AcpiExExitInterpreter ();
}
@@ -636,17 +649,15 @@
Status = AE_OK;
}
}
break;
-
case AML_NAME_OP:
Status = AcpiDsCreateNode (WalkState, Node, Op);
break;
-
case AML_METHOD_OP:
/*
* MethodOp PkgLength NameString MethodFlags TermList
*
* Note: We must create the method node/object pair as soon as we
@@ -680,22 +691,21 @@
break;
#endif /* ACPI_NO_METHOD_EXECUTION */
default:
+
/* All NAMED_COMPLEX opcodes must be handled above */
break;
}
break;
-
case AML_CLASS_INTERNAL:
/* case AML_INT_NAMEPATH_OP: */
break;
-
case AML_CLASS_METHOD_CALL:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
WalkState, Op, Node));
@@ -731,10 +741,11 @@
}
break;
default:
+
break;
}
Cleanup:
@@ -742,6 +753,5 @@
WalkState->Operands[0] = NULL;
WalkState->NumOperands = 0;
return_ACPI_STATUS (Status);
}
-