/**\r
This is the POSTFIX version of the dependency evaluator. This code does\r
not need to handle Before or After, as it is not valid to call this\r
- routine in this case. The SOR is just ignored and is a nop in the grammer.\r
- POSTFIX means all the math is done on top of the stack.\r
+ routine in this case. POSTFIX means all the math is done on top of the stack.\r
\r
@param DriverEntry DriverEntry element to update.\r
\r
return FALSE;\r
}\r
\r
+ DEBUG ((DEBUG_DISPATCH, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
+ \r
if (DriverEntry->Depex == NULL) {\r
//\r
// A NULL Depex means that the SMM driver is not built correctly. \r
// All SMM drivers must have a valid depex expressiion.\r
//\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Depex is empty)\n"));\r
ASSERT (FALSE);\r
return FALSE;\r
}\r
// past the end of the dependency expression.\r
//\r
if (((UINTN)Iterator - (UINTN)DriverEntry->Depex) >= DriverEntry->DepexSize) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Attempt to fetch past end of depex)\n"));\r
return FALSE;\r
}\r
\r
// If the code flow arrives at this point, there was a BEFORE or AFTER\r
// that were not the first opcodes.\r
//\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected BEFORE or AFTER opcode)\n"));\r
ASSERT (FALSE);\r
- case EFI_DEP_SOR:\r
- //\r
- // These opcodes can only appear once as the first opcode. If it is found\r
- // at any other location, then the dependency expression evaluates to FALSE\r
- //\r
- if (Iterator != DriverEntry->Depex) {\r
- return FALSE;\r
- }\r
- //\r
- // Otherwise, it is the first opcode and should be treated as a NOP.\r
- //\r
- break;\r
\r
case EFI_DEP_PUSH:\r
//\r
}\r
\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid));\r
Status = PushBool (FALSE);\r
} else {\r
+ DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));\r
*Iterator = EFI_DEP_REPLACE_TRUE;\r
Status = PushBool (TRUE);\r
}\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
break;\r
\r
case EFI_DEP_AND:\r
+ DEBUG ((DEBUG_DISPATCH, " AND\n"));\r
Status = PopBool (&Operator);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
Status = PopBool (&Operator2);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
Status = PushBool ((BOOLEAN)(Operator && Operator2));\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
break;\r
\r
case EFI_DEP_OR:\r
+ DEBUG ((DEBUG_DISPATCH, " OR\n"));\r
Status = PopBool (&Operator);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
Status = PopBool (&Operator2);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
Status = PushBool ((BOOLEAN)(Operator || Operator2));\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
break;\r
\r
case EFI_DEP_NOT:\r
+ DEBUG ((DEBUG_DISPATCH, " NOT\n"));\r
Status = PopBool (&Operator);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
Status = PushBool ((BOOLEAN)(!Operator));\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
break;\r
\r
case EFI_DEP_TRUE:\r
+ DEBUG ((DEBUG_DISPATCH, " TRUE\n"));\r
Status = PushBool (TRUE);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
break;\r
\r
case EFI_DEP_FALSE:\r
+ DEBUG ((DEBUG_DISPATCH, " FALSE\n"));\r
Status = PushBool (FALSE);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
break;\r
\r
case EFI_DEP_END:\r
+ DEBUG ((DEBUG_DISPATCH, " END\n"));\r
Status = PopBool (&Operator);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", Operator ? "TRUE" : "FALSE"));\r
return Operator;\r
\r
case EFI_DEP_REPLACE_TRUE:\r
+ CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));\r
+ DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));\r
Status = PushBool (TRUE);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));\r
return FALSE;\r
}\r
\r
break;\r
\r
default:\r
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unknown opcode)\n"));\r
goto Done;\r
}\r
\r