]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Optimize the size of the Base Library for the MSFT 32-bit tool chains by taking advan...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Sep 2006 19:04:40 +0000 (19:04 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Sep 2006 19:04:40 +0000 (19:04 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1567 6f19259b-4bc3-4df7-8a09-765794883524

95 files changed:
MdePkg/Library/BaseLib/BaseLib.msa
MdePkg/Library/BaseLib/Ia32/ARShiftU64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuId.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuIdEx.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuPause.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/CpuSleep.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/DisablePaging32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/DivU64x32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/EnablePaging32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/FxRestore.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/FxSave.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/Invd.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/LRotU64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/LShiftU64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/LongJump.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ModU64x32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/Monitor.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/MultU64x32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/MultU64x64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/Mwait.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/RRotU64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/RShiftU64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadCr0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadCr2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadCr3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadCr4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadCs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr1.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr5.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr6.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDr7.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadDs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadEflags.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadEs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadFs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadGdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadGs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadIdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadLdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm1.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm5.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm6.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMm7.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadMsr64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadPmc.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadSs.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadTr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ReadTsc.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/SetJump.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/SwapBytes64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/Wbinvd.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteCr0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteCr2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteCr3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteCr4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr1.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr5.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr6.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteDr7.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteGdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteIdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteLdtr.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm0.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm1.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm2.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm3.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm4.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm5.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm6.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMm7.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/WriteMsr64.c [new file with mode: 0644]

index 8924f4dbf54bded75abd6cbf1fc8b70e06e93149..508640775af4ad7167b5eb2014406fd00fd2e17e 100644 (file)
@@ -100,103 +100,114 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Filename SupArchList="IA32">Unaligned.c</Filename>\r
     <Filename SupArchList="IA32">Ia32/Non-existing.c</Filename>\r
     <Filename SupArchList="IA32">Ia32/InternalSwitchStack.c</Filename>\r
-    <Filename SupArchList="IA32">Ia32/LShiftU64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/RShiftU64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ARShiftU64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/LRotU64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/RRotU64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/MultU64x32.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/MultU64x64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/DivU64x32.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ModU64x32.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/DivU64x32Remainder.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/DivU64x64Remainder.asm</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/ARShiftU64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuBreakpoint.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuFlushTlb.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuSleep.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuId.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuIdEx.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/CpuPause.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/DisableInterrupts.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/DisablePaging32.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/DivU64x32.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/DivU64x32Remainder.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/DivU64x64Remainder.c</Filename>\r
     <Filename SupArchList="IA32">Ia32/DivS64x64Remainder.c</Filename>\r
-    <Filename SupArchList="IA32">Ia32/SwapBytes64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/SetJump.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/LongJump.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuId.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuIdEx.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadEflags.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMsr64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMsr64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadCr0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadCr2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadCr3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadCr4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteCr0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteCr2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteCr3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteCr4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr1.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr5.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr6.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDr7.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr1.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr5.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr6.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteDr7.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadCs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadDs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadEs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadFs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadGs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadSs.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadTr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadGdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteGdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadIdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteIdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadLdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteLdtr.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/FxSave.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/FxRestore.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm1.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm5.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm6.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadMm7.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm0.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm1.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm2.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm3.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm4.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm5.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm6.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/WriteMm7.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadTsc.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/ReadPmc.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/Monitor.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/Mwait.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/EnablePaging32.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/DisablePaging32.asm</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/EnableDisableInterrupts.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/EnableInterrupts.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/EnablePaging32.c</Filename>\r
     <Filename SupArchList="IA32">Ia32/EnablePaging64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/Wbinvd.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/Invd.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/FlushCacheLine.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/InterlockedIncrement.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/InterlockedDecrement.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange32.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange64.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/EnableInterrupts.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/DisableInterrupts.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/EnableDisableInterrupts.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuSleep.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuPause.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuBreakpoint.asm</Filename>\r
-    <Filename SupArchList="IA32">Ia32/CpuFlushTlb.asm</Filename>\r
+    \r
+    <Filename SupArchList="IA32">Ia32/FlushCacheLine.c</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/FxSave.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/FxRestore.c</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/InterlockedIncrement.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/InterlockedDecrement.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange32.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/Invd.c</Filename>\r
+    \r
+    <Filename SupArchList="IA32">Ia32/LongJump.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/LRotU64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/LShiftU64.c</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/MultU64x32.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/MultU64x64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ModU64x32.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/Monitor.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/Mwait.c</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/ReadCr0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadCr2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadCr3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadCr4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr1.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr5.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr6.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDr7.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadEflags.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm1.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm5.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm6.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMm7.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadMsr64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadCs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadDs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadEs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadFs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadGs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadSs.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadTr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadGdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadIdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadLdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadTsc.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/ReadPmc.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/RShiftU64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/RRotU64.c</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/SetJump.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/SwapBytes64.c</Filename>\r
     <Filename SupArchList="IA32">Ia32/Thunk16.asm</Filename>\r
+\r
+    <Filename SupArchList="IA32">Ia32/WriteMsr64.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteCr0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteCr2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteCr3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteCr4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr1.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr5.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr6.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteDr7.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteGdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteIdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteLdtr.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm0.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm1.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm2.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm3.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm4.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm5.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm6.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/WriteMm7.c</Filename>\r
+    <Filename SupArchList="IA32">Ia32/Wbinvd.c</Filename>\r
+    \r
     <!-- GCC assembly code is with .S extension -->\r
     <Filename SupArchList="IA32">Ia32/LShiftU64.S</Filename>\r
     <Filename SupArchList="IA32">Ia32/RShiftU64.S</Filename>\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
new file mode 100644 (file)
index 0000000..3c4a5b3
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  64-bit arithmetic right shift function for IA-32.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathARShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  )\r
+{\r
+  _asm {\r
+    mov     cl, byte ptr [Count]\r
+    mov     eax, dword ptr [Operand + 4]\r
+    cdq\r
+    test    cl, 32\r
+    cmovz   edx, eax\r
+    cmovz   eax, dword ptr [Operand + 0]\r
+    shrd    eax, edx, cl\r
+    sar     edx, cl\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
new file mode 100644 (file)
index 0000000..9924832
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  CpuBreakpoint function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    int  3\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c b/MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.c
new file mode 100644 (file)
index 0000000..6845117
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  CpuFlushTlb function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuFlushTlb (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, cr3\r
+    mov     cr3, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuId.c b/MdePkg/Library/BaseLib/Ia32/CpuId.c
new file mode 100644 (file)
index 0000000..189e9e6
--- /dev/null
@@ -0,0 +1,52 @@
+/** @file\r
+  AsmCpuid function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+AsmCpuid (\r
+  IN      UINT32                    Index,\r
+  OUT     UINT32                    *RegisterEax,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEbx,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEcx,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEdx   OPTIONAL\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Index\r
+    cpuid\r
+    push    ecx\r
+    mov     ecx, RegisterEax\r
+    jecxz   SkipEax\r
+    mov     [ecx], eax\r
+SkipEax:\r
+    mov     ecx, RegisterEbx\r
+    jecxz   SkipEbx\r
+    mov     [ecx], ebx\r
+SkipEbx:\r
+    pop     eax\r
+    mov     ecx, RegisterEcx\r
+    jecxz   SkipEcx\r
+    mov     [ecx], eax\r
+SkipEcx:\r
+    mov     ecx, RegisterEdx\r
+    jecxz   SkipEdx\r
+    mov     [ecx], edx\r
+SkipEdx:\r
+    mov     eax, Index\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c b/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
new file mode 100644 (file)
index 0000000..6ebbcbc
--- /dev/null
@@ -0,0 +1,54 @@
+/** @file\r
+  AsmCpuidEx function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+AsmCpuidEx (\r
+  IN      UINT32                    Index,\r
+  IN      UINT32                    SubIndex,\r
+  OUT     UINT32                    *RegisterEax,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEbx,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEcx,  OPTIONAL\r
+  OUT     UINT32                    *RegisterEdx   OPTIONAL\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Index\r
+    mov     ecx, SubIndex\r
+    cpuid\r
+    push    ecx\r
+    mov     ecx, RegisterEax\r
+    jecxz   SkipEax\r
+    mov     [ecx], eax\r
+SkipEax:\r
+    mov     ecx, RegisterEbx\r
+    jecxz   SkipEbx\r
+    mov     [ecx], ebx\r
+SkipEbx:\r
+    pop     eax\r
+    mov     ecx, RegisterEcx\r
+    jecxz   SkipEcx\r
+    mov     [ecx], eax\r
+SkipEcx:\r
+    mov     ecx, RegisterEdx\r
+    jecxz   SkipEdx\r
+    mov     [ecx], edx\r
+SkipEdx:\r
+    mov     eax, Index\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuPause.c b/MdePkg/Library/BaseLib/Ia32/CpuPause.c
new file mode 100644 (file)
index 0000000..e520698
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  CpuPause function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuPause (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    pause\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.c b/MdePkg/Library/BaseLib/Ia32/CpuSleep.c
new file mode 100644 (file)
index 0000000..f813ff9
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  CpuSleep function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    hlt\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
new file mode 100644 (file)
index 0000000..99d9e29
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  DisableInterrupts function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+DisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    cli\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
new file mode 100644 (file)
index 0000000..2e7f928
--- /dev/null
@@ -0,0 +1,49 @@
+/** @file\r
+  AsmDisablePaging32 function.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalX86DisablePaging32 (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,    OPTIONAL\r
+  IN      VOID                      *Context2,    OPTIONAL\r
+  IN      VOID                      *NewStack\r
+  )\r
+{\r
+  _asm {\r
+    push    ebp\r
+    mov     ebp, esp\r
+    mov     ebx, EntryPoint\r
+    mov     ecx, Context1\r
+    mov     edx, Context2\r
+    pushfd\r
+    pop     edi                         // save EFLAGS to edi\r
+    cli\r
+    mov     eax, cr0\r
+    btr     eax, 31\r
+    mov     esp, NewStack\r
+    mov     cr0, eax\r
+    push    edi\r
+    popfd                               // restore EFLAGS from edi\r
+    push    edx\r
+    push    ecx\r
+    call    ebx\r
+    jmp     $                           // EntryPoint() should not return\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32.c b/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
new file mode 100644 (file)
index 0000000..dd73215
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  Calculate the quotient of a 64-bit integer by a 32-bit integer\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivU64x32 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, dword ptr [Dividend + 4]\r
+    mov     ecx, Divisor\r
+    xor     edx, edx\r
+    div     ecx\r
+    push    eax                     ; save quotient on stack\r
+    mov     eax, dword ptr [Dividend]\r
+    div     ecx\r
+    pop     edx                     ; restore high-order dword of the quotient\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
new file mode 100644 (file)
index 0000000..b7e354b
--- /dev/null
@@ -0,0 +1,41 @@
+/** @file\r
+  Set error flag for all division functions\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivRemU64x32 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor,\r
+  OUT     UINT32                    *Remainder\r
+  )\r
+{\r
+  _asm {\r
+    mov     ecx, Divisor\r
+    mov     eax, dword ptr [Dividend + 4]\r
+    xor     edx, edx\r
+    div     ecx\r
+    push    eax\r
+    mov     eax, dword ptr [Dividend + 0]\r
+    div     ecx\r
+    mov     ecx, Remainder\r
+    jecxz   RemainderNull                      // abandon remainder if Remainder == NULL\r
+    mov     [ecx], edx\r
+RemainderNull:\r
+    pop     edx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.c
new file mode 100644 (file)
index 0000000..62034f7
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  Calculate the quotient of a 64-bit integer by a 64-bit integer and returns\r
+  both the quotient and the remainderSet error flag for all division functions\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivRemU64x64 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT64                    Divisor,\r
+  OUT     UINT64                    *Remainder    OPTIONAL\r
+  )\r
+{\r
+  _asm {\r
+    mov     edx, dword ptr [Dividend + 4]\r
+    mov     eax, dword ptr [Dividend + 0]   // edx:eax <- dividend\r
+    mov     edi, edx\r
+    mov     esi, eax                    // edi:esi <- dividend\r
+    mov     ebx, dword ptr [Divisor + 0]   // ecx:ebx <- divisor\r
+BitLoop:\r
+    shr     edx, 1\r
+    rcr     eax, 1\r
+    shrd    ebx, ecx, 1\r
+    shr     ecx, 1\r
+    jnz     BitLoop\r
+    div     ebx\r
+    mov     ebx, eax                    // ebx <- quotient\r
+    mov     ecx, dword ptr [Divisor + 4]\r
+    mul     dword ptr [Divisor]\r
+    imul    ecx, ebx\r
+    add     edx, ecx\r
+    mov     ecx, Remainder\r
+    jc      TooLarge                   // product > 2^64\r
+    cmp     edi, edx                    // compare high 32 bits\r
+    ja      Correct\r
+    jb      TooLarge                   // product > dividend\r
+    cmp     esi, eax\r
+    jae     Correct                    // product <= dividend\r
+TooLarge:\r
+    dec     ebx                         // adjust quotient by -1\r
+    jecxz   Return                     // return if Remainder == NULL\r
+    sub     eax, dword ptr [Divisor + 0]\r
+    sbb     edx, dword ptr [Divisor + 4]\r
+Correct:\r
+    jecxz   Return\r
+    sub     esi, eax\r
+    sbb     edi, edx                    // edi:esi <- remainder\r
+    mov     [ecx], esi\r
+    mov     [ecx + 4], edi\r
+Return:\r
+    mov     eax, ebx                    // eax <- quotient\r
+    xor     edx, edx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
new file mode 100644 (file)
index 0000000..d6b0370
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  EnableDisableInterrupts function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    sti\r
+    nop\r
+    nop\r
+    cli\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
new file mode 100644 (file)
index 0000000..bead074
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  EnableInterrupts function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+EnableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    sti\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
new file mode 100644 (file)
index 0000000..146089c
--- /dev/null
@@ -0,0 +1,49 @@
+/** @file\r
+  AsmEnablePaging32 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalX86EnablePaging32 (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,    OPTIONAL\r
+  IN      VOID                      *Context2,    OPTIONAL\r
+  IN      VOID                      *NewStack\r
+  )\r
+{\r
+  _asm {\r
+    push    ebp\r
+    mov     ebp, esp\r
+    mov     ebx, EntryPoint\r
+    mov     ecx, Context1\r
+    mov     edx, Context2\r
+    pushfd\r
+    pop     edi\r
+    cli\r
+    mov     eax, cr0\r
+    bts     eax, 31\r
+    mov     esp, NewStack\r
+    mov     cr0, eax\r
+    push    edi\r
+    popfd\r
+    push    edx\r
+    push    ecx\r
+    call    ebx\r
+    jmp     $\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
new file mode 100644 (file)
index 0000000..6da213a
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmFlushCacheLine function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID *\r
+EFIAPI\r
+AsmFlushCacheLine (\r
+  IN      VOID                      *LinearAddress\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, LinearAddress\r
+    clflush [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.c b/MdePkg/Library/BaseLib/Ia32/FxRestore.c
new file mode 100644 (file)
index 0000000..e51b882
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmFxRestore function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86FxRestore (\r
+  IN CONST IA32_FX_BUFFER *Buffer\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Buffer\r
+    fxrstor [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.c b/MdePkg/Library/BaseLib/Ia32/FxSave.c
new file mode 100644 (file)
index 0000000..8a34023
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmFxSave function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86FxSave (\r
+  OUT IA32_FX_BUFFER *Buffer\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Buffer\r
+    fxsave  [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
new file mode 100644 (file)
index 0000000..2440896
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  InterlockedCompareExchange32 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncCompareExchange32 (\r
+  IN      UINT32                    *Value,\r
+  IN      UINT32                    CompareValue,\r
+  IN      UINT32                    ExchangeValue\r
+  )\r
+{\r
+  _asm {\r
+    mov     ecx, Value\r
+    mov     eax, CompareValue\r
+    mov     edx, ExchangeValue\r
+    lock    cmpxchg [ecx], edx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
new file mode 100644 (file)
index 0000000..5bddf71
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  InterlockedCompareExchange64 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalSyncCompareExchange64 (\r
+  IN      UINT64                    *Value,\r
+  IN      UINT64                    CompareValue,\r
+  IN      UINT64                    ExchangeValue\r
+  )\r
+{\r
+  _asm {\r
+    mov     esi, Value\r
+    mov     eax, dword ptr [CompareValue + 0]\r
+    mov     edx, dword ptr [CompareValue + 4]\r
+    mov     ebx, dword ptr [ExchangeValue + 0]\r
+    mov     ecx, dword ptr [ExchangeValue + 4]\r
+    lock    cmpxchg8b   qword ptr [esi]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.c
new file mode 100644 (file)
index 0000000..f0d5fb2
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  InterlockedDecrement function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncDecrement (\r
+  IN      UINT32                    *Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    lock    dec     dword ptr [eax]\r
+    mov     eax, [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.c
new file mode 100644 (file)
index 0000000..0854ace
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  InterLockedIncrement function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncIncrement (\r
+  IN      UINT32                    *Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    lock    inc     dword ptr [eax]\r
+    mov     eax, [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/Invd.c b/MdePkg/Library/BaseLib/Ia32/Invd.c
new file mode 100644 (file)
index 0000000..113bdd6
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmInvd function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmInvd (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    invd\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.c b/MdePkg/Library/BaseLib/Ia32/LRotU64.c
new file mode 100644 (file)
index 0000000..e45d2de
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  64-bit left rotation for Ia32\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathLRotU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  )\r
+{\r
+  _asm {\r
+    mov     cl, byte ptr [Count]\r
+    mov     edx, dword ptr [Operand + 4]\r
+    mov     eax, dword ptr [Operand + 0]\r
+    shld    ebx, edx, cl\r
+    shld    edx, eax, cl\r
+    ror     ebx, cl\r
+    shld    eax, ebx, cl\r
+    test    cl, 32                      ; Count >= 32?\r
+    cmovnz  ecx, eax\r
+    cmovnz  eax, edx\r
+    cmovnz  edx, ecx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/LShiftU64.c b/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
new file mode 100644 (file)
index 0000000..64f9e37
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  64-bit left shift function for IA-32.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathLShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  )\r
+{\r
+  _asm {\r
+    mov     cl, byte ptr [Count]\r
+    xor     eax, eax\r
+    mov     edx, dword ptr [Operand + 0]\r
+    test    cl, 32                      // Count >= 32?\r
+    cmovz   eax, edx\r
+    cmovz   edx, dword ptr [Operand + 4]\r
+    shld    edx, eax, cl\r
+    shl     eax, cl\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.c b/MdePkg/Library/BaseLib/Ia32/LongJump.c
new file mode 100644 (file)
index 0000000..3444773
--- /dev/null
@@ -0,0 +1,38 @@
+/** @file\r
+  Implementation of _LongJump() on IA-32.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalLongJump (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
+  IN      UINTN                     Value\r
+  )\r
+{\r
+  _asm {\r
+    pop     eax                         ; skip return address\r
+    pop     edx                         ; edx <- JumpBuffer\r
+    pop     eax                         ; eax <- Value\r
+    mov     ebx, [edx]\r
+    mov     esi, [edx + 4]\r
+    mov     edi, [edx + 8]\r
+    mov     ebp, [edx + 12]\r
+    mov     esp, [edx + 16]\r
+    jmp     dword ptr [edx + 20]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ModU64x32.c b/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
new file mode 100644 (file)
index 0000000..2433bcc
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  Calculate the remainder of a 64-bit integer by a 32-bit integer\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalMathModU64x32 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, dword ptr [Dividend + 4]\r
+    mov     ecx, Divisor\r
+    xor     edx, edx\r
+    div     ecx\r
+    mov     eax, dword ptr [Dividend + 0]\r
+    div     ecx\r
+    mov     eax, edx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.c b/MdePkg/Library/BaseLib/Ia32/Monitor.c
new file mode 100644 (file)
index 0000000..ec29a0d
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  AsmMonitor function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmMonitor (\r
+  IN      UINTN                     RegisterEax,\r
+  IN      UINTN                     RegisterEcx,\r
+  IN      UINTN                     RegisterEdx\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, RegisterEax\r
+    mov     ecx, RegisterEcx\r
+    mov     edx, RegisterEdx\r
+    _emit   0x0f             // monitor\r
+    _emit   0x01\r
+    _emit   0xc8\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x32.c b/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
new file mode 100644 (file)
index 0000000..a2444e9
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  Calculate the product of a 64-bit integer and a 32-bit integer\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathMultU64x32 (\r
+  IN      UINT64                    Multiplicand,\r
+  IN      UINT32                    Multiplier\r
+  )\r
+{\r
+  _asm {\r
+    mov     ecx, Multiplier\r
+    mov     eax, ecx\r
+    imul    ecx, dword ptr [Multiplicand + 4]  // overflow not detectable\r
+    mul     dword ptr [Multiplicand + 0]\r
+    add     edx, ecx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.c b/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
new file mode 100644 (file)
index 0000000..71757bd
--- /dev/null
@@ -0,0 +1,37 @@
+/** @file\r
+  Calculate the product of a 64-bit integer and another 64-bit integer\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathMultU64x64 (\r
+  IN      UINT64                    Multiplicand,\r
+  IN      UINT64                    Multiplier\r
+  )\r
+{\r
+  _asm {\r
+    mov     ebx, dword ptr [Multiplicand + 0]\r
+    mov     edx, dword ptr [Multiplier + 0]\r
+    mov     ecx, ebx\r
+    mov     eax, edx\r
+    imul    ebx, dword ptr [Multiplier + 4]\r
+    imul    edx, dword ptr [Multiplicand + 4]\r
+    add     ebx, edx\r
+    mul     ecx\r
+    add     edx, ebx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.c b/MdePkg/Library/BaseLib/Ia32/Mwait.c
new file mode 100644 (file)
index 0000000..b6ad777
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmMwait function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmMwait (\r
+  IN      UINTN                     RegisterEax,\r
+  IN      UINTN                     RegisterEcx\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, RegisterEax\r
+    mov     ecx, RegisterEcx\r
+    _emit   0x0f              // mwait\r
+    _emit   0x01\r
+    _emit   0xC9\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.c b/MdePkg/Library/BaseLib/Ia32/RRotU64.c
new file mode 100644 (file)
index 0000000..78ac484
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  64-bit right rotation for Ia32\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathRRotU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  )\r
+{\r
+  _asm {\r
+    mov     cl, byte ptr [Count]\r
+    mov     eax, dword ptr [Operand + 0]\r
+    mov     edx, dword ptr [Operand + 4]\r
+    shrd    ebx, eax, cl\r
+    shrd    eax, edx, cl\r
+    rol     ebx, cl\r
+    shrd    edx, ebx, cl\r
+    test    cl, 32                      // Count >= 32?\r
+    cmovnz  ecx, eax\r
+    cmovnz  eax, edx\r
+    cmovnz  edx, ecx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/RShiftU64.c b/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
new file mode 100644 (file)
index 0000000..a57539d
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  64-bit logical right shift function for IA-32\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathRShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  )\r
+{\r
+  _asm {\r
+    mov     cl, byte ptr [Count]\r
+    xor     edx, edx\r
+    mov     eax, dword ptr [Operand + 4]\r
+    test    cl, 32\r
+    cmovz   edx, eax\r
+    cmovz   eax, dword ptr [Operand + 0]\r
+    shrd    eax, edx, cl\r
+    shr     edx, cl\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr0.c b/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
new file mode 100644 (file)
index 0000000..4931775
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadCr0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr0 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, cr0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr2.c b/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
new file mode 100644 (file)
index 0000000..09a4230
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadCr2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr2 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, cr2\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr3.c b/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
new file mode 100644 (file)
index 0000000..02462ef
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadCr3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr3 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, cr3\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCr4.c b/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
new file mode 100644 (file)
index 0000000..bc5dd72
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  AsmReadCr4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr4 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    _emit  0x0f  // mov  eax, cr4\r
+    _emit  0x20\r
+    _emit  0xE0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadCs.c b/MdePkg/Library/BaseLib/Ia32/ReadCs.c
new file mode 100644 (file)
index 0000000..5634e49
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadCs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadCs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, cs\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr0.c b/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
new file mode 100644 (file)
index 0000000..cc91973
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr0 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr1.c b/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
new file mode 100644 (file)
index 0000000..10e8a48
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr1 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr1 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr1\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr2.c b/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
new file mode 100644 (file)
index 0000000..bbacec4
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr2 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr2\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr3.c b/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
new file mode 100644 (file)
index 0000000..c4390d0
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr3 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr3\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.c b/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
new file mode 100644 (file)
index 0000000..fab9f67
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  AsmReadDr4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr4 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    _emit  0x0f\r
+    _emit  0x21\r
+    _emit  0xe0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.c b/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
new file mode 100644 (file)
index 0000000..6b0db98
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  AsmReadDr5 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr5 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    _emit  0x0f\r
+    _emit  0x21\r
+    _emit  0xe8\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr6.c b/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
new file mode 100644 (file)
index 0000000..8a84658
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr6 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr6 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr6\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr7.c b/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
new file mode 100644 (file)
index 0000000..02794f8
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadDr7 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr7 (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    mov     eax, dr7\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDs.c b/MdePkg/Library/BaseLib/Ia32/ReadDs.c
new file mode 100644 (file)
index 0000000..c757928
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadDs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadDs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, ds\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEflags.c b/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
new file mode 100644 (file)
index 0000000..49901b0
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadEflags function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadEflags (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    pushfd\r
+    pop     eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadEs.c b/MdePkg/Library/BaseLib/Ia32/ReadEs.c
new file mode 100644 (file)
index 0000000..dcd04ee
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadEs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadEs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, es\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadFs.c b/MdePkg/Library/BaseLib/Ia32/ReadFs.c
new file mode 100644 (file)
index 0000000..73f6d0e
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadFs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadFs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, fs\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
new file mode 100644 (file)
index 0000000..f98e9f8
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadGdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86ReadGdtr (\r
+  OUT IA32_DESCRIPTOR  *Gdtr\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Gdtr\r
+    sgdt    fword ptr [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGs.c b/MdePkg/Library/BaseLib/Ia32/ReadGs.c
new file mode 100644 (file)
index 0000000..47da6e7
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadGs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadGs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, gs\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
new file mode 100644 (file)
index 0000000..d39f72f
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadIdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86ReadIdtr (\r
+  OUT     IA32_DESCRIPTOR           *Idtr\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Idtr\r
+    sidt    fword ptr [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c b/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
new file mode 100644 (file)
index 0000000..df3f983
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadLdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadLdtr (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    sldt    ax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm0.c b/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
new file mode 100644 (file)
index 0000000..16ecd24
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm0 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm0\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm1.c b/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
new file mode 100644 (file)
index 0000000..7026e18
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm1 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm1 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm1\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm2.c b/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
new file mode 100644 (file)
index 0000000..33188eb
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm2 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm2\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm3.c b/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
new file mode 100644 (file)
index 0000000..2690e00
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm3 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm3\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm4.c b/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
new file mode 100644 (file)
index 0000000..6e8f9d0
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm4 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm4\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm5.c b/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
new file mode 100644 (file)
index 0000000..ed3d37c
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm5 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm5 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm5\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm6.c b/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
new file mode 100644 (file)
index 0000000..9aa892e
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm6 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm6 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm6\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMm7.c b/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
new file mode 100644 (file)
index 0000000..93ddfdb
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  AsmReadMm7 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm7 (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    push    eax\r
+    push    eax\r
+    movq    [esp], mm7\r
+    pop     eax\r
+    pop     edx\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
new file mode 100644 (file)
index 0000000..3b4d0ca
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadMsr64 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMsr64 (\r
+  IN UINT32  Index\r
+  )\r
+{\r
+  _asm {\r
+    mov     ecx, Index\r
+    rdmsr\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadPmc.c b/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
new file mode 100644 (file)
index 0000000..bf5f5d8
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadPmc function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadPmc (\r
+  IN UINT32   PmcIndex\r
+  )\r
+{\r
+  _asm {\r
+    mov     ecx, PmcIndex\r
+    rdpmc\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadSs.c b/MdePkg/Library/BaseLib/Ia32/ReadSs.c
new file mode 100644 (file)
index 0000000..9fd5d96
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmReadSs function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadSs (\r
+  VOID\r
+  )\r
+{\r
+  __asm {\r
+    xor     eax, eax\r
+    mov     ax, ss\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTr.c b/MdePkg/Library/BaseLib/Ia32/ReadTr.c
new file mode 100644 (file)
index 0000000..7f7f1d5
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadTr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadTr (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    str     ax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadTsc.c b/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
new file mode 100644 (file)
index 0000000..54cbd90
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmReadTsc function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadTsc (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    rdtsc\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.c b/MdePkg/Library/BaseLib/Ia32/SetJump.c
new file mode 100644 (file)
index 0000000..9854334
--- /dev/null
@@ -0,0 +1,47 @@
+/** @file\r
+  Implementation of SetJump() on IA-32.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalAssertJumpBuffer (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+  );\r
+\r
+_declspec (naked)\r
+UINTN\r
+EFIAPI\r
+SetJump (\r
+  OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+  )\r
+{ \r
+  _asm {\r
+    push    [esp + 4]\r
+    call    InternalAssertJumpBuffer\r
+    pop     ecx\r
+    pop     ecx\r
+    mov     edx, [esp]\r
+    mov     [edx], ebx\r
+    mov     [edx + 4], esi\r
+    mov     [edx + 8], edi\r
+    mov     [edx + 12], ebp\r
+    mov     [edx + 16], esp\r
+    mov     [edx + 20], ecx\r
+    xor     eax, eax\r
+    jmp     ecx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c b/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
new file mode 100644 (file)
index 0000000..acd0b82
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  Implementation of 64-bit swap bytes\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathSwapBytes64 (\r
+  IN      UINT64                    Operand\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, dword ptr [Operand + 4]\r
+    mov     edx, dword ptr [Operand + 0]\r
+    bswap   eax\r
+    bswap   edx\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/Wbinvd.c b/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
new file mode 100644 (file)
index 0000000..25e794d
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  AsmWbinvd function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWbinvd (\r
+  VOID\r
+  )\r
+{\r
+  _asm {\r
+    wbinvd\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr0.c b/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
new file mode 100644 (file)
index 0000000..a120250
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteCr0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr0 (\r
+  UINTN  Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     cr0, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr2.c b/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
new file mode 100644 (file)
index 0000000..45f1faa
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteCr2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr2 (\r
+  UINTN  Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     cr2, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr3.c b/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
new file mode 100644 (file)
index 0000000..e4606a7
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteCr3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr3 (\r
+  UINTN  Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     cr3, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteCr4.c b/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
new file mode 100644 (file)
index 0000000..772a463
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  AsmWriteCr4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr4 (\r
+  UINTN  Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    _emit  0x0f  // mov  cr4, eax\r
+    _emit  0x22\r
+    _emit  0xE0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr0.c b/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
new file mode 100644 (file)
index 0000000..e511a6e
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr0 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr0, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr1.c b/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
new file mode 100644 (file)
index 0000000..74f4877
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr1 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr1 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr1, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr2.c b/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
new file mode 100644 (file)
index 0000000..4ecbcb1
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr2 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr2, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr3.c b/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
new file mode 100644 (file)
index 0000000..f8a4b45
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr3 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr3, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.c b/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
new file mode 100644 (file)
index 0000000..546f92c
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  AsmWriteDr4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr4 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    _emit   0x0f         // mov dr4, eax\r
+    _emit   0x23\r
+    _emit   0xe0\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.c b/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
new file mode 100644 (file)
index 0000000..e2f72e3
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  AsmWriteDr5 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr5 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    _emit   0x0f         // mov dr5, eax\r
+    _emit   0x23\r
+    _emit   0xe8\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr6.c b/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
new file mode 100644 (file)
index 0000000..1b50f4d
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr6 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr6 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr6, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr7.c b/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
new file mode 100644 (file)
index 0000000..3f5f420
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteDr7 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr7 (\r
+  IN UINTN Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Value\r
+    mov     dr7, eax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
new file mode 100644 (file)
index 0000000..b264651
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteGdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86WriteGdtr (\r
+  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Gdtr\r
+    lgdt    fword ptr [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
new file mode 100644 (file)
index 0000000..4fd530f
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteIdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86WriteIdtr (\r
+  IN      CONST IA32_DESCRIPTOR     *Idtr\r
+  )\r
+{\r
+  _asm {\r
+    mov     eax, Idtr\r
+    lidt    fword ptr [eax]\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c b/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
new file mode 100644 (file)
index 0000000..93b5142
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  AsmWriteLdtr function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteLdtr (\r
+  IN UINT16 Ldtr\r
+  )\r
+{\r
+  _asm {\r
+    xor     eax, eax\r
+    mov     ax, Ldtr\r
+    lldt    ax\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm0.c b/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
new file mode 100644 (file)
index 0000000..c4abb9c
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm0 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm0 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm0, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm1.c b/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
new file mode 100644 (file)
index 0000000..f64b338
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm1 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm1 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm1, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm2.c b/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
new file mode 100644 (file)
index 0000000..238a7c4
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm2 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm2 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm2, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm3.c b/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
new file mode 100644 (file)
index 0000000..5cc01b6
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm3 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm3 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm3, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm4.c b/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
new file mode 100644 (file)
index 0000000..0ad39dc
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm4 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm4 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm4, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm5.c b/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
new file mode 100644 (file)
index 0000000..0904dc8
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm5 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm5 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm5, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm6.c b/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
new file mode 100644 (file)
index 0000000..8003f7f
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm6 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm6 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm6, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMm7.c b/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
new file mode 100644 (file)
index 0000000..8085d03
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  AsmWriteMm7 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm7 (\r
+  IN UINT64   Value\r
+  )\r
+{\r
+  _asm {\r
+    movq    mm7, qword ptr [Value]\r
+    emms\r
+  }\r
+}\r
+\r
+#endif\r
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
new file mode 100644 (file)
index 0000000..778fb9f
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  AsmWriteMsr64 function\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmWriteMsr64 (\r
+  IN UINT32  Index,\r
+  IN UINT64  Value\r
+  )\r
+{\r
+  _asm {\r
+    mov     edx, dword ptr [Value + 4]\r
+    mov     eax, dword ptr [Value + 0]\r
+    mov     ecx, Index\r
+    wrmsr\r
+  }\r
+}\r
+\r
+#endif\r