MdePkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

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

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:05 -08:00
committed by mergify[bot]
parent 1436aea4d5
commit 2f88bd3a12
975 changed files with 55681 additions and 57790 deletions

View File

@@ -10,7 +10,6 @@
#include "BasePeCoffLibInternals.h"
#include <Library/BaseLib.h>
/**
Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and
return the immediate data encoded in the instruction.
@@ -22,7 +21,7 @@
**/
UINT16
ThumbMovtImmediateAddress (
IN UINT16 *Instruction
IN UINT16 *Instruction
)
{
UINT32 Movt;
@@ -43,7 +42,6 @@ ThumbMovtImmediateAddress (
return Address;
}
/**
Update an ARM MOVT or MOVW immediate instruction immediate data.
@@ -52,14 +50,14 @@ ThumbMovtImmediateAddress (
**/
VOID
ThumbMovtImmediatePatch (
IN OUT UINT16 *Instruction,
IN UINT16 Address
IN OUT UINT16 *Instruction,
IN UINT16 Address
)
{
UINT16 Patch;
// First 16-bit chunk of instruciton
Patch = ((Address >> 12) & 0x000f); // imm4
Patch = ((Address >> 12) & 0x000f); // imm4
Patch |= (((Address & BIT11) != 0) ? BIT10 : 0); // i
// Mask out instruction bits and or in address
*(Instruction) = (*Instruction & ~0x040f) | Patch;
@@ -72,8 +70,6 @@ ThumbMovtImmediatePatch (
*Instruction = (*Instruction & ~0x70ff) | Patch;
}
/**
Pass in a pointer to an ARM MOVW/MOVT instruciton pair and
return the immediate data encoded in the two` instruction.
@@ -85,7 +81,7 @@ ThumbMovtImmediatePatch (
**/
UINT32
ThumbMovwMovtImmediateAddress (
IN UINT16 *Instructions
IN UINT16 *Instructions
)
{
UINT16 *Word;
@@ -97,7 +93,6 @@ ThumbMovwMovtImmediateAddress (
return (ThumbMovtImmediateAddress (Top) << 16) + ThumbMovtImmediateAddress (Word);
}
/**
Update an ARM MOVW/MOVT immediate instruction instruction pair.
@@ -106,8 +101,8 @@ ThumbMovwMovtImmediateAddress (
**/
VOID
ThumbMovwMovtImmediatePatch (
IN OUT UINT16 *Instructions,
IN UINT32 Address
IN OUT UINT16 *Instructions,
IN UINT32 Address
)
{
UINT16 *Word;
@@ -120,8 +115,6 @@ ThumbMovwMovtImmediatePatch (
ThumbMovtImmediatePatch (Top, (UINT16)(Address >> 16));
}
/**
Performs an ARM-based specific relocation fixup and is a no-op on other
instruction sets.
@@ -136,36 +129,36 @@ ThumbMovwMovtImmediatePatch (
**/
RETURN_STATUS
PeCoffLoaderRelocateImageEx (
IN UINT16 *Reloc,
IN OUT CHAR8 *Fixup,
IN OUT CHAR8 **FixupData,
IN UINT64 Adjust
IN UINT16 *Reloc,
IN OUT CHAR8 *Fixup,
IN OUT CHAR8 **FixupData,
IN UINT64 Adjust
)
{
UINT16 *Fixup16;
UINT32 FixupVal;
UINT16 *Fixup16;
UINT32 FixupVal;
Fixup16 = (UINT16 *) Fixup;
Fixup16 = (UINT16 *)Fixup;
switch ((*Reloc) >> 12) {
case EFI_IMAGE_REL_BASED_ARM_MOV32T:
FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
case EFI_IMAGE_REL_BASED_ARM_MOV32T:
FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
if (*FixupData != NULL) {
*FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));
// Fixup16 is not aligned so we must copy it. Thumb instructions are streams of 16 bytes.
CopyMem (*FixupData, Fixup16, sizeof (UINT64));
*FixupData = *FixupData + sizeof (UINT64);
}
if (*FixupData != NULL) {
*FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
// Fixup16 is not aligned so we must copy it. Thumb instructions are streams of 16 bytes.
CopyMem (*FixupData, Fixup16, sizeof (UINT64));
*FixupData = *FixupData + sizeof(UINT64);
}
break;
break;
case EFI_IMAGE_REL_BASED_ARM_MOV32A:
ASSERT (FALSE);
// break omitted - ARM instruction encoding not implemented
default:
return RETURN_UNSUPPORTED;
case EFI_IMAGE_REL_BASED_ARM_MOV32A:
ASSERT (FALSE);
// break omitted - ARM instruction encoding not implemented
default:
return RETURN_UNSUPPORTED;
}
return RETURN_SUCCESS;
@@ -209,10 +202,10 @@ PeCoffLoaderImageFormatSupported (
**/
RETURN_STATUS
PeHotRelocateImageEx (
IN UINT16 *Reloc,
IN OUT CHAR8 *Fixup,
IN OUT CHAR8 **FixupData,
IN UINT64 Adjust
IN UINT16 *Reloc,
IN OUT CHAR8 *Fixup,
IN OUT CHAR8 **FixupData,
IN UINT64 Adjust
)
{
UINT16 *Fixup16;
@@ -221,22 +214,22 @@ PeHotRelocateImageEx (
Fixup16 = (UINT16 *)Fixup;
switch ((*Reloc) >> 12) {
case EFI_IMAGE_REL_BASED_ARM_MOV32T:
*FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));
if (*(UINT64 *)(*FixupData) == ReadUnaligned64 ((UINT64 *)Fixup16)) {
FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
}
case EFI_IMAGE_REL_BASED_ARM_MOV32T:
*FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));
if (*(UINT64 *) (*FixupData) == ReadUnaligned64 ((UINT64 *)Fixup16)) {
FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
}
*FixupData = *FixupData + sizeof(UINT64);
break;
*FixupData = *FixupData + sizeof (UINT64);
break;
case EFI_IMAGE_REL_BASED_ARM_MOV32A:
ASSERT (FALSE);
case EFI_IMAGE_REL_BASED_ARM_MOV32A:
ASSERT (FALSE);
// break omitted - ARM instruction encoding not implemented
default:
DEBUG ((DEBUG_ERROR, "PeHotRelocateEx:unknown fixed type\n"));
return RETURN_UNSUPPORTED;
default:
DEBUG ((DEBUG_ERROR, "PeHotRelocateEx:unknown fixed type\n"));
return RETURN_UNSUPPORTED;
}
return RETURN_SUCCESS;