summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/Ia32
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/Ia32')
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ARShiftU64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuId.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuIdEx.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuPause.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/CpuSleep.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DisablePaging32.c5
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DivU64x32.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/EnablePaging32.c5
-rw-r--r--MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FxRestore.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/FxSave.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Invd.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/LRotU64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/LShiftU64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/LongJump.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ModU64x32.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Monitor.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/MultU64x32.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/MultU64x64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Mwait.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Non-existing.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/RRotU64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/RShiftU64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCr4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadCs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr1.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr5.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr6.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDr7.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadDs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadEflags.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadEs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadFs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadGdtr.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadGs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadIdtr.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadLdtr.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm1.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm5.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm6.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMm7.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadMsr64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadPmc.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadSs.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadTr.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/ReadTsc.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/SetJump.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/SwapBytes64.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Thunk16.asm2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Wbinvd.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteCr4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr1.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr5.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr6.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteDr7.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteGdtr.c3
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteIdtr.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteLdtr.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm0.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm1.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm2.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm3.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm4.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm5.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm6.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMm7.c2
-rw-r--r--MdePkg/Library/BaseLib/Ia32/WriteMsr64.c2
99 files changed, 113 insertions, 99 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
index 4e1f715ab2..fb5f4282bb 100644
--- a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
+++ b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
index 71bb896c82..35d0fc9c23 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c
index 2660deb096..e785095d7a 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuId.c b/MdePkg/Library/BaseLib/Ia32/CpuId.c
index d1893aebbe..73f12bcaee 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuId.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuId.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
index 99e2edb428..2c1eca670e 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.c b/MdePkg/Library/BaseLib/Ia32/CpuPause.c
index 7750ee417e..ee7c96736b 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuPause.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuPause.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.c b/MdePkg/Library/BaseLib/Ia32/CpuSleep.c
index 59753747ee..690f9b3598 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuSleep.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuSleep.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
index f1ef0f1706..60c1169a57 100644
--- a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
+++ b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
index d3c77183eb..d462c01ff3 100644
--- a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
+++ b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
@@ -15,7 +15,9 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
+#if _MSC_EXTENSIONS
__declspec (naked)
VOID
@@ -49,3 +51,4 @@ InternalX86DisablePaging32 (
}
}
+#endif
diff --git a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
index da3afbf95c..5c5f270c4c 100644
--- a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
+++ b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
@@ -17,7 +17,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
#include "../BaseLibInternals.h"
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32.c b/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
index d680c29c41..0ec3c6319b 100644
--- a/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
+++ b/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
index a9c54a7e19..54da1e9ab0 100644
--- a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
+++ b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c
index 29413b25b2..46ef12b204 100644
--- a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c
+++ b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c
@@ -16,7 +16,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
index 7194ca2536..39118728f0 100644
--- a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
+++ b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
index ada4100cf6..cb4ee2e3ad 100644
--- a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
+++ b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
index e4765a7f28..3cb290c516 100644
--- a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
+++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
@@ -15,7 +15,9 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
+#if _MSC_EXTENSIONS
__declspec (naked)
VOID
@@ -49,3 +51,4 @@ InternalX86EnablePaging32 (
}
}
+#endif
diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm
index d54c27e719..3755c0585b 100644
--- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm
+++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm
@@ -1,7 +1,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
;------------------------------------------------------------------------------
;
diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
index 5071a39bb2..1c7cc0f33f 100644
--- a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
+++ b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID *
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.c b/MdePkg/Library/BaseLib/Ia32/FxRestore.c
index e95fb67b43..1314da4194 100644
--- a/MdePkg/Library/BaseLib/Ia32/FxRestore.c
+++ b/MdePkg/Library/BaseLib/Ia32/FxRestore.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.c b/MdePkg/Library/BaseLib/Ia32/FxSave.c
index 721de5368b..44aaee0090 100644
--- a/MdePkg/Library/BaseLib/Ia32/FxSave.c
+++ b/MdePkg/Library/BaseLib/Ia32/FxSave.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
index d584a900d3..ec60f97344 100644
--- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
+++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
index a0d0ba89e1..6bdbedad1f 100644
--- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
+++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c
index afa9a15f60..c7ace7ad54 100644
--- a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c
+++ b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c
index 82fa86f0cd..f34f4748eb 100644
--- a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c
+++ b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c b/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
index 2fb0710cc6..2bd46a0ffb 100644
--- a/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
+++ b/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
@@ -17,7 +17,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
/**
Transfers control to a function starting with a new stack.
diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.c b/MdePkg/Library/BaseLib/Ia32/Invd.c
index 47f651342d..0206e6d44b 100644
--- a/MdePkg/Library/BaseLib/Ia32/Invd.c
+++ b/MdePkg/Library/BaseLib/Ia32/Invd.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.c b/MdePkg/Library/BaseLib/Ia32/LRotU64.c
index 48a6a6bb68..9a5deea70d 100644
--- a/MdePkg/Library/BaseLib/Ia32/LRotU64.c
+++ b/MdePkg/Library/BaseLib/Ia32/LRotU64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/LShiftU64.c b/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
index 766b33b097..4324bfb53b 100644
--- a/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
+++ b/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.c b/MdePkg/Library/BaseLib/Ia32/LongJump.c
index 3186da522f..f0408b83fa 100644
--- a/MdePkg/Library/BaseLib/Ia32/LongJump.c
+++ b/MdePkg/Library/BaseLib/Ia32/LongJump.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
__declspec (naked)
VOID
diff --git a/MdePkg/Library/BaseLib/Ia32/ModU64x32.c b/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
index 4337f8cbbb..59ed50433a 100644
--- a/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
+++ b/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT32
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.c b/MdePkg/Library/BaseLib/Ia32/Monitor.c
index a1b3f7b2df..469aa6d7fa 100644
--- a/MdePkg/Library/BaseLib/Ia32/Monitor.c
+++ b/MdePkg/Library/BaseLib/Ia32/Monitor.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x32.c b/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
index 8eecb14b8c..db911cadb2 100644
--- a/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
+++ b/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.c b/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
index 52e553de1a..ddafff47ae 100644
--- a/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
+++ b/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.c b/MdePkg/Library/BaseLib/Ia32/Mwait.c
index 9ced4c9297..0629afe295 100644
--- a/MdePkg/Library/BaseLib/Ia32/Mwait.c
+++ b/MdePkg/Library/BaseLib/Ia32/Mwait.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/Non-existing.c b/MdePkg/Library/BaseLib/Ia32/Non-existing.c
index 0343455b47..b1a8dae738 100644
--- a/MdePkg/Library/BaseLib/Ia32/Non-existing.c
+++ b/MdePkg/Library/BaseLib/Ia32/Non-existing.c
@@ -17,7 +17,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
#include "../BaseLibInternals.h"
diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.c b/MdePkg/Library/BaseLib/Ia32/RRotU64.c
index 6b48222c57..31274aac2c 100644
--- a/MdePkg/Library/BaseLib/Ia32/RRotU64.c
+++ b/MdePkg/Library/BaseLib/Ia32/RRotU64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/RShiftU64.c b/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
index 7480ebd639..a6b957bacc 100644
--- a/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
+++ b/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.c b/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
index d220e8ed5d..8c6ab3527f 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.c b/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
index 9ef4d44c6e..1c682b3899 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.c b/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
index 04efb497e6..39ad5e4f2f 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.c b/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
index 9f24fce50d..71ffa9b72d 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.c b/MdePkg/Library/BaseLib/Ia32/ReadCs.c
index 52b9a7ffa0..cd9bad54e7 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadCs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadCs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.c b/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
index b8ba6535a2..7c6f0c629a 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.c b/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
index 8820256e08..573f658864 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.c b/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
index 30f8da6911..6685d775f7 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.c b/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
index 5858419512..e8a4bcc6bb 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.c b/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
index df081aaf65..9ec23218d4 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.c b/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
index d26d1eab41..3470524b22 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.c b/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
index 732334d24f..debeecb24f 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.c b/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
index b61d674da2..da7a120d70 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.c b/MdePkg/Library/BaseLib/Ia32/ReadDs.c
index ce12d0c940..91294896e0 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadDs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadDs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.c b/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
index 0600c66b25..ca5d19c5ac 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.c b/MdePkg/Library/BaseLib/Ia32/ReadEs.c
index d7780b7771..8f73b99e6b 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadEs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadEs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.c b/MdePkg/Library/BaseLib/Ia32/ReadFs.c
index 193e9078bc..848d15581b 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadFs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadFs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
index 3b35d26297..1bff03c7d6 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.c b/MdePkg/Library/BaseLib/Ia32/ReadGs.c
index 01c191d504..df495a0ff9 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadGs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadGs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
index 0e3c25ab62..0cfbd63ff4 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
index df9a2b97cf..813c08442e 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.c b/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
index 8c74545e2a..279e657edf 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.c b/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
index c6721c8d35..b46a44c8de 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.c b/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
index 35c0a2ade1..1e4905f20e 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.c b/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
index fabc524c4b..f742a9f6aa 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.c b/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
index 42fa902e00..5b9920bf5b 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.c b/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
index c6b35f109e..6b5d5df5b7 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.c b/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
index 123a0def3d..c0b1b51195 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.c b/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
index 5c8d87f49b..af98994636 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
index 94aa2c8e80..d93b9cd6e4 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.c b/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
index 2bba18815f..761fa6bf4e 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadSs.c b/MdePkg/Library/BaseLib/Ia32/ReadSs.c
index b65e1acefe..002b20cbba 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadSs.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadSs.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTr.c b/MdePkg/Library/BaseLib/Ia32/ReadTr.c
index ce192bcd3a..0069811f46 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadTr.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadTr.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT16
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.c b/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
index 2e169317a1..3946ffc792 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.c b/MdePkg/Library/BaseLib/Ia32/SetJump.c
index b96ec3a8ff..5d8692a619 100644
--- a/MdePkg/Library/BaseLib/Ia32/SetJump.c
+++ b/MdePkg/Library/BaseLib/Ia32/SetJump.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
index 9979b684f1..714fd8acdc 100644
--- a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
+++ b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
index 13ff466550..2a3f21794e 100644
--- a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
+++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
@@ -1,7 +1,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
;------------------------------------------------------------------------------
;
diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.c b/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
index 60e72139f5..fa9c8b13a0 100644
--- a/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
+++ b/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.c b/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
index 9993d47de6..4f2406c67e 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.c b/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
index dcbd3458fc..8c5d617d53 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.c b/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
index 0a1d21e100..7bcf537a7d 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.c b/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
index dcd557712e..04e7b00491 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.c b/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
index 0de464765a..0e9da73bf8 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.c b/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
index b6634e20b2..f9d1c2b5fb 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.c b/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
index 2d366497f7..61f0979bf1 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.c b/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
index ffba939e16..b39c7a4f9d 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.c b/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
index adc9005eac..c2503c26a8 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.c b/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
index 0798d25265..dbc6dc90d6 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.c b/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
index dcf5e3a9bf..1da2a0fec4 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.c b/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
index e53eccb3e9..22d28636fa 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINTN
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
index 0664908e16..bc599e0945 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
@@ -15,7 +15,8 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
index f6422412c0..b92dfbdfb9 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+#include <BaseLibInternals.h>
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
index e8ca5756b6..600f015b35 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.c b/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
index b59335e42d..c9789315b1 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.c b/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
index 39bfa6d4b9..8a9900bede 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.c b/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
index f9972076b1..fb2196963c 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.c b/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
index 39a401fd3b..d788f3be8c 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.c b/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
index 1c31d6beb7..7b0160d2a9 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.c b/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
index 48e2eb29c7..0dd02b706f 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.c b/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
index 7a038a47db..de081405e1 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.c b/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
index 044f68cec1..0bb8d205a9 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
VOID
EFIAPI
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
index 1e909d1f72..06cf910c48 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
@@ -15,7 +15,7 @@
//
// Include common header file for this module.
//
-#include "CommonHeader.h"
+
UINT64
EFIAPI