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

@@ -26,8 +26,8 @@
UINT64
EFIAPI
ARShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
)
{
ASSERT (Count < 64);

View File

@@ -33,7 +33,6 @@ InternalSwitchStackAsm (
IN VOID *NewStack
);
/**
Transfers control to a function starting with a new stack.

View File

@@ -27,16 +27,16 @@
UINT16
EFIAPI
ReadUnaligned16 (
IN CONST UINT16 *Buffer
IN CONST UINT16 *Buffer
)
{
volatile UINT8 LowerByte;
volatile UINT8 HigherByte;
volatile UINT8 LowerByte;
volatile UINT8 HigherByte;
ASSERT (Buffer != NULL);
LowerByte = ((UINT8*)Buffer)[0];
HigherByte = ((UINT8*)Buffer)[1];
LowerByte = ((UINT8 *)Buffer)[0];
HigherByte = ((UINT8 *)Buffer)[1];
return (UINT16)(LowerByte | (HigherByte << 8));
}
@@ -59,14 +59,14 @@ ReadUnaligned16 (
UINT16
EFIAPI
WriteUnaligned16 (
OUT UINT16 *Buffer,
IN UINT16 Value
OUT UINT16 *Buffer,
IN UINT16 Value
)
{
ASSERT (Buffer != NULL);
((volatile UINT8*)Buffer)[0] = (UINT8)Value;
((volatile UINT8*)Buffer)[1] = (UINT8)(Value >> 8);
((volatile UINT8 *)Buffer)[0] = (UINT8)Value;
((volatile UINT8 *)Buffer)[1] = (UINT8)(Value >> 8);
return Value;
}
@@ -87,15 +87,15 @@ WriteUnaligned16 (
UINT32
EFIAPI
ReadUnaligned24 (
IN CONST UINT32 *Buffer
IN CONST UINT32 *Buffer
)
{
ASSERT (Buffer != NULL);
return (UINT32)(
ReadUnaligned16 ((UINT16*)Buffer) |
(((UINT8*)Buffer)[2] << 16)
);
ReadUnaligned16 ((UINT16 *)Buffer) |
(((UINT8 *)Buffer)[2] << 16)
);
}
/**
@@ -116,14 +116,14 @@ ReadUnaligned24 (
UINT32
EFIAPI
WriteUnaligned24 (
OUT UINT32 *Buffer,
IN UINT32 Value
OUT UINT32 *Buffer,
IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
*(UINT8*)((UINT16*)Buffer + 1) = (UINT8)(Value >> 16);
WriteUnaligned16 ((UINT16 *)Buffer, (UINT16)Value);
*(UINT8 *)((UINT16 *)Buffer + 1) = (UINT8)(Value >> 16);
return Value;
}
@@ -143,7 +143,7 @@ WriteUnaligned24 (
UINT32
EFIAPI
ReadUnaligned32 (
IN CONST UINT32 *Buffer
IN CONST UINT32 *Buffer
)
{
UINT16 LowerBytes;
@@ -151,10 +151,10 @@ ReadUnaligned32 (
ASSERT (Buffer != NULL);
LowerBytes = ReadUnaligned16 ((UINT16*) Buffer);
HigherBytes = ReadUnaligned16 ((UINT16*) Buffer + 1);
LowerBytes = ReadUnaligned16 ((UINT16 *)Buffer);
HigherBytes = ReadUnaligned16 ((UINT16 *)Buffer + 1);
return (UINT32) (LowerBytes | (HigherBytes << 16));
return (UINT32)(LowerBytes | (HigherBytes << 16));
}
/**
@@ -175,14 +175,14 @@ ReadUnaligned32 (
UINT32
EFIAPI
WriteUnaligned32 (
OUT UINT32 *Buffer,
IN UINT32 Value
OUT UINT32 *Buffer,
IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
WriteUnaligned16 ((UINT16*)Buffer + 1, (UINT16)(Value >> 16));
WriteUnaligned16 ((UINT16 *)Buffer, (UINT16)Value);
WriteUnaligned16 ((UINT16 *)Buffer + 1, (UINT16)(Value >> 16));
return Value;
}
@@ -202,7 +202,7 @@ WriteUnaligned32 (
UINT64
EFIAPI
ReadUnaligned64 (
IN CONST UINT64 *Buffer
IN CONST UINT64 *Buffer
)
{
UINT32 LowerBytes;
@@ -210,10 +210,10 @@ ReadUnaligned64 (
ASSERT (Buffer != NULL);
LowerBytes = ReadUnaligned32 ((UINT32*) Buffer);
HigherBytes = ReadUnaligned32 ((UINT32*) Buffer + 1);
LowerBytes = ReadUnaligned32 ((UINT32 *)Buffer);
HigherBytes = ReadUnaligned32 ((UINT32 *)Buffer + 1);
return (UINT64) (LowerBytes | LShiftU64 (HigherBytes, 32));
return (UINT64)(LowerBytes | LShiftU64 (HigherBytes, 32));
}
/**
@@ -234,13 +234,13 @@ ReadUnaligned64 (
UINT64
EFIAPI
WriteUnaligned64 (
OUT UINT64 *Buffer,
IN UINT64 Value
OUT UINT64 *Buffer,
IN UINT64 Value
)
{
ASSERT (Buffer != NULL);
WriteUnaligned32 ((UINT32*)Buffer, (UINT32)Value);
WriteUnaligned32 ((UINT32*)Buffer + 1, (UINT32)RShiftU64 (Value, 32));
WriteUnaligned32 ((UINT32 *)Buffer, (UINT32)Value);
WriteUnaligned32 ((UINT32 *)Buffer + 1, (UINT32)RShiftU64 (Value, 32));
return Value;
}

View File

@@ -35,8 +35,8 @@
UINT64
EFIAPI
InternalMathLShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
);
/**
@@ -55,8 +55,8 @@ InternalMathLShiftU64 (
UINT64
EFIAPI
InternalMathRShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
);
/**
@@ -75,8 +75,8 @@ InternalMathRShiftU64 (
UINT64
EFIAPI
InternalMathARShiftU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
);
/**
@@ -96,8 +96,8 @@ InternalMathARShiftU64 (
UINT64
EFIAPI
InternalMathLRotU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
);
/**
@@ -117,8 +117,8 @@ InternalMathLRotU64 (
UINT64
EFIAPI
InternalMathRRotU64 (
IN UINT64 Operand,
IN UINTN Count
IN UINT64 Operand,
IN UINTN Count
);
/**
@@ -136,7 +136,7 @@ InternalMathRRotU64 (
UINT64
EFIAPI
InternalMathSwapBytes64 (
IN UINT64 Operand
IN UINT64 Operand
);
/**
@@ -156,8 +156,8 @@ InternalMathSwapBytes64 (
UINT64
EFIAPI
InternalMathMultU64x32 (
IN UINT64 Multiplicand,
IN UINT32 Multiplier
IN UINT64 Multiplicand,
IN UINT32 Multiplier
);
/**
@@ -177,8 +177,8 @@ InternalMathMultU64x32 (
UINT64
EFIAPI
InternalMathMultU64x64 (
IN UINT64 Multiplicand,
IN UINT64 Multiplier
IN UINT64 Multiplicand,
IN UINT64 Multiplier
);
/**
@@ -198,8 +198,8 @@ InternalMathMultU64x64 (
UINT64
EFIAPI
InternalMathDivU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor
IN UINT64 Dividend,
IN UINT32 Divisor
);
/**
@@ -219,8 +219,8 @@ InternalMathDivU64x32 (
UINT32
EFIAPI
InternalMathModU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor
IN UINT64 Dividend,
IN UINT32 Divisor
);
/**
@@ -243,9 +243,9 @@ InternalMathModU64x32 (
UINT64
EFIAPI
InternalMathDivRemU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder OPTIONAL
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder OPTIONAL
);
/**
@@ -268,9 +268,9 @@ InternalMathDivRemU64x32 (
UINT64
EFIAPI
InternalMathDivRemU64x64 (
IN UINT64 Dividend,
IN UINT64 Divisor,
OUT UINT64 *Remainder OPTIONAL
IN UINT64 Dividend,
IN UINT64 Divisor,
OUT UINT64 *Remainder OPTIONAL
);
/**
@@ -293,9 +293,9 @@ InternalMathDivRemU64x64 (
INT64
EFIAPI
InternalMathDivRemS64x64 (
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
);
/**
@@ -332,7 +332,6 @@ InternalSwitchStack (
IN VA_LIST Marker
);
/**
Worker function that returns a bit field from Operand.
@@ -348,12 +347,11 @@ InternalSwitchStack (
UINTN
EFIAPI
BitFieldReadUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit
);
/**
Worker function that reads a bit field from Operand, performs a bitwise OR,
and returns the result.
@@ -373,13 +371,12 @@ BitFieldReadUint (
UINTN
EFIAPI
BitFieldOrUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN OrData
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN OrData
);
/**
Worker function that reads a bit field from Operand, performs a bitwise AND,
and returns the result.
@@ -399,13 +396,12 @@ BitFieldOrUint (
UINTN
EFIAPI
BitFieldAndUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN AndData
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN AndData
);
/**
Worker function that checks ASSERT condition for JumpBuffer
@@ -423,7 +419,6 @@ InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
);
/**
Restores the CPU context that was saved with SetJump().
@@ -442,7 +437,6 @@ InternalLongJump (
IN UINTN Value
);
/**
Check if a Unicode character is a decimal character.
@@ -459,10 +453,9 @@ InternalLongJump (
BOOLEAN
EFIAPI
InternalIsDecimalDigitCharacter (
IN CHAR16 Char
IN CHAR16 Char
);
/**
Convert a Unicode character to numerical value.
@@ -479,10 +472,9 @@ InternalIsDecimalDigitCharacter (
UINTN
EFIAPI
InternalHexCharToUintn (
IN CHAR16 Char
IN CHAR16 Char
);
/**
Check if a Unicode character is a hexadecimal character.
@@ -500,10 +492,9 @@ InternalHexCharToUintn (
BOOLEAN
EFIAPI
InternalIsHexaDecimalDigitCharacter (
IN CHAR16 Char
IN CHAR16 Char
);
/**
Check if a ASCII character is a decimal character.
@@ -520,10 +511,9 @@ InternalIsHexaDecimalDigitCharacter (
BOOLEAN
EFIAPI
InternalAsciiIsDecimalDigitCharacter (
IN CHAR8 Char
IN CHAR8 Char
);
/**
Check if a ASCII character is a hexadecimal character.
@@ -541,10 +531,9 @@ InternalAsciiIsDecimalDigitCharacter (
BOOLEAN
EFIAPI
InternalAsciiIsHexaDecimalDigitCharacter (
IN CHAR8 Char
IN CHAR8 Char
);
/**
Convert a ASCII character to numerical value.
@@ -561,10 +550,9 @@ InternalAsciiIsHexaDecimalDigitCharacter (
UINTN
EFIAPI
InternalAsciiHexCharToUintn (
IN CHAR8 Char
IN CHAR8 Char
);
//
// Ia32 and x64 specific functions
//
@@ -582,7 +570,7 @@ InternalAsciiHexCharToUintn (
VOID
EFIAPI
InternalX86ReadGdtr (
OUT IA32_DESCRIPTOR *Gdtr
OUT IA32_DESCRIPTOR *Gdtr
);
/**
@@ -597,7 +585,7 @@ InternalX86ReadGdtr (
VOID
EFIAPI
InternalX86WriteGdtr (
IN CONST IA32_DESCRIPTOR *Gdtr
IN CONST IA32_DESCRIPTOR *Gdtr
);
/**
@@ -612,7 +600,7 @@ InternalX86WriteGdtr (
VOID
EFIAPI
InternalX86ReadIdtr (
OUT IA32_DESCRIPTOR *Idtr
OUT IA32_DESCRIPTOR *Idtr
);
/**
@@ -627,7 +615,7 @@ InternalX86ReadIdtr (
VOID
EFIAPI
InternalX86WriteIdtr (
IN CONST IA32_DESCRIPTOR *Idtr
IN CONST IA32_DESCRIPTOR *Idtr
);
/**
@@ -643,7 +631,7 @@ InternalX86WriteIdtr (
VOID
EFIAPI
InternalX86FxSave (
OUT IA32_FX_BUFFER *Buffer
OUT IA32_FX_BUFFER *Buffer
);
/**
@@ -659,7 +647,7 @@ InternalX86FxSave (
VOID
EFIAPI
InternalX86FxRestore (
IN CONST IA32_FX_BUFFER *Buffer
IN CONST IA32_FX_BUFFER *Buffer
);
/**
@@ -773,11 +761,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
);
/**
@@ -809,11 +797,11 @@ InternalX86EnablePaging64 (
VOID
EFIAPI
InternalX86DisablePaging64 (
IN UINT16 Cs,
IN UINT32 EntryPoint,
IN UINT32 Context1 OPTIONAL,
IN UINT32 Context2 OPTIONAL,
IN UINT32 NewStack
IN UINT16 Cs,
IN UINT32 EntryPoint,
IN UINT32 Context1 OPTIONAL,
IN UINT32 Context2 OPTIONAL,
IN UINT32 NewStack
);
/**
@@ -828,7 +816,7 @@ InternalX86DisablePaging64 (
BOOLEAN
EFIAPI
InternalX86RdRand16 (
OUT UINT16 *Rand
OUT UINT16 *Rand
);
/**
@@ -843,7 +831,7 @@ InternalX86RdRand16 (
BOOLEAN
EFIAPI
InternalX86RdRand32 (
OUT UINT32 *Rand
OUT UINT32 *Rand
);
/**
@@ -859,7 +847,7 @@ InternalX86RdRand32 (
BOOLEAN
EFIAPI
InternalX86RdRand64 (
OUT UINT64 *Rand
OUT UINT64 *Rand
);
#else

View File

@@ -23,9 +23,9 @@
UINTN
EFIAPI
InternalBaseLibBitFieldReadUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
//
@@ -56,10 +56,10 @@ InternalBaseLibBitFieldReadUint (
UINTN
EFIAPI
InternalBaseLibBitFieldOrUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN OrData
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN OrData
)
{
//
@@ -74,7 +74,7 @@ InternalBaseLibBitFieldOrUint (
// ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
//
return Operand | ((OrData << StartBit) & ~((UINTN) -2 << EndBit));
return Operand | ((OrData << StartBit) & ~((UINTN)-2 << EndBit));
}
/**
@@ -98,10 +98,10 @@ InternalBaseLibBitFieldOrUint (
UINTN
EFIAPI
InternalBaseLibBitFieldAndUint (
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN AndData
IN UINTN Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINTN AndData
)
{
//
@@ -141,9 +141,9 @@ InternalBaseLibBitFieldAndUint (
UINT8
EFIAPI
BitFieldRead8 (
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
ASSERT (EndBit < 8);
@@ -177,10 +177,10 @@ BitFieldRead8 (
UINT8
EFIAPI
BitFieldWrite8 (
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 Value
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 Value
)
{
ASSERT (EndBit < 8);
@@ -215,10 +215,10 @@ BitFieldWrite8 (
UINT8
EFIAPI
BitFieldOr8 (
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 OrData
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 OrData
)
{
ASSERT (EndBit < 8);
@@ -253,10 +253,10 @@ BitFieldOr8 (
UINT8
EFIAPI
BitFieldAnd8 (
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData
)
{
ASSERT (EndBit < 8);
@@ -294,11 +294,11 @@ BitFieldAnd8 (
UINT8
EFIAPI
BitFieldAndThenOr8 (
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData,
IN UINT8 OrData
IN UINT8 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData,
IN UINT8 OrData
)
{
ASSERT (EndBit < 8);
@@ -333,9 +333,9 @@ BitFieldAndThenOr8 (
UINT16
EFIAPI
BitFieldRead16 (
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
ASSERT (EndBit < 16);
@@ -369,10 +369,10 @@ BitFieldRead16 (
UINT16
EFIAPI
BitFieldWrite16 (
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 Value
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 Value
)
{
ASSERT (EndBit < 16);
@@ -407,10 +407,10 @@ BitFieldWrite16 (
UINT16
EFIAPI
BitFieldOr16 (
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 OrData
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 OrData
)
{
ASSERT (EndBit < 16);
@@ -445,10 +445,10 @@ BitFieldOr16 (
UINT16
EFIAPI
BitFieldAnd16 (
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData
)
{
ASSERT (EndBit < 16);
@@ -486,11 +486,11 @@ BitFieldAnd16 (
UINT16
EFIAPI
BitFieldAndThenOr16 (
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData,
IN UINT16 OrData
IN UINT16 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData,
IN UINT16 OrData
)
{
ASSERT (EndBit < 16);
@@ -525,9 +525,9 @@ BitFieldAndThenOr16 (
UINT32
EFIAPI
BitFieldRead32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
ASSERT (EndBit < 32);
@@ -561,10 +561,10 @@ BitFieldRead32 (
UINT32
EFIAPI
BitFieldWrite32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 Value
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 Value
)
{
ASSERT (EndBit < 32);
@@ -599,10 +599,10 @@ BitFieldWrite32 (
UINT32
EFIAPI
BitFieldOr32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 OrData
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 OrData
)
{
ASSERT (EndBit < 32);
@@ -637,10 +637,10 @@ BitFieldOr32 (
UINT32
EFIAPI
BitFieldAnd32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData
)
{
ASSERT (EndBit < 32);
@@ -678,11 +678,11 @@ BitFieldAnd32 (
UINT32
EFIAPI
BitFieldAndThenOr32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData,
IN UINT32 OrData
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData,
IN UINT32 OrData
)
{
ASSERT (EndBit < 32);
@@ -717,9 +717,9 @@ BitFieldAndThenOr32 (
UINT64
EFIAPI
BitFieldRead64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
ASSERT (EndBit < 64);
@@ -753,10 +753,10 @@ BitFieldRead64 (
UINT64
EFIAPI
BitFieldWrite64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 Value
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 Value
)
{
ASSERT (EndBit < 64);
@@ -791,10 +791,10 @@ BitFieldWrite64 (
UINT64
EFIAPI
BitFieldOr64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 OrData
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 OrData
)
{
UINT64 Value1;
@@ -811,7 +811,7 @@ BitFieldOr64 (
ASSERT (RShiftU64 (OrData, EndBit - StartBit) == (RShiftU64 (OrData, EndBit - StartBit) & 1));
Value1 = LShiftU64 (OrData, StartBit);
Value2 = LShiftU64 ((UINT64) - 2, EndBit);
Value2 = LShiftU64 ((UINT64)-2, EndBit);
return Operand | (Value1 & ~Value2);
}
@@ -843,10 +843,10 @@ BitFieldOr64 (
UINT64
EFIAPI
BitFieldAnd64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 AndData
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 AndData
)
{
UINT64 Value1;
@@ -898,11 +898,11 @@ BitFieldAnd64 (
UINT64
EFIAPI
BitFieldAndThenOr64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 AndData,
IN UINT64 OrData
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT64 AndData,
IN UINT64 OrData
)
{
ASSERT (EndBit < 64);
@@ -938,25 +938,25 @@ BitFieldAndThenOr64 (
UINT8
EFIAPI
BitFieldCountOnes32 (
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT32 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
UINT32 Count;
UINT32 Count;
ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
Count = BitFieldRead32 (Operand, StartBit, EndBit);
Count = BitFieldRead32 (Operand, StartBit, EndBit);
Count -= ((Count >> 1) & 0x55555555);
Count = (Count & 0x33333333) + ((Count >> 2) & 0x33333333);
Count = (Count & 0x33333333) + ((Count >> 2) & 0x33333333);
Count += Count >> 4;
Count &= 0x0F0F0F0F;
Count += Count >> 8;
Count += Count >> 16;
return (UINT8) Count & 0x3F;
return (UINT8)Count & 0x3F;
}
/**
@@ -982,21 +982,20 @@ BitFieldCountOnes32 (
UINT8
EFIAPI
BitFieldCountOnes64 (
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit
IN UINT64 Operand,
IN UINTN StartBit,
IN UINTN EndBit
)
{
UINT64 BitField;
UINT8 Count;
UINT64 BitField;
UINT8 Count;
ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
BitField = BitFieldRead64 (Operand, StartBit, EndBit);
Count = BitFieldCountOnes32 ((UINT32) BitField, 0, 31);
Count += BitFieldCountOnes32 ((UINT32) RShiftU64(BitField, 32), 0, 31);
Count = BitFieldCountOnes32 ((UINT32)BitField, 0, 31);
Count += BitFieldCountOnes32 ((UINT32)RShiftU64 (BitField, 32), 0, 31);
return Count;
}

View File

@@ -30,24 +30,23 @@
UINT8
EFIAPI
CalculateSum8 (
IN CONST UINT8 *Buffer,
IN UINTN Length
IN CONST UINT8 *Buffer,
IN UINTN Length
)
{
UINT8 Sum;
UINTN Count;
UINT8 Sum;
UINTN Count;
ASSERT (Buffer != NULL);
ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1));
for (Sum = 0, Count = 0; Count < Length; Count++) {
Sum = (UINT8) (Sum + *(Buffer + Count));
Sum = (UINT8)(Sum + *(Buffer + Count));
}
return Sum;
}
/**
Returns the two's complement checksum of all elements in a buffer
of 8-bit values.
@@ -69,18 +68,18 @@ CalculateSum8 (
UINT8
EFIAPI
CalculateCheckSum8 (
IN CONST UINT8 *Buffer,
IN UINTN Length
IN CONST UINT8 *Buffer,
IN UINTN Length
)
{
UINT8 CheckSum;
UINT8 CheckSum;
CheckSum = CalculateSum8 (Buffer, Length);
//
// Return the checksum based on 2's complement.
//
return (UINT8) (0x100 - CheckSum);
return (UINT8)(0x100 - CheckSum);
}
/**
@@ -105,28 +104,27 @@ CalculateCheckSum8 (
UINT16
EFIAPI
CalculateSum16 (
IN CONST UINT16 *Buffer,
IN UINTN Length
IN CONST UINT16 *Buffer,
IN UINTN Length
)
{
UINT16 Sum;
UINTN Count;
UINTN Total;
UINT16 Sum;
UINTN Count;
UINTN Total;
ASSERT (Buffer != NULL);
ASSERT (((UINTN) Buffer & 0x1) == 0);
ASSERT (((UINTN)Buffer & 0x1) == 0);
ASSERT ((Length & 0x1) == 0);
ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1));
Total = Length / sizeof (*Buffer);
for (Sum = 0, Count = 0; Count < Total; Count++) {
Sum = (UINT16) (Sum + *(Buffer + Count));
Sum = (UINT16)(Sum + *(Buffer + Count));
}
return Sum;
}
/**
Returns the two's complement checksum of all elements in a buffer of
16-bit values.
@@ -150,21 +148,20 @@ CalculateSum16 (
UINT16
EFIAPI
CalculateCheckSum16 (
IN CONST UINT16 *Buffer,
IN UINTN Length
IN CONST UINT16 *Buffer,
IN UINTN Length
)
{
UINT16 CheckSum;
UINT16 CheckSum;
CheckSum = CalculateSum16 (Buffer, Length);
//
// Return the checksum based on 2's complement.
//
return (UINT16) (0x10000 - CheckSum);
return (UINT16)(0x10000 - CheckSum);
}
/**
Returns the sum of all elements in a buffer of 32-bit values. During
calculation, the carry bits are dropped.
@@ -187,18 +184,18 @@ CalculateCheckSum16 (
UINT32
EFIAPI
CalculateSum32 (
IN CONST UINT32 *Buffer,
IN UINTN Length
IN CONST UINT32 *Buffer,
IN UINTN Length
)
{
UINT32 Sum;
UINTN Count;
UINTN Total;
UINT32 Sum;
UINTN Count;
UINTN Total;
ASSERT (Buffer != NULL);
ASSERT (((UINTN) Buffer & 0x3) == 0);
ASSERT (((UINTN)Buffer & 0x3) == 0);
ASSERT ((Length & 0x3) == 0);
ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1));
Total = Length / sizeof (*Buffer);
for (Sum = 0, Count = 0; Count < Total; Count++) {
@@ -208,7 +205,6 @@ CalculateSum32 (
return Sum;
}
/**
Returns the two's complement checksum of all elements in a buffer of
32-bit values.
@@ -232,21 +228,20 @@ CalculateSum32 (
UINT32
EFIAPI
CalculateCheckSum32 (
IN CONST UINT32 *Buffer,
IN UINTN Length
IN CONST UINT32 *Buffer,
IN UINTN Length
)
{
UINT32 CheckSum;
UINT32 CheckSum;
CheckSum = CalculateSum32 (Buffer, Length);
//
// Return the checksum based on 2's complement.
//
return (UINT32) ((UINT32)(-1) - CheckSum + 1);
return (UINT32)((UINT32)(-1) - CheckSum + 1);
}
/**
Returns the sum of all elements in a buffer of 64-bit values. During
calculation, the carry bits are dropped.
@@ -269,18 +264,18 @@ CalculateCheckSum32 (
UINT64
EFIAPI
CalculateSum64 (
IN CONST UINT64 *Buffer,
IN UINTN Length
IN CONST UINT64 *Buffer,
IN UINTN Length
)
{
UINT64 Sum;
UINTN Count;
UINTN Total;
UINT64 Sum;
UINTN Count;
UINTN Total;
ASSERT (Buffer != NULL);
ASSERT (((UINTN) Buffer & 0x7) == 0);
ASSERT (((UINTN)Buffer & 0x7) == 0);
ASSERT ((Length & 0x7) == 0);
ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1));
Total = Length / sizeof (*Buffer);
for (Sum = 0, Count = 0; Count < Total; Count++) {
@@ -290,7 +285,6 @@ CalculateSum64 (
return Sum;
}
/**
Returns the two's complement checksum of all elements in a buffer of
64-bit values.
@@ -314,18 +308,18 @@ CalculateSum64 (
UINT64
EFIAPI
CalculateCheckSum64 (
IN CONST UINT64 *Buffer,
IN UINTN Length
IN CONST UINT64 *Buffer,
IN UINTN Length
)
{
UINT64 CheckSum;
UINT64 CheckSum;
CheckSum = CalculateSum64 (Buffer, Length);
//
// Return the checksum based on 2's complement.
//
return (UINT64) ((UINT64)(-1) - CheckSum + 1);
return (UINT64)((UINT64)(-1) - CheckSum + 1);
}
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 mCrcTable[256] = {
@@ -602,9 +596,9 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 mCrcTable[256] = {
**/
UINT32
EFIAPI
CalculateCrc32(
IN VOID *Buffer,
IN UINTN Length
CalculateCrc32 (
IN VOID *Buffer,
IN UINTN Length
)
{
UINTN Index;
@@ -612,14 +606,14 @@ CalculateCrc32(
UINT8 *Ptr;
ASSERT (Buffer != NULL);
ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1));
//
// Compute CRC
//
Crc = 0xffffffff;
for (Index = 0, Ptr = Buffer; Index < Length; Index++, Ptr++) {
Crc = (Crc >> 8) ^ mCrcTable[(UINT8) Crc ^ *Ptr];
Crc = (Crc >> 8) ^ mCrcTable[(UINT8)Crc ^ *Ptr];
}
return Crc ^ 0xffffffff;

View File

@@ -12,7 +12,7 @@
Hack function for passing GCC build.
**/
VOID
__chkstk()
__chkstk (
)
{
}

View File

@@ -8,7 +8,6 @@
#include "BaseLibInternals.h"
/**
Disables CPU interrupts and returns the interrupt state prior to the disable
operation.
@@ -23,7 +22,7 @@ SaveAndDisableInterrupts (
VOID
)
{
BOOLEAN InterruptState;
BOOLEAN InterruptState;
InterruptState = GetInterruptState ();
DisableInterrupts ();
@@ -47,7 +46,7 @@ SaveAndDisableInterrupts (
BOOLEAN
EFIAPI
SetInterruptState (
IN BOOLEAN InterruptState
IN BOOLEAN InterruptState
)
{
if (InterruptState) {
@@ -55,5 +54,6 @@ SetInterruptState (
} else {
DisableInterrupts ();
}
return InterruptState;
}

View File

@@ -6,8 +6,6 @@
**/
#include <Base.h>
#include <Library/BaseLib.h>
@@ -29,6 +27,6 @@ CpuDeadLoop (
volatile UINTN Index;
for (Index = 0; Index == 0;) {
CpuPause();
CpuPause ();
}
}

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -37,9 +34,9 @@
INT64
EFIAPI
DivS64x64Remainder (
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
IN INT64 Dividend,
IN INT64 Divisor,
OUT INT64 *Remainder OPTIONAL
)
{
ASSERT (Divisor != 0);

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -30,8 +27,8 @@
UINT64
EFIAPI
DivU64x32 (
IN UINT64 Dividend,
IN UINT32 Divisor
IN UINT64 Dividend,
IN UINT32 Divisor
)
{
ASSERT (Divisor != 0);

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -33,9 +30,9 @@
UINT64
EFIAPI
DivU64x32Remainder (
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder OPTIONAL
IN UINT64 Dividend,
IN UINT32 Divisor,
OUT UINT32 *Remainder OPTIONAL
)
{
ASSERT (Divisor != 0);

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -33,9 +30,9 @@
UINT64
EFIAPI
DivU64x64Remainder (
IN UINT64 Dividend,
IN UINT64 Divisor,
OUT UINT64 *Remainder OPTIONAL
IN UINT64 Dividend,
IN UINT64 Divisor,
OUT UINT64 *Remainder OPTIONAL
)
{
ASSERT (Divisor != 0);

View File

@@ -11,7 +11,7 @@
extern
UINT64
_break (
CHAR8 BreakCode
CHAR8 BreakCode
);
/**
@@ -120,4 +120,3 @@ CpuPause (
)
{
}

View File

@@ -7,7 +7,6 @@
**/
/**
Uses as a barrier to stop speculative execution.

View File

@@ -19,29 +19,33 @@
**/
BOOLEAN
EFIAPI
PathRemoveLastItem(
IN OUT CHAR16 *Path
PathRemoveLastItem (
IN OUT CHAR16 *Path
)
{
CHAR16 *Walker;
CHAR16 *LastSlash;
CHAR16 *Walker;
CHAR16 *LastSlash;
//
// get directory name from path... ('chop' off extra)
//
for ( Walker = Path, LastSlash = NULL
; Walker != NULL && *Walker != CHAR_NULL
; Walker++
){
if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {
; Walker != NULL && *Walker != CHAR_NULL
; Walker++
)
{
if ((*Walker == L'\\') && (*(Walker + 1) != CHAR_NULL)) {
LastSlash = Walker+1;
} else if (*Walker == L':' && *(Walker + 1) != L'\\' && *(Walker + 1) != CHAR_NULL) {
} else if ((*Walker == L':') && (*(Walker + 1) != L'\\') && (*(Walker + 1) != CHAR_NULL)) {
LastSlash = Walker+1;
}
}
if (LastSlash != NULL) {
*LastSlash = CHAR_NULL;
return (TRUE);
}
return (FALSE);
}
@@ -59,11 +63,11 @@ PathRemoveLastItem(
@return Returns Path, otherwise returns NULL to indicate that an error has occurred.
**/
CHAR16*
CHAR16 *
EFIAPI
PathCleanUpDirectories(
IN CHAR16 *Path
)
PathCleanUpDirectories (
IN CHAR16 *Path
)
{
CHAR16 *TempString;
@@ -93,6 +97,7 @@ PathCleanUpDirectories(
while ((TempString = StrStr (Path, L"\\.\\")) != NULL) {
CopyMem (TempString, TempString + 2, StrSize (TempString + 2));
}
if ((StrLen (Path) >= 2) && (StrCmp (Path + StrLen (Path) - 2, L"\\.") == 0)) {
Path[StrLen (Path) - 1] = CHAR_NULL;
}
@@ -100,11 +105,12 @@ PathCleanUpDirectories(
//
// Remove all the "\..". E.g.: fs0:\abc\..\def\..
//
while (((TempString = StrStr(Path, L"\\..")) != NULL) &&
while (((TempString = StrStr (Path, L"\\..")) != NULL) &&
((*(TempString + 3) == L'\\') || (*(TempString + 3) == CHAR_NULL))
) {
)
{
*(TempString + 1) = CHAR_NULL;
PathRemoveLastItem(Path);
PathRemoveLastItem (Path);
if (*(TempString + 3) != CHAR_NULL) {
CopyMem (Path + StrLen (Path), TempString + 4, StrSize (TempString + 4));
}
@@ -112,4 +118,3 @@ PathCleanUpDirectories(
return Path;
}

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -27,7 +24,7 @@
UINT32
EFIAPI
GetPowerOfTwo32 (
IN UINT32 Operand
IN UINT32 Operand
)
{
if (0 == Operand) {

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -27,12 +24,12 @@
UINT64
EFIAPI
GetPowerOfTwo64 (
IN UINT64 Operand
IN UINT64 Operand
)
{
if (Operand == 0) {
return 0;
}
return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
return LShiftU64 (1, (UINTN)HighBitSet64 (Operand));
}

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -28,14 +25,17 @@
INTN
EFIAPI
HighBitSet32 (
IN UINT32 Operand
IN UINT32 Operand
)
{
INTN BitIndex;
INTN BitIndex;
if (Operand == 0) {
return - 1;
return -1;
}
for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1);
for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1) {
}
return BitIndex;
}

View File

@@ -6,9 +6,6 @@
**/
#include "BaseLibInternals.h"
/**
@@ -28,7 +25,7 @@
INTN
EFIAPI
HighBitSet64 (
IN UINT64 Operand
IN UINT64 Operand
)
{
if (Operand == (UINT32)Operand) {
@@ -42,7 +39,7 @@ HighBitSet64 (
// Operand is really a 64-bit integer
//
if (sizeof (UINTN) == sizeof (UINT32)) {
return HighBitSet32 (((UINT32*)&Operand)[1]) + 32;
return HighBitSet32 (((UINT32 *)&Operand)[1]) + 32;
} else {
return HighBitSet32 ((UINT32)RShiftU64 (Operand, 32)) + 32;
}

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
}
}

Some files were not shown because too many files have changed in this diff Show More