summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-18 05:37:58 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-18 05:37:58 +0000
commitcf683fedc773f31e220c52ba5af466e86d9d885c (patch)
tree20f6231a601eb068f654c85bbdb3981de2427eb2 /MdePkg
parent40d841f6a8f84e75409178e19e69b95e01bada0f (diff)
downloadedk2-platforms-cf683fedc773f31e220c52ba5af466e86d9d885c.tar.xz
1. Restore the inline C implementation of GCC assembly files that was temporarily removed in Svn r10045.
2. Remove 139 GCC assembly files whose functionality have been covered in the inline C implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10503 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseCpuLib/BaseCpuLib.inf4
-rw-r--r--MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.S35
-rw-r--r--MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c32
-rw-r--r--MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.S34
-rw-r--r--MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c33
-rw-r--r--MdePkg/Library/BaseLib/BaseLib.inf138
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuPause.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FxRestore.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FxSave.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/GccInline.c1758
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Invd.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr0.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr2.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr3.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr4.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCs.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr0.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr1.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr2.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr3.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr4.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr5.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr6.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr7.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDs.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadEflags.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadEs.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadFs.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadGdtr.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadGs.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadIdtr.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadLdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm0.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm1.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm2.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm3.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm4.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm5.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm6.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm7.S39
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadPmc.S36
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadTsc.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Wbinvd.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr0.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr2.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr3.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr4.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr0.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr1.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr2.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr3.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr4.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr5.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr6.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr7.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteGdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteIdtr.S38
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteLdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm0.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm1.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm2.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm3.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm4.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm5.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm6.S34
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm7.S34
-rw-r--r--MdePkg/Library/BaseLib/X64/CpuPause.S34
-rw-r--r--MdePkg/Library/BaseLib/X64/DisableInterrupts.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/EnableInterrupts.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/FlushCacheLine.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/FxRestore.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/FxSave.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/GccInline.c1806
-rw-r--r--MdePkg/Library/BaseLib/X64/Invd.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/Monitor.S40
-rw-r--r--MdePkg/Library/BaseLib/X64/Mwait.S38
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadCr0.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadCr2.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadCr3.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadCr4.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadCs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr0.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr1.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr2.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr3.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr4.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr5.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr6.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDr7.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadDs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadEflags.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadEs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadFs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadGdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadGs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadIdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadLdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm0.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm1.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm2.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm3.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm4.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm5.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm6.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMm7.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMsr64.S37
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadPmc.S37
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadSs.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadTr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadTsc.S37
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteCr0.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteCr2.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteCr3.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteCr4.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr0.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr1.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr2.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr3.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr4.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr5.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr6.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteDr7.S36
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteGdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteIdtr.S38
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteLdtr.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm0.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm1.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm2.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm3.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm4.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm5.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm6.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMm7.S35
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMsr64.S38
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf11
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c193
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.S41
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.S47
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.S38
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.S38
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c192
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.S37
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.S38
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.S36
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.S36
148 files changed, 4020 insertions, 5107 deletions
diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
index f17c6516a9..9bbb1871f3 100644
--- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
+++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
@@ -37,8 +37,8 @@
Ia32/CpuSleep.asm | INTEL
Ia32/CpuFlushTlb.asm | INTEL
- Ia32/CpuSleep.S | GCC
- Ia32/CpuFlushTlb.S | GCC
+ Ia32/CpuSleepGcc.c | GCC
+ Ia32/CpuFlushTlbGcc.c | GCC
[Sources.X64]
X64/CpuFlushTlb.asm
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.S b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.S
deleted file mode 100644
index 0aec5d015c..0000000000
--- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuFlushTlb.Asm
-#
-# Abstract:
-#
-# CpuFlushTlb function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(CpuFlushTlb)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuFlushTlb (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuFlushTlb):
- movl %cr3, %eax
- movl %eax, %cr3
- ret
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
new file mode 100644
index 0000000000..f8c3a253d2
--- /dev/null
+++ b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
@@ -0,0 +1,32 @@
+/** @file
+ CpuFlushTlb function for Ia32/X64 GCC.
+
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+
+/**
+ Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
+
+ Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
+
+**/
+VOID
+EFIAPI
+CpuFlushTlb (
+ VOID
+ )
+{
+ AsmWriteCr3 (AsmReadCr3 ());
+}
+
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.S b/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.S
deleted file mode 100644
index b826ca2a95..0000000000
--- a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuSleep.Asm
-#
-# Abstract:
-#
-# CpuSleep function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(CpuSleep)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuSleep (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuSleep):
- hlt
- ret
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c b/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
new file mode 100644
index 0000000000..fb5ca29abe
--- /dev/null
+++ b/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
@@ -0,0 +1,33 @@
+/** @file
+ CpuSleep function for Ia32/X64 GCC.
+
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+/**
+ Places the CPU in a sleep state until an interrupt is received.
+
+ Places the CPU in a sleep state until an interrupt is received. If interrupts
+ are disabled prior to calling this function, then the CPU will be placed in a
+ sleep state indefinitely.
+
+**/
+VOID
+EFIAPI
+CpuSleep (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("hlt"::: "memory");
+}
+
diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
index 8da951c947..7a90728794 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -249,80 +249,14 @@
Ia32/EnableCache.asm | INTEL
Ia32/DisableCache.asm | INTEL
+ Ia32/GccInline.c | GCC
Ia32/Thunk16.S | GCC
- Ia32/CpuBreakpoint.S | GCC
- Ia32/CpuPause.S | GCC
Ia32/EnableDisableInterrupts.S | GCC
- Ia32/DisableInterrupts.S | GCC
- Ia32/EnableInterrupts.S | GCC
- Ia32/FlushCacheLine.S | GCC
- Ia32/Invd.S | GCC
- Ia32/Wbinvd.S | GCC
Ia32/EnablePaging64.S | GCC
Ia32/DisablePaging32.S | GCC
Ia32/EnablePaging32.S | GCC
Ia32/Mwait.S | GCC
Ia32/Monitor.S | GCC
- Ia32/ReadPmc.S | GCC
- Ia32/ReadTsc.S | GCC
- Ia32/WriteMm7.S | GCC
- Ia32/WriteMm6.S | GCC
- Ia32/WriteMm5.S | GCC
- Ia32/WriteMm4.S | GCC
- Ia32/WriteMm3.S | GCC
- Ia32/WriteMm2.S | GCC
- Ia32/WriteMm1.S | GCC
- Ia32/WriteMm0.S | GCC
- Ia32/ReadMm7.S | GCC
- Ia32/ReadMm6.S | GCC
- Ia32/ReadMm5.S | GCC
- Ia32/ReadMm4.S | GCC
- Ia32/ReadMm3.S | GCC
- Ia32/ReadMm2.S | GCC
- Ia32/ReadMm1.S | GCC
- Ia32/ReadMm0.S | GCC
- Ia32/FxRestore.S | GCC
- Ia32/FxSave.S | GCC
- Ia32/WriteLdtr.S | GCC
- Ia32/ReadLdtr.S | GCC
- Ia32/WriteIdtr.S | GCC
- Ia32/ReadIdtr.S | GCC
- Ia32/WriteGdtr.S | GCC
- Ia32/ReadGdtr.S | GCC
- Ia32/ReadTr.S | GCC
- Ia32/ReadSs.S | GCC
- Ia32/ReadGs.S | GCC
- Ia32/ReadFs.S | GCC
- Ia32/ReadEs.S | GCC
- Ia32/ReadDs.S | GCC
- Ia32/ReadCs.S | GCC
- Ia32/WriteDr7.S | GCC
- Ia32/WriteDr6.S | GCC
- Ia32/WriteDr5.S | GCC
- Ia32/WriteDr4.S | GCC
- Ia32/WriteDr3.S | GCC
- Ia32/WriteDr2.S | GCC
- Ia32/WriteDr1.S | GCC
- Ia32/WriteDr0.S | GCC
- Ia32/ReadDr7.S | GCC
- Ia32/ReadDr6.S | GCC
- Ia32/ReadDr5.S | GCC
- Ia32/ReadDr4.S | GCC
- Ia32/ReadDr3.S | GCC
- Ia32/ReadDr2.S | GCC
- Ia32/ReadDr1.S | GCC
- Ia32/ReadDr0.S | GCC
- Ia32/WriteCr4.S | GCC
- Ia32/WriteCr3.S | GCC
- Ia32/WriteCr2.S | GCC
- Ia32/WriteCr0.S | GCC
- Ia32/ReadCr4.S | GCC
- Ia32/ReadCr3.S | GCC
- Ia32/ReadCr2.S | GCC
- Ia32/ReadCr0.S | GCC
- Ia32/WriteMsr64.S | GCC
- Ia32/ReadMsr64.S | GCC
- Ia32/ReadEflags.S | GCC
Ia32/CpuIdEx.S | GCC
Ia32/CpuId.S | GCC
Ia32/LongJump.S | GCC
@@ -464,83 +398,15 @@
X86EnablePaging32.c
X86DisablePaging64.c
X86DisablePaging32.c
- X64/WriteMsr64.S | GCC
- X64/WriteMm7.S | GCC
- X64/WriteMm6.S | GCC
- X64/WriteMm5.S | GCC
- X64/WriteMm4.S | GCC
- X64/WriteMm3.S | GCC
- X64/WriteMm2.S | GCC
- X64/WriteMm1.S | GCC
- X64/WriteMm0.S | GCC
- X64/WriteLdtr.S | GCC
- X64/WriteIdtr.S | GCC
- X64/WriteGdtr.S | GCC
- X64/WriteDr7.S | GCC
- X64/WriteDr6.S | GCC
- X64/WriteDr5.S | GCC
- X64/WriteDr4.S | GCC
- X64/WriteDr3.S | GCC
- X64/WriteDr2.S | GCC
- X64/WriteDr1.S | GCC
- X64/WriteDr0.S | GCC
- X64/WriteCr4.S | GCC
- X64/WriteCr3.S | GCC
- X64/WriteCr2.S | GCC
- X64/WriteCr0.S | GCC
- X64/Wbinvd.S | GCC
+ X64/GccInline.c | GCC
X64/Thunk16.S | GCC
X64/SwitchStack.S | GCC
X64/SetJump.S | GCC
- X64/ReadTsc.S | GCC
- X64/ReadTr.S | GCC
- X64/ReadSs.S | GCC
- X64/ReadPmc.S | GCC
- X64/ReadMsr64.S | GCC
- X64/ReadMm7.S | GCC
- X64/ReadMm6.S | GCC
- X64/ReadMm5.S | GCC
- X64/ReadMm4.S | GCC
- X64/ReadMm3.S | GCC
- X64/ReadMm2.S | GCC
- X64/ReadMm1.S | GCC
- X64/ReadMm0.S | GCC
- X64/ReadLdtr.S | GCC
- X64/ReadIdtr.S | GCC
- X64/ReadGs.S | GCC
- X64/ReadGdtr.S | GCC
- X64/ReadFs.S | GCC
- X64/ReadEs.S | GCC
- X64/ReadEflags.S | GCC
- X64/ReadDs.S | GCC
- X64/ReadDr7.S | GCC
- X64/ReadDr6.S | GCC
- X64/ReadDr5.S | GCC
- X64/ReadDr4.S | GCC
- X64/ReadDr3.S | GCC
- X64/ReadDr2.S | GCC
- X64/ReadDr1.S | GCC
- X64/ReadDr0.S | GCC
- X64/ReadCs.S | GCC
- X64/ReadCr4.S | GCC
- X64/ReadCr3.S | GCC
- X64/ReadCr2.S | GCC
- X64/ReadCr0.S | GCC
- X64/Mwait.S | GCC
- X64/Monitor.S | GCC
X64/LongJump.S | GCC
- X64/Invd.S | GCC
- X64/FxSave.S | GCC
- X64/FxRestore.S | GCC
- X64/FlushCacheLine.S | GCC
- X64/EnableInterrupts.S | GCC
X64/EnableDisableInterrupts.S | GCC
X64/DisablePaging64.S | GCC
- X64/DisableInterrupts.S | GCC
- X64/CpuPause.S | GCC
X64/CpuId.S | GCC
X64/CpuIdEx.S | GCC
- X64/CpuBreakpoint.S | GCC
X64/EnableCache.S | GCC
X64/DisableCache.S | GCC
ChkStkGcc.c | GCC
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S
deleted file mode 100644
index 7ad3a1a985..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuBreakpoint.S
-#
-# Abstract:
-#
-# CpuBreakpoint function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(CpuBreakpoint)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuBreakpoint (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuBreakpoint):
- int $3
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.S b/MdePkg/Library/BaseLib/Ia32/CpuPause.S
deleted file mode 100644
index b5eebb7986..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/CpuPause.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuPause.S
-#
-# Abstract:
-#
-# CpuPause function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(CpuPause)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuPause (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuPause):
- pause
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S
deleted file mode 100644
index 273410e9ed..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisableInterrupts.S
-#
-# Abstract:
-#
-# DisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(DisableInterrupts)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# DisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(DisableInterrupts):
- cli
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S
deleted file mode 100644
index 51030bbe1d..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FlushCacheLine.S
-#
-# Abstract:
-#
-# AsmFlushCacheLine function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmFlushCacheLine)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmFlushCacheLine (
-# IN VOID *LinearAddress
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFlushCacheLine):
- movl 4(%esp), %eax
- clflush (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.S b/MdePkg/Library/BaseLib/Ia32/FxRestore.S
deleted file mode 100644
index e1de9c9223..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/FxRestore.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FxRestore.S
-#
-# Abstract:
-#
-# InternalX86FxRestore function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86FxRestore)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86FxRestore):
- movl 4(%esp), %eax # Buffer must be 16-byte aligned
- fxrstor (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.S b/MdePkg/Library/BaseLib/Ia32/FxSave.S
deleted file mode 100644
index 01e96d0878..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/FxSave.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FxSave.S
-#
-# Abstract:
-#
-# InternalX86FxSave function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86FxSave)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86FxSave):
- movl 4(%esp), %eax # Buffer must be 16-byte aligned
- fxsave (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/GccInline.c b/MdePkg/Library/BaseLib/Ia32/GccInline.c
new file mode 100644
index 0000000000..d603b3f1d5
--- /dev/null
+++ b/MdePkg/Library/BaseLib/Ia32/GccInline.c
@@ -0,0 +1,1758 @@
+/** @file
+ GCC inline implementation of BaseLib processor specific functions.
+
+ Copyright (c) 2006 - 2010, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+#include "BaseLibInternals.h"
+
+
+
+/**
+ Used to serialize load and store operations.
+
+ All loads and stores that proceed calls to this function are guaranteed to be
+ globally visible when this function returns.
+
+**/
+VOID
+EFIAPI
+MemoryFence (
+ VOID
+ )
+{
+ // This is a little bit of overkill and it is more about the compiler that it is
+ // actually processor syncronization. This is like the _ReadWriteBarrier
+ // Microsft specific intrinsic
+ __asm__ __volatile__ ("":::"memory");
+}
+
+
+/**
+ Enables CPU interrupts.
+
+ Enables CPU interrupts.
+
+**/
+VOID
+EFIAPI
+EnableInterrupts (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("sti"::: "memory");
+}
+
+
+/**
+ Disables CPU interrupts.
+
+ Disables CPU interrupts.
+
+**/
+VOID
+EFIAPI
+DisableInterrupts (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("cli"::: "memory");
+}
+
+
+
+
+/**
+ Requests CPU to pause for a short period of time.
+
+ Requests CPU to pause for a short period of time. Typically used in MP
+ systems to prevent memory starvation while waiting for a spin lock.
+
+**/
+VOID
+EFIAPI
+CpuPause (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("pause");
+}
+
+
+/**
+ Generates a breakpoint on the CPU.
+
+ Generates a breakpoint on the CPU. The breakpoint must be implemented such
+ that code can resume normal execution after the breakpoint.
+
+**/
+VOID
+EFIAPI
+CpuBreakpoint (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("int $3");
+}
+
+
+
+/**
+ Returns a 64-bit Machine Specific Register(MSR).
+
+ Reads and returns the 64-bit MSR specified by Index. No parameter checking is
+ performed on Index, and some Index values may cause CPU exceptions. The
+ caller must either guarantee that Index is valid, or the caller must set up
+ exception handlers to catch the exceptions. This function is only available
+ on IA-32 and X64.
+
+ @param Index The 32-bit MSR index to read.
+
+ @return The value of the MSR identified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadMsr64 (
+ IN UINT32 Index
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "rdmsr"
+ : "=A" (Data) // %0
+ : "c" (Index) // %1
+ );
+
+ return Data;
+}
+
+/**
+ Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
+ value.
+
+ Writes the 64-bit value specified by Value to the MSR specified by Index. The
+ 64-bit value written to the MSR is returned. No parameter checking is
+ performed on Index or Value, and some of these may cause CPU exceptions. The
+ caller must either guarantee that Index and Value are valid, or the caller
+ must establish proper exception handlers. This function is only available on
+ IA-32 and X64.
+
+ @param Index The 32-bit MSR index to write.
+ @param Value The 64-bit value to write to the MSR.
+
+ @return Value
+
+**/
+UINT64
+EFIAPI
+AsmWriteMsr64 (
+ IN UINT32 Index,
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "wrmsr"
+ :
+ : "c" (Index),
+ "A" (Value)
+ );
+
+ return Value;
+}
+
+
+
+/**
+ Reads the current value of the EFLAGS register.
+
+ Reads and returns the current value of the EFLAGS register. This function is
+ only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a
+ 64-bit value on X64.
+
+ @return EFLAGS on IA-32 or RFLAGS on X64.
+
+**/
+UINTN
+EFIAPI
+AsmReadEflags (
+ VOID
+ )
+{
+ UINTN Eflags;
+
+ __asm__ __volatile__ (
+ "pushfl \n\t"
+ "popl %0 "
+ : "=r" (Eflags)
+ );
+
+ return Eflags;
+}
+
+
+
+/**
+ Reads the current value of the Control Register 0 (CR0).
+
+ Reads and returns the current value of CR0. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 0 (CR0).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr0 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%cr0,%0"
+ : "=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of the Control Register 2 (CR2).
+
+ Reads and returns the current value of CR2. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 2 (CR2).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr2 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%cr2, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+/**
+ Reads the current value of the Control Register 3 (CR3).
+
+ Reads and returns the current value of CR3. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 3 (CR3).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr3 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%cr3, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of the Control Register 4 (CR4).
+
+ Reads and returns the current value of CR4. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 4 (CR4).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr4 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%cr4, %0"
+ : "=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes a value to Control Register 0 (CR0).
+
+ Writes and returns a new value to CR0. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr0 The value to write to CR0.
+
+ @return The value written to CR0.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr0 (
+ UINTN Cr0
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%cr0"
+ :
+ : "r" (Cr0)
+ );
+ return Cr0;
+}
+
+
+/**
+ Writes a value to Control Register 2 (CR2).
+
+ Writes and returns a new value to CR2. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr2 The value to write to CR2.
+
+ @return The value written to CR2.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr2 (
+ UINTN Cr2
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%cr2"
+ :
+ : "r" (Cr2)
+ );
+ return Cr2;
+}
+
+
+/**
+ Writes a value to Control Register 3 (CR3).
+
+ Writes and returns a new value to CR3. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr3 The value to write to CR3.
+
+ @return The value written to CR3.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr3 (
+ UINTN Cr3
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%cr3"
+ :
+ : "r" (Cr3)
+ );
+ return Cr3;
+}
+
+
+/**
+ Writes a value to Control Register 4 (CR4).
+
+ Writes and returns a new value to CR4. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr4 The value to write to CR4.
+
+ @return The value written to CR4.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr4 (
+ UINTN Cr4
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%cr4"
+ :
+ : "r" (Cr4)
+ );
+ return Cr4;
+}
+
+
+/**
+ Reads the current value of Debug Register 0 (DR0).
+
+ Reads and returns the current value of DR0. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 0 (DR0).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr0 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr0, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 1 (DR1).
+
+ Reads and returns the current value of DR1. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 1 (DR1).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr1 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr1, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 2 (DR2).
+
+ Reads and returns the current value of DR2. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 2 (DR2).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr2 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr2, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 3 (DR3).
+
+ Reads and returns the current value of DR3. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 3 (DR3).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr3 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr3, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 4 (DR4).
+
+ Reads and returns the current value of DR4. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 4 (DR4).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr4 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr4, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 5 (DR5).
+
+ Reads and returns the current value of DR5. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 5 (DR5).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr5 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr5, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 6 (DR6).
+
+ Reads and returns the current value of DR6. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 6 (DR6).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr6 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr6, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 7 (DR7).
+
+ Reads and returns the current value of DR7. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 7 (DR7).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr7 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "movl %%dr7, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes a value to Debug Register 0 (DR0).
+
+ Writes and returns a new value to DR0. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr0 The value to write to Dr0.
+
+ @return The value written to Debug Register 0 (DR0).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr0 (
+ UINTN Dr0
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr0"
+ :
+ : "r" (Dr0)
+ );
+ return Dr0;
+}
+
+
+/**
+ Writes a value to Debug Register 1 (DR1).
+
+ Writes and returns a new value to DR1. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr1 The value to write to Dr1.
+
+ @return The value written to Debug Register 1 (DR1).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr1 (
+ UINTN Dr1
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr1"
+ :
+ : "r" (Dr1)
+ );
+ return Dr1;
+}
+
+
+/**
+ Writes a value to Debug Register 2 (DR2).
+
+ Writes and returns a new value to DR2. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr2 The value to write to Dr2.
+
+ @return The value written to Debug Register 2 (DR2).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr2 (
+ UINTN Dr2
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr2"
+ :
+ : "r" (Dr2)
+ );
+ return Dr2;
+}
+
+
+/**
+ Writes a value to Debug Register 3 (DR3).
+
+ Writes and returns a new value to DR3. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr3 The value to write to Dr3.
+
+ @return The value written to Debug Register 3 (DR3).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr3 (
+ UINTN Dr3
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr3"
+ :
+ : "r" (Dr3)
+ );
+ return Dr3;
+}
+
+
+/**
+ Writes a value to Debug Register 4 (DR4).
+
+ Writes and returns a new value to DR4. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr4 The value to write to Dr4.
+
+ @return The value written to Debug Register 4 (DR4).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr4 (
+ UINTN Dr4
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr4"
+ :
+ : "r" (Dr4)
+ );
+ return Dr4;
+}
+
+
+/**
+ Writes a value to Debug Register 5 (DR5).
+
+ Writes and returns a new value to DR5. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr5 The value to write to Dr5.
+
+ @return The value written to Debug Register 5 (DR5).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr5 (
+ UINTN Dr5
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr5"
+ :
+ : "r" (Dr5)
+ );
+ return Dr5;
+}
+
+
+/**
+ Writes a value to Debug Register 6 (DR6).
+
+ Writes and returns a new value to DR6. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr6 The value to write to Dr6.
+
+ @return The value written to Debug Register 6 (DR6).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr6 (
+ UINTN Dr6
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr6"
+ :
+ : "r" (Dr6)
+ );
+ return Dr6;
+}
+
+
+/**
+ Writes a value to Debug Register 7 (DR7).
+
+ Writes and returns a new value to DR7. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr7 The value to write to Dr7.
+
+ @return The value written to Debug Register 7 (DR7).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr7 (
+ UINTN Dr7
+ )
+{
+ __asm__ __volatile__ (
+ "movl %0, %%dr7"
+ :
+ : "r" (Dr7)
+ );
+ return Dr7;
+}
+
+
+/**
+ Reads the current value of Code Segment Register (CS).
+
+ Reads and returns the current value of CS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of CS.
+
+**/
+UINT16
+EFIAPI
+AsmReadCs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%cs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Data Segment Register (DS).
+
+ Reads and returns the current value of DS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of DS.
+
+**/
+UINT16
+EFIAPI
+AsmReadDs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%ds, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Extra Segment Register (ES).
+
+ Reads and returns the current value of ES. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of ES.
+
+**/
+UINT16
+EFIAPI
+AsmReadEs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%es, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of FS Data Segment Register (FS).
+
+ Reads and returns the current value of FS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of FS.
+
+**/
+UINT16
+EFIAPI
+AsmReadFs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%fs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of GS Data Segment Register (GS).
+
+ Reads and returns the current value of GS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of GS.
+
+**/
+UINT16
+EFIAPI
+AsmReadGs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%gs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Stack Segment Register (SS).
+
+ Reads and returns the current value of SS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of SS.
+
+**/
+UINT16
+EFIAPI
+AsmReadSs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%ds, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Task Register (TR).
+
+ Reads and returns the current value of TR. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of TR.
+
+**/
+UINT16
+EFIAPI
+AsmReadTr (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "str %0"
+ : "=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current Global Descriptor Table Register(GDTR) descriptor.
+
+ Reads and returns the current GDTR descriptor and returns it in Gdtr. This
+ function is only available on IA-32 and X64.
+
+ @param Gdtr Pointer to a GDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86ReadGdtr (
+ OUT IA32_DESCRIPTOR *Gdtr
+ )
+{
+ __asm__ __volatile__ (
+ "sgdt %0"
+ : "=m" (*Gdtr)
+ );
+}
+
+
+/**
+ Writes the current Global Descriptor Table Register (GDTR) descriptor.
+
+ Writes and the current GDTR descriptor specified by Gdtr. This function is
+ only available on IA-32 and X64.
+
+ @param Gdtr Pointer to a GDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86WriteGdtr (
+ IN CONST IA32_DESCRIPTOR *Gdtr
+ )
+{
+ __asm__ __volatile__ (
+ "lgdt %0"
+ :
+ : "m" (*Gdtr)
+ );
+
+}
+
+
+/**
+ Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
+
+ Reads and returns the current IDTR descriptor and returns it in Idtr. This
+ function is only available on IA-32 and X64.
+
+ @param Idtr Pointer to a IDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86ReadIdtr (
+ OUT IA32_DESCRIPTOR *Idtr
+ )
+{
+ __asm__ __volatile__ (
+ "sldt %0"
+ : "=m" (*Idtr)
+ );
+}
+
+
+/**
+ Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
+
+ Writes the current IDTR descriptor and returns it in Idtr. This function is
+ only available on IA-32 and X64.
+
+ @param Idtr Pointer to a IDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86WriteIdtr (
+ IN CONST IA32_DESCRIPTOR *Idtr
+ )
+{
+ __asm__ __volatile__ (
+ "lidt %0"
+ :
+ : "m" (*Idtr)
+ );
+}
+
+
+/**
+ Reads the current Local Descriptor Table Register(LDTR) selector.
+
+ Reads and returns the current 16-bit LDTR descriptor value. This function is
+ only available on IA-32 and X64.
+
+ @return The current selector of LDT.
+
+**/
+UINT16
+EFIAPI
+AsmReadLdtr (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "sldt %0"
+ : "=g" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes the current Local Descriptor Table Register (GDTR) selector.
+
+ Writes and the current LDTR descriptor specified by Ldtr. This function is
+ only available on IA-32 and X64.
+
+ @param Ldtr 16-bit LDTR selector value.
+
+**/
+VOID
+EFIAPI
+AsmWriteLdtr (
+ IN UINT16 Ldtr
+ )
+{
+ __asm__ __volatile__ (
+ "lldtw %0"
+ :
+ : "g" (Ldtr) // %0
+ );
+}
+
+
+/**
+ Save the current floating point/SSE/SSE2 context to a buffer.
+
+ Saves the current floating point/SSE/SSE2 state to the buffer specified by
+ Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
+ available on IA-32 and X64.
+
+ @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
+
+**/
+VOID
+EFIAPI
+InternalX86FxSave (
+ OUT IA32_FX_BUFFER *Buffer
+ )
+{
+ __asm__ __volatile__ (
+ "fxsave %0"
+ :
+ : "m" (*Buffer) // %0
+ );
+}
+
+
+/**
+ Restores the current floating point/SSE/SSE2 context from a buffer.
+
+ Restores the current floating point/SSE/SSE2 state from the buffer specified
+ by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
+ only available on IA-32 and X64.
+
+ @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
+
+**/
+VOID
+EFIAPI
+InternalX86FxRestore (
+ IN CONST IA32_FX_BUFFER *Buffer
+ )
+{
+ __asm__ __volatile__ (
+ "fxrstor %0"
+ :
+ : "m" (*Buffer) // %0
+ );
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #0 (MM0).
+
+ Reads and returns the current value of MM0. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM0.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm0 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm0, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #1 (MM1).
+
+ Reads and returns the current value of MM1. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM1.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm1 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm1, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #2 (MM2).
+
+ Reads and returns the current value of MM2. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM2.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm2 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm2, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #3 (MM3).
+
+ Reads and returns the current value of MM3. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM3.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm3 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm3, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #4 (MM4).
+
+ Reads and returns the current value of MM4. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM4.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm4 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm4, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #5 (MM5).
+
+ Reads and returns the current value of MM5. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM5.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm5 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm5, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #6 (MM6).
+
+ Reads and returns the current value of MM6. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM6.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm6 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm6, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #7 (MM7).
+
+ Reads and returns the current value of MM7. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM7.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm7 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "push %%eax \n\t"
+ "push %%eax \n\t"
+ "movq %%mm7, (%%esp)\n\t"
+ "pop %%eax \n\t"
+ "pop %%edx \n\t"
+ : "=A" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #0 (MM0).
+
+ Writes the current value of MM0. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM0.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm0 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm0" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #1 (MM1).
+
+ Writes the current value of MM1. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM1.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm1 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm1" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #2 (MM2).
+
+ Writes the current value of MM2. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM2.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm2 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm2" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #3 (MM3).
+
+ Writes the current value of MM3. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM3.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm3 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm3" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #4 (MM4).
+
+ Writes the current value of MM4. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM4.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm4 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm4" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #5 (MM5).
+
+ Writes the current value of MM5. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM5.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm5 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm5" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #6 (MM6).
+
+ Writes the current value of MM6. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM6.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm6 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm6" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #7 (MM7).
+
+ Writes the current value of MM7. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM7.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm7 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movq %0, %%mm7" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Reads the current value of Time Stamp Counter (TSC).
+
+ Reads and returns the current value of TSC. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of TSC
+
+**/
+UINT64
+EFIAPI
+AsmReadTsc (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "rdtsc"
+ : "=A" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of a Performance Counter (PMC).
+
+ Reads and returns the current value of performance counter specified by
+ Index. This function is only available on IA-32 and X64.
+
+ @param Index The 32-bit Performance Counter index to read.
+
+ @return The value of the PMC specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmc (
+ IN UINT32 Index
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "rdpmc"
+ : "=A" (Data)
+ : "c" (Index)
+ );
+
+ return Data;
+}
+
+
+
+
+/**
+ Executes a WBINVD instruction.
+
+ Executes a WBINVD instruction. This function is only available on IA-32 and
+ X64.
+
+**/
+VOID
+EFIAPI
+AsmWbinvd (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("wbinvd":::"memory");
+}
+
+
+/**
+ Executes a INVD instruction.
+
+ Executes a INVD instruction. This function is only available on IA-32 and
+ X64.
+
+**/
+VOID
+EFIAPI
+AsmInvd (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("invd":::"memory");
+
+}
+
+
+/**
+ Flushes a cache line from all the instruction and data caches within the
+ coherency domain of the CPU.
+
+ Flushed the cache line specified by LinearAddress, and returns LinearAddress.
+ This function is only available on IA-32 and X64.
+
+ @param LinearAddress The address of the cache line to flush. If the CPU is
+ in a physical addressing mode, then LinearAddress is a
+ physical address. If the CPU is in a virtual
+ addressing mode, then LinearAddress is a virtual
+ address.
+
+ @return LinearAddress
+**/
+VOID *
+EFIAPI
+AsmFlushCacheLine (
+ IN VOID *LinearAddress
+ )
+{
+ __asm__ __volatile__ (
+ "clflush (%0)"
+ : "+a" (LinearAddress)
+ :
+ : "memory"
+ );
+
+ return LinearAddress;
+}
+
+
diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.S b/MdePkg/Library/BaseLib/Ia32/Invd.S
deleted file mode 100644
index 76d9017401..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/Invd.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Invd.S
-#
-# Abstract:
-#
-# AsmInvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmInvd)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmInvd (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmInvd):
- invd
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.S b/MdePkg/Library/BaseLib/Ia32/ReadCr0.S
deleted file mode 100644
index aadf088057..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr0.S
-#
-# Abstract:
-#
-# AsmReadCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadCr0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr0):
- movl %cr0, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.S b/MdePkg/Library/BaseLib/Ia32/ReadCr2.S
deleted file mode 100644
index 0b32673c05..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr2.S
-#
-# Abstract:
-#
-# AsmReadCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadCr2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr2):
- movl %cr2, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.S b/MdePkg/Library/BaseLib/Ia32/ReadCr3.S
deleted file mode 100644
index d29fe905d9..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr3.S
-#
-# Abstract:
-#
-# AsmReadCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadCr3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr3):
- movl %cr3, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.S b/MdePkg/Library/BaseLib/Ia32/ReadCr4.S
deleted file mode 100644
index 5754f80a4e..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr4.S
-#
-# Abstract:
-#
-# AsmReadCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadCr4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr4):
- movl %cr4, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.S b/MdePkg/Library/BaseLib/Ia32/ReadCs.S
deleted file mode 100644
index e2450657c0..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadCs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCs.S
-#
-# Abstract:
-#
-# AsmReadCs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadCs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadCs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCs):
- movl %cs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.S b/MdePkg/Library/BaseLib/Ia32/ReadDr0.S
deleted file mode 100644
index 2bf34e064f..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr0.S
-#
-# Abstract:
-#
-# AsmReadDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr0):
- movl %dr0, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.S b/MdePkg/Library/BaseLib/Ia32/ReadDr1.S
deleted file mode 100644
index b608ffaba4..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr1.S
-#
-# Abstract:
-#
-# AsmReadDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr1)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr1):
- movl %dr1, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.S b/MdePkg/Library/BaseLib/Ia32/ReadDr2.S
deleted file mode 100644
index b4a3a91efb..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr2.S
-#
-# Abstract:
-#
-# AsmReadDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr2):
- movl %dr2, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.S b/MdePkg/Library/BaseLib/Ia32/ReadDr3.S
deleted file mode 100644
index 47ebded917..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr3.S
-#
-# Abstract:
-#
-# AsmReadDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr3):
- movl %dr3, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.S b/MdePkg/Library/BaseLib/Ia32/ReadDr4.S
deleted file mode 100644
index e8e7b3804c..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr4.S
-#
-# Abstract:
-#
-# AsmReadDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr4):
- movl %dr4, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.S b/MdePkg/Library/BaseLib/Ia32/ReadDr5.S
deleted file mode 100644
index 280cdf64f1..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr5.S
-#
-# Abstract:
-#
-# AsmReadDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr5)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr5):
- movl %dr5, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.S b/MdePkg/Library/BaseLib/Ia32/ReadDr6.S
deleted file mode 100644
index c7029702d4..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr6.S
-#
-# Abstract:
-#
-# AsmReadDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr6)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr6):
- movl %dr6, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.S b/MdePkg/Library/BaseLib/Ia32/ReadDr7.S
deleted file mode 100644
index 52e225ac33..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr7.S
-#
-# Abstract:
-#
-# AsmReadDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDr7)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr7):
- movl %dr7, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.S b/MdePkg/Library/BaseLib/Ia32/ReadDs.S
deleted file mode 100644
index 39ec0282cc..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadDs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDs.S
-#
-# Abstract:
-#
-# AsmReadDs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadDs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadDs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDs):
- movl %ds, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.S b/MdePkg/Library/BaseLib/Ia32/ReadEflags.S
deleted file mode 100644
index 9796243e8e..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadEflags.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadEflags.S
-#
-# Abstract:
-#
-# AsmReadEflags function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadEflags)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadEflags):
- pushfl
- pop %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.S b/MdePkg/Library/BaseLib/Ia32/ReadEs.S
deleted file mode 100644
index 80c76042e1..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadEs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadEs.S
-#
-# Abstract:
-#
-# AsmReadEs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadEs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadEs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadEs):
- movl %es, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.S b/MdePkg/Library/BaseLib/Ia32/ReadFs.S
deleted file mode 100644
index 57a99dbd82..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadFs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadFs.S
-#
-# Abstract:
-#
-# AsmReadFs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadFs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadFs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadFs):
- movl %fs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S
deleted file mode 100644
index 61b4e2e703..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadGdtr.S
-#
-# Abstract:
-#
-# InternalX86ReadGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86ReadGdtr)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86ReadGdtr):
- movl 4(%esp), %eax
- sgdt (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.S b/MdePkg/Library/BaseLib/Ia32/ReadGs.S
deleted file mode 100644
index d3f3a4c2b1..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadGs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadGs.S
-#
-# Abstract:
-#
-# AsmReadGs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadGs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadGs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadGs):
- movl %gs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S
deleted file mode 100644
index fefe4225d2..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadIdtr.S
-#
-# Abstract:
-#
-# InternalX86ReadIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86ReadIdtr)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86ReadIdtr):
- movl 4(%esp), %eax
- sidt (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S
deleted file mode 100644
index 58184275de..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadLdtr.S
-#
-# Abstract:
-#
-# AsmReadLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadLdtr)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadLdtr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadLdtr):
- sldt %ax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.S b/MdePkg/Library/BaseLib/Ia32/ReadMm0.S
deleted file mode 100644
index 3dbe4261c6..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm0.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm0.S
-#
-# Abstract:
-#
-# AsmReadMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm0):
- push %eax
- push %eax
- movq %mm0, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.S b/MdePkg/Library/BaseLib/Ia32/ReadMm1.S
deleted file mode 100644
index 7adbed101d..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm1.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm1.S
-#
-# Abstract:
-#
-# AsmReadMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm1)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm1):
- push %eax
- push %eax
- movq %mm1, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.S b/MdePkg/Library/BaseLib/Ia32/ReadMm2.S
deleted file mode 100644
index beba09dfee..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm2.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm2.S
-#
-# Abstract:
-#
-# AsmReadMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm2):
- push %eax
- push %eax
- movq %mm2, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.S b/MdePkg/Library/BaseLib/Ia32/ReadMm3.S
deleted file mode 100644
index 2d81fd1e3d..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm3.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm3.S
-#
-# Abstract:
-#
-# AsmReadMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm3):
- push %eax
- push %eax
- movq %mm3, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.S b/MdePkg/Library/BaseLib/Ia32/ReadMm4.S
deleted file mode 100644
index 7a197b975c..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm4.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm4.S
-#
-# Abstract:
-#
-# AsmReadMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm4):
- push %eax
- push %eax
- movq %mm4, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.S b/MdePkg/Library/BaseLib/Ia32/ReadMm5.S
deleted file mode 100644
index 1d2c595d23..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm5.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm5.S
-#
-# Abstract:
-#
-# AsmReadMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm5)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm5):
- push %eax
- push %eax
- movq %mm5, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.S b/MdePkg/Library/BaseLib/Ia32/ReadMm6.S
deleted file mode 100644
index a6d0bbe85e..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm6.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm6.S
-#
-# Abstract:
-#
-# AsmReadMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm6)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm6):
- push %eax
- push %eax
- movq %mm6, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.S b/MdePkg/Library/BaseLib/Ia32/ReadMm7.S
deleted file mode 100644
index 7c36f595e7..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm7.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm7.S
-#
-# Abstract:
-#
-# AsmReadMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadMm7)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm7):
- push %eax
- push %eax
- movq %mm7, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.S b/MdePkg/Library/BaseLib/Ia32/ReadPmc.S
deleted file mode 100644
index 124f5efd0e..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadPmc.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadPmc.S
-#
-# Abstract:
-#
-# AsmReadPmc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadPmc)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadPmc (
-# IN UINT32 PmcIndex
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadPmc):
- movl 4(%esp), %ecx
- rdpmc
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.S b/MdePkg/Library/BaseLib/Ia32/ReadTsc.S
deleted file mode 100644
index 8a44a24083..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/ReadTsc.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadTsc.S
-#
-# Abstract:
-#
-# AsmReadTsc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmReadTsc)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadTsc (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadTsc):
- rdtsc
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.S b/MdePkg/Library/BaseLib/Ia32/Wbinvd.S
deleted file mode 100644
index c5625864a0..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/Wbinvd.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Wbinvd.S
-#
-# Abstract:
-#
-# AsmWbinvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWbinvd (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWbinvd)
-ASM_PFX(AsmWbinvd):
- wbinvd
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.S b/MdePkg/Library/BaseLib/Ia32/WriteCr0.S
deleted file mode 100644
index e98cdb6358..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr0.S
-#
-# Abstract:
-#
-# AsmWriteCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr0 (
-# IN UINTN Cr0
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- movl 4(%esp), %eax
- movl %eax, %cr0
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.S b/MdePkg/Library/BaseLib/Ia32/WriteCr2.S
deleted file mode 100644
index f90da899f3..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr2.S
-#
-# Abstract:
-#
-# AsmWriteCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr2 (
-# IN UINTN Cr2
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- movl 4(%esp), %eax
- movl %eax, %cr2
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.S b/MdePkg/Library/BaseLib/Ia32/WriteCr3.S
deleted file mode 100644
index 8b3ebebed1..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr3.S
-#
-# Abstract:
-#
-# AsmWriteCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr3 (
-# IN UINTN Cr3
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- movl 4(%esp), %eax
- movl %eax, %cr3
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.S b/MdePkg/Library/BaseLib/Ia32/WriteCr4.S
deleted file mode 100644
index 2ab8ce63ca..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr4.S
-#
-# Abstract:
-#
-# AsmWriteCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr4 (
-# IN UINTN Cr4
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- movl 4(%esp), %eax
- movl %eax, %cr4
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.S b/MdePkg/Library/BaseLib/Ia32/WriteDr0.S
deleted file mode 100644
index daf32856c5..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr0.S
-#
-# Abstract:
-#
-# AsmWriteDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr0 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- movl 4(%esp), %eax
- movl %eax, %dr0
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.S b/MdePkg/Library/BaseLib/Ia32/WriteDr1.S
deleted file mode 100644
index 19b608aeb3..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr1.S
-#
-# Abstract:
-#
-# AsmWriteDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr1 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- movl 4(%esp), %eax
- movl %eax, %dr1
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.S b/MdePkg/Library/BaseLib/Ia32/WriteDr2.S
deleted file mode 100644
index 8c07524465..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr2.S
-#
-# Abstract:
-#
-# AsmWriteDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr2 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- movl 4(%esp), %eax
- movl %eax, %dr2
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.S b/MdePkg/Library/BaseLib/Ia32/WriteDr3.S
deleted file mode 100644
index 752f29972f..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr3.S
-#
-# Abstract:
-#
-# AsmWriteDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr3 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- movl 4(%esp), %eax
- movl %eax, %dr3
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.S b/MdePkg/Library/BaseLib/Ia32/WriteDr4.S
deleted file mode 100644
index ab06b6d28d..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr4.S
-#
-# Abstract:
-#
-# AsmWriteDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr4 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- movl 4(%esp), %eax
- movl %eax, %dr4
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.S b/MdePkg/Library/BaseLib/Ia32/WriteDr5.S
deleted file mode 100644
index 2acd8410e1..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr5.S
-#
-# Abstract:
-#
-# AsmWriteDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr5 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- movl 4(%esp), %eax
- movl %eax, %dr5
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.S b/MdePkg/Library/BaseLib/Ia32/WriteDr6.S
deleted file mode 100644
index 6b96f0051f..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr6.S
-#
-# Abstract:
-#
-# AsmWriteDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr6 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- movl 4(%esp), %eax
- movl %eax, %dr6
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.S b/MdePkg/Library/BaseLib/Ia32/WriteDr7.S
deleted file mode 100644
index 900985b4cd..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr7.S
-#
-# Abstract:
-#
-# AsmWriteDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr7 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- movl 4(%esp), %eax
- movl %eax, %dr7
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S
deleted file mode 100644
index b5265e3c0b..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteGdtr.S
-#
-# Abstract:
-#
-# InternalX86WriteGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- movl 4(%esp), %eax
- lgdt (%eax)
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S
deleted file mode 100644
index 4dad958f73..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteIdtr.S
-#
-# Abstract:
-#
-# InternalX86WriteIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- movl 4(%esp), %eax
- pushfl
- cli
- lidt (%eax)
- popfl
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S
deleted file mode 100644
index 2f6ce32061..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteLdtr.S
-#
-# Abstract:
-#
-# AsmWriteLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteLdtr (
-# IN UINT16 Ldtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteLdtr)
-ASM_PFX(AsmWriteLdtr):
- movl 4(%esp), %eax
- lldtw %ax
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.S b/MdePkg/Library/BaseLib/Ia32/WriteMm0.S
deleted file mode 100644
index 2b7d7581d6..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm0.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm0.S
-#
-# Abstract:
-#
-# AsmWriteMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm0 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm0)
-ASM_PFX(AsmWriteMm0):
- movq 4(%esp), %mm0
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.S b/MdePkg/Library/BaseLib/Ia32/WriteMm1.S
deleted file mode 100644
index 8cf8489165..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm1.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm1.S
-#
-# Abstract:
-#
-# AsmWriteMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm1 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm1)
-ASM_PFX(AsmWriteMm1):
- movq 4(%esp), %mm1
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.S b/MdePkg/Library/BaseLib/Ia32/WriteMm2.S
deleted file mode 100644
index 9149fb32fb..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm2.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm2.S
-#
-# Abstract:
-#
-# AsmWriteMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm2 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- movq 4(%esp), %mm2
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.S b/MdePkg/Library/BaseLib/Ia32/WriteMm3.S
deleted file mode 100644
index a898afaaed..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm3.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm3.S
-#
-# Abstract:
-#
-# AsmWriteMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm3 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- movq 4(%esp), %mm3
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.S b/MdePkg/Library/BaseLib/Ia32/WriteMm4.S
deleted file mode 100644
index eb78e1ff55..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm4.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm4.S
-#
-# Abstract:
-#
-# AsmWriteMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm4 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- movq 4(%esp), %mm4
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.S b/MdePkg/Library/BaseLib/Ia32/WriteMm5.S
deleted file mode 100644
index aff39bee91..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm5.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm5.S
-#
-# Abstract:
-#
-# AsmWriteMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm5 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- movq 4(%esp), %mm5
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.S b/MdePkg/Library/BaseLib/Ia32/WriteMm6.S
deleted file mode 100644
index a4412b568f..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm6.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm6.S
-#
-# Abstract:
-#
-# AsmWriteMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm6 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- movq 4(%esp), %mm6
- ret
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.S b/MdePkg/Library/BaseLib/Ia32/WriteMm7.S
deleted file mode 100644
index a9ce09db36..0000000000
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm7.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm7.S
-#
-# Abstract:
-#
-# AsmWriteMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm7 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- movq 4(%esp), %mm7
- ret
diff --git a/MdePkg/Library/BaseLib/X64/CpuPause.S b/MdePkg/Library/BaseLib/X64/CpuPause.S
deleted file mode 100644
index e1ced4ff8f..0000000000
--- a/MdePkg/Library/BaseLib/X64/CpuPause.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuPause.S
-#
-# Abstract:
-#
-# CpuPause function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuPause (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(CpuPause)
-ASM_PFX(CpuPause):
- pause
- ret
diff --git a/MdePkg/Library/BaseLib/X64/DisableInterrupts.S b/MdePkg/Library/BaseLib/X64/DisableInterrupts.S
deleted file mode 100644
index 14ce320e96..0000000000
--- a/MdePkg/Library/BaseLib/X64/DisableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisableInterrupts.S
-#
-# Abstract:
-#
-# DisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# DisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(DisableInterrupts)
-ASM_PFX(DisableInterrupts):
- cli
- ret
diff --git a/MdePkg/Library/BaseLib/X64/EnableInterrupts.S b/MdePkg/Library/BaseLib/X64/EnableInterrupts.S
deleted file mode 100644
index 698977f08c..0000000000
--- a/MdePkg/Library/BaseLib/X64/EnableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnableInterrupts.S
-#
-# Abstract:
-#
-# EnableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(EnableInterrupts)
-ASM_PFX(EnableInterrupts):
- sti
- ret
diff --git a/MdePkg/Library/BaseLib/X64/FlushCacheLine.S b/MdePkg/Library/BaseLib/X64/FlushCacheLine.S
deleted file mode 100644
index 693d2e4caf..0000000000
--- a/MdePkg/Library/BaseLib/X64/FlushCacheLine.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FlushCacheLine.S
-#
-# Abstract:
-#
-# AsmFlushCacheLine function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# AsmFlushCacheLine (
-# IN VOID *LinearAddress
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmFlushCacheLine)
-ASM_PFX(AsmFlushCacheLine):
- clflush (%rcx)
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/FxRestore.S b/MdePkg/Library/BaseLib/X64/FxRestore.S
deleted file mode 100644
index 028e8b25cf..0000000000
--- a/MdePkg/Library/BaseLib/X64/FxRestore.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FxRestore.S
-#
-# Abstract:
-#
-# AsmFxRestore function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# )#
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86FxRestore)
-ASM_PFX(InternalX86FxRestore):
- fxrstor (%rcx)
- ret
diff --git a/MdePkg/Library/BaseLib/X64/FxSave.S b/MdePkg/Library/BaseLib/X64/FxSave.S
deleted file mode 100644
index 080142739d..0000000000
--- a/MdePkg/Library/BaseLib/X64/FxSave.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# FxSave.S
-#
-# Abstract:
-#
-# AsmFxSave function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86FxSave)
-ASM_PFX(InternalX86FxSave):
- fxsave (%rcx)
- ret
diff --git a/MdePkg/Library/BaseLib/X64/GccInline.c b/MdePkg/Library/BaseLib/X64/GccInline.c
new file mode 100644
index 0000000000..d559e3be55
--- /dev/null
+++ b/MdePkg/Library/BaseLib/X64/GccInline.c
@@ -0,0 +1,1806 @@
+/** @file
+ GCC inline implementation of BaseLib processor specific functions.
+
+ Copyright (c) 2006 - 2010, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+#include "BaseLibInternals.h"
+
+
+
+
+/**
+ Used to serialize load and store operations.
+
+ All loads and stores that proceed calls to this function are guaranteed to be
+ globally visible when this function returns.
+
+**/
+VOID
+EFIAPI
+MemoryFence (
+ VOID
+ )
+{
+ // This is a little bit of overkill and it is more about the compiler that it is
+ // actually processor syncronization. This is like the _ReadWriteBarrier
+ // Microsft specific intrinsic
+ __asm__ __volatile__ ("":::"memory");
+}
+
+
+/**
+ Enables CPU interrupts.
+
+ Enables CPU interrupts.
+
+**/
+VOID
+EFIAPI
+EnableInterrupts (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("sti"::: "memory");
+}
+
+
+/**
+ Disables CPU interrupts.
+
+ Disables CPU interrupts.
+
+**/
+VOID
+EFIAPI
+DisableInterrupts (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("cli"::: "memory");
+}
+
+
+
+
+/**
+ Requests CPU to pause for a short period of time.
+
+ Requests CPU to pause for a short period of time. Typically used in MP
+ systems to prevent memory starvation while waiting for a spin lock.
+
+**/
+VOID
+EFIAPI
+CpuPause (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("pause");
+}
+
+
+/**
+ Generates a breakpoint on the CPU.
+
+ Generates a breakpoint on the CPU. The breakpoint must be implemented such
+ that code can resume normal execution after the breakpoint.
+
+**/
+VOID
+EFIAPI
+CpuBreakpoint (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("int $3");
+}
+
+
+
+/**
+ Returns a 64-bit Machine Specific Register(MSR).
+
+ Reads and returns the 64-bit MSR specified by Index. No parameter checking is
+ performed on Index, and some Index values may cause CPU exceptions. The
+ caller must either guarantee that Index is valid, or the caller must set up
+ exception handlers to catch the exceptions. This function is only available
+ on IA-32 and X64.
+
+ @param Index The 32-bit MSR index to read.
+
+ @return The value of the MSR identified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadMsr64 (
+ IN UINT32 Index
+ )
+{
+ UINT32 LowData;
+ UINT32 HighData;
+
+ __asm__ __volatile__ (
+ "rdmsr"
+ : "=a" (LowData), // %0
+ "=d" (HighData) // %1
+ : "c" (Index) // %2
+ );
+
+ return (((UINT64)HighData) << 32) | LowData;
+}
+
+/**
+ Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
+ value.
+
+ Writes the 64-bit value specified by Value to the MSR specified by Index. The
+ 64-bit value written to the MSR is returned. No parameter checking is
+ performed on Index or Value, and some of these may cause CPU exceptions. The
+ caller must either guarantee that Index and Value are valid, or the caller
+ must establish proper exception handlers. This function is only available on
+ IA-32 and X64.
+
+ @param Index The 32-bit MSR index to write.
+ @param Value The 64-bit value to write to the MSR.
+
+ @return Value
+
+**/
+UINT64
+EFIAPI
+AsmWriteMsr64 (
+ IN UINT32 Index,
+ IN UINT64 Value
+ )
+{
+ UINT32 LowData;
+ UINT32 HighData;
+
+ LowData = (UINT32)(Value);
+ HighData = (UINT32)(Value >> 32);
+
+ __asm__ __volatile__ (
+ "wrmsr"
+ :
+ : "c" (Index),
+ "a" (LowData),
+ "d" (HighData)
+ );
+
+ return Value;
+}
+
+
+
+/**
+ Reads the current value of the EFLAGS register.
+
+ Reads and returns the current value of the EFLAGS register. This function is
+ only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a
+ 64-bit value on X64.
+
+ @return EFLAGS on IA-32 or RFLAGS on X64.
+
+**/
+UINTN
+EFIAPI
+AsmReadEflags (
+ VOID
+ )
+{
+ UINTN Eflags;
+
+ __asm__ __volatile__ (
+ "pushfq \n\t"
+ "pop %0 "
+ : "=r" (Eflags) // %0
+ );
+
+ return Eflags;
+}
+
+
+
+/**
+ Reads the current value of the Control Register 0 (CR0).
+
+ Reads and returns the current value of CR0. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 0 (CR0).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr0 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%cr0,%0"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of the Control Register 2 (CR2).
+
+ Reads and returns the current value of CR2. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 2 (CR2).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr2 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%cr2, %0"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+/**
+ Reads the current value of the Control Register 3 (CR3).
+
+ Reads and returns the current value of CR3. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 3 (CR3).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr3 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%cr3, %0"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of the Control Register 4 (CR4).
+
+ Reads and returns the current value of CR4. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of the Control Register 4 (CR4).
+
+**/
+UINTN
+EFIAPI
+AsmReadCr4 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%cr4, %0"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes a value to Control Register 0 (CR0).
+
+ Writes and returns a new value to CR0. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr0 The value to write to CR0.
+
+ @return The value written to CR0.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr0 (
+ UINTN Cr0
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%cr0"
+ :
+ : "r" (Cr0)
+ );
+ return Cr0;
+}
+
+
+/**
+ Writes a value to Control Register 2 (CR2).
+
+ Writes and returns a new value to CR2. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr2 The value to write to CR2.
+
+ @return The value written to CR2.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr2 (
+ UINTN Cr2
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%cr2"
+ :
+ : "r" (Cr2)
+ );
+ return Cr2;
+}
+
+
+/**
+ Writes a value to Control Register 3 (CR3).
+
+ Writes and returns a new value to CR3. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr3 The value to write to CR3.
+
+ @return The value written to CR3.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr3 (
+ UINTN Cr3
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%cr3"
+ :
+ : "r" (Cr3)
+ );
+ return Cr3;
+}
+
+
+/**
+ Writes a value to Control Register 4 (CR4).
+
+ Writes and returns a new value to CR4. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Cr4 The value to write to CR4.
+
+ @return The value written to CR4.
+
+**/
+UINTN
+EFIAPI
+AsmWriteCr4 (
+ UINTN Cr4
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%cr4"
+ :
+ : "r" (Cr4)
+ );
+ return Cr4;
+}
+
+
+/**
+ Reads the current value of Debug Register 0 (DR0).
+
+ Reads and returns the current value of DR0. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 0 (DR0).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr0 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr0, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 1 (DR1).
+
+ Reads and returns the current value of DR1. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 1 (DR1).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr1 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr1, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 2 (DR2).
+
+ Reads and returns the current value of DR2. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 2 (DR2).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr2 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr2, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 3 (DR3).
+
+ Reads and returns the current value of DR3. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 3 (DR3).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr3 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr3, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 4 (DR4).
+
+ Reads and returns the current value of DR4. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 4 (DR4).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr4 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr4, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 5 (DR5).
+
+ Reads and returns the current value of DR5. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 5 (DR5).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr5 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr5, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 6 (DR6).
+
+ Reads and returns the current value of DR6. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 6 (DR6).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr6 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr6, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Debug Register 7 (DR7).
+
+ Reads and returns the current value of DR7. This function is only available
+ on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
+ X64.
+
+ @return The value of Debug Register 7 (DR7).
+
+**/
+UINTN
+EFIAPI
+AsmReadDr7 (
+ VOID
+ )
+{
+ UINTN Data;
+
+ __asm__ __volatile__ (
+ "mov %%dr7, %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes a value to Debug Register 0 (DR0).
+
+ Writes and returns a new value to DR0. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr0 The value to write to Dr0.
+
+ @return The value written to Debug Register 0 (DR0).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr0 (
+ UINTN Dr0
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr0"
+ :
+ : "r" (Dr0)
+ );
+ return Dr0;
+}
+
+
+/**
+ Writes a value to Debug Register 1 (DR1).
+
+ Writes and returns a new value to DR1. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr1 The value to write to Dr1.
+
+ @return The value written to Debug Register 1 (DR1).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr1 (
+ UINTN Dr1
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr1"
+ :
+ : "r" (Dr1)
+ );
+ return Dr1;
+}
+
+
+/**
+ Writes a value to Debug Register 2 (DR2).
+
+ Writes and returns a new value to DR2. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr2 The value to write to Dr2.
+
+ @return The value written to Debug Register 2 (DR2).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr2 (
+ UINTN Dr2
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr2"
+ :
+ : "r" (Dr2)
+ );
+ return Dr2;
+}
+
+
+/**
+ Writes a value to Debug Register 3 (DR3).
+
+ Writes and returns a new value to DR3. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr3 The value to write to Dr3.
+
+ @return The value written to Debug Register 3 (DR3).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr3 (
+ UINTN Dr3
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr3"
+ :
+ : "r" (Dr3)
+ );
+ return Dr3;
+}
+
+
+/**
+ Writes a value to Debug Register 4 (DR4).
+
+ Writes and returns a new value to DR4. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr4 The value to write to Dr4.
+
+ @return The value written to Debug Register 4 (DR4).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr4 (
+ UINTN Dr4
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr4"
+ :
+ : "r" (Dr4)
+ );
+ return Dr4;
+}
+
+
+/**
+ Writes a value to Debug Register 5 (DR5).
+
+ Writes and returns a new value to DR5. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr5 The value to write to Dr5.
+
+ @return The value written to Debug Register 5 (DR5).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr5 (
+ UINTN Dr5
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr5"
+ :
+ : "r" (Dr5)
+ );
+ return Dr5;
+}
+
+
+/**
+ Writes a value to Debug Register 6 (DR6).
+
+ Writes and returns a new value to DR6. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr6 The value to write to Dr6.
+
+ @return The value written to Debug Register 6 (DR6).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr6 (
+ UINTN Dr6
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr6"
+ :
+ : "r" (Dr6)
+ );
+ return Dr6;
+}
+
+
+/**
+ Writes a value to Debug Register 7 (DR7).
+
+ Writes and returns a new value to DR7. This function is only available on
+ IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
+
+ @param Dr7 The value to write to Dr7.
+
+ @return The value written to Debug Register 7 (DR7).
+
+**/
+UINTN
+EFIAPI
+AsmWriteDr7 (
+ UINTN Dr7
+ )
+{
+ __asm__ __volatile__ (
+ "mov %0, %%dr7"
+ :
+ : "r" (Dr7)
+ );
+ return Dr7;
+}
+
+
+/**
+ Reads the current value of Code Segment Register (CS).
+
+ Reads and returns the current value of CS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of CS.
+
+**/
+UINT16
+EFIAPI
+AsmReadCs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%cs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Data Segment Register (DS).
+
+ Reads and returns the current value of DS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of DS.
+
+**/
+UINT16
+EFIAPI
+AsmReadDs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%ds, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Extra Segment Register (ES).
+
+ Reads and returns the current value of ES. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of ES.
+
+**/
+UINT16
+EFIAPI
+AsmReadEs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%es, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of FS Data Segment Register (FS).
+
+ Reads and returns the current value of FS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of FS.
+
+**/
+UINT16
+EFIAPI
+AsmReadFs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%fs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of GS Data Segment Register (GS).
+
+ Reads and returns the current value of GS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of GS.
+
+**/
+UINT16
+EFIAPI
+AsmReadGs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%gs, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Stack Segment Register (SS).
+
+ Reads and returns the current value of SS. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of SS.
+
+**/
+UINT16
+EFIAPI
+AsmReadSs (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "mov %%ds, %0"
+ :"=a" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of Task Register (TR).
+
+ Reads and returns the current value of TR. This function is only available on
+ IA-32 and X64.
+
+ @return The current value of TR.
+
+**/
+UINT16
+EFIAPI
+AsmReadTr (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "str %0"
+ : "=r" (Data)
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current Global Descriptor Table Register(GDTR) descriptor.
+
+ Reads and returns the current GDTR descriptor and returns it in Gdtr. This
+ function is only available on IA-32 and X64.
+
+ @param Gdtr Pointer to a GDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86ReadGdtr (
+ OUT IA32_DESCRIPTOR *Gdtr
+ )
+{
+ __asm__ __volatile__ (
+ "sgdt %0"
+ : "=m" (*Gdtr)
+ );
+}
+
+
+/**
+ Writes the current Global Descriptor Table Register (GDTR) descriptor.
+
+ Writes and the current GDTR descriptor specified by Gdtr. This function is
+ only available on IA-32 and X64.
+
+ @param Gdtr Pointer to a GDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86WriteGdtr (
+ IN CONST IA32_DESCRIPTOR *Gdtr
+ )
+{
+ __asm__ __volatile__ (
+ "lgdt %0"
+ :
+ : "m" (*Gdtr)
+ );
+
+}
+
+
+/**
+ Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
+
+ Reads and returns the current IDTR descriptor and returns it in Idtr. This
+ function is only available on IA-32 and X64.
+
+ @param Idtr Pointer to a IDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86ReadIdtr (
+ OUT IA32_DESCRIPTOR *Idtr
+ )
+{
+ __asm__ __volatile__ (
+ "sldt %0"
+ : "=m" (*Idtr)
+ );
+}
+
+
+/**
+ Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
+
+ Writes the current IDTR descriptor and returns it in Idtr. This function is
+ only available on IA-32 and X64.
+
+ @param Idtr Pointer to a IDTR descriptor.
+
+**/
+VOID
+EFIAPI
+InternalX86WriteIdtr (
+ IN CONST IA32_DESCRIPTOR *Idtr
+ )
+{
+ __asm__ __volatile__ (
+ "lidt %0"
+ :
+ : "m" (*Idtr)
+ );
+}
+
+
+/**
+ Reads the current Local Descriptor Table Register(LDTR) selector.
+
+ Reads and returns the current 16-bit LDTR descriptor value. This function is
+ only available on IA-32 and X64.
+
+ @return The current selector of LDT.
+
+**/
+UINT16
+EFIAPI
+AsmReadLdtr (
+ VOID
+ )
+{
+ UINT16 Data;
+
+ __asm__ __volatile__ (
+ "sldt %0"
+ : "=g" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes the current Local Descriptor Table Register (GDTR) selector.
+
+ Writes and the current LDTR descriptor specified by Ldtr. This function is
+ only available on IA-32 and X64.
+
+ @param Ldtr 16-bit LDTR selector value.
+
+**/
+VOID
+EFIAPI
+AsmWriteLdtr (
+ IN UINT16 Ldtr
+ )
+{
+ __asm__ __volatile__ (
+ "lldtw %0"
+ :
+ : "g" (Ldtr) // %0
+ );
+}
+
+
+/**
+ Save the current floating point/SSE/SSE2 context to a buffer.
+
+ Saves the current floating point/SSE/SSE2 state to the buffer specified by
+ Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
+ available on IA-32 and X64.
+
+ @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
+
+**/
+VOID
+EFIAPI
+InternalX86FxSave (
+ OUT IA32_FX_BUFFER *Buffer
+ )
+{
+ __asm__ __volatile__ (
+ "fxsave %0"
+ :
+ : "m" (*Buffer) // %0
+ );
+}
+
+
+/**
+ Restores the current floating point/SSE/SSE2 context from a buffer.
+
+ Restores the current floating point/SSE/SSE2 state from the buffer specified
+ by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
+ only available on IA-32 and X64.
+
+ @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
+
+**/
+VOID
+EFIAPI
+InternalX86FxRestore (
+ IN CONST IA32_FX_BUFFER *Buffer
+ )
+{
+ __asm__ __volatile__ (
+ "fxrstor %0"
+ :
+ : "m" (*Buffer) // %0
+ );
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #0 (MM0).
+
+ Reads and returns the current value of MM0. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM0.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm0 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm0, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #1 (MM1).
+
+ Reads and returns the current value of MM1. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM1.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm1 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm1, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #2 (MM2).
+
+ Reads and returns the current value of MM2. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM2.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm2 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm2, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #3 (MM3).
+
+ Reads and returns the current value of MM3. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM3.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm3 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm3, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #4 (MM4).
+
+ Reads and returns the current value of MM4. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM4.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm4 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm4, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #5 (MM5).
+
+ Reads and returns the current value of MM5. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM5.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm5 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm5, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #6 (MM6).
+
+ Reads and returns the current value of MM6. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM6.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm6 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm6, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Reads the current value of 64-bit MMX Register #7 (MM7).
+
+ Reads and returns the current value of MM7. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of MM7.
+
+**/
+UINT64
+EFIAPI
+AsmReadMm7 (
+ VOID
+ )
+{
+ UINT64 Data;
+
+ __asm__ __volatile__ (
+ "movd %%mm7, %0 \n\t"
+ : "=r" (Data) // %0
+ );
+
+ return Data;
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #0 (MM0).
+
+ Writes the current value of MM0. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM0.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm0 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm0" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #1 (MM1).
+
+ Writes the current value of MM1. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM1.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm1 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm1" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #2 (MM2).
+
+ Writes the current value of MM2. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM2.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm2 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm2" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #3 (MM3).
+
+ Writes the current value of MM3. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM3.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm3 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm3" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #4 (MM4).
+
+ Writes the current value of MM4. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM4.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm4 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm4" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #5 (MM5).
+
+ Writes the current value of MM5. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM5.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm5 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm5" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #6 (MM6).
+
+ Writes the current value of MM6. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM6.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm6 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm6" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Writes the current value of 64-bit MMX Register #7 (MM7).
+
+ Writes the current value of MM7. This function is only available on IA32 and
+ X64.
+
+ @param Value The 64-bit value to write to MM7.
+
+**/
+VOID
+EFIAPI
+AsmWriteMm7 (
+ IN UINT64 Value
+ )
+{
+ __asm__ __volatile__ (
+ "movd %0, %%mm7" // %0
+ :
+ : "m" (Value)
+ );
+}
+
+
+/**
+ Reads the current value of Time Stamp Counter (TSC).
+
+ Reads and returns the current value of TSC. This function is only available
+ on IA-32 and X64.
+
+ @return The current value of TSC
+
+**/
+UINT64
+EFIAPI
+AsmReadTsc (
+ VOID
+ )
+{
+ UINT32 LowData;
+ UINT32 HiData;
+
+ __asm__ __volatile__ (
+ "rdtsc"
+ : "=a" (LowData),
+ "=d" (HiData)
+ );
+
+ return (((UINT64)HiData) << 32) | LowData;
+}
+
+
+/**
+ Reads the current value of a Performance Counter (PMC).
+
+ Reads and returns the current value of performance counter specified by
+ Index. This function is only available on IA-32 and X64.
+
+ @param Index The 32-bit Performance Counter index to read.
+
+ @return The value of the PMC specified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmc (
+ IN UINT32 Index
+ )
+{
+ UINT32 LowData;
+ UINT32 HiData;
+
+ __asm__ __volatile__ (
+ "rdpmc"
+ : "=a" (LowData),
+ "=d" (HiData)
+ : "c" (Index)
+ );
+
+ return (((UINT64)HiData) << 32) | LowData;
+}
+
+
+/**
+ Sets up a monitor buffer that is used by AsmMwait().
+
+ Executes a MONITOR instruction with the register state specified by Eax, Ecx
+ and Edx. Returns Eax. This function is only available on IA-32 and X64.
+
+ @param Eax The value to load into EAX or RAX before executing the MONITOR
+ instruction.
+ @param Ecx The value to load into ECX or RCX before executing the MONITOR
+ instruction.
+ @param Edx The value to load into EDX or RDX before executing the MONITOR
+ instruction.
+
+ @return Eax
+
+**/
+UINTN
+EFIAPI
+AsmMonitor (
+ IN UINTN Eax,
+ IN UINTN Ecx,
+ IN UINTN Edx
+ )
+{
+ __asm__ __volatile__ (
+ "monitor"
+ :
+ : "a" (Eax),
+ "c" (Ecx),
+ "d" (Edx)
+ );
+
+ return Eax;
+}
+
+
+/**
+ Executes an MWAIT instruction.
+
+ Executes an MWAIT instruction with the register state specified by Eax and
+ Ecx. Returns Eax. This function is only available on IA-32 and X64.
+
+ @param Eax The value to load into EAX or RAX before executing the MONITOR
+ instruction.
+ @param Ecx The value to load into ECX or RCX before executing the MONITOR
+ instruction.
+
+ @return Eax
+
+**/
+UINTN
+EFIAPI
+AsmMwait (
+ IN UINTN Eax,
+ IN UINTN Ecx
+ )
+{
+ __asm__ __volatile__ (
+ "mwait"
+ :
+ : "a" (Eax),
+ "c" (Ecx)
+ );
+
+ return Eax;
+}
+
+
+/**
+ Executes a WBINVD instruction.
+
+ Executes a WBINVD instruction. This function is only available on IA-32 and
+ X64.
+
+**/
+VOID
+EFIAPI
+AsmWbinvd (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("wbinvd":::"memory");
+}
+
+
+/**
+ Executes a INVD instruction.
+
+ Executes a INVD instruction. This function is only available on IA-32 and
+ X64.
+
+**/
+VOID
+EFIAPI
+AsmInvd (
+ VOID
+ )
+{
+ __asm__ __volatile__ ("invd":::"memory");
+
+}
+
+
+/**
+ Flushes a cache line from all the instruction and data caches within the
+ coherency domain of the CPU.
+
+ Flushed the cache line specified by LinearAddress, and returns LinearAddress.
+ This function is only available on IA-32 and X64.
+
+ @param LinearAddress The address of the cache line to flush. If the CPU is
+ in a physical addressing mode, then LinearAddress is a
+ physical address. If the CPU is in a virtual
+ addressing mode, then LinearAddress is a virtual
+ address.
+
+ @return LinearAddress
+**/
+VOID *
+EFIAPI
+AsmFlushCacheLine (
+ IN VOID *LinearAddress
+ )
+{
+ __asm__ __volatile__ (
+ "clflush (%0)"
+ :
+ : "r" (LinearAddress)
+ : "memory"
+ );
+
+ return LinearAddress;
+}
+
+
diff --git a/MdePkg/Library/BaseLib/X64/Invd.S b/MdePkg/Library/BaseLib/X64/Invd.S
deleted file mode 100644
index e6794b2aeb..0000000000
--- a/MdePkg/Library/BaseLib/X64/Invd.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Invd.S
-#
-# Abstract:
-#
-# AsmInvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmInvd (
-# VOID
-# )#
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmInvd)
-ASM_PFX(AsmInvd):
- invd
- ret
diff --git a/MdePkg/Library/BaseLib/X64/Monitor.S b/MdePkg/Library/BaseLib/X64/Monitor.S
deleted file mode 100644
index c6acb338ef..0000000000
--- a/MdePkg/Library/BaseLib/X64/Monitor.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Monitor.S
-#
-# Abstract:
-#
-# AsmMonitor function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMonitor (
-# IN UINTN Eax,
-# IN UINTN Ecx,
-# IN UINTN Edx
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmMonitor)
-ASM_PFX(AsmMonitor):
- mov %ecx,%eax
- mov %edx,%ecx
- mov %r8d,%edx
- monitor
- ret
diff --git a/MdePkg/Library/BaseLib/X64/Mwait.S b/MdePkg/Library/BaseLib/X64/Mwait.S
deleted file mode 100644
index d3429e0025..0000000000
--- a/MdePkg/Library/BaseLib/X64/Mwait.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Mwait.S
-#
-# Abstract:
-#
-# AsmMwait function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMwait (
-# IN UINTN Eax,
-# IN UINTN Ecx
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmMwait)
-ASM_PFX(AsmMwait):
- mov %ecx,%eax
- mov %edx,%ecx
- mwait
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr0.S b/MdePkg/Library/BaseLib/X64/ReadCr0.S
deleted file mode 100644
index e35495ca3d..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadCr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr0.S
-#
-# Abstract:
-#
-# AsmReadCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadCr0)
-ASM_PFX(AsmReadCr0):
- mov %cr0, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr2.S b/MdePkg/Library/BaseLib/X64/ReadCr2.S
deleted file mode 100644
index c8ccc9c803..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadCr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr2.S
-#
-# Abstract:
-#
-# AsmReadCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadCr2)
-ASM_PFX(AsmReadCr2):
- mov %cr2, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr3.S b/MdePkg/Library/BaseLib/X64/ReadCr3.S
deleted file mode 100644
index ce05e425e9..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadCr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr3.S
-#
-# Abstract:
-#
-# AsmReadCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadCr3)
-ASM_PFX(AsmReadCr3):
- mov %cr3, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr4.S b/MdePkg/Library/BaseLib/X64/ReadCr4.S
deleted file mode 100644
index c79042ab5e..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadCr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCr4.S
-#
-# Abstract:
-#
-# AsmReadCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadCr4)
-ASM_PFX(AsmReadCr4):
- mov %cr4, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCs.S b/MdePkg/Library/BaseLib/X64/ReadCs.S
deleted file mode 100644
index 7c0a631d6c..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadCs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadCs.S
-#
-# Abstract:
-#
-# AsmReadCs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadCs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadCs)
-ASM_PFX(AsmReadCs):
- mov %cs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr0.S b/MdePkg/Library/BaseLib/X64/ReadDr0.S
deleted file mode 100644
index 035cb67d7e..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr0.S
-#
-# Abstract:
-#
-# AsmReadDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr0)
-ASM_PFX(AsmReadDr0):
- mov %dr0, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr1.S b/MdePkg/Library/BaseLib/X64/ReadDr1.S
deleted file mode 100644
index 9ed503a3b7..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr1.S
-#
-# Abstract:
-#
-# AsmReadDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr1)
-ASM_PFX(AsmReadDr1):
- mov %dr1, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr2.S b/MdePkg/Library/BaseLib/X64/ReadDr2.S
deleted file mode 100644
index 875463c6c6..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr2.S
-#
-# Abstract:
-#
-# AsmReadDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr2)
-ASM_PFX(AsmReadDr2):
- mov %dr2, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr3.S b/MdePkg/Library/BaseLib/X64/ReadDr3.S
deleted file mode 100644
index 73a05f3175..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr3.S
-#
-# Abstract:
-#
-# AsmReadDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr3)
-ASM_PFX(AsmReadDr3):
- mov %dr3, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr4.S b/MdePkg/Library/BaseLib/X64/ReadDr4.S
deleted file mode 100644
index 202d83b628..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr4.S
-#
-# Abstract:
-#
-# AsmReadDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr4)
-ASM_PFX(AsmReadDr4):
- #DB 0fh, 21h, 0e0h
- mov %dr4, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr5.S b/MdePkg/Library/BaseLib/X64/ReadDr5.S
deleted file mode 100644
index 7f89c0073f..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr5.S
-#
-# Abstract:
-#
-# AsmReadDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr5)
-ASM_PFX(AsmReadDr5):
- mov %dr5, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr6.S b/MdePkg/Library/BaseLib/X64/ReadDr6.S
deleted file mode 100644
index d92a531a38..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr6.S
-#
-# Abstract:
-#
-# AsmReadDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr6)
-ASM_PFX(AsmReadDr6):
- mov %dr6, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr7.S b/MdePkg/Library/BaseLib/X64/ReadDr7.S
deleted file mode 100644
index 878b0b194f..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDr7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDr7.S
-#
-# Abstract:
-#
-# AsmReadDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDr7)
-ASM_PFX(AsmReadDr7):
- mov %dr7, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDs.S b/MdePkg/Library/BaseLib/X64/ReadDs.S
deleted file mode 100644
index 39ccebfec5..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadDs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadDs.S
-#
-# Abstract:
-#
-# AsmReadDs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadDs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadDs)
-ASM_PFX(AsmReadDs):
- movl %ds, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadEflags.S b/MdePkg/Library/BaseLib/X64/ReadEflags.S
deleted file mode 100644
index 7aa943a145..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadEflags.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadEflags.S
-#
-# Abstract:
-#
-# AsmReadEflags function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadEflags)
-ASM_PFX(AsmReadEflags):
- pushfq
- pop %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadEs.S b/MdePkg/Library/BaseLib/X64/ReadEs.S
deleted file mode 100644
index e9491ae061..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadEs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadEs.S
-#
-# Abstract:
-#
-# AsmReadEs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadEs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadEs)
-ASM_PFX(AsmReadEs):
- mov %es, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadFs.S b/MdePkg/Library/BaseLib/X64/ReadFs.S
deleted file mode 100644
index a6a89f78ea..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadFs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadFs.S
-#
-# Abstract:
-#
-# AsmReadFs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadFs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadFs)
-ASM_PFX(AsmReadFs):
- mov %fs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadGdtr.S b/MdePkg/Library/BaseLib/X64/ReadGdtr.S
deleted file mode 100644
index 0c7f261c01..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadGdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadGdtr.S
-#
-# Abstract:
-#
-# AsmReadGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86ReadGdtr)
-ASM_PFX(InternalX86ReadGdtr):
- sgdt (%rcx)
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadGs.S b/MdePkg/Library/BaseLib/X64/ReadGs.S
deleted file mode 100644
index a48014513f..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadGs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadGs.S
-#
-# Abstract:
-#
-# AsmReadGs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadGs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadGs)
-ASM_PFX(AsmReadGs):
- mov %gs, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadIdtr.S b/MdePkg/Library/BaseLib/X64/ReadIdtr.S
deleted file mode 100644
index 92aa90c5b7..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadIdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadIdtr.AS
-#
-# Abstract:
-#
-# AsmReadIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86ReadIdtr)
-ASM_PFX(InternalX86ReadIdtr):
- sidt (%rcx)
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadLdtr.S b/MdePkg/Library/BaseLib/X64/ReadLdtr.S
deleted file mode 100644
index 4c7d7af8ba..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadLdtr.AS
-#
-# Abstract:
-#
-# AsmReadLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadLdtr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadLdtr)
-ASM_PFX(AsmReadLdtr):
- sldt %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm0.S b/MdePkg/Library/BaseLib/X64/ReadMm0.S
deleted file mode 100644
index bb52904e8d..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm0.S
-#
-# Abstract:
-#
-# AsmReadMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm0)
-ASM_PFX(AsmReadMm0):
- movd %mm0, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm1.S b/MdePkg/Library/BaseLib/X64/ReadMm1.S
deleted file mode 100644
index 9e96f48711..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm1.S
-#
-# Abstract:
-#
-# AsmReadMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm1)
-ASM_PFX(AsmReadMm1):
- movd %mm1, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm2.S b/MdePkg/Library/BaseLib/X64/ReadMm2.S
deleted file mode 100644
index f4734329e5..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm2.S
-#
-# Abstract:
-#
-# AsmReadMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm2)
-ASM_PFX(AsmReadMm2):
- movd %mm2, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm3.S b/MdePkg/Library/BaseLib/X64/ReadMm3.S
deleted file mode 100644
index be3496281e..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm3.S
-#
-# Abstract:
-#
-# AsmReadMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm3)
-ASM_PFX(AsmReadMm3):
- movd %mm3, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm4.S b/MdePkg/Library/BaseLib/X64/ReadMm4.S
deleted file mode 100644
index cd098b668d..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm4.AS
-#
-# Abstract:
-#
-# AsmReadMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm4)
-ASM_PFX(AsmReadMm4):
- movd %mm4, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm5.S b/MdePkg/Library/BaseLib/X64/ReadMm5.S
deleted file mode 100644
index c55301cc79..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm5.S
-#
-# Abstract:
-#
-# AsmReadMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm5)
-ASM_PFX(AsmReadMm5):
- movd %mm5, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm6.S b/MdePkg/Library/BaseLib/X64/ReadMm6.S
deleted file mode 100644
index 0a5b51bb28..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm6.S
-#
-# Abstract:
-#
-# AsmReadMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm6)
-ASM_PFX(AsmReadMm6):
- movd %mm6, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm7.S b/MdePkg/Library/BaseLib/X64/ReadMm7.S
deleted file mode 100644
index d851d19936..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMm7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMm7.S
-#
-# Abstract:
-#
-# AsmReadMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMm7)
-ASM_PFX(AsmReadMm7):
- movd %mm7, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.S b/MdePkg/Library/BaseLib/X64/ReadMsr64.S
deleted file mode 100644
index f9fe2c0803..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadMsr64.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadMsr64.S
-#
-# Abstract:
-#
-# AsmReadMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMsr64 (
-# IN UINT32 Index
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadMsr64)
-ASM_PFX(AsmReadMsr64):
- rdmsr # edx & eax are zero extended
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadPmc.S b/MdePkg/Library/BaseLib/X64/ReadPmc.S
deleted file mode 100644
index a7f63e4c55..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadPmc.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadPmc.S
-#
-# Abstract:
-#
-# AsmReadPmc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadPmc (
-# IN UINT32 PmcIndex
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadPmc)
-ASM_PFX(AsmReadPmc):
- rdpmc
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadSs.S b/MdePkg/Library/BaseLib/X64/ReadSs.S
deleted file mode 100644
index a04c6fe82e..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadSs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadSs.S
-#
-# Abstract:
-#
-# AsmReadSs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadSs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadSs)
-ASM_PFX(AsmReadSs):
- movl %ss, %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadTr.S b/MdePkg/Library/BaseLib/X64/ReadTr.S
deleted file mode 100644
index d9aed1118a..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadTr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadTr.S
-#
-# Abstract:
-#
-# AsmReadTr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadTr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadTr)
-ASM_PFX(AsmReadTr):
- str %eax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadTsc.S b/MdePkg/Library/BaseLib/X64/ReadTsc.S
deleted file mode 100644
index a520169ab7..0000000000
--- a/MdePkg/Library/BaseLib/X64/ReadTsc.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ReadTsc.S
-#
-# Abstract:
-#
-# AsmReadTsc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadTsc (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmReadTsc)
-ASM_PFX(AsmReadTsc):
- rdtsc
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr0.S b/MdePkg/Library/BaseLib/X64/WriteCr0.S
deleted file mode 100644
index 2fc5503c35..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteCr0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr0.S
-#
-# Abstract:
-#
-# AsmWriteCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr0 (
-# UINTN Cr0
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- mov %rcx,%cr0
- mov %rcx,%rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr2.S b/MdePkg/Library/BaseLib/X64/WriteCr2.S
deleted file mode 100644
index 4b5eddf269..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteCr2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr2.S
-#
-# Abstract:
-#
-# AsmWriteCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr2 (
-# UINTN Cr2
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- mov %rcx,%cr2
- mov %rcx,%rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr3.S b/MdePkg/Library/BaseLib/X64/WriteCr3.S
deleted file mode 100644
index ea8b241844..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteCr3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr3.S
-#
-# Abstract:
-#
-# AsmWriteCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr3 (
-# UINTN Cr3
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- mov %rcx,%cr3
- mov %rcx,%rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr4.S b/MdePkg/Library/BaseLib/X64/WriteCr4.S
deleted file mode 100644
index e468d382b1..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteCr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteCr4.S
-#
-# Abstract:
-#
-# AsmWriteCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr4 (
-# UINTN Cr4
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- mov %rcx,%cr4
- mov %rcx,%rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr0.S b/MdePkg/Library/BaseLib/X64/WriteDr0.S
deleted file mode 100644
index 0fe79147ed..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr0.S
-#
-# Abstract:
-#
-# AsmWriteDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr0 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- mov %rcx, %dr0
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr1.S b/MdePkg/Library/BaseLib/X64/WriteDr1.S
deleted file mode 100644
index be1f68ae4e..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr1.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr1.S
-#
-# Abstract:
-#
-# AsmWriteDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr1 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- mov %rcx, %dr1
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr2.S b/MdePkg/Library/BaseLib/X64/WriteDr2.S
deleted file mode 100644
index e5b03e83e4..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr2.S
-#
-# Abstract:
-#
-# AsmWriteDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr2 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- mov %rcx, %dr2
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr3.S b/MdePkg/Library/BaseLib/X64/WriteDr3.S
deleted file mode 100644
index 61a5d74307..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr3.S
-#
-# Abstract:
-#
-# AsmWriteDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr3 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- mov %rcx, %dr3
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr4.S b/MdePkg/Library/BaseLib/X64/WriteDr4.S
deleted file mode 100644
index ce31a10303..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr4.S
-#
-# Abstract:
-#
-# AsmWriteDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr4 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- mov %rcx, %dr4
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr5.S b/MdePkg/Library/BaseLib/X64/WriteDr5.S
deleted file mode 100644
index 11f2702627..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr5.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr5.S
-#
-# Abstract:
-#
-# AsmWriteDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr5 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- mov %rcx, %dr5
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr6.S b/MdePkg/Library/BaseLib/X64/WriteDr6.S
deleted file mode 100644
index 15333d103e..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr6.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr6.S
-#
-# Abstract:
-#
-# AsmWriteDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr6 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- mov %rcx, %dr6
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr7.S b/MdePkg/Library/BaseLib/X64/WriteDr7.S
deleted file mode 100644
index 11967444a9..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteDr7.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteDr7.S
-#
-# Abstract:
-#
-# AsmWriteDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr7 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- mov %rcx, %dr7
- mov %rcx, %rax
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteGdtr.S b/MdePkg/Library/BaseLib/X64/WriteGdtr.S
deleted file mode 100644
index 69f1a708a6..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteGdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteGdtr.S
-#
-# Abstract:
-#
-# AsmWriteGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteGdtr (
-# IN CONST IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- lgdt (%rcx)
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteIdtr.S b/MdePkg/Library/BaseLib/X64/WriteIdtr.S
deleted file mode 100644
index d18fd624b2..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteIdtr.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteIdtr.S
-#
-# Abstract:
-#
-# AsmWriteIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteIdtr (
-# IN CONST IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- pushfq
- cli
- lidt (%rcx)
- popfq
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteLdtr.S b/MdePkg/Library/BaseLib/X64/WriteLdtr.S
deleted file mode 100644
index b375649e95..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteLdtr.S
-#
-# Abstract:
-#
-# AsmWriteLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteLdtr (
-# IN UINT16 Ldtr
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteLdtr)
-ASM_PFX(AsmWriteLdtr):
- lldt %cx
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm0.S b/MdePkg/Library/BaseLib/X64/WriteMm0.S
deleted file mode 100644
index 166987c1b8..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm0.S
-#
-# Abstract:
-#
-# AsmWriteMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm0 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm0)
-ASM_PFX(AsmWriteMm0):
- movd %rcx, %mm0
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm1.S b/MdePkg/Library/BaseLib/X64/WriteMm1.S
deleted file mode 100644
index e1446e9709..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm1.S
-#
-# Abstract:
-#
-# AsmWriteMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm1 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm1)
-ASM_PFX(AsmWriteMm1):
- movd %rcx, %mm1
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm2.S b/MdePkg/Library/BaseLib/X64/WriteMm2.S
deleted file mode 100644
index a1afba0381..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm2.S
-#
-# Abstract:
-#
-# AsmWriteMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm2 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- movd %rcx, %mm2
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm3.S b/MdePkg/Library/BaseLib/X64/WriteMm3.S
deleted file mode 100644
index 9c803e5e61..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm3.S
-#
-# Abstract:
-#
-# AsmWriteMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm3 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- movd %rcx, %mm3
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm4.S b/MdePkg/Library/BaseLib/X64/WriteMm4.S
deleted file mode 100644
index adb574e438..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm4.S
-#
-# Abstract:
-#
-# AsmWriteMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm4 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- movd %rcx, %mm4
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm5.S b/MdePkg/Library/BaseLib/X64/WriteMm5.S
deleted file mode 100644
index 0eba90a196..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm5.S
-#
-# Abstract:
-#
-# AsmWriteMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm5 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- movd %rcx, %mm5
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm6.S b/MdePkg/Library/BaseLib/X64/WriteMm6.S
deleted file mode 100644
index 20c906b87f..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm6.S
-#
-# Abstract:
-#
-# AsmWriteMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm6 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- movd %rcx, %mm6
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm7.S b/MdePkg/Library/BaseLib/X64/WriteMm7.S
deleted file mode 100644
index 5aa3776b6d..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMm7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMm7.S
-#
-# Abstract:
-#
-# AsmWriteMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm7 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- movd %rcx, %mm7
- ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.S b/MdePkg/Library/BaseLib/X64/WriteMsr64.S
deleted file mode 100644
index 2dc4fb8080..0000000000
--- a/MdePkg/Library/BaseLib/X64/WriteMsr64.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# WriteMsr64.S
-#
-# Abstract:
-#
-# AsmWriteMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmWriteMsr64 (
-# IN UINT32 Index,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmWriteMsr64)
-ASM_PFX(AsmWriteMsr64):
- mov %rdx, %rax # meanwhile, rax <- return value
- shr $0x20, %rdx # edx:eax contains the value to write
- wrmsr
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
index 461be0ddab..b036f7c32a 100644
--- a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
+++ b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
@@ -41,10 +41,7 @@
Ia32/InterlockedIncrement.asm | INTEL
Synchronization.c | INTEL
- Ia32/InterlockedCompareExchange64.S | GCC
- Ia32/InterlockedCompareExchange32.S | GCC
- Ia32/InterlockedDecrement.S | GCC
- Ia32/InterlockedIncrement.S | GCC
+ Ia32/GccInline.c | GCC
SynchronizationGcc.c | GCC
[Sources.X64]
@@ -62,11 +59,7 @@
X64/InterlockedIncrement.asm | INTEL
Synchronization.c | INTEL
-
- X64/InterlockedIncrement.S | GCC
- X64/InterlockedDecrement.S | GCC
- X64/InterlockedCompareExchange64.S | GCC
- X64/InterlockedCompareExchange32.S | GCC
+ X64/GccInline.c | GCC
SynchronizationGcc.c | GCC
[Sources.IPF]
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
new file mode 100644
index 0000000000..9b939c9709
--- /dev/null
+++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
@@ -0,0 +1,193 @@
+/** @file
+ GCC inline implementation of BaseSynchronizationLib processor specific functions.
+
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+
+/**
+ Performs an atomic increment of an 32-bit unsigned integer.
+
+ Performs an atomic increment of the 32-bit unsigned integer specified by
+ Value and returns the incremented value. The increment operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to increment.
+
+ @return The incremented value.
+
+**/
+UINT32
+EFIAPI
+InternalSyncIncrement (
+ IN volatile UINT32 *Value
+ )
+{
+ UINT32 Result;
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "incl %2 \n\t"
+ "movl %2, %%eax "
+ : "=a" (Result), // %0
+ "=m" (*Value) // %1
+ : "m" (*Value) // %2
+ : "memory",
+ "cc"
+ );
+
+ return Result;
+
+}
+
+
+/**
+ Performs an atomic decrement of an 32-bit unsigned integer.
+
+ Performs an atomic decrement of the 32-bit unsigned integer specified by
+ Value and returns the decremented value. The decrement operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to decrement.
+
+ @return The decremented value.
+
+**/
+UINT32
+EFIAPI
+InternalSyncDecrement (
+ IN volatile UINT32 *Value
+ )
+{
+ UINT32 Result;
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "decl %2 \n\t"
+ "movl %2, %%eax "
+ : "=a" (Result), // %0
+ "=m" (*Value) // %1
+ : "m" (*Value) // %2
+ : "memory",
+ "cc"
+ );
+
+ return Result;
+}
+
+/**
+ Performs an atomic compare exchange operation on a 32-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 32-bit unsigned integer
+ specified by Value. If Value is equal to CompareValue, then Value is set to
+ ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
+ then Value is returned. The compare exchange operation must be performed using
+ MP safe mechanisms.
+
+
+ @param Value A pointer to the 32-bit value for the compare exchange
+ operation.
+ @param CompareValue 32-bit value used in compare operation.
+ @param ExchangeValue 32-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
+UINT32
+EFIAPI
+InternalSyncCompareExchange32 (
+ IN OUT volatile UINT32 *Value,
+ IN UINT32 CompareValue,
+ IN UINT32 ExchangeValue
+ )
+{
+
+// GCC 4.1 and forward supports atomic builtins
+#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
+
+ return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
+
+#else
+
+ __asm__ __volatile__ (
+ " \n\t"
+ "lock \n\t"
+ "cmpxchgl %1, %2 \n\t"
+ : "=a" (CompareValue) // %0
+ : "q" (ExchangeValue), // %1
+ "m" (*Value), // %2
+ "0" (CompareValue) // %4
+ : "memory",
+ "cc"
+ );
+
+ return CompareValue;
+
+#endif
+}
+
+/**
+ Performs an atomic compare exchange operation on a 64-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
+ by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
+ CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
+ The compare exchange operation must be performed using MP safe mechanisms.
+
+
+ @param Value A pointer to the 64-bit value for the compare exchange
+ operation.
+ @param CompareValue 64-bit value used in compare operation.
+ @param ExchangeValue 64-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
+UINT64
+EFIAPI
+InternalSyncCompareExchange64 (
+ IN OUT volatile UINT64 *Value,
+ IN UINT64 CompareValue,
+ IN UINT64 ExchangeValue
+ )
+{
+// GCC 4.1 and forward supports atomic builtins
+#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
+
+ return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
+
+#else
+
+ __asm__ __volatile__ (
+ " \n\t"
+ "push %%ebx \n\t"
+ "movl %2,%%ebx \n\t"
+ "lock \n\t"
+ "cmpxchg8b (%1) \n\t"
+ "pop %%ebx \n\t"
+ : "+A" (CompareValue) // %0
+ : "S" (Value), // %1
+ "r" ((UINT32) ExchangeValue), // %2
+ "c" ((UINT32) (ExchangeValue >> 32)) // %3
+ : "memory",
+ "cc"
+ );
+
+ return CompareValue;
+
+#endif
+}
+
+
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.S b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.S
deleted file mode 100644
index 7bb8bb5b6c..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedCompareExchange32.S
-#
-# Abstract:
-#
-# InternalSyncCompareExchange32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalSyncCompareExchange32)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncCompareExchange32 (
-# IN UINT32 *Value,
-# IN UINT32 CompareValue,
-# IN UINT32 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncCompareExchange32):
- movl 4(%esp), %ecx
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- lock
- cmpxchgl %edx, (%ecx)
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.S b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.S
deleted file mode 100644
index ec77892017..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedCompareExchange64.S
-#
-# Abstract:
-#
-# InternalSyncCompareExchange64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalSyncCompareExchange64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalSyncCompareExchange64 (
-# IN UINT64 *Value,
-# IN UINT64 CompareValue,
-# IN UINT64 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncCompareExchange64):
- push %esi
- push %ebx
- movl 12(%esp), %esi
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 24(%esp), %ebx
- movl 28(%esp), %ecx
- lock
- cmpxchg8b (%esi)
- pop %ebx
- pop %esi
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.S b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.S
deleted file mode 100644
index e77af9538e..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedDecrement.S
-#
-# Abstract:
-#
-# InternalSyncDecrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalSyncDecrement)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncDecrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncDecrement):
- movl 4(%esp), %eax
- lock
- decl (%eax)
- movl (%eax), %eax
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.S b/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.S
deleted file mode 100644
index 207341de19..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedIncrement.S
-#
-# Abstract:
-#
-# InternalSyncIncrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalSyncIncrement)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncIncrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncIncrement):
- movl 4(%esp), %eax
- lock
- incl (%eax)
- movl (%eax), %eax
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
new file mode 100644
index 0000000000..f2f72f80a4
--- /dev/null
+++ b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
@@ -0,0 +1,192 @@
+/** @file
+ GCC inline implementation of BaseSynchronizationLib processor specific functions.
+
+ Copyright (c) 2006 - 2009, Intel Corporation<BR>
+ Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+
+
+/**
+ Performs an atomic increment of an 32-bit unsigned integer.
+
+ Performs an atomic increment of the 32-bit unsigned integer specified by
+ Value and returns the incremented value. The increment operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to increment.
+
+ @return The incremented value.
+
+**/
+UINT32
+EFIAPI
+InternalSyncIncrement (
+ IN volatile UINT32 *Value
+ )
+{
+ UINT32 Result;
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "incl %2 \n\t"
+ "mov %2, %%eax "
+ : "=a" (Result), // %0
+ "=m" (*Value) // %1
+ : "m" (*Value) // %2
+ : "memory",
+ "cc"
+ );
+
+ return Result;
+
+}
+
+
+/**
+ Performs an atomic decrement of an 32-bit unsigned integer.
+
+ Performs an atomic decrement of the 32-bit unsigned integer specified by
+ Value and returns the decremented value. The decrement operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to decrement.
+
+ @return The decremented value.
+
+**/
+UINT32
+EFIAPI
+InternalSyncDecrement (
+ IN volatile UINT32 *Value
+ )
+{
+ UINT32 Result;
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "decl %2 \n\t"
+ "mov %2, %%eax "
+ : "=a" (Result), // %0
+ "=m" (*Value) // %1
+ : "m" (*Value) // %2
+ : "memory",
+ "cc"
+ );
+
+ return Result;
+}
+
+
+/**
+ Performs an atomic compare exchange operation on a 32-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 32-bit unsigned integer
+ specified by Value. If Value is equal to CompareValue, then Value is set to
+ ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
+ then Value is returned. The compare exchange operation must be performed using
+ MP safe mechanisms.
+
+
+ @param Value A pointer to the 32-bit value for the compare exchange
+ operation.
+ @param CompareValue 32-bit value used in compare operation.
+ @param ExchangeValue 32-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
+UINT32
+EFIAPI
+InternalSyncCompareExchange32 (
+ IN OUT volatile UINT32 *Value,
+ IN UINT32 CompareValue,
+ IN UINT32 ExchangeValue
+ )
+{
+// GCC 4.1 and forward supports atomic builtins
+#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
+
+ return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
+
+#else
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "cmpxchgl %3, %1 "
+ : "=a" (CompareValue), // %0
+ "=m" (*Value) // %1
+ : "a" (CompareValue), // %2
+ "r" (ExchangeValue), // %3
+ "m" (*Value)
+ : "memory",
+ "cc"
+ );
+
+ return CompareValue;
+
+#endif
+}
+
+
+/**
+ Performs an atomic compare exchange operation on a 64-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
+ by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
+ CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
+ The compare exchange operation must be performed using MP safe mechanisms.
+
+
+ @param Value A pointer to the 64-bit value for the compare exchange
+ operation.
+ @param CompareValue 64-bit value used in compare operation.
+ @param ExchangeValue 64-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
+UINT64
+EFIAPI
+InternalSyncCompareExchange64 (
+ IN OUT volatile UINT64 *Value,
+ IN UINT64 CompareValue,
+ IN UINT64 ExchangeValue
+ )
+{
+// GCC 4.1 and forward supports atomic builtins
+#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
+
+ return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
+
+#else
+
+ __asm__ __volatile__ (
+ "lock \n\t"
+ "cmpxchgq %3, %1 "
+ : "=a" (CompareValue), // %0
+ "=m" (*Value) // %1
+ : "a" (CompareValue), // %2
+ "r" (ExchangeValue), // %3
+ "m" (*Value)
+ : "memory",
+ "cc"
+ );
+
+ return CompareValue;
+
+#endif
+}
+
+
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.S b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.S
deleted file mode 100644
index 980c473219..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedCompareExchange32.S
-#
-# Abstract:
-#
-# InterlockedCompareExchange32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedCompareExchange32 (
-# IN UINT32 *Value,
-# IN UINT32 CompareValue,
-# IN UINT32 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalSyncCompareExchange32)
-ASM_PFX(InternalSyncCompareExchange32):
- mov %edx, %eax
- lock/cmpxchg %r8d, (%rcx)
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.S b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.S
deleted file mode 100644
index 00362f2552..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedCompareExchange64.S
-#
-# Abstract:
-#
-# InterlockedCompareExchange64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InterlockedCompareExchange64 (
-# IN UINT64 *Value,
-# IN UINT64 CompareValue,
-# IN UINT64 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalSyncCompareExchange64)
-ASM_PFX(InternalSyncCompareExchange64):
- mov %rdx, %rax
- lock/cmpxchg %r8,(%rcx)
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.S b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.S
deleted file mode 100644
index 72ba5a7f44..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedDecrement.S
-#
-# Abstract:
-#
-# InterlockedDecrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedDecrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalSyncDecrement)
-ASM_PFX(InternalSyncDecrement):
- lock/decl (%rcx)
- mov (%rcx), %eax
- ret
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.S b/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.S
deleted file mode 100644
index ceb92a2c77..0000000000
--- a/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InterlockedIncrement.S
-#
-# Abstract:
-#
-# InterlockedIncrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedIncrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalSyncIncrement)
-ASM_PFX(InternalSyncIncrement):
- lock/incl (%rcx)
- mov (%rcx), %eax
- ret