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:
committed by
mergify[bot]
parent
1436aea4d5
commit
2f88bd3a12
@@ -28,7 +28,7 @@ InvalidateInstructionCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,12 +59,12 @@ InvalidateInstructionCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateInstructionCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ WriteBackInvalidateDataCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,12 +116,12 @@ WriteBackInvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackInvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ WriteBackDataCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,12 +172,12 @@ WriteBackDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ InvalidateDataCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,11 +231,11 @@ InvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
ASSERT(FALSE);
|
||||
ASSERT (FALSE);
|
||||
return Address;
|
||||
}
|
||||
|
@@ -50,8 +50,8 @@ InvalidateInstructionCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateInstructionCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -105,8 +105,8 @@ WriteBackInvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackInvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -159,8 +159,8 @@ WriteBackDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -216,8 +216,8 @@ InvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
|
@@ -72,11 +72,11 @@ InvalidateInstructionCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateInstructionCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ WriteBackInvalidateDataCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,11 +128,11 @@ WriteBackInvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackInvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ WriteBackDataCache (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,11 +183,11 @@ WriteBackDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -241,10 +241,10 @@ InvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
DEBUG((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
|
||||
return Address;
|
||||
}
|
||||
|
@@ -52,8 +52,8 @@ InvalidateInstructionCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateInstructionCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
if (Length == 0) {
|
||||
@@ -112,15 +112,15 @@ WriteBackInvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackInvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
UINT32 RegEbx;
|
||||
UINT32 RegEdx;
|
||||
UINTN CacheLineSize;
|
||||
UINTN Start;
|
||||
UINTN End;
|
||||
UINT32 RegEbx;
|
||||
UINT32 RegEdx;
|
||||
UINTN CacheLineSize;
|
||||
UINTN Start;
|
||||
UINTN End;
|
||||
|
||||
if (Length == 0) {
|
||||
return Address;
|
||||
@@ -147,12 +147,13 @@ WriteBackInvalidateDataCacheRange (
|
||||
//
|
||||
// Calculate the cache line alignment
|
||||
//
|
||||
End = (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1);
|
||||
End = (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1);
|
||||
Start &= ~((UINTN)CacheLineSize - 1);
|
||||
|
||||
do {
|
||||
Start = (UINTN)AsmFlushCacheLine ((VOID*)Start) + CacheLineSize;
|
||||
Start = (UINTN)AsmFlushCacheLine ((VOID *)Start) + CacheLineSize;
|
||||
} while (Start != End);
|
||||
|
||||
return Address;
|
||||
}
|
||||
|
||||
@@ -203,8 +204,8 @@ WriteBackDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
return WriteBackInvalidateDataCacheRange (Address, Length);
|
||||
@@ -260,8 +261,8 @@ InvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
//
|
||||
|
@@ -50,8 +50,8 @@ InvalidateInstructionCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateInstructionCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -105,8 +105,8 @@ WriteBackInvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackInvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -159,8 +159,8 @@ WriteBackDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
WriteBackDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
@@ -216,8 +216,8 @@ InvalidateDataCache (
|
||||
VOID *
|
||||
EFIAPI
|
||||
InvalidateDataCacheRange (
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
IN VOID *Address,
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
|
||||
|
@@ -6,8 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
|
||||
|
||||
@@ -25,4 +23,3 @@ CpuFlushTlb (
|
||||
mov cr3, eax
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,4 +23,3 @@ CpuFlushTlb (
|
||||
{
|
||||
AsmWriteCr3 (AsmReadCr3 ());
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
Places the CPU in a sleep state until an interrupt is received.
|
||||
|
||||
@@ -25,4 +24,3 @@ CpuSleep (
|
||||
hlt
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
Places the CPU in a sleep state until an interrupt is received.
|
||||
|
||||
@@ -24,4 +23,3 @@ CpuSleep (
|
||||
{
|
||||
__asm__ __volatile__ ("hlt"::: "memory");
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,6 @@ DebugPrint (
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a debug message to the debug output device if the specified
|
||||
error level is enabled.
|
||||
@@ -53,14 +52,13 @@ DebugPrint (
|
||||
VOID
|
||||
EFIAPI
|
||||
DebugVPrint (
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a debug message to the debug output device if the specified
|
||||
error level is enabled.
|
||||
@@ -81,14 +79,13 @@ DebugVPrint (
|
||||
VOID
|
||||
EFIAPI
|
||||
DebugBPrint (
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN BASE_LIST BaseListMarker
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN BASE_LIST BaseListMarker
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints an assert message containing a filename, line number, and description.
|
||||
This may be followed by a breakpoint or a dead loop.
|
||||
@@ -120,7 +117,6 @@ DebugAssert (
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
|
||||
|
||||
@@ -146,7 +142,6 @@ DebugClearMemory (
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if ASSERT() macros are enabled.
|
||||
|
||||
@@ -166,7 +161,6 @@ DebugAssertEnabled (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG() macros are enabled.
|
||||
|
||||
@@ -186,7 +180,6 @@ DebugPrintEnabled (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG_CODE() macros are enabled.
|
||||
|
||||
@@ -206,7 +199,6 @@ DebugCodeEnabled (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
|
||||
|
||||
@@ -238,9 +230,8 @@ DebugClearMemoryEnabled (
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
DebugPrintLevelEnabled (
|
||||
IN CONST UINTN ErrorLevel
|
||||
IN CONST UINTN ErrorLevel
|
||||
)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
// VA_LIST can not initialize to NULL for all compiler, so we use this to
|
||||
// indicate a null VA_LIST
|
||||
//
|
||||
VA_LIST mVaListNull;
|
||||
VA_LIST mVaListNull;
|
||||
|
||||
/**
|
||||
The constructor function initialize the Serial Port Library
|
||||
@@ -77,7 +77,6 @@ DebugPrint (
|
||||
VA_END (Marker);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a debug message to the debug output device if the specified
|
||||
error level is enabled base on Null-terminated format string and a
|
||||
@@ -97,13 +96,13 @@ DebugPrint (
|
||||
**/
|
||||
VOID
|
||||
DebugPrintMarker (
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker,
|
||||
IN BASE_LIST BaseListMarker
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker,
|
||||
IN BASE_LIST BaseListMarker
|
||||
)
|
||||
{
|
||||
CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
|
||||
CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
|
||||
|
||||
//
|
||||
// If Format is NULL, then ASSERT().
|
||||
@@ -132,7 +131,6 @@ DebugPrintMarker (
|
||||
SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a debug message to the debug output device if the specified
|
||||
error level is enabled.
|
||||
@@ -151,15 +149,14 @@ DebugPrintMarker (
|
||||
VOID
|
||||
EFIAPI
|
||||
DebugVPrint (
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN VA_LIST VaListMarker
|
||||
)
|
||||
{
|
||||
DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints a debug message to the debug output device if the specified
|
||||
error level is enabled.
|
||||
@@ -180,15 +177,14 @@ DebugVPrint (
|
||||
VOID
|
||||
EFIAPI
|
||||
DebugBPrint (
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN BASE_LIST BaseListMarker
|
||||
IN UINTN ErrorLevel,
|
||||
IN CONST CHAR8 *Format,
|
||||
IN BASE_LIST BaseListMarker
|
||||
)
|
||||
{
|
||||
DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Prints an assert message containing a filename, line number, and description.
|
||||
This may be followed by a breakpoint or a dead loop.
|
||||
@@ -233,14 +229,13 @@ DebugAssert (
|
||||
//
|
||||
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
|
||||
//
|
||||
if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
|
||||
if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
|
||||
CpuBreakpoint ();
|
||||
} else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
|
||||
} else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
|
||||
|
||||
@@ -271,10 +266,9 @@ DebugClearMemory (
|
||||
//
|
||||
// SetMem() checks for the the ASSERT() condition on Length and returns Buffer
|
||||
//
|
||||
return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
|
||||
return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if ASSERT() macros are enabled.
|
||||
|
||||
@@ -291,10 +285,9 @@ DebugAssertEnabled (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
|
||||
return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG() macros are enabled.
|
||||
|
||||
@@ -311,10 +304,9 @@ DebugPrintEnabled (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
|
||||
return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG_CODE() macros are enabled.
|
||||
|
||||
@@ -331,10 +323,9 @@ DebugCodeEnabled (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
|
||||
return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
|
||||
|
||||
@@ -351,7 +342,7 @@ DebugClearMemoryEnabled (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
|
||||
return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,9 +357,8 @@ DebugClearMemoryEnabled (
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
DebugPrintLevelEnabled (
|
||||
IN CONST UINTN ErrorLevel
|
||||
IN CONST UINTN ErrorLevel
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
|
||||
return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);
|
||||
}
|
||||
|
||||
|
@@ -13,14 +13,14 @@
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/ExtractGuidedSectionLib.h>
|
||||
|
||||
#define EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('E', 'G', 'S', 'I')
|
||||
#define EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('E', 'G', 'S', 'I')
|
||||
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
UINT32 NumberOfExtractHandler;
|
||||
GUID *ExtractHandlerGuidTable;
|
||||
EXTRACT_GUIDED_SECTION_DECODE_HANDLER *ExtractDecodeHandlerTable;
|
||||
EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *ExtractGetInfoHandlerTable;
|
||||
UINT32 Signature;
|
||||
UINT32 NumberOfExtractHandler;
|
||||
GUID *ExtractHandlerGuidTable;
|
||||
EXTRACT_GUIDED_SECTION_DECODE_HANDLER *ExtractDecodeHandlerTable;
|
||||
EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *ExtractGetInfoHandlerTable;
|
||||
} EXTRACT_GUIDED_SECTION_HANDLER_INFO;
|
||||
|
||||
/**
|
||||
@@ -35,15 +35,15 @@ typedef struct {
|
||||
**/
|
||||
RETURN_STATUS
|
||||
GetExtractGuidedSectionHandlerInfo (
|
||||
IN OUT EXTRACT_GUIDED_SECTION_HANDLER_INFO **InfoPointer
|
||||
IN OUT EXTRACT_GUIDED_SECTION_HANDLER_INFO **InfoPointer
|
||||
)
|
||||
{
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
|
||||
//
|
||||
// Set the available memory address to handler info.
|
||||
//
|
||||
HandlerInfo = (EXTRACT_GUIDED_SECTION_HANDLER_INFO*)(VOID*)(UINTN) PcdGet64 (PcdGuidedExtractHandlerTableAddress);
|
||||
HandlerInfo = (EXTRACT_GUIDED_SECTION_HANDLER_INFO *)(VOID *)(UINTN)PcdGet64 (PcdGuidedExtractHandlerTableAddress);
|
||||
if (HandlerInfo == NULL) {
|
||||
*InfoPointer = NULL;
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@@ -75,17 +75,17 @@ GetExtractGuidedSectionHandlerInfo (
|
||||
//
|
||||
// Init HandlerInfo structure
|
||||
//
|
||||
HandlerInfo->NumberOfExtractHandler = 0;
|
||||
HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1);
|
||||
HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) (
|
||||
(UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
|
||||
PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID)
|
||||
);
|
||||
HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (
|
||||
(UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
|
||||
PcdGet32 (PcdMaximumGuidedExtractHandler) *
|
||||
sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)
|
||||
);
|
||||
HandlerInfo->NumberOfExtractHandler = 0;
|
||||
HandlerInfo->ExtractHandlerGuidTable = (GUID *)(HandlerInfo + 1);
|
||||
HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *)(
|
||||
(UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
|
||||
PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID)
|
||||
);
|
||||
HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *)(
|
||||
(UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
|
||||
PcdGet32 (PcdMaximumGuidedExtractHandler) *
|
||||
sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)
|
||||
);
|
||||
*InfoPointer = HandlerInfo;
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
@@ -110,8 +110,8 @@ ExtractGuidedSectionGetGuidList (
|
||||
OUT GUID **ExtractHandlerGuidTable
|
||||
)
|
||||
{
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
|
||||
ASSERT (ExtractHandlerGuidTable != NULL);
|
||||
|
||||
@@ -164,9 +164,9 @@ ExtractGuidedSectionRegisterHandlers (
|
||||
IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
|
||||
//
|
||||
// Check input parameter
|
||||
@@ -187,13 +187,13 @@ ExtractGuidedSectionRegisterHandlers (
|
||||
// Search the match registered GetInfo handler for the input guided section.
|
||||
//
|
||||
ASSERT (HandlerInfo != NULL);
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
|
||||
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
|
||||
//
|
||||
// If the guided handler has been registered before, only update its handler.
|
||||
//
|
||||
HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
|
||||
HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
|
||||
HandlerInfo->ExtractDecodeHandlerTable[Index] = DecodeHandler;
|
||||
HandlerInfo->ExtractGetInfoHandlerTable[Index] = GetInfoHandler;
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -209,8 +209,8 @@ ExtractGuidedSectionRegisterHandlers (
|
||||
// Register new Handler and guid value.
|
||||
//
|
||||
CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);
|
||||
HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
|
||||
HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
|
||||
HandlerInfo->ExtractDecodeHandlerTable[HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
|
||||
HandlerInfo->ExtractGetInfoHandlerTable[HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
|
||||
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
@@ -258,10 +258,10 @@ ExtractGuidedSectionGetInfo (
|
||||
OUT UINT16 *SectionAttribute
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
EFI_GUID *SectionDefinitionGuid;
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
EFI_GUID *SectionDefinitionGuid;
|
||||
|
||||
//
|
||||
// Check input parameter
|
||||
@@ -280,26 +280,26 @@ ExtractGuidedSectionGetInfo (
|
||||
}
|
||||
|
||||
if (IS_SECTION2 (InputSection)) {
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
|
||||
} else {
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
|
||||
}
|
||||
|
||||
//
|
||||
// Search the match registered GetInfo handler for the input guided section.
|
||||
//
|
||||
ASSERT (HandlerInfo != NULL);
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
|
||||
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
|
||||
//
|
||||
// Call the match handler to get information for the input section data.
|
||||
//
|
||||
return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
|
||||
InputSection,
|
||||
OutputBufferSize,
|
||||
ScratchBufferSize,
|
||||
SectionAttribute
|
||||
);
|
||||
return HandlerInfo->ExtractGetInfoHandlerTable[Index](
|
||||
InputSection,
|
||||
OutputBufferSize,
|
||||
ScratchBufferSize,
|
||||
SectionAttribute
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,10 +353,10 @@ ExtractGuidedSectionDecode (
|
||||
OUT UINT32 *AuthenticationStatus
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
EFI_GUID *SectionDefinitionGuid;
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
EFI_GUID *SectionDefinitionGuid;
|
||||
|
||||
//
|
||||
// Check input parameter
|
||||
@@ -374,26 +374,26 @@ ExtractGuidedSectionDecode (
|
||||
}
|
||||
|
||||
if (IS_SECTION2 (InputSection)) {
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
|
||||
} else {
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
|
||||
SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
|
||||
}
|
||||
|
||||
//
|
||||
// Search the match registered Extract handler for the input guided section.
|
||||
//
|
||||
ASSERT (HandlerInfo != NULL);
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
|
||||
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
|
||||
//
|
||||
// Call the match handler to extract raw data for the input guided section.
|
||||
//
|
||||
return HandlerInfo->ExtractDecodeHandlerTable [Index] (
|
||||
InputSection,
|
||||
OutputBuffer,
|
||||
ScratchBuffer,
|
||||
AuthenticationStatus
|
||||
);
|
||||
return HandlerInfo->ExtractDecodeHandlerTable[Index](
|
||||
InputSection,
|
||||
OutputBuffer,
|
||||
ScratchBuffer,
|
||||
AuthenticationStatus
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,9 +438,9 @@ ExtractGuidedSectionGetHandlers (
|
||||
OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL
|
||||
)
|
||||
{
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
UINT32 Index;
|
||||
RETURN_STATUS Status;
|
||||
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
|
||||
|
||||
//
|
||||
// Check input parameter
|
||||
@@ -459,20 +459,22 @@ ExtractGuidedSectionGetHandlers (
|
||||
// Search the match registered GetInfo handler for the input guided section.
|
||||
//
|
||||
ASSERT (HandlerInfo != NULL);
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
|
||||
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
|
||||
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
|
||||
|
||||
//
|
||||
// If the guided handler has been registered before, then return the registered handlers.
|
||||
//
|
||||
if (GetInfoHandler != NULL) {
|
||||
*GetInfoHandler = HandlerInfo->ExtractGetInfoHandlerTable[Index];
|
||||
}
|
||||
|
||||
if (DecodeHandler != NULL) {
|
||||
*DecodeHandler = HandlerInfo->ExtractDecodeHandlerTable[Index];
|
||||
}
|
||||
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return RETURN_NOT_FOUND;
|
||||
}
|
||||
|
@@ -10,8 +10,6 @@
|
||||
#ifndef __BASEIOLIB_INTRINSIC_INTERNAL_H_
|
||||
#define __BASEIOLIB_INTRINSIC_INTERNAL_H_
|
||||
|
||||
|
||||
|
||||
#include <Base.h>
|
||||
|
||||
#include <Library/IoLib.h>
|
||||
|
@@ -38,11 +38,11 @@
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoOr8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));
|
||||
return IoWrite8 (Port, (UINT8)(IoRead8 (Port) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,11 +66,11 @@ IoOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoAnd8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Port,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));
|
||||
return IoWrite8 (Port, (UINT8)(IoRead8 (Port) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,12 +96,12 @@ IoAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoAndThenOr8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));
|
||||
return IoWrite8 (Port, (UINT8)((IoRead8 (Port) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,9 +127,9 @@ IoAndThenOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoBitFieldRead8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead8 (IoRead8 (Port), StartBit, EndBit);
|
||||
@@ -161,10 +161,10 @@ IoBitFieldRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoBitFieldWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
return IoWrite8 (
|
||||
@@ -202,10 +202,10 @@ IoBitFieldWrite8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoBitFieldOr8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (
|
||||
@@ -243,10 +243,10 @@ IoBitFieldOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoBitFieldAnd8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (
|
||||
@@ -288,11 +288,11 @@ IoBitFieldAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoBitFieldAndThenOr8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite8 (
|
||||
@@ -323,11 +323,11 @@ IoBitFieldAndThenOr8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoOr16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));
|
||||
return IoWrite16 (Port, (UINT16)(IoRead16 (Port) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,11 +352,11 @@ IoOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoAnd16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Port,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));
|
||||
return IoWrite16 (Port, (UINT16)(IoRead16 (Port) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,12 +383,12 @@ IoAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoAndThenOr16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));
|
||||
return IoWrite16 (Port, (UINT16)((IoRead16 (Port) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -415,9 +415,9 @@ IoAndThenOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoBitFieldRead16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead16 (IoRead16 (Port), StartBit, EndBit);
|
||||
@@ -451,10 +451,10 @@ IoBitFieldRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoBitFieldWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
return IoWrite16 (
|
||||
@@ -493,10 +493,10 @@ IoBitFieldWrite16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoBitFieldOr16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (
|
||||
@@ -535,10 +535,10 @@ IoBitFieldOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoBitFieldAnd16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (
|
||||
@@ -581,11 +581,11 @@ IoBitFieldAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoBitFieldAndThenOr16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite16 (
|
||||
@@ -616,8 +616,8 @@ IoBitFieldAndThenOr16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoOr32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (Port, IoRead32 (Port) | OrData);
|
||||
@@ -645,8 +645,8 @@ IoOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoAnd32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Port,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (Port, IoRead32 (Port) & AndData);
|
||||
@@ -676,9 +676,9 @@ IoAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoAndThenOr32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (Port, (IoRead32 (Port) & AndData) | OrData);
|
||||
@@ -708,9 +708,9 @@ IoAndThenOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoBitFieldRead32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead32 (IoRead32 (Port), StartBit, EndBit);
|
||||
@@ -744,10 +744,10 @@ IoBitFieldRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoBitFieldWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
return IoWrite32 (
|
||||
@@ -786,10 +786,10 @@ IoBitFieldWrite32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoBitFieldOr32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (
|
||||
@@ -828,10 +828,10 @@ IoBitFieldOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoBitFieldAnd32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (
|
||||
@@ -874,11 +874,11 @@ IoBitFieldAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoBitFieldAndThenOr32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite32 (
|
||||
@@ -909,8 +909,8 @@ IoBitFieldAndThenOr32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoOr64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (Port, IoRead64 (Port) | OrData);
|
||||
@@ -938,8 +938,8 @@ IoOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoAnd64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 AndData
|
||||
IN UINTN Port,
|
||||
IN UINT64 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (Port, IoRead64 (Port) & AndData);
|
||||
@@ -969,9 +969,9 @@ IoAnd64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoAndThenOr64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Port,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);
|
||||
@@ -1001,9 +1001,9 @@ IoAndThenOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoBitFieldRead64 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead64 (IoRead64 (Port), StartBit, EndBit);
|
||||
@@ -1037,10 +1037,10 @@ IoBitFieldRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoBitFieldWrite64 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 Value
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
return IoWrite64 (
|
||||
@@ -1079,10 +1079,10 @@ IoBitFieldWrite64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoBitFieldOr64 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (
|
||||
@@ -1121,10 +1121,10 @@ IoBitFieldOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoBitFieldAnd64 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (
|
||||
@@ -1167,11 +1167,11 @@ IoBitFieldAnd64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoBitFieldAndThenOr64 (
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Port,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return IoWrite64 (
|
||||
@@ -1201,11 +1201,11 @@ IoBitFieldAndThenOr64 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));
|
||||
return MmioWrite8 (Address, (UINT8)(MmioRead8 (Address) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1229,11 +1229,11 @@ MmioOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioAnd8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));
|
||||
return MmioWrite8 (Address, (UINT8)(MmioRead8 (Address) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1260,12 +1260,12 @@ MmioAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioAndThenOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));
|
||||
return MmioWrite8 (Address, (UINT8)((MmioRead8 (Address) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1291,9 +1291,9 @@ MmioAndThenOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioBitFieldRead8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead8 (MmioRead8 (Address), StartBit, EndBit);
|
||||
@@ -1325,10 +1325,10 @@ MmioBitFieldRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioBitFieldWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (
|
||||
@@ -1367,10 +1367,10 @@ MmioBitFieldWrite8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioBitFieldOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (
|
||||
@@ -1409,10 +1409,10 @@ MmioBitFieldOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioBitFieldAnd8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (
|
||||
@@ -1454,11 +1454,11 @@ MmioBitFieldAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioBitFieldAndThenOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite8 (
|
||||
@@ -1489,11 +1489,11 @@ MmioBitFieldAndThenOr8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));
|
||||
return MmioWrite16 (Address, (UINT16)(MmioRead16 (Address) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1518,11 +1518,11 @@ MmioOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioAnd16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));
|
||||
return MmioWrite16 (Address, (UINT16)(MmioRead16 (Address) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1549,12 +1549,12 @@ MmioAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioAndThenOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));
|
||||
return MmioWrite16 (Address, (UINT16)((MmioRead16 (Address) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1581,9 +1581,9 @@ MmioAndThenOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioBitFieldRead16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead16 (MmioRead16 (Address), StartBit, EndBit);
|
||||
@@ -1616,10 +1616,10 @@ MmioBitFieldRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioBitFieldWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (
|
||||
@@ -1659,10 +1659,10 @@ MmioBitFieldWrite16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioBitFieldOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (
|
||||
@@ -1702,10 +1702,10 @@ MmioBitFieldOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioBitFieldAnd16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (
|
||||
@@ -1748,11 +1748,11 @@ MmioBitFieldAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioBitFieldAndThenOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite16 (
|
||||
@@ -1783,8 +1783,8 @@ MmioBitFieldAndThenOr16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (Address, MmioRead32 (Address) | OrData);
|
||||
@@ -1812,8 +1812,8 @@ MmioOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioAnd32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (Address, MmioRead32 (Address) & AndData);
|
||||
@@ -1843,9 +1843,9 @@ MmioAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioAndThenOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (Address, (MmioRead32 (Address) & AndData) | OrData);
|
||||
@@ -1875,9 +1875,9 @@ MmioAndThenOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioBitFieldRead32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead32 (MmioRead32 (Address), StartBit, EndBit);
|
||||
@@ -1910,10 +1910,10 @@ MmioBitFieldRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioBitFieldWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (
|
||||
@@ -1953,10 +1953,10 @@ MmioBitFieldWrite32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioBitFieldOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (
|
||||
@@ -1996,10 +1996,10 @@ MmioBitFieldOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioBitFieldAnd32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (
|
||||
@@ -2042,11 +2042,11 @@ MmioBitFieldAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioBitFieldAndThenOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite32 (
|
||||
@@ -2077,8 +2077,8 @@ MmioBitFieldAndThenOr32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioOr64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (Address, MmioRead64 (Address) | OrData);
|
||||
@@ -2106,8 +2106,8 @@ MmioOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioAnd64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT64 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (Address, MmioRead64 (Address) & AndData);
|
||||
@@ -2137,9 +2137,9 @@ MmioAnd64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioAndThenOr64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (Address, (MmioRead64 (Address) & AndData) | OrData);
|
||||
@@ -2169,9 +2169,9 @@ MmioAndThenOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioBitFieldRead64 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead64 (MmioRead64 (Address), StartBit, EndBit);
|
||||
@@ -2204,10 +2204,10 @@ MmioBitFieldRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioBitFieldWrite64 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (
|
||||
@@ -2247,10 +2247,10 @@ MmioBitFieldWrite64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioBitFieldOr64 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (
|
||||
@@ -2290,10 +2290,10 @@ MmioBitFieldOr64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioBitFieldAnd64 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (
|
||||
@@ -2336,11 +2336,11 @@ MmioBitFieldAnd64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioBitFieldAndThenOr64 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT64 AndData,
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
return MmioWrite64 (
|
||||
|
@@ -26,7 +26,7 @@
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoRead64 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -52,15 +52,14 @@ IoRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoWrite64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Reads an 8-bit MMIO register.
|
||||
|
||||
@@ -78,18 +77,19 @@ IoWrite64 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioRead8 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT8*)Address;
|
||||
Value = *(volatile UINT8 *)Address;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -113,18 +113,19 @@ MmioRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
*(volatile UINT8*)Address = Value;
|
||||
*(volatile UINT8 *)Address = Value;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -148,19 +149,20 @@ MmioWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioRead16 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth16, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT16*)Address;
|
||||
Value = *(volatile UINT16 *)Address;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -185,20 +187,21 @@ MmioRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth16, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
*(volatile UINT16*)Address = Value;
|
||||
*(volatile UINT16 *)Address = Value;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -222,20 +225,21 @@ MmioWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioRead32 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT32*)Address;
|
||||
Value = *(volatile UINT32 *)Address;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -260,20 +264,21 @@ MmioRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth32, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
*(volatile UINT32*)Address = Value;
|
||||
*(volatile UINT32 *)Address = Value;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -297,20 +302,21 @@ MmioWrite32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioRead64 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT64 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT64 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth64, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
Value = *(volatile UINT64*)Address;
|
||||
Value = *(volatile UINT64 *)Address;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -333,22 +339,22 @@ MmioRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioWrite64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth64, Address, &Value);
|
||||
if (Flag) {
|
||||
MemoryFence ();
|
||||
*(volatile UINT64*)Address = Value;
|
||||
*(volatile UINT64 *)Address = Value;
|
||||
MemoryFence ();
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioRead8Internal (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -44,8 +44,8 @@ MmioRead8Internal (
|
||||
VOID
|
||||
EFIAPI
|
||||
MmioWrite8Internal (
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ MmioWrite8Internal (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioRead16Internal (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -80,8 +80,8 @@ MmioRead16Internal (
|
||||
VOID
|
||||
EFIAPI
|
||||
MmioWrite16Internal (
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ MmioWrite16Internal (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioRead32Internal (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -116,8 +116,8 @@ MmioRead32Internal (
|
||||
VOID
|
||||
EFIAPI
|
||||
MmioWrite32Internal (
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -135,7 +135,7 @@ MmioWrite32Internal (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioRead64Internal (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -152,8 +152,8 @@ MmioRead64Internal (
|
||||
VOID
|
||||
EFIAPI
|
||||
MmioWrite64Internal (
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -173,7 +173,7 @@ MmioWrite64Internal (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoRead8 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -198,8 +198,8 @@ IoRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -223,7 +223,7 @@ IoWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoRead16 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -248,8 +248,8 @@ IoRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -273,7 +273,7 @@ IoWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoRead32 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -298,8 +298,8 @@ IoRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -324,7 +324,7 @@ IoWrite32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoRead64 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -350,8 +350,8 @@ IoRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoWrite64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -378,9 +378,9 @@ IoWrite64 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -406,9 +406,9 @@ IoReadFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -434,9 +434,9 @@ IoWriteFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -462,9 +462,9 @@ IoReadFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -490,9 +490,9 @@ IoWriteFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -518,9 +518,9 @@ IoReadFifo32 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -543,16 +543,17 @@ IoWriteFifo32 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioRead8 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
Value = MmioRead8Internal (Address);
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -574,16 +575,17 @@ MmioRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
MmioWrite8Internal (Address, Value);
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -606,11 +608,11 @@ MmioWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioRead16 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT16 Value;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
@@ -618,6 +620,7 @@ MmioRead16 (
|
||||
if (Flag) {
|
||||
Value = MmioRead16Internal (Address);
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -639,11 +642,11 @@ MmioRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
@@ -651,6 +654,7 @@ MmioWrite16 (
|
||||
if (Flag) {
|
||||
MmioWrite16Internal (Address, Value);
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -673,11 +677,11 @@ MmioWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioRead32 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT32 Value;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
@@ -685,6 +689,7 @@ MmioRead32 (
|
||||
if (Flag) {
|
||||
Value = MmioRead32Internal (Address);
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -706,11 +711,11 @@ MmioRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
@@ -718,6 +723,7 @@ MmioWrite32 (
|
||||
if (Flag) {
|
||||
MmioWrite32Internal (Address, Value);
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -740,11 +746,11 @@ MmioWrite32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioRead64 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
UINT64 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT64 Value;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
@@ -752,6 +758,7 @@ MmioRead64 (
|
||||
if (Flag) {
|
||||
Value = MmioRead64Internal (Address);
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -773,11 +780,11 @@ MmioRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioWrite64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
@@ -785,6 +792,7 @@ MmioWrite64 (
|
||||
if (Flag) {
|
||||
MmioWrite64Internal (Address, Value);
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoRead8 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -54,8 +54,8 @@ IoRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -80,7 +80,7 @@ IoWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoRead16 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -106,8 +106,8 @@ IoRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -132,7 +132,7 @@ IoWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoRead32 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -158,8 +158,8 @@ IoRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -186,9 +186,9 @@ IoWrite32 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -214,9 +214,9 @@ IoReadFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -242,9 +242,9 @@ IoWriteFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -270,9 +270,9 @@ IoReadFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -298,9 +298,9 @@ IoWriteFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -326,11 +326,10 @@ IoReadFifo32 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "BaseIoLibIntrinsicInternal.h"
|
||||
|
||||
/**
|
||||
@@ -35,16 +34,17 @@
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoRead8 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT8 Data;
|
||||
BOOLEAN Flag;
|
||||
UINT8 Data;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeIoRead (FilterWidth8, Port, &Data);
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("inb %w1,%b0" : "=a" (Data) : "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoRead (FilterWidth8, Port, &Data);
|
||||
|
||||
return Data;
|
||||
@@ -68,19 +68,20 @@ IoRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeIoWrite (FilterWidth8, Port, &Value);
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("outb %b0,%w1" : : "a" (Value), "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth8, Port, &Value);
|
||||
|
||||
return Value;;
|
||||
return Value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +102,7 @@ IoWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoRead16 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT16 Data;
|
||||
@@ -111,8 +112,9 @@ IoRead16 (
|
||||
|
||||
Flag = FilterBeforeIoRead (FilterWidth16, Port, &Data);
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
|
||||
__asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoRead (FilterWidth16, Port, &Data);
|
||||
|
||||
return Data;
|
||||
@@ -137,12 +139,11 @@ IoRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Port & 1) == 0);
|
||||
|
||||
@@ -150,9 +151,10 @@ IoWrite16 (
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("outw %w0,%w1" : : "a" (Value), "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth16, Port, &Value);
|
||||
|
||||
return Value;;
|
||||
return Value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +175,7 @@ IoWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoRead32 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT32 Data;
|
||||
@@ -185,6 +187,7 @@ IoRead32 (
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("inl %w1,%0" : "=a" (Data) : "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoRead (FilterWidth32, Port, &Data);
|
||||
|
||||
return Data;
|
||||
@@ -209,8 +212,8 @@ IoRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
@@ -221,8 +224,8 @@ IoWrite32 (
|
||||
if (Flag) {
|
||||
__asm__ __volatile__ ("outl %0,%w1" : : "a" (Value), "d" ((UINT16)Port));
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth32, Port, &Value);
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
|
@@ -29,15 +29,15 @@
|
||||
UINT8 *
|
||||
EFIAPI
|
||||
MmioReadBuffer8 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT8 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT8 *Buffer
|
||||
)
|
||||
{
|
||||
UINT8 *ReturnBuffer;
|
||||
UINT8 *ReturnBuffer;
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
@@ -73,27 +73,27 @@ MmioReadBuffer8 (
|
||||
UINT16 *
|
||||
EFIAPI
|
||||
MmioReadBuffer16 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT16 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT16 *Buffer
|
||||
)
|
||||
{
|
||||
UINT16 *ReturnBuffer;
|
||||
UINT16 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead16 (StartAddress);
|
||||
*(Buffer++) = MmioRead16 (StartAddress);
|
||||
StartAddress += sizeof (UINT16);
|
||||
Length -= sizeof (UINT16);
|
||||
Length -= sizeof (UINT16);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
@@ -124,27 +124,27 @@ MmioReadBuffer16 (
|
||||
UINT32 *
|
||||
EFIAPI
|
||||
MmioReadBuffer32 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT32 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT32 *Buffer
|
||||
)
|
||||
{
|
||||
UINT32 *ReturnBuffer;
|
||||
UINT32 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead32 (StartAddress);
|
||||
*(Buffer++) = MmioRead32 (StartAddress);
|
||||
StartAddress += sizeof (UINT32);
|
||||
Length -= sizeof (UINT32);
|
||||
Length -= sizeof (UINT32);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
@@ -175,33 +175,32 @@ MmioReadBuffer32 (
|
||||
UINT64 *
|
||||
EFIAPI
|
||||
MmioReadBuffer64 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT64 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
OUT UINT64 *Buffer
|
||||
)
|
||||
{
|
||||
UINT64 *ReturnBuffer;
|
||||
UINT64 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
*(Buffer++) = MmioRead64 (StartAddress);
|
||||
*(Buffer++) = MmioRead64 (StartAddress);
|
||||
StartAddress += sizeof (UINT64);
|
||||
Length -= sizeof (UINT64);
|
||||
Length -= sizeof (UINT64);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 8-bit access.
|
||||
|
||||
@@ -223,24 +222,23 @@ MmioReadBuffer64 (
|
||||
UINT8 *
|
||||
EFIAPI
|
||||
MmioWriteBuffer8 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT8 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT8 *Buffer
|
||||
)
|
||||
{
|
||||
VOID* ReturnBuffer;
|
||||
VOID *ReturnBuffer;
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ReturnBuffer = (UINT8 *) Buffer;
|
||||
ReturnBuffer = (UINT8 *)Buffer;
|
||||
|
||||
while (Length-- != 0) {
|
||||
MmioWrite8 (StartAddress++, *(Buffer++));
|
||||
MmioWrite8 (StartAddress++, *(Buffer++));
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,34 +267,33 @@ MmioWriteBuffer8 (
|
||||
UINT16 *
|
||||
EFIAPI
|
||||
MmioWriteBuffer16 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT16 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT16 *Buffer
|
||||
)
|
||||
{
|
||||
UINT16 *ReturnBuffer;
|
||||
UINT16 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT16) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT16 *) Buffer;
|
||||
ReturnBuffer = (UINT16 *)Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite16 (StartAddress, *(Buffer++));
|
||||
|
||||
StartAddress += sizeof (UINT16);
|
||||
Length -= sizeof (UINT16);
|
||||
Length -= sizeof (UINT16);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Copy data from system memory to the MMIO region by using 32-bit access.
|
||||
|
||||
@@ -323,28 +320,28 @@ MmioWriteBuffer16 (
|
||||
UINT32 *
|
||||
EFIAPI
|
||||
MmioWriteBuffer32 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT32 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT32 *Buffer
|
||||
)
|
||||
{
|
||||
UINT32 *ReturnBuffer;
|
||||
UINT32 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT32) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT32 *) Buffer;
|
||||
ReturnBuffer = (UINT32 *)Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite32 (StartAddress, *(Buffer++));
|
||||
|
||||
StartAddress += sizeof (UINT32);
|
||||
Length -= sizeof (UINT32);
|
||||
Length -= sizeof (UINT32);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
@@ -376,30 +373,29 @@ MmioWriteBuffer32 (
|
||||
UINT64 *
|
||||
EFIAPI
|
||||
MmioWriteBuffer64 (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT64 *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Length,
|
||||
IN CONST UINT64 *Buffer
|
||||
)
|
||||
{
|
||||
UINT64 *ReturnBuffer;
|
||||
UINT64 *ReturnBuffer;
|
||||
|
||||
ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
|
||||
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
|
||||
|
||||
ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
|
||||
ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
ASSERT (((UINTN)Buffer & (sizeof (UINT64) - 1)) == 0);
|
||||
|
||||
ReturnBuffer = (UINT64 *) Buffer;
|
||||
ReturnBuffer = (UINT64 *)Buffer;
|
||||
|
||||
while (Length != 0) {
|
||||
MmioWrite64 (StartAddress, *(Buffer++));
|
||||
|
||||
StartAddress += sizeof (UINT64);
|
||||
Length -= sizeof (UINT64);
|
||||
Length -= sizeof (UINT64);
|
||||
}
|
||||
|
||||
return ReturnBuffer;
|
||||
}
|
||||
|
||||
|
@@ -13,21 +13,49 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
#include "BaseIoLibIntrinsicInternal.h"
|
||||
|
||||
//
|
||||
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
|
||||
//
|
||||
|
||||
int _inp (unsigned short port);
|
||||
unsigned short _inpw (unsigned short port);
|
||||
unsigned long _inpd (unsigned short port);
|
||||
int _outp (unsigned short port, int databyte );
|
||||
unsigned short _outpw (unsigned short port, unsigned short dataword );
|
||||
unsigned long _outpd (unsigned short port, unsigned long dataword );
|
||||
void _ReadWriteBarrier (void);
|
||||
int
|
||||
_inp (
|
||||
unsigned short port
|
||||
);
|
||||
|
||||
unsigned short
|
||||
_inpw (
|
||||
unsigned short port
|
||||
);
|
||||
|
||||
unsigned long
|
||||
_inpd (
|
||||
unsigned short port
|
||||
);
|
||||
|
||||
int
|
||||
_outp (
|
||||
unsigned short port,
|
||||
int databyte
|
||||
);
|
||||
|
||||
unsigned short
|
||||
_outpw (
|
||||
unsigned short port,
|
||||
unsigned short dataword
|
||||
);
|
||||
|
||||
unsigned long
|
||||
_outpd (
|
||||
unsigned short port,
|
||||
unsigned long dataword
|
||||
);
|
||||
|
||||
void
|
||||
_ReadWriteBarrier (
|
||||
void
|
||||
);
|
||||
|
||||
#pragma intrinsic(_inp)
|
||||
#pragma intrinsic(_inpw)
|
||||
@@ -62,11 +90,11 @@ void _ReadWriteBarrier (void);
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoRead8 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeIoRead (FilterWidth8, Port, &Value);
|
||||
if (Flag) {
|
||||
@@ -74,6 +102,7 @@ IoRead8 (
|
||||
Value = (UINT8)_inp ((UINT16)Port);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterAfterIoRead (FilterWidth8, Port, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -97,18 +126,19 @@ IoRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeIoWrite(FilterWidth8, Port, &Value);
|
||||
Flag = FilterBeforeIoWrite (FilterWidth8, Port, &Value);
|
||||
if (Flag) {
|
||||
_ReadWriteBarrier ();
|
||||
(UINT8)_outp ((UINT16)Port, Value);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth8, Port, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -132,11 +162,11 @@ IoWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoRead16 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Port & 1) == 0);
|
||||
|
||||
@@ -146,6 +176,7 @@ IoRead16 (
|
||||
Value = _inpw ((UINT16)Port);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterBeforeIoRead (FilterWidth16, Port, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -170,20 +201,21 @@ IoRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Port & 1) == 0);
|
||||
|
||||
Flag = FilterBeforeIoWrite(FilterWidth16, Port, &Value);
|
||||
Flag = FilterBeforeIoWrite (FilterWidth16, Port, &Value);
|
||||
if (Flag) {
|
||||
_ReadWriteBarrier ();
|
||||
_outpw ((UINT16)Port, Value);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth16, Port, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -207,20 +239,21 @@ IoWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoRead32 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Port & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeIoRead(FilterWidth32, Port, &Value);
|
||||
Flag = FilterBeforeIoRead (FilterWidth32, Port, &Value);
|
||||
if (Flag) {
|
||||
_ReadWriteBarrier ();
|
||||
Value = _inpd ((UINT16)Port);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterAfterIoRead (FilterWidth32, Port, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -245,20 +278,21 @@ IoRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Port & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeIoWrite(FilterWidth32, Port, &Value);
|
||||
Flag = FilterBeforeIoWrite (FilterWidth32, Port, &Value);
|
||||
if (Flag) {
|
||||
_ReadWriteBarrier ();
|
||||
_outpd ((UINT16)Port, Value);
|
||||
_ReadWriteBarrier ();
|
||||
}
|
||||
|
||||
FilterAfterIoWrite (FilterWidth32, Port, &Value);
|
||||
|
||||
return Value;
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
//
|
||||
// Include common header file for this module.
|
||||
//
|
||||
@@ -34,7 +33,7 @@
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoRead8 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -59,8 +58,8 @@ IoRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
IoWrite8 (
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
IN UINTN Port,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -84,7 +83,7 @@ IoWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoRead16 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -109,8 +108,8 @@ IoRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
IoWrite16 (
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
IN UINTN Port,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -134,7 +133,7 @@ IoWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoRead32 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -159,8 +158,8 @@ IoRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
IoWrite32 (
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
IN UINTN Port,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -185,7 +184,7 @@ IoWrite32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoRead64 (
|
||||
IN UINTN Port
|
||||
IN UINTN Port
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -211,8 +210,8 @@ IoRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
IoWrite64 (
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
IN UINTN Port,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -239,9 +238,9 @@ IoWrite64 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -267,9 +266,9 @@ IoReadFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo8 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -295,9 +294,9 @@ IoWriteFifo8 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -323,9 +322,9 @@ IoReadFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo16 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -351,9 +350,9 @@ IoWriteFifo16 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoReadFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -379,9 +378,9 @@ IoReadFifo32 (
|
||||
VOID
|
||||
EFIAPI
|
||||
IoWriteFifo32 (
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
IN UINTN Port,
|
||||
IN UINTN Count,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
ASSERT (FALSE);
|
||||
@@ -404,16 +403,17 @@ IoWriteFifo32 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioRead8 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT8 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
Value = *(volatile UINT8*)Address;
|
||||
Value = *(volatile UINT8 *)Address;
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -435,16 +435,17 @@ MmioRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
MmioWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
|
||||
if (Flag) {
|
||||
*(volatile UINT8*)Address = Value;
|
||||
*(volatile UINT8 *)Address = Value;
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -467,18 +468,19 @@ MmioWrite8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioRead16 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT16 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth16, Address, &Value);
|
||||
if (Flag) {
|
||||
Value = *(volatile UINT16*)Address;
|
||||
Value = *(volatile UINT16 *)Address;
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -500,18 +502,19 @@ MmioRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
MmioWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 1) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth16, Address, &Value);
|
||||
if (Flag) {
|
||||
*(volatile UINT16*)Address = Value;
|
||||
*(volatile UINT16 *)Address = Value;
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -534,18 +537,19 @@ MmioWrite16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioRead32 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT32 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
|
||||
if (Flag) {
|
||||
Value = *(volatile UINT32*)Address;
|
||||
Value = *(volatile UINT32 *)Address;
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -567,18 +571,19 @@ MmioRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
MmioWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 3) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth32, Address, &Value);
|
||||
if (Flag) {
|
||||
*(volatile UINT32*)Address = Value;
|
||||
*(volatile UINT32 *)Address = Value;
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -601,18 +606,19 @@ MmioWrite32 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioRead64 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
UINT64 Value;
|
||||
BOOLEAN Flag;
|
||||
UINT64 Value;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoRead (FilterWidth64, Address, &Value);
|
||||
if (Flag) {
|
||||
Value = *(volatile UINT64*)Address;
|
||||
Value = *(volatile UINT64 *)Address;
|
||||
}
|
||||
|
||||
FilterAfterMmIoRead (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
@@ -634,20 +640,20 @@ MmioRead64 (
|
||||
UINT64
|
||||
EFIAPI
|
||||
MmioWrite64 (
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
IN UINTN Address,
|
||||
IN UINT64 Value
|
||||
)
|
||||
{
|
||||
BOOLEAN Flag;
|
||||
BOOLEAN Flag;
|
||||
|
||||
ASSERT ((Address & 7) == 0);
|
||||
|
||||
Flag = FilterBeforeMmIoWrite (FilterWidth64, Address, &Value);
|
||||
if (Flag) {
|
||||
*(volatile UINT64*)Address = Value;
|
||||
*(volatile UINT64 *)Address = Value;
|
||||
}
|
||||
|
||||
FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
|
@@ -26,8 +26,8 @@
|
||||
UINT64
|
||||
EFIAPI
|
||||
ARShiftU64 (
|
||||
IN UINT64 Operand,
|
||||
IN UINTN Count
|
||||
IN UINT64 Operand,
|
||||
IN UINTN Count
|
||||
)
|
||||
{
|
||||
ASSERT (Count < 64);
|
||||
|
@@ -33,7 +33,6 @@ InternalSwitchStackAsm (
|
||||
IN VOID *NewStack
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -12,7 +12,7 @@
|
||||
Hack function for passing GCC build.
|
||||
**/
|
||||
VOID
|
||||
__chkstk()
|
||||
__chkstk (
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 ();
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
extern
|
||||
UINT64
|
||||
_break (
|
||||
CHAR8 BreakCode
|
||||
CHAR8 BreakCode
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -120,4 +120,3 @@ CpuPause (
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
Uses as a barrier to stop speculative execution.
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
@@ -27,7 +24,7 @@
|
||||
UINT32
|
||||
EFIAPI
|
||||
GetPowerOfTwo32 (
|
||||
IN UINT32 Operand
|
||||
IN UINT32 Operand
|
||||
)
|
||||
{
|
||||
if (0 == Operand) {
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 ();
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Requests CPU to pause for a short period of time.
|
||||
|
||||
@@ -26,4 +23,3 @@ CpuPause (
|
||||
pause
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,4 +27,3 @@ AsmDisableCache (
|
||||
wbinvd
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Disables CPU interrupts.
|
||||
|
||||
@@ -23,4 +20,3 @@ DisableInterrupts (
|
||||
cli
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
function after paging is disabled.
|
||||
|
||||
**/
|
||||
__declspec (naked)
|
||||
__declspec(naked)
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalX86DisablePaging32 (
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,4 +27,3 @@ AsmEnableCache (
|
||||
mov cr0, eax
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Enables CPU interrupts for the smallest window required to capture any
|
||||
pending interrupts.
|
||||
@@ -27,4 +24,3 @@ EnableDisableInterrupts (
|
||||
cli
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Enables CPU interrupts.
|
||||
|
||||
@@ -23,4 +20,3 @@ EnableInterrupts (
|
||||
sti
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
function after paging is enabled.
|
||||
|
||||
**/
|
||||
__declspec (naked)
|
||||
__declspec(naked)
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalX86EnablePaging32 (
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Executes a INVD instruction.
|
||||
|
||||
@@ -26,4 +23,3 @@ AsmInvd (
|
||||
invd
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 :
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
)
|
||||
{
|
||||
//
|
||||
|
@@ -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:
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of the Control Register 0 (CR0).
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of the Control Register 2 (CR2).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadCr2 (
|
||||
mov eax, cr2
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of the Control Register 3 (CR3).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadCr3 (
|
||||
mov eax, cr3
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of the Control Register 4 (CR4).
|
||||
|
||||
@@ -31,4 +28,3 @@ AsmReadCr4 (
|
||||
_emit 0xE0
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Code Segment Register (CS).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadCs (
|
||||
mov ax, cs
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 0 (DR0).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr0 (
|
||||
mov eax, dr0
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 1 (DR1).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr1 (
|
||||
mov eax, dr1
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 2 (DR2).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr2 (
|
||||
mov eax, dr2
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 3 (DR3).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr3 (
|
||||
mov eax, dr3
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 4 (DR4).
|
||||
|
||||
@@ -31,4 +28,3 @@ AsmReadDr4 (
|
||||
_emit 0xe0
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 5 (DR5).
|
||||
|
||||
@@ -31,4 +28,3 @@ AsmReadDr5 (
|
||||
_emit 0xe8
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 6 (DR6).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr6 (
|
||||
mov eax, dr6
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Debug Register 7 (DR7).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDr7 (
|
||||
mov eax, dr7
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of Data Segment Register (DS).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadDs (
|
||||
mov ax, ds
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of the EFLAGS register.
|
||||
|
||||
@@ -30,4 +27,3 @@ AsmReadEflags (
|
||||
pop eax
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of ES Data Segment Register (ES).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadEs (
|
||||
mov ax, es
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of FS Data Segment Register (FS).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadFs (
|
||||
mov ax, fs
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of GS Data Segment Register (GS).
|
||||
|
||||
@@ -29,4 +26,3 @@ AsmReadGs (
|
||||
mov ax, gs
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current Local Descriptor Table Register(LDTR) selector.
|
||||
|
||||
@@ -28,4 +25,3 @@ AsmReadLdtr (
|
||||
sldt ax
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #0 (MM0).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm0 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #1 (MM1).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm1 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #2 (MM2).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm2 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #3 (MM3).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm3 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #4 (MM4).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm4 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,9 +6,6 @@
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Reads the current value of 64-bit MMX Register #5 (MM5).
|
||||
|
||||
@@ -33,4 +30,3 @@ AsmReadMm5 (
|
||||
emms
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user