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

@@ -6,12 +6,14 @@
**/
/**
Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
**/
void __debugbreak (VOID);
void
__debugbreak (
VOID
);
#pragma intrinsic(__debugbreak)
@@ -30,4 +32,3 @@ CpuBreakpoint (
{
__debugbreak ();
}

View File

@@ -7,12 +7,8 @@
**/
#include "BaseLibInternals.h"
/**
Used to serialize load and store operations.
@@ -32,7 +28,6 @@ MemoryFence (
__asm__ __volatile__ ("":::"memory");
}
/**
Requests CPU to pause for a short period of time.
@@ -49,7 +44,6 @@ CpuPause (
__asm__ __volatile__ ("pause");
}
/**
Generates a breakpoint on the CPU.
@@ -66,7 +60,6 @@ CpuBreakpoint (
__asm__ __volatile__ ("int $3");
}
/**
Reads the current value of the EFLAGS register.
@@ -83,13 +76,13 @@ AsmReadEflags (
VOID
)
{
UINTN Eflags;
UINTN Eflags;
__asm__ __volatile__ (
"pushfq \n\t"
"pop %0 "
: "=r" (Eflags) // %0
);
);
return Eflags;
}
@@ -107,17 +100,16 @@ AsmReadEflags (
VOID
EFIAPI
InternalX86FxSave (
OUT IA32_FX_BUFFER *Buffer
OUT IA32_FX_BUFFER *Buffer
)
{
__asm__ __volatile__ (
"fxsave %0"
:
: "m" (*Buffer) // %0
);
);
}
/**
Restores the current floating point/SSE/SSE2 context from a buffer.
@@ -131,17 +123,16 @@ InternalX86FxSave (
VOID
EFIAPI
InternalX86FxRestore (
IN CONST IA32_FX_BUFFER *Buffer
IN CONST IA32_FX_BUFFER *Buffer
)
{
__asm__ __volatile__ (
"fxrstor %0"
:
: "m" (*Buffer) // %0
);
);
}
/**
Reads the current value of 64-bit MMX Register #0 (MM0).
@@ -162,12 +153,11 @@ AsmReadMm0 (
__asm__ __volatile__ (
"movd %%mm0, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #1 (MM1).
@@ -188,12 +178,11 @@ AsmReadMm1 (
__asm__ __volatile__ (
"movd %%mm1, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #2 (MM2).
@@ -214,12 +203,11 @@ AsmReadMm2 (
__asm__ __volatile__ (
"movd %%mm2, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #3 (MM3).
@@ -240,12 +228,11 @@ AsmReadMm3 (
__asm__ __volatile__ (
"movd %%mm3, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #4 (MM4).
@@ -266,12 +253,11 @@ AsmReadMm4 (
__asm__ __volatile__ (
"movd %%mm4, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #5 (MM5).
@@ -292,12 +278,11 @@ AsmReadMm5 (
__asm__ __volatile__ (
"movd %%mm5, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #6 (MM6).
@@ -318,12 +303,11 @@ AsmReadMm6 (
__asm__ __volatile__ (
"movd %%mm6, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #7 (MM7).
@@ -344,12 +328,11 @@ AsmReadMm7 (
__asm__ __volatile__ (
"movd %%mm7, %0 \n\t"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Writes the current value of 64-bit MMX Register #0 (MM0).
@@ -362,17 +345,16 @@ AsmReadMm7 (
VOID
EFIAPI
AsmWriteMm0 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm0" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #1 (MM1).
@@ -385,17 +367,16 @@ AsmWriteMm0 (
VOID
EFIAPI
AsmWriteMm1 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm1" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #2 (MM2).
@@ -408,17 +389,16 @@ AsmWriteMm1 (
VOID
EFIAPI
AsmWriteMm2 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm2" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #3 (MM3).
@@ -431,17 +411,16 @@ AsmWriteMm2 (
VOID
EFIAPI
AsmWriteMm3 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm3" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #4 (MM4).
@@ -454,17 +433,16 @@ AsmWriteMm3 (
VOID
EFIAPI
AsmWriteMm4 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm4" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #5 (MM5).
@@ -477,17 +455,16 @@ AsmWriteMm4 (
VOID
EFIAPI
AsmWriteMm5 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm5" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #6 (MM6).
@@ -500,17 +477,16 @@ AsmWriteMm5 (
VOID
EFIAPI
AsmWriteMm6 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm6" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #7 (MM7).
@@ -523,17 +499,16 @@ AsmWriteMm6 (
VOID
EFIAPI
AsmWriteMm7 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movd %0, %%mm7" // %0
:
: "m" (Value)
);
);
}
/**
Reads the current value of Time Stamp Counter (TSC).
@@ -556,7 +531,7 @@ AsmReadTsc (
"rdtsc"
: "=a" (LowData),
"=d" (HiData)
);
);
return (((UINT64)HiData) << 32) | LowData;
}

View File

@@ -8,7 +8,6 @@
**/
#include "BaseLibInternals.h"
#include <Library/RegisterFilterLib.h>
@@ -27,7 +26,6 @@ EnableInterrupts (
__asm__ __volatile__ ("sti"::: "memory");
}
/**
Disables CPU interrupts.
@@ -60,13 +58,13 @@ DisableInterrupts (
UINT64
EFIAPI
AsmReadMsr64 (
IN UINT32 Index
IN UINT32 Index
)
{
UINT32 LowData;
UINT32 HighData;
UINT64 Value;
BOOLEAN Flag;
UINT32 LowData;
UINT32 HighData;
UINT64 Value;
BOOLEAN Flag;
Flag = FilterBeforeMsrRead (Index, &Value);
if (Flag) {
@@ -75,9 +73,10 @@ AsmReadMsr64 (
: "=a" (LowData), // %0
"=d" (HighData) // %1
: "c" (Index) // %2
);
);
Value = (((UINT64)HighData) << 32) | LowData;
}
FilterAfterMsrRead (Index, &Value);
return Value;
@@ -103,13 +102,13 @@ AsmReadMsr64 (
UINT64
EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
IN UINT32 Index,
IN UINT64 Value
)
{
UINT32 LowData;
UINT32 HighData;
BOOLEAN Flag;
UINT32 LowData;
UINT32 HighData;
BOOLEAN Flag;
Flag = FilterBeforeMsrWrite (Index, &Value);
if (Flag) {
@@ -121,8 +120,9 @@ AsmWriteMsr64 (
: "c" (Index),
"a" (LowData),
"d" (HighData)
);
);
}
FilterAfterMsrWrite (Index, &Value);
return Value;
@@ -144,17 +144,16 @@ AsmReadCr0 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%cr0,%0"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of the Control Register 2 (CR2).
@@ -171,12 +170,12 @@ AsmReadCr2 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%cr2, %0"
: "=r" (Data) // %0
);
);
return Data;
}
@@ -197,17 +196,16 @@ AsmReadCr3 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%cr3, %0"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of the Control Register 4 (CR4).
@@ -224,17 +222,16 @@ AsmReadCr4 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%cr4, %0"
: "=r" (Data) // %0
);
);
return Data;
}
/**
Writes a value to Control Register 0 (CR0).
@@ -256,11 +253,10 @@ AsmWriteCr0 (
"mov %0, %%cr0"
:
: "r" (Cr0)
);
);
return Cr0;
}
/**
Writes a value to Control Register 2 (CR2).
@@ -282,11 +278,10 @@ AsmWriteCr2 (
"mov %0, %%cr2"
:
: "r" (Cr2)
);
);
return Cr2;
}
/**
Writes a value to Control Register 3 (CR3).
@@ -308,11 +303,10 @@ AsmWriteCr3 (
"mov %0, %%cr3"
:
: "r" (Cr3)
);
);
return Cr3;
}
/**
Writes a value to Control Register 4 (CR4).
@@ -334,11 +328,10 @@ AsmWriteCr4 (
"mov %0, %%cr4"
:
: "r" (Cr4)
);
);
return Cr4;
}
/**
Reads the current value of Debug Register 0 (DR0).
@@ -355,17 +348,16 @@ AsmReadDr0 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr0, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 1 (DR1).
@@ -382,17 +374,16 @@ AsmReadDr1 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr1, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 2 (DR2).
@@ -409,17 +400,16 @@ AsmReadDr2 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr2, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 3 (DR3).
@@ -436,17 +426,16 @@ AsmReadDr3 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr3, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 4 (DR4).
@@ -463,17 +452,16 @@ AsmReadDr4 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr4, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 5 (DR5).
@@ -490,17 +478,16 @@ AsmReadDr5 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr5, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 6 (DR6).
@@ -517,17 +504,16 @@ AsmReadDr6 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr6, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 7 (DR7).
@@ -544,17 +530,16 @@ AsmReadDr7 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"mov %%dr7, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Writes a value to Debug Register 0 (DR0).
@@ -576,11 +561,10 @@ AsmWriteDr0 (
"mov %0, %%dr0"
:
: "r" (Dr0)
);
);
return Dr0;
}
/**
Writes a value to Debug Register 1 (DR1).
@@ -602,11 +586,10 @@ AsmWriteDr1 (
"mov %0, %%dr1"
:
: "r" (Dr1)
);
);
return Dr1;
}
/**
Writes a value to Debug Register 2 (DR2).
@@ -628,11 +611,10 @@ AsmWriteDr2 (
"mov %0, %%dr2"
:
: "r" (Dr2)
);
);
return Dr2;
}
/**
Writes a value to Debug Register 3 (DR3).
@@ -654,11 +636,10 @@ AsmWriteDr3 (
"mov %0, %%dr3"
:
: "r" (Dr3)
);
);
return Dr3;
}
/**
Writes a value to Debug Register 4 (DR4).
@@ -680,11 +661,10 @@ AsmWriteDr4 (
"mov %0, %%dr4"
:
: "r" (Dr4)
);
);
return Dr4;
}
/**
Writes a value to Debug Register 5 (DR5).
@@ -706,11 +686,10 @@ AsmWriteDr5 (
"mov %0, %%dr5"
:
: "r" (Dr5)
);
);
return Dr5;
}
/**
Writes a value to Debug Register 6 (DR6).
@@ -732,11 +711,10 @@ AsmWriteDr6 (
"mov %0, %%dr6"
:
: "r" (Dr6)
);
);
return Dr6;
}
/**
Writes a value to Debug Register 7 (DR7).
@@ -758,11 +736,10 @@ AsmWriteDr7 (
"mov %0, %%dr7"
:
: "r" (Dr7)
);
);
return Dr7;
}
/**
Reads the current value of Code Segment Register (CS).
@@ -783,12 +760,11 @@ AsmReadCs (
__asm__ __volatile__ (
"mov %%cs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Data Segment Register (DS).
@@ -809,12 +785,11 @@ AsmReadDs (
__asm__ __volatile__ (
"mov %%ds, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Extra Segment Register (ES).
@@ -835,12 +810,11 @@ AsmReadEs (
__asm__ __volatile__ (
"mov %%es, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of FS Data Segment Register (FS).
@@ -861,12 +835,11 @@ AsmReadFs (
__asm__ __volatile__ (
"mov %%fs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of GS Data Segment Register (GS).
@@ -887,12 +860,11 @@ AsmReadGs (
__asm__ __volatile__ (
"mov %%gs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Stack Segment Register (SS).
@@ -913,12 +885,11 @@ AsmReadSs (
__asm__ __volatile__ (
"mov %%ss, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Task Register (TR).
@@ -939,12 +910,11 @@ AsmReadTr (
__asm__ __volatile__ (
"str %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current Global Descriptor Table Register(GDTR) descriptor.
@@ -957,16 +927,15 @@ AsmReadTr (
VOID
EFIAPI
InternalX86ReadGdtr (
OUT IA32_DESCRIPTOR *Gdtr
OUT IA32_DESCRIPTOR *Gdtr
)
{
__asm__ __volatile__ (
"sgdt %0"
: "=m" (*Gdtr)
);
);
}
/**
Writes the current Global Descriptor Table Register (GDTR) descriptor.
@@ -979,18 +948,16 @@ InternalX86ReadGdtr (
VOID
EFIAPI
InternalX86WriteGdtr (
IN CONST IA32_DESCRIPTOR *Gdtr
IN CONST IA32_DESCRIPTOR *Gdtr
)
{
__asm__ __volatile__ (
"lgdt %0"
:
: "m" (*Gdtr)
);
);
}
/**
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
@@ -1003,16 +970,15 @@ InternalX86WriteGdtr (
VOID
EFIAPI
InternalX86ReadIdtr (
OUT IA32_DESCRIPTOR *Idtr
OUT IA32_DESCRIPTOR *Idtr
)
{
__asm__ __volatile__ (
"sidt %0"
: "=m" (*Idtr)
);
);
}
/**
Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
@@ -1025,17 +991,16 @@ InternalX86ReadIdtr (
VOID
EFIAPI
InternalX86WriteIdtr (
IN CONST IA32_DESCRIPTOR *Idtr
IN CONST IA32_DESCRIPTOR *Idtr
)
{
__asm__ __volatile__ (
"lidt %0"
:
: "m" (*Idtr)
);
);
}
/**
Reads the current Local Descriptor Table Register(LDTR) selector.
@@ -1056,12 +1021,11 @@ AsmReadLdtr (
__asm__ __volatile__ (
"sldt %0"
: "=g" (Data) // %0
);
);
return Data;
}
/**
Writes the current Local Descriptor Table Register (GDTR) selector.
@@ -1074,14 +1038,14 @@ AsmReadLdtr (
VOID
EFIAPI
AsmWriteLdtr (
IN UINT16 Ldtr
IN UINT16 Ldtr
)
{
__asm__ __volatile__ (
"lldtw %0"
:
: "g" (Ldtr) // %0
);
);
}
/**
@@ -1098,7 +1062,7 @@ AsmWriteLdtr (
UINT64
EFIAPI
AsmReadPmc (
IN UINT32 Index
IN UINT32 Index
)
{
UINT32 LowData;
@@ -1109,7 +1073,7 @@ AsmReadPmc (
: "=a" (LowData),
"=d" (HiData)
: "c" (Index)
);
);
return (((UINT64)HiData) << 32) | LowData;
}
@@ -1133,9 +1097,9 @@ AsmReadPmc (
UINTN
EFIAPI
AsmMonitor (
IN UINTN Eax,
IN UINTN Ecx,
IN UINTN Edx
IN UINTN Eax,
IN UINTN Ecx,
IN UINTN Edx
)
{
__asm__ __volatile__ (
@@ -1144,7 +1108,7 @@ AsmMonitor (
: "a" (Eax),
"c" (Ecx),
"d" (Edx)
);
);
return Eax;
}
@@ -1166,8 +1130,8 @@ AsmMonitor (
UINTN
EFIAPI
AsmMwait (
IN UINTN Eax,
IN UINTN Ecx
IN UINTN Eax,
IN UINTN Ecx
)
{
__asm__ __volatile__ (
@@ -1175,7 +1139,7 @@ AsmMwait (
:
: "a" (Eax),
"c" (Ecx)
);
);
return Eax;
}
@@ -1210,10 +1174,8 @@ AsmInvd (
)
{
__asm__ __volatile__ ("invd":::"memory");
}
/**
Flushes a cache line from all the instruction and data caches within the
coherency domain of the CPU.
@@ -1232,7 +1194,7 @@ AsmInvd (
VOID *
EFIAPI
AsmFlushCacheLine (
IN VOID *LinearAddress
IN VOID *LinearAddress
)
{
__asm__ __volatile__ (
@@ -1240,7 +1202,7 @@ AsmFlushCacheLine (
:
: "r" (LinearAddress)
: "memory"
);
);
return LinearAddress;
return LinearAddress;
}

View File

@@ -102,7 +102,6 @@ InternalX86DisablePaging32 (
ASSERT (FALSE);
}
/**
Enables the 64-bit paging mode on the CPU.
@@ -133,11 +132,11 @@ InternalX86DisablePaging32 (
VOID
EFIAPI
InternalX86EnablePaging64 (
IN UINT16 Cs,
IN UINT64 EntryPoint,
IN UINT64 Context1 OPTIONAL,
IN UINT64 Context2 OPTIONAL,
IN UINT64 NewStack
IN UINT16 Cs,
IN UINT64 EntryPoint,
IN UINT64 Context1 OPTIONAL,
IN UINT64 Context2 OPTIONAL,
IN UINT64 NewStack
)
{
//

View File

@@ -12,7 +12,10 @@
#include <Library/RegisterFilterLib.h>
unsigned __int64 __readmsr (int register);
unsigned __int64
__readmsr (
int register
);
#pragma intrinsic(__readmsr)
@@ -30,15 +33,15 @@ AsmReadMsr64 (
IN UINT32 Index
)
{
UINT64 Value;
BOOLEAN Flag;
UINT64 Value;
BOOLEAN Flag;
Flag = FilterBeforeMsrRead (Index, &Value);
if (Flag) {
Value = __readmsr (Index);
}
FilterAfterMsrRead (Index, &Value);
return Value;
}

View File

@@ -12,7 +12,11 @@
#include <Library/RegisterFilterLib.h>
void __writemsr (unsigned long Register, unsigned __int64 Value);
void
__writemsr (
unsigned long Register,
unsigned __int64 Value
);
#pragma intrinsic(__writemsr)
@@ -32,14 +36,14 @@ AsmWriteMsr64 (
IN UINT64 Value
)
{
BOOLEAN Flag;
BOOLEAN Flag;
Flag = FilterBeforeMsrWrite (Index, &Value);
if (Flag) {
__writemsr (Index, Value);
}
FilterAfterMsrWrite (Index, &Value);
return Value;
}