summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Pei/Dependency/Dependency.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Core/Pei/Dependency/Dependency.c')
-rw-r--r--MdeModulePkg/Core/Pei/Dependency/Dependency.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.c b/MdeModulePkg/Core/Pei/Dependency/Dependency.c
index b53e5f2686..9982167635 100644
--- a/MdeModulePkg/Core/Pei/Dependency/Dependency.c
+++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.c
@@ -49,19 +49,19 @@ IsPpiInstalled (
// possibilities of alignment faults for cross-compilation
// environments such as Intel?Itanium(TM).
//
- CopyMem(&PpiGuid, Stack->Operator, sizeof(EFI_GUID));
+ CopyMem (&PpiGuid, Stack->Operator, sizeof (EFI_GUID));
//
// Check if the PPI is installed.
//
- Status = PeiServicesLocatePpi(
+ Status = PeiServicesLocatePpi (
&PpiGuid, // GUID
0, // INSTANCE
NULL, // EFI_PEI_PPI_DESCRIPTOR
&PeiInstance // PPI
);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
return FALSE;
}
@@ -90,22 +90,20 @@ IsPpiInstalled (
**/
BOOLEAN
PeimDispatchReadiness (
- IN EFI_PEI_SERVICES **PeiServices,
- IN VOID *DependencyExpression
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN VOID *DependencyExpression
)
{
DEPENDENCY_EXPRESSION_OPERAND *Iterator;
EVAL_STACK_ENTRY *StackPtr;
EVAL_STACK_ENTRY EvalStack[MAX_GRAMMAR_SIZE];
- Iterator = DependencyExpression;
+ Iterator = DependencyExpression;
StackPtr = EvalStack;
while (TRUE) {
-
switch (*(Iterator++)) {
-
//
// For performance reason we put the frequently used items in front of
// the rarely used items
@@ -125,8 +123,8 @@ PeimDispatchReadiness (
// Push the pointer to the PUSH opcode operator (pointer to PPI GUID)
// We will evaluate if the PPI is installed on the POP operation.
//
- StackPtr->Operator = (VOID *) Iterator;
- Iterator = Iterator + sizeof (EFI_GUID);
+ StackPtr->Operator = (VOID *)Iterator;
+ Iterator = Iterator + sizeof (EFI_GUID);
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = %a\n", StackPtr->Operator, IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));
StackPtr++;
break;
@@ -138,6 +136,7 @@ PeimDispatchReadiness (
} else {
DEBUG ((DEBUG_DISPATCH, " OR\n"));
}
+
//
// Check to make sure the dependency grammar doesn't underflow the
// EvalStack on the two POPs for the AND operation. Don't need to
@@ -166,15 +165,16 @@ PeimDispatchReadiness (
//
if (*(Iterator - 1) == EFI_DEP_AND) {
if (!(IsPpiInstalled (PeiServices, StackPtr))) {
- (StackPtr-1)->Result = FALSE;
+ (StackPtr-1)->Result = FALSE;
(StackPtr-1)->Operator = NULL;
}
} else {
if (IsPpiInstalled (PeiServices, StackPtr)) {
- (StackPtr-1)->Result = TRUE;
+ (StackPtr-1)->Result = TRUE;
(StackPtr-1)->Operator = NULL;
}
}
+
break;
case (EFI_DEP_END):
@@ -188,6 +188,7 @@ PeimDispatchReadiness (
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
+
DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));
return IsPpiInstalled (PeiServices, StackPtr);
@@ -203,7 +204,8 @@ PeimDispatchReadiness (
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
- (StackPtr-1)->Result = (BOOLEAN) !IsPpiInstalled (PeiServices, (StackPtr-1));
+
+ (StackPtr-1)->Result = (BOOLEAN) !IsPpiInstalled (PeiServices, (StackPtr-1));
(StackPtr-1)->Operator = NULL;
break;
@@ -214,6 +216,7 @@ PeimDispatchReadiness (
} else {
DEBUG ((DEBUG_DISPATCH, " FALSE\n"));
}
+
//
// Check to make sure the dependency grammar doesn't overflow the
// EvalStack on the push
@@ -222,6 +225,7 @@ PeimDispatchReadiness (
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
+
//
// Iterator has increased by 1 after we retrieve the operand, so here we
// should get the value pointed by (Iterator - 1), in order to obtain the
@@ -232,6 +236,7 @@ PeimDispatchReadiness (
} else {
StackPtr->Result = FALSE;
}
+
StackPtr->Operator = NULL;
StackPtr++;
break;