Skip to content

Commit

Permalink
StandaloneMmPkg: Apply uncrustify changes
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the StandaloneMmPkg package

Cc: Andrew Fish <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Michael D Kinney <[email protected]>
Signed-off-by: Michael Kubacki <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
  • Loading branch information
makubacki authored and mergify[bot] committed Dec 7, 2021
1 parent c1e126b commit 91415a3
Show file tree
Hide file tree
Showing 41 changed files with 1,841 additions and 1,578 deletions.
288 changes: 147 additions & 141 deletions StandaloneMmPkg/Core/Dependency.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ GrowDepexStack (
VOID
)
{
BOOLEAN *NewStack;
UINTN Size;
BOOLEAN *NewStack;
UINTN Size;

Size = DEPEX_STACK_SIZE_INCREMENT;
if (mDepexEvaluationStack != NULL) {
Expand Down Expand Up @@ -167,7 +167,7 @@ PopBool (
**/
BOOLEAN
MmIsSchedulable (
IN EFI_MM_DRIVER_ENTRY *DriverEntry
IN EFI_MM_DRIVER_ENTRY *DriverEntry
)
{
EFI_STATUS Status;
Expand All @@ -177,7 +177,7 @@ MmIsSchedulable (
EFI_GUID DriverGuid;
VOID *Interface;

Operator = FALSE;
Operator = FALSE;
Operator2 = FALSE;

if (DriverEntry->After || DriverEntry->Before) {
Expand Down Expand Up @@ -206,7 +206,6 @@ MmIsSchedulable (
//
mDepexEvaluationStackPointer = mDepexEvaluationStack;


Iterator = DriverEntry->Depex;

while (TRUE) {
Expand All @@ -223,148 +222,155 @@ MmIsSchedulable (
// Look at the opcode of the dependency expression instruction.
//
switch (*Iterator) {
case EFI_DEP_BEFORE:
case EFI_DEP_AFTER:
//
// For a well-formed Dependency Expression, the code should never get here.
// The BEFORE and AFTER are processed prior to this routine's invocation.
// If the code flow arrives at this point, there was a BEFORE or AFTER
// that were not the first opcodes.
//
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected BEFORE or AFTER opcode)\n"));
ASSERT (FALSE);

case EFI_DEP_PUSH:
//
// Push operator is followed by a GUID. Test to see if the GUID protocol
// is installed and push the boolean result on the stack.
//
CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));

Status = MmLocateProtocol (&DriverGuid, NULL, &Interface);
if (EFI_ERROR (Status) && (mEfiSystemTable != NULL)) {
case EFI_DEP_BEFORE:
case EFI_DEP_AFTER:
//
// For a well-formed Dependency Expression, the code should never get here.
// The BEFORE and AFTER are processed prior to this routine's invocation.
// If the code flow arrives at this point, there was a BEFORE or AFTER
// that were not the first opcodes.
//
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected BEFORE or AFTER opcode)\n"));
ASSERT (FALSE);

case EFI_DEP_PUSH:
//
// For MM Driver, it may depend on uefi protocols
// Push operator is followed by a GUID. Test to see if the GUID protocol
// is installed and push the boolean result on the stack.
//
Status = mEfiSystemTable->BootServices->LocateProtocol (&DriverGuid, NULL, &Interface);
}
CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));

Status = MmLocateProtocol (&DriverGuid, NULL, &Interface);
if (EFI_ERROR (Status) && (mEfiSystemTable != NULL)) {
//
// For MM Driver, it may depend on uefi protocols
//
Status = mEfiSystemTable->BootServices->LocateProtocol (&DriverGuid, NULL, &Interface);
}

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid));
Status = PushBool (FALSE);
} else {
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));
*Iterator = EFI_DEP_REPLACE_TRUE;
Status = PushBool (TRUE);
}

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Iterator += sizeof (EFI_GUID);
break;

case EFI_DEP_AND:
DEBUG ((DEBUG_DISPATCH, " AND\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PopBool (&Operator2);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(Operator && Operator2));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

break;

case EFI_DEP_OR:
DEBUG ((DEBUG_DISPATCH, " OR\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PopBool (&Operator2);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(Operator || Operator2));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

break;

case EFI_DEP_NOT:
DEBUG ((DEBUG_DISPATCH, " NOT\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(!Operator));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

break;

case EFI_DEP_TRUE:
DEBUG ((DEBUG_DISPATCH, " TRUE\n"));
Status = PushBool (TRUE);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

break;

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = FALSE\n", &DriverGuid));
case EFI_DEP_FALSE:
DEBUG ((DEBUG_DISPATCH, " FALSE\n"));
Status = PushBool (FALSE);
} else {
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

break;

case EFI_DEP_END:
DEBUG ((DEBUG_DISPATCH, " END\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", Operator ? "TRUE" : "FALSE"));
return Operator;

case EFI_DEP_REPLACE_TRUE:
CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));
*Iterator = EFI_DEP_REPLACE_TRUE;
Status = PushBool (TRUE);
}
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Iterator += sizeof (EFI_GUID);
break;

case EFI_DEP_AND:
DEBUG ((DEBUG_DISPATCH, " AND\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PopBool (&Operator2);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(Operator && Operator2));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
break;

case EFI_DEP_OR:
DEBUG ((DEBUG_DISPATCH, " OR\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PopBool (&Operator2);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(Operator || Operator2));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
break;

case EFI_DEP_NOT:
DEBUG ((DEBUG_DISPATCH, " NOT\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Status = PushBool ((BOOLEAN)(!Operator));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
break;

case EFI_DEP_TRUE:
DEBUG ((DEBUG_DISPATCH, " TRUE\n"));
Status = PushBool (TRUE);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
break;

case EFI_DEP_FALSE:
DEBUG ((DEBUG_DISPATCH, " FALSE\n"));
Status = PushBool (FALSE);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
break;

case EFI_DEP_END:
DEBUG ((DEBUG_DISPATCH, " END\n"));
Status = PopBool (&Operator);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}
DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", Operator ? "TRUE" : "FALSE"));
return Operator;

case EFI_DEP_REPLACE_TRUE:
CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));
Status = PushBool (TRUE);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Iterator += sizeof (EFI_GUID);
break;

default:
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unknown opcode)\n"));
goto Done;
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
return FALSE;
}

Iterator += sizeof (EFI_GUID);
break;

default:
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unknown opcode)\n"));
goto Done;
}

//
Expand Down
Loading

0 comments on commit 91415a3

Please sign in to comment.