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