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,9 +6,6 @@
**/
/**
Shifts a 64-bit integer right between 0 and 63 bits. The high bits
are filled with original integer's bit 63. The shifted value is returned.
@@ -25,8 +22,8 @@
UINT64
EFIAPI
InternalMathARShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
_asm {
@@ -42,4 +39,3 @@ L0:
sar edx, cl
}
}

View File

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

View File

@@ -34,11 +34,11 @@
UINT32
EFIAPI
AsmCpuid (
IN UINT32 Index,
OUT UINT32 *RegisterEax OPTIONAL,
OUT UINT32 *RegisterEbx OPTIONAL,
OUT UINT32 *RegisterEcx OPTIONAL,
OUT UINT32 *RegisterEdx OPTIONAL
IN UINT32 Index,
OUT UINT32 *RegisterEax OPTIONAL,
OUT UINT32 *RegisterEbx OPTIONAL,
OUT UINT32 *RegisterEcx OPTIONAL,
OUT UINT32 *RegisterEdx OPTIONAL
)
{
_asm {

View File

@@ -41,12 +41,12 @@
UINT32
EFIAPI
AsmCpuidEx (
IN UINT32 Index,
IN UINT32 SubIndex,
OUT UINT32 *RegisterEax OPTIONAL,
OUT UINT32 *RegisterEbx OPTIONAL,
OUT UINT32 *RegisterEcx OPTIONAL,
OUT UINT32 *RegisterEdx OPTIONAL
IN UINT32 Index,
IN UINT32 SubIndex,
OUT UINT32 *RegisterEax OPTIONAL,
OUT UINT32 *RegisterEbx OPTIONAL,
OUT UINT32 *RegisterEcx OPTIONAL,
OUT UINT32 *RegisterEdx OPTIONAL
)
{
_asm {

View File

@@ -6,9 +6,6 @@
**/
/**
Requests CPU to pause for a short period of time.
@@ -26,4 +23,3 @@ CpuPause (
pause
}
}

View File

@@ -27,4 +27,3 @@ AsmDisableCache (
wbinvd
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Disables CPU interrupts.
@@ -23,4 +20,3 @@ DisableInterrupts (
cli
}
}

View File

@@ -38,7 +38,7 @@
function after paging is disabled.
**/
__declspec (naked)
__declspec(naked)
VOID
EFIAPI
InternalX86DisablePaging32 (

View File

@@ -28,20 +28,21 @@
INT64
EFIAPI
InternalMathDivRemS64x64 (
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
)
{
INT64 Quot;
INT64 Quot;
Quot = InternalMathDivRemU64x64 (
(UINT64) (Dividend >= 0 ? Dividend : -Dividend),
(UINT64) (Divisor >= 0 ? Divisor : -Divisor),
(UINT64 *) Remainder
(UINT64)(Dividend >= 0 ? Dividend : -Dividend),
(UINT64)(Divisor >= 0 ? Divisor : -Divisor),
(UINT64 *)Remainder
);
if (Remainder != NULL && Dividend < 0) {
if ((Remainder != NULL) && (Dividend < 0)) {
*Remainder = -*Remainder;
}
return (Dividend ^ Divisor) >= 0 ? Quot : -Quot;
}

View File

@@ -6,9 +6,6 @@
**/
/**
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
generates a 64-bit unsigned result.
@@ -26,8 +23,8 @@
UINT64
EFIAPI
InternalMathDivU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor
IN UINT64 Dividend,
IN UINT32 Divisor
)
{
_asm {
@@ -41,4 +38,3 @@ InternalMathDivU64x32 (
pop edx ; restore high-order dword of the quotient
}
}

View File

@@ -26,9 +26,9 @@
UINT64
EFIAPI
InternalMathDivRemU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder
)
{
_asm {
@@ -46,4 +46,3 @@ RemainderNull:
pop edx
}
}

View File

@@ -27,4 +27,3 @@ AsmEnableCache (
mov cr0, eax
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
@@ -27,4 +24,3 @@ EnableDisableInterrupts (
cli
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Enables CPU interrupts.
@@ -23,4 +20,3 @@ EnableInterrupts (
sti
}
}

View File

@@ -41,7 +41,7 @@
function after paging is enabled.
**/
__declspec (naked)
__declspec(naked)
VOID
EFIAPI
InternalX86EnablePaging32 (

View File

@@ -6,9 +6,6 @@
**/
/**
Flushes a cache line from all the instruction and data caches within the
coherency domain of the CPU.
@@ -27,7 +24,7 @@
VOID *
EFIAPI
AsmFlushCacheLine (
IN VOID *LinearAddress
IN VOID *LinearAddress
)
{
//
@@ -49,4 +46,3 @@ Done:
return LinearAddress;
}

View File

@@ -6,10 +6,8 @@
**/
#include "BaseLibInternals.h"
/**
Restores the current floating point/SSE/SSE2 context from a buffer.
@@ -23,7 +21,7 @@
VOID
EFIAPI
InternalX86FxRestore (
IN CONST IA32_FX_BUFFER *Buffer
IN CONST IA32_FX_BUFFER *Buffer
)
{
_asm {
@@ -31,4 +29,3 @@ InternalX86FxRestore (
fxrstor [eax]
}
}

View File

@@ -6,10 +6,8 @@
**/
#include "BaseLibInternals.h"
/**
Save the current floating point/SSE/SSE2 context to a buffer.
@@ -23,7 +21,7 @@
VOID
EFIAPI
InternalX86FxSave (
OUT IA32_FX_BUFFER *Buffer
OUT IA32_FX_BUFFER *Buffer
)
{
_asm {
@@ -31,4 +29,3 @@ InternalX86FxSave (
fxsave [eax]
}
}

View File

@@ -7,7 +7,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -77,13 +76,13 @@ AsmReadEflags (
VOID
)
{
UINTN Eflags;
UINTN Eflags;
__asm__ __volatile__ (
"pushfl \n\t"
"popl %0 "
: "=r" (Eflags)
);
);
return Eflags;
}
@@ -101,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.
@@ -125,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).
@@ -160,12 +157,11 @@ AsmReadMm0 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #1 (MM1).
@@ -190,12 +186,11 @@ AsmReadMm1 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #2 (MM2).
@@ -220,12 +215,11 @@ AsmReadMm2 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #3 (MM3).
@@ -250,12 +244,11 @@ AsmReadMm3 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #4 (MM4).
@@ -280,12 +273,11 @@ AsmReadMm4 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #5 (MM5).
@@ -310,12 +302,11 @@ AsmReadMm5 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #6 (MM6).
@@ -340,12 +331,11 @@ AsmReadMm6 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Reads the current value of 64-bit MMX Register #7 (MM7).
@@ -370,12 +360,11 @@ AsmReadMm7 (
"pop %%eax \n\t"
"pop %%edx \n\t"
: "=A" (Data) // %0
);
);
return Data;
}
/**
Writes the current value of 64-bit MMX Register #0 (MM0).
@@ -388,17 +377,16 @@ AsmReadMm7 (
VOID
EFIAPI
AsmWriteMm0 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm0" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #1 (MM1).
@@ -411,17 +399,16 @@ AsmWriteMm0 (
VOID
EFIAPI
AsmWriteMm1 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm1" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #2 (MM2).
@@ -434,17 +421,16 @@ AsmWriteMm1 (
VOID
EFIAPI
AsmWriteMm2 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm2" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #3 (MM3).
@@ -457,17 +443,16 @@ AsmWriteMm2 (
VOID
EFIAPI
AsmWriteMm3 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm3" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #4 (MM4).
@@ -480,17 +465,16 @@ AsmWriteMm3 (
VOID
EFIAPI
AsmWriteMm4 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm4" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #5 (MM5).
@@ -503,17 +487,16 @@ AsmWriteMm4 (
VOID
EFIAPI
AsmWriteMm5 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm5" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #6 (MM6).
@@ -526,17 +509,16 @@ AsmWriteMm5 (
VOID
EFIAPI
AsmWriteMm6 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm6" // %0
:
: "m" (Value)
);
);
}
/**
Writes the current value of 64-bit MMX Register #7 (MM7).
@@ -549,17 +531,16 @@ AsmWriteMm6 (
VOID
EFIAPI
AsmWriteMm7 (
IN UINT64 Value
IN UINT64 Value
)
{
__asm__ __volatile__ (
"movq %0, %%mm7" // %0
:
: "m" (Value)
);
);
}
/**
Reads the current value of Time Stamp Counter (TSC).
@@ -580,7 +561,7 @@ AsmReadTsc (
__asm__ __volatile__ (
"rdtsc"
: "=A" (Data)
);
);
return Data;
}

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,11 +58,11 @@ DisableInterrupts (
UINT64
EFIAPI
AsmReadMsr64 (
IN UINT32 Index
IN UINT32 Index
)
{
UINT64 Data;
BOOLEAN Flag;
UINT64 Data;
BOOLEAN Flag;
Flag = FilterBeforeMsrRead (Index, &Data);
if (Flag) {
@@ -72,8 +70,9 @@ AsmReadMsr64 (
"rdmsr"
: "=A" (Data) // %0
: "c" (Index) // %1
);
);
}
FilterAfterMsrRead (Index, &Data);
return Data;
@@ -99,8 +98,8 @@ AsmReadMsr64 (
UINT64
EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
IN UINT32 Index,
IN UINT64 Value
)
{
BOOLEAN Flag;
@@ -112,8 +111,9 @@ AsmWriteMsr64 (
:
: "c" (Index),
"A" (Value)
);
);
}
FilterAfterMsrWrite (Index, &Value);
return Value;
@@ -135,17 +135,16 @@ AsmReadCr0 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%cr0,%0"
: "=a" (Data)
);
);
return Data;
}
/**
Reads the current value of the Control Register 2 (CR2).
@@ -162,12 +161,12 @@ AsmReadCr2 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%cr2, %0"
: "=r" (Data)
);
);
return Data;
}
@@ -188,17 +187,16 @@ AsmReadCr3 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%cr3, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of the Control Register 4 (CR4).
@@ -215,17 +213,16 @@ AsmReadCr4 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%cr4, %0"
: "=a" (Data)
);
);
return Data;
}
/**
Writes a value to Control Register 0 (CR0).
@@ -247,11 +244,10 @@ AsmWriteCr0 (
"movl %0, %%cr0"
:
: "r" (Cr0)
);
);
return Cr0;
}
/**
Writes a value to Control Register 2 (CR2).
@@ -273,11 +269,10 @@ AsmWriteCr2 (
"movl %0, %%cr2"
:
: "r" (Cr2)
);
);
return Cr2;
}
/**
Writes a value to Control Register 3 (CR3).
@@ -299,11 +294,10 @@ AsmWriteCr3 (
"movl %0, %%cr3"
:
: "r" (Cr3)
);
);
return Cr3;
}
/**
Writes a value to Control Register 4 (CR4).
@@ -325,11 +319,10 @@ AsmWriteCr4 (
"movl %0, %%cr4"
:
: "r" (Cr4)
);
);
return Cr4;
}
/**
Reads the current value of Debug Register 0 (DR0).
@@ -346,17 +339,16 @@ AsmReadDr0 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr0, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 1 (DR1).
@@ -373,17 +365,16 @@ AsmReadDr1 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr1, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 2 (DR2).
@@ -400,17 +391,16 @@ AsmReadDr2 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr2, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 3 (DR3).
@@ -427,17 +417,16 @@ AsmReadDr3 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr3, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 4 (DR4).
@@ -454,17 +443,16 @@ AsmReadDr4 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr4, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 5 (DR5).
@@ -481,17 +469,16 @@ AsmReadDr5 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr5, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 6 (DR6).
@@ -508,17 +495,16 @@ AsmReadDr6 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr6, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Reads the current value of Debug Register 7 (DR7).
@@ -535,17 +521,16 @@ AsmReadDr7 (
VOID
)
{
UINTN Data;
UINTN Data;
__asm__ __volatile__ (
"movl %%dr7, %0"
: "=r" (Data)
);
);
return Data;
}
/**
Writes a value to Debug Register 0 (DR0).
@@ -567,11 +552,10 @@ AsmWriteDr0 (
"movl %0, %%dr0"
:
: "r" (Dr0)
);
);
return Dr0;
}
/**
Writes a value to Debug Register 1 (DR1).
@@ -593,11 +577,10 @@ AsmWriteDr1 (
"movl %0, %%dr1"
:
: "r" (Dr1)
);
);
return Dr1;
}
/**
Writes a value to Debug Register 2 (DR2).
@@ -619,11 +602,10 @@ AsmWriteDr2 (
"movl %0, %%dr2"
:
: "r" (Dr2)
);
);
return Dr2;
}
/**
Writes a value to Debug Register 3 (DR3).
@@ -645,11 +627,10 @@ AsmWriteDr3 (
"movl %0, %%dr3"
:
: "r" (Dr3)
);
);
return Dr3;
}
/**
Writes a value to Debug Register 4 (DR4).
@@ -671,11 +652,10 @@ AsmWriteDr4 (
"movl %0, %%dr4"
:
: "r" (Dr4)
);
);
return Dr4;
}
/**
Writes a value to Debug Register 5 (DR5).
@@ -697,11 +677,10 @@ AsmWriteDr5 (
"movl %0, %%dr5"
:
: "r" (Dr5)
);
);
return Dr5;
}
/**
Writes a value to Debug Register 6 (DR6).
@@ -723,11 +702,10 @@ AsmWriteDr6 (
"movl %0, %%dr6"
:
: "r" (Dr6)
);
);
return Dr6;
}
/**
Writes a value to Debug Register 7 (DR7).
@@ -749,11 +727,10 @@ AsmWriteDr7 (
"movl %0, %%dr7"
:
: "r" (Dr7)
);
);
return Dr7;
}
/**
Reads the current value of Code Segment Register (CS).
@@ -774,12 +751,11 @@ AsmReadCs (
__asm__ __volatile__ (
"mov %%cs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Data Segment Register (DS).
@@ -800,12 +776,11 @@ AsmReadDs (
__asm__ __volatile__ (
"mov %%ds, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Extra Segment Register (ES).
@@ -826,12 +801,11 @@ AsmReadEs (
__asm__ __volatile__ (
"mov %%es, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of FS Data Segment Register (FS).
@@ -852,12 +826,11 @@ AsmReadFs (
__asm__ __volatile__ (
"mov %%fs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of GS Data Segment Register (GS).
@@ -878,12 +851,11 @@ AsmReadGs (
__asm__ __volatile__ (
"mov %%gs, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Stack Segment Register (SS).
@@ -904,12 +876,11 @@ AsmReadSs (
__asm__ __volatile__ (
"mov %%ss, %0"
:"=a" (Data)
);
);
return Data;
}
/**
Reads the current value of Task Register (TR).
@@ -930,12 +901,11 @@ AsmReadTr (
__asm__ __volatile__ (
"str %0"
: "=a" (Data)
);
);
return Data;
}
/**
Reads the current Global Descriptor Table Register(GDTR) descriptor.
@@ -948,16 +918,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.
@@ -970,18 +939,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.
@@ -994,16 +961,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.
@@ -1016,17 +982,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.
@@ -1047,12 +1012,11 @@ AsmReadLdtr (
__asm__ __volatile__ (
"sldt %0"
: "=g" (Data) // %0
);
);
return Data;
}
/**
Writes the current Local Descriptor Table Register (GDTR) selector.
@@ -1065,14 +1029,14 @@ AsmReadLdtr (
VOID
EFIAPI
AsmWriteLdtr (
IN UINT16 Ldtr
IN UINT16 Ldtr
)
{
__asm__ __volatile__ (
"lldtw %0"
:
: "g" (Ldtr) // %0
);
);
}
/**
@@ -1089,7 +1053,7 @@ AsmWriteLdtr (
UINT64
EFIAPI
AsmReadPmc (
IN UINT32 Index
IN UINT32 Index
)
{
UINT64 Data;
@@ -1098,7 +1062,7 @@ AsmReadPmc (
"rdpmc"
: "=A" (Data)
: "c" (Index)
);
);
return Data;
}
@@ -1133,10 +1097,8 @@ AsmInvd (
)
{
__asm__ __volatile__ ("invd":::"memory");
}
/**
Flushes a cache line from all the instruction and data caches within the
coherency domain of the CPU.
@@ -1155,7 +1117,7 @@ AsmInvd (
VOID *
EFIAPI
AsmFlushCacheLine (
IN VOID *LinearAddress
IN VOID *LinearAddress
)
{
UINT32 RegEdx;
@@ -1170,13 +1132,12 @@ AsmFlushCacheLine (
return LinearAddress;
}
__asm__ __volatile__ (
"clflush (%0)"
: "+a" (LinearAddress)
:
: "memory"
);
);
return LinearAddress;
}

View File

@@ -44,11 +44,11 @@ InternalSwitchStack (
{
BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
JumpBuffer.Eip = (UINTN)EntryPoint;
JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
((VOID**)JumpBuffer.Esp)[1] = Context1;
((VOID**)JumpBuffer.Esp)[2] = Context2;
JumpBuffer.Eip = (UINTN)EntryPoint;
JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID *);
JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
((VOID **)JumpBuffer.Esp)[1] = Context1;
((VOID **)JumpBuffer.Esp)[2] = Context2;
LongJump (&JumpBuffer, (UINTN)-1);
}

View File

@@ -6,9 +6,6 @@
**/
/**
Executes a INVD instruction.
@@ -26,4 +23,3 @@ AsmInvd (
invd
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Rotates a 64-bit integer left between 0 and 63 bits, filling
the low bits with the high bits that were rotated.
@@ -26,8 +23,8 @@
UINT64
EFIAPI
InternalMathLRotU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
_asm {
@@ -43,7 +40,6 @@ InternalMathLRotU64 (
mov ecx, eax
mov eax, edx
mov edx, ecx
L0:
L0 :
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Shifts a 64-bit integer left between 0 and 63 bits. The low bits
are filled with zeros. The shifted value is returned.
@@ -25,8 +22,8 @@
UINT64
EFIAPI
InternalMathLShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
_asm {
@@ -42,4 +39,3 @@ L0:
shl eax, cl
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
generates a 32-bit unsigned remainder.
@@ -26,8 +23,8 @@
UINT32
EFIAPI
InternalMathModU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor
IN UINT64 Dividend,
IN UINT32 Divisor
)
{
_asm {

View File

@@ -25,9 +25,9 @@
UINTN
EFIAPI
AsmMonitor (
IN UINTN RegisterEax,
IN UINTN RegisterEcx,
IN UINTN RegisterEdx
IN UINTN RegisterEax,
IN UINTN RegisterEcx,
IN UINTN RegisterEdx
)
{
_asm {
@@ -39,4 +39,3 @@ AsmMonitor (
_emit 0xc8
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
and generates a 64-bit unsigned result.
@@ -26,8 +23,8 @@
UINT64
EFIAPI
InternalMathMultU64x32 (
IN UINT64 Multiplicand,
IN UINT32 Multiplier
IN UINT64 Multiplicand,
IN UINT32 Multiplier
)
{
_asm {
@@ -38,4 +35,3 @@ InternalMathMultU64x32 (
add edx, ecx
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer
and generates a 64-bit unsigned result.
@@ -26,8 +23,8 @@
UINT64
EFIAPI
InternalMathMultU64x64 (
IN UINT64 Multiplicand,
IN UINT64 Multiplier
IN UINT64 Multiplicand,
IN UINT64 Multiplier
)
{
_asm {
@@ -42,4 +39,3 @@ InternalMathMultU64x64 (
add edx, ebx
}
}

View File

@@ -23,8 +23,8 @@
UINTN
EFIAPI
AsmMwait (
IN UINTN RegisterEax,
IN UINTN RegisterEcx
IN UINTN RegisterEax,
IN UINTN RegisterEcx
)
{
_asm {
@@ -35,4 +35,3 @@ AsmMwait (
_emit 0xC9
}
}

View File

@@ -37,11 +37,11 @@
VOID
EFIAPI
InternalX86DisablePaging64 (
IN UINT16 CodeSelector,
IN UINT32 EntryPoint,
IN UINT32 Context1 OPTIONAL,
IN UINT32 Context2 OPTIONAL,
IN UINT32 NewStack
IN UINT16 CodeSelector,
IN UINT32 EntryPoint,
IN UINT32 Context1 OPTIONAL,
IN UINT32 Context2 OPTIONAL,
IN UINT32 NewStack
)
{
//

View File

@@ -6,9 +6,6 @@
**/
/**
Rotates a 64-bit integer right between 0 and 63 bits, filling
the high bits with the high low bits that were rotated.
@@ -26,8 +23,8 @@
UINT64
EFIAPI
InternalMathRRotU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
_asm {
@@ -46,4 +43,3 @@ InternalMathRRotU64 (
L0:
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Shifts a 64-bit integer right between 0 and 63 bits. This high bits
are filled with zeros. The shifted value is returned.
@@ -25,8 +22,8 @@
UINT64
EFIAPI
InternalMathRShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
_asm {
@@ -42,4 +39,3 @@ L0:
shr edx, cl
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of the Control Register 0 (CR0).

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of the Control Register 2 (CR2).
@@ -29,4 +26,3 @@ AsmReadCr2 (
mov eax, cr2
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of the Control Register 3 (CR3).
@@ -29,4 +26,3 @@ AsmReadCr3 (
mov eax, cr3
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of the Control Register 4 (CR4).
@@ -31,4 +28,3 @@ AsmReadCr4 (
_emit 0xE0
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Code Segment Register (CS).
@@ -29,4 +26,3 @@ AsmReadCs (
mov ax, cs
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 0 (DR0).
@@ -29,4 +26,3 @@ AsmReadDr0 (
mov eax, dr0
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 1 (DR1).
@@ -29,4 +26,3 @@ AsmReadDr1 (
mov eax, dr1
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 2 (DR2).
@@ -29,4 +26,3 @@ AsmReadDr2 (
mov eax, dr2
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 3 (DR3).
@@ -29,4 +26,3 @@ AsmReadDr3 (
mov eax, dr3
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 4 (DR4).
@@ -31,4 +28,3 @@ AsmReadDr4 (
_emit 0xe0
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 5 (DR5).
@@ -31,4 +28,3 @@ AsmReadDr5 (
_emit 0xe8
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 6 (DR6).
@@ -29,4 +26,3 @@ AsmReadDr6 (
mov eax, dr6
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Debug Register 7 (DR7).
@@ -29,4 +26,3 @@ AsmReadDr7 (
mov eax, dr7
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Data Segment Register (DS).
@@ -29,4 +26,3 @@ AsmReadDs (
mov ax, ds
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of the EFLAGS register.
@@ -30,4 +27,3 @@ AsmReadEflags (
pop eax
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of ES Data Segment Register (ES).
@@ -29,4 +26,3 @@ AsmReadEs (
mov ax, es
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of FS Data Segment Register (FS).
@@ -29,4 +26,3 @@ AsmReadFs (
mov ax, fs
}
}

View File

@@ -6,10 +6,8 @@
**/
#include "BaseLibInternals.h"
/**
Reads the current Global Descriptor Table Register(GDTR) descriptor.
@@ -30,4 +28,3 @@ InternalX86ReadGdtr (
sgdt fword ptr [eax]
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of GS Data Segment Register (GS).
@@ -29,4 +26,3 @@ AsmReadGs (
mov ax, gs
}
}

View File

@@ -6,10 +6,8 @@
**/
#include "BaseLibInternals.h"
/**
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
@@ -22,7 +20,7 @@
VOID
EFIAPI
InternalX86ReadIdtr (
OUT IA32_DESCRIPTOR *Idtr
OUT IA32_DESCRIPTOR *Idtr
)
{
_asm {

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current Local Descriptor Table Register(LDTR) selector.
@@ -28,4 +25,3 @@ AsmReadLdtr (
sldt ax
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #0 (MM0).
@@ -33,4 +30,3 @@ AsmReadMm0 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #1 (MM1).
@@ -33,4 +30,3 @@ AsmReadMm1 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #2 (MM2).
@@ -33,4 +30,3 @@ AsmReadMm2 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #3 (MM3).
@@ -33,4 +30,3 @@ AsmReadMm3 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #4 (MM4).
@@ -33,4 +30,3 @@ AsmReadMm4 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #5 (MM5).
@@ -33,4 +30,3 @@ AsmReadMm5 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #6 (MM6).
@@ -33,4 +30,3 @@ AsmReadMm6 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of 64-bit MMX Register #7 (MM7).
@@ -33,4 +30,3 @@ AsmReadMm7 (
emms
}
}

View File

@@ -6,7 +6,6 @@
**/
#include <Library/RegisterFilterLib.h>
/**
@@ -54,13 +53,14 @@ AsmReadMsr64 (
IN UINT32 Index
)
{
UINT64 Value;
BOOLEAN Flag;
UINT64 Value;
BOOLEAN Flag;
Flag = FilterBeforeMsrRead (Index, &Value);
if (Flag) {
Value = AsmReadMsr64Internal (Index);
}
FilterAfterMsrRead (Index, &Value);
return Value;

View File

@@ -20,7 +20,7 @@
UINT64
EFIAPI
AsmReadPmc (
IN UINT32 Index
IN UINT32 Index
)
{
_asm {
@@ -28,4 +28,3 @@ AsmReadPmc (
rdpmc
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Stack Segment Register (SS).
@@ -29,4 +26,3 @@ AsmReadSs (
mov ax, ss
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Task Register (TR).
@@ -28,4 +25,3 @@ AsmReadTr (
str ax
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Reads the current value of Time Stamp Counter (TSC).
@@ -28,4 +25,3 @@ AsmReadTsc (
rdtsc
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Switches the endianess of a 64-bit integer.
@@ -24,7 +21,7 @@
UINT64
EFIAPI
InternalMathSwapBytes64 (
IN UINT64 Operand
IN UINT64 Operand
)
{
_asm {
@@ -34,4 +31,3 @@ InternalMathSwapBytes64 (
bswap edx
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Executes a WBINVD instruction.
@@ -26,4 +23,3 @@ AsmWbinvd (
wbinvd
}
}

View File

@@ -28,4 +28,3 @@ AsmWriteCr0 (
mov cr0, eax
}
}

View File

@@ -28,4 +28,3 @@ AsmWriteCr2 (
mov cr2, eax
}
}

View File

@@ -28,4 +28,3 @@ AsmWriteCr3 (
mov cr3, eax
}
}

View File

@@ -30,4 +30,3 @@ AsmWriteCr4 (
_emit 0xE0
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr0 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr0 (
mov dr0, eax
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr1 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr1 (
mov dr1, eax
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr2 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr2 (
mov dr2, eax
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr3 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr3 (
mov dr3, eax
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr4 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -30,4 +30,3 @@ AsmWriteDr4 (
_emit 0xe0
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr5 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -30,4 +30,3 @@ AsmWriteDr5 (
_emit 0xe8
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr6 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr6 (
mov dr6, eax
}
}

View File

@@ -20,7 +20,7 @@
UINTN
EFIAPI
AsmWriteDr7 (
IN UINTN Value
IN UINTN Value
)
{
_asm {
@@ -28,4 +28,3 @@ AsmWriteDr7 (
mov dr7, eax
}
}

View File

@@ -6,10 +6,8 @@
**/
#include "BaseLibInternals.h"
/**
Writes the current Global Descriptor Table Register (GDTR) descriptor.
@@ -22,7 +20,7 @@
VOID
EFIAPI
InternalX86WriteGdtr (
IN CONST IA32_DESCRIPTOR *Gdtr
IN CONST IA32_DESCRIPTOR *Gdtr
)
{
_asm {
@@ -30,4 +28,3 @@ InternalX86WriteGdtr (
lgdt fword ptr [eax]
}
}

View File

@@ -6,7 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -21,7 +20,7 @@
VOID
EFIAPI
InternalX86WriteIdtr (
IN CONST IA32_DESCRIPTOR *Idtr
IN CONST IA32_DESCRIPTOR *Idtr
)
{
_asm {
@@ -32,4 +31,3 @@ InternalX86WriteIdtr (
popfd
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current Local Descriptor Table Register (GDTR) selector.
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteLdtr (
IN UINT16 Ldtr
IN UINT16 Ldtr
)
{
_asm {
@@ -30,4 +27,3 @@ AsmWriteLdtr (
lldt ax
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #0 (MM0).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm0 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm0 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #1 (MM1).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm1 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm1 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #2 (MM2).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm2 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm2 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #3 (MM3).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm3 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm3 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #4 (MM4).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm4 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #5 (MM5).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm5 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #6 (MM6).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm6 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm6 (
emms
}
}

View File

@@ -6,9 +6,6 @@
**/
/**
Writes the current value of 64-bit MMX Register #7 (MM7).
@@ -21,7 +18,7 @@
VOID
EFIAPI
AsmWriteMm7 (
IN UINT64 Value
IN UINT64 Value
)
{
_asm {
@@ -29,4 +26,3 @@ AsmWriteMm7 (
emms
}
}

View File

@@ -6,7 +6,6 @@
**/
#include <Library/RegisterFilterLib.h>
/**
@@ -33,7 +32,7 @@ AsmWriteMsr64 (
IN UINT64 Value
)
{
BOOLEAN Flag;
BOOLEAN Flag;
Flag = FilterBeforeMsrWrite (Index, &Value);
if (Flag) {
@@ -44,8 +43,8 @@ AsmWriteMsr64 (
wrmsr
}
}
FilterAfterMsrWrite (Index, &Value);
return Value;
}