]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Port X64, IPF and EBC arch for BaseLib
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 2 Jul 2007 09:34:25 +0000 (09:34 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 2 Jul 2007 09:34:25 +0000 (09:34 +0000)
2. Port X64 arch codes for BaseMemoryLibRepStr and BaseMemoryLibSee2

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2955 6f19259b-4bc3-4df7-8a09-765794883524

371 files changed:
MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ebc/SwitchStack.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ebc/Synchronization.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ia32/ARShiftU64.S
MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.S
MdePkg/Library/BaseLib/Ia32/CpuFlushTlb.S
MdePkg/Library/BaseLib/Ia32/CpuId.S
MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
MdePkg/Library/BaseLib/Ia32/CpuPause.S
MdePkg/Library/BaseLib/Ia32/CpuSleep.S
MdePkg/Library/BaseLib/Ia32/DisableInterrupts.S
MdePkg/Library/BaseLib/Ia32/DisablePaging32.S
MdePkg/Library/BaseLib/Ia32/DivU64x32.S
MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S
MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S
MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S
MdePkg/Library/BaseLib/Ia32/EnableInterrupts.S
MdePkg/Library/BaseLib/Ia32/EnablePaging32.S
MdePkg/Library/BaseLib/Ia32/EnablePaging64.S
MdePkg/Library/BaseLib/Ia32/EnablePaging64.asm
MdePkg/Library/BaseLib/Ia32/FlushCacheLine.S
MdePkg/Library/BaseLib/Ia32/FxRestore.S
MdePkg/Library/BaseLib/Ia32/FxSave.S
MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S
MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S
MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S
MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S
MdePkg/Library/BaseLib/Ia32/Invd.S
MdePkg/Library/BaseLib/Ia32/LRotU64.S
MdePkg/Library/BaseLib/Ia32/LShiftU64.S
MdePkg/Library/BaseLib/Ia32/LongJump.S
MdePkg/Library/BaseLib/Ia32/ModU64x32.S
MdePkg/Library/BaseLib/Ia32/Monitor.S
MdePkg/Library/BaseLib/Ia32/MultU64x32.S
MdePkg/Library/BaseLib/Ia32/MultU64x64.S
MdePkg/Library/BaseLib/Ia32/Mwait.S
MdePkg/Library/BaseLib/Ia32/RRotU64.S
MdePkg/Library/BaseLib/Ia32/RShiftU64.S
MdePkg/Library/BaseLib/Ia32/ReadCr0.S
MdePkg/Library/BaseLib/Ia32/ReadCr2.S
MdePkg/Library/BaseLib/Ia32/ReadCr3.S
MdePkg/Library/BaseLib/Ia32/ReadCr4.S
MdePkg/Library/BaseLib/Ia32/ReadCs.S
MdePkg/Library/BaseLib/Ia32/ReadDr0.S
MdePkg/Library/BaseLib/Ia32/ReadDr1.S
MdePkg/Library/BaseLib/Ia32/ReadDr2.S
MdePkg/Library/BaseLib/Ia32/ReadDr3.S
MdePkg/Library/BaseLib/Ia32/ReadDr4.S
MdePkg/Library/BaseLib/Ia32/ReadDr5.S
MdePkg/Library/BaseLib/Ia32/ReadDr6.S
MdePkg/Library/BaseLib/Ia32/ReadDr7.S
MdePkg/Library/BaseLib/Ia32/ReadDs.S
MdePkg/Library/BaseLib/Ia32/ReadEflags.S
MdePkg/Library/BaseLib/Ia32/ReadEs.S
MdePkg/Library/BaseLib/Ia32/ReadFs.S
MdePkg/Library/BaseLib/Ia32/ReadGdtr.S
MdePkg/Library/BaseLib/Ia32/ReadGs.S
MdePkg/Library/BaseLib/Ia32/ReadIdtr.S
MdePkg/Library/BaseLib/Ia32/ReadLdtr.S
MdePkg/Library/BaseLib/Ia32/ReadMm0.S
MdePkg/Library/BaseLib/Ia32/ReadMm1.S
MdePkg/Library/BaseLib/Ia32/ReadMm2.S
MdePkg/Library/BaseLib/Ia32/ReadMm3.S
MdePkg/Library/BaseLib/Ia32/ReadMm4.S
MdePkg/Library/BaseLib/Ia32/ReadMm5.S
MdePkg/Library/BaseLib/Ia32/ReadMm6.S
MdePkg/Library/BaseLib/Ia32/ReadMm7.S
MdePkg/Library/BaseLib/Ia32/ReadMsr64.S
MdePkg/Library/BaseLib/Ia32/ReadPmc.S
MdePkg/Library/BaseLib/Ia32/ReadSs.S
MdePkg/Library/BaseLib/Ia32/ReadTr.S
MdePkg/Library/BaseLib/Ia32/ReadTsc.S
MdePkg/Library/BaseLib/Ia32/SetJump.S
MdePkg/Library/BaseLib/Ia32/SwapBytes64.S
MdePkg/Library/BaseLib/Ia32/Thunk16.S
MdePkg/Library/BaseLib/Ia32/Wbinvd.S
MdePkg/Library/BaseLib/Ia32/WriteCr0.S
MdePkg/Library/BaseLib/Ia32/WriteCr2.S
MdePkg/Library/BaseLib/Ia32/WriteCr3.S
MdePkg/Library/BaseLib/Ia32/WriteCr4.S
MdePkg/Library/BaseLib/Ia32/WriteDr0.S
MdePkg/Library/BaseLib/Ia32/WriteDr1.S
MdePkg/Library/BaseLib/Ia32/WriteDr2.S
MdePkg/Library/BaseLib/Ia32/WriteDr3.S
MdePkg/Library/BaseLib/Ia32/WriteDr4.S
MdePkg/Library/BaseLib/Ia32/WriteDr5.S
MdePkg/Library/BaseLib/Ia32/WriteDr6.S
MdePkg/Library/BaseLib/Ia32/WriteDr7.S
MdePkg/Library/BaseLib/Ia32/WriteGdtr.S
MdePkg/Library/BaseLib/Ia32/WriteIdtr.S
MdePkg/Library/BaseLib/Ia32/WriteLdtr.S
MdePkg/Library/BaseLib/Ia32/WriteMm0.S
MdePkg/Library/BaseLib/Ia32/WriteMm1.S
MdePkg/Library/BaseLib/Ia32/WriteMm2.S
MdePkg/Library/BaseLib/Ia32/WriteMm3.S
MdePkg/Library/BaseLib/Ia32/WriteMm4.S
MdePkg/Library/BaseLib/Ia32/WriteMm5.S
MdePkg/Library/BaseLib/Ia32/WriteMm6.S
MdePkg/Library/BaseLib/Ia32/WriteMm7.S
MdePkg/Library/BaseLib/Ia32/WriteMsr64.S
MdePkg/Library/BaseLib/Ipf/AccessDbr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessEicr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessGcr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessGp.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessKr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessPmr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AccessPsr.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/AsmPalCall.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/CpuPause.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/ExecFc.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/FlushCacheRange.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/GetInterruptState.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange32.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange64.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/PalCallStatic.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/ReadCpuid.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/SwitchStack.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/Synchronization.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/Unaligned.c [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/asm.h [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/ia_64gen.h [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/longjmp.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/setjmp.s [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuBreakpoint.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuBreakpoint.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuFlushTlb.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuFlushTlb.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuId.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuId.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuIdEx.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuIdEx.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuPause.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuPause.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuSleep.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/CpuSleep.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/DisableInterrupts.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/DisableInterrupts.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/DisablePaging64.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/DisablePaging64.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnableInterrupts.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnableInterrupts.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnablePaging64.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/EnablePaging64.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FlushCacheLine.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FlushCacheLine.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FxRestore.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FxRestore.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FxSave.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/FxSave.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedDecrement.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedDecrement.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedDecrement.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedIncrement.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedIncrement.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/InterlockedIncrement.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Invd.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Invd.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/LongJump.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/LongJump.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Monitor.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Monitor.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Mwait.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Mwait.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Non-existing.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCr4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadCs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr1.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr1.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr5.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr5.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr6.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr6.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr7.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDr7.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadDs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadEflags.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadEflags.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadEs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadEs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadFs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadFs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadGdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadGdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadGs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadGs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadIdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadIdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadLdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadLdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm1.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm1.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm5.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm5.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm6.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm6.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm7.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMm7.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMsr64.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMsr64.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadMsr64.c [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadPmc.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadPmc.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadSs.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadSs.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadTr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadTr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadTsc.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/ReadTsc.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/SetJump.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/SetJump.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/SwitchStack.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/SwitchStack.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Thunk16.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Thunk16.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Wbinvd.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/Wbinvd.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteCr4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr1.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr1.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr5.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr5.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr6.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr6.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr7.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteDr7.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteGdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteGdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteIdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteIdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteLdtr.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteLdtr.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm0.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm0.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm1.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm1.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm2.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm2.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm3.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm3.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm4.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm4.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm5.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm5.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm6.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm6.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm7.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMm7.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMsr64.S [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMsr64.asm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/WriteMsr64.c [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem16.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem32.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem64.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ScanMem8.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem16.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem32.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.S
MdePkg/Library/BaseMemoryLibRepStr/Ia32/ZeroMem.asm
MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/CompareMem.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem16.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem32.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem64.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/ScanMem8.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem16.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem32.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/SetMem64.asm
MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.S
MdePkg/Library/BaseMemoryLibSse2/Ia32/ZeroMem.asm
MdePkg/Library/BaseMemoryLibSse2/x64/CompareMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/CopyMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem16.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem32.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem64.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem8.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/SetMem.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/SetMem16.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/SetMem32.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/SetMem64.asm [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibSse2/x64/ZeroMem.asm [new file with mode: 0644]
MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
MdePkg/MdePkg.dsc

diff --git a/MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c b/MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c
new file mode 100644 (file)
index 0000000..352e1c7
--- /dev/null
@@ -0,0 +1,164 @@
+/** @file\r
+  Base Library CPU Functions for EBC\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
+extern\r
+UINT64\r
+_break (\r
+  CHAR8 BreakCode\r
+  );\r
+\r
+/**\r
+  Generates a breakpoint on the CPU.\r
+\r
+  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
+  that code can resume normal execution after the breakpoint.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+  VOID\r
+  )\r
+{\r
+  _break (3);\r
+}\r
+\r
+/**\r
+  Used to serialize load and store operations.\r
+\r
+  All loads and stores that proceed calls to this function are guaranteed to be\r
+  globally visible when this function returns.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+MemoryFence (\r
+  VOID\r
+  )\r
+{\r
+}\r
+\r
+/**\r
+  Disables CPU interrupts.\r
+\r
+  Disables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+  Enables CPU interrupts.\r
+\r
+  Enables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+  Retrieves the current CPU interrupt state.\r
+\r
+  Retrieves the current CPU interrupt state. Returns TRUE is interrupts are\r
+  currently enabled. Otherwise returns FALSE.\r
+\r
+  @retval TRUE  CPU interrupts are enabled.\r
+  @retval FALSE CPU interrupts are disabled.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetInterruptState (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  EnableInterrupts ();\r
+  DisableInterrupts ();\r
+}\r
+\r
+/**\r
+  Requests CPU to pause for a short period of time.\r
+\r
+  Requests CPU to pause for a short period of time. Typically used in MP\r
+  systems to prevent memory starvation while waiting for a spin lock.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuPause (\r
+  VOID\r
+  )\r
+{\r
+}\r
+\r
+/**\r
+  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuFlushTlb (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+  Places the CPU in a sleep state until an interrupt is received.\r
+\r
+  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+  are disabled prior to calling this function, then the CPU will be placed in a\r
+  sleep state indefinitely.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+  VOID\r
+  )\r
+{\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
new file mode 100644 (file)
index 0000000..b485d3e
--- /dev/null
@@ -0,0 +1,78 @@
+/** @file\r
+  Switch Stack functions.\r
+\r
+  Copyright (c) 2006, Intel Corporation\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
+  Module Name:  SetJumpLongJump.c\r
+\r
+**/\r
+\r
+/**\r
+  Worker function that checks ASSERT condition for JumpBuffer\r
+\r
+  Checks ASSERT condition for JumpBuffer.\r
+\r
+  If JumpBuffer is NULL, then ASSERT().\r
+  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
+\r
+  @param  JumpBuffer    A pointer to CPU context buffer.\r
+\r
+**/\r
+VOID\r
+InternalAssertJumpBuffer (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+  );\r
+\r
+/**\r
+  Saves the current CPU context that can be restored with a call to LongJump() and returns 0.\r
+\r
+  Saves the current CPU context in the buffer specified by JumpBuffer and returns 0.  The initial \r
+  call to SetJump() must always return 0.  Subsequent calls to LongJump() cause a non-zero \r
+  value to be returned by SetJump(). \r
+\r
+  If JumpBuffer is NULL, then ASSERT().\r
+  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
+\r
+  @param  JumpBuffer    A pointer to CPU context buffer.\r
\r
+**/\r
+UINTN\r
+EFIAPI\r
+SetJump (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+  )\r
+{\r
+  InternalAssertJumpBuffer (JumpBuffer);\r
+  return 0;\r
+}\r
+\r
+/**\r
+  Restores the CPU context that was saved with SetJump().\r
+\r
+  Restores the CPU context from the buffer specified by JumpBuffer.\r
+  This function never returns to the caller.\r
+  Instead is resumes execution based on the state of JumpBuffer.\r
+\r
+  @param  JumpBuffer    A pointer to CPU context buffer.\r
+  @param  Value         The value to return when the SetJump() context is restored.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+InternalLongJump (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
+  IN      UINTN                     Value\r
+  )\r
+{\r
+  //\r
+  // This function cannot work on EBC\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ebc/SwitchStack.c b/MdePkg/Library/BaseLib/Ebc/SwitchStack.c
new file mode 100644 (file)
index 0000000..d2861c4
--- /dev/null
@@ -0,0 +1,64 @@
+/** @file\r
+  Switch Stack functions.\r
+\r
+  Copyright (c) 2006 - 2007, 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
+  Module Name:  SwitchStack.c\r
+\r
+**/\r
+\r
+/**\r
+  Transfers control to a function starting with a new stack.\r
+\r
+  Transfers control to the function specified by EntryPoint using the\r
+  new stack specified by NewStack and passing in the parameters specified\r
+  by Context1 and Context2.  Context1 and Context2 are optional and may\r
+  be NULL.  The function EntryPoint must never return.\r
+  Marker will be ignored on IA-32, x64, and EBC.\r
+  IPF CPUs expect one additional parameter of type VOID * that specifies\r
+  the new backing store pointer.\r
+\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function.\r
+  @param  Marker      VA_LIST marker for the variable argument list.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+InternalSwitchStack (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,   OPTIONAL\r
+  IN      VOID                      *Context2,   OPTIONAL\r
+  IN      VOID                      *NewStack,\r
+  IN      VA_LIST                   Marker\r
+  )\r
+\r
+{\r
+  //\r
+  // This version of this function does not actually change the stack pointer\r
+  // This is to support compilation of CPU types that do not support assemblers\r
+  // such as EBC\r
+  //\r
+\r
+  //\r
+  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
+  //\r
+  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+\r
+  EntryPoint (Context1, Context2);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ebc/Synchronization.c b/MdePkg/Library/BaseLib/Ebc/Synchronization.c
new file mode 100644 (file)
index 0000000..5d5bc2f
--- /dev/null
@@ -0,0 +1,99 @@
+/** @file\r
+  Implementation of synchronization functions on EBC.\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
+  Module Name:  Synchronization.c\r
+\r
+**/\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncCompareExchange32 (\r
+  IN      volatile UINT32           *Value,\r
+  IN      UINT32                    CompareValue,\r
+  IN      UINT32                    ExchangeValue\r
+  )\r
+{\r
+  return *Value != CompareValue ? *Value :\r
+           ((*Value = ExchangeValue), CompareValue);\r
+}\r
+\r
+/**\r
+  Performs an atomic compare exchange operation on a 64-bit unsigned integer.\r
+\r
+  Performs an atomic compare exchange operation on the 64-bit unsigned integer specified \r
+  by Value.  If Value is equal to CompareValue, then Value is set to ExchangeValue and \r
+  CompareValue is returned.  If Value is not equal to CompareValue, then Value is returned. \r
+  The compare exchange operation must be performed using MP safe mechanisms.\r
+\r
+  @param  Value         A pointer to the 64-bit value for the compare exchange\r
+                        operation.\r
+  @param  CompareValue  64-bit value used in compare operation.\r
+  @param  ExchangeValue 64-bit value used in exchange operation.\r
+\r
+  @return The original *Value before exchange.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+InternalSyncCompareExchange64 (\r
+  IN      volatile UINT64           *Value,\r
+  IN      UINT64                    CompareValue,\r
+  IN      UINT64                    ExchangeValue\r
+  )\r
+{\r
+  return *Value != CompareValue ? *Value :\r
+           ((*Value = ExchangeValue), CompareValue);\r
+}\r
+\r
+/**\r
+  Performs an atomic increment of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic increment of the 32-bit unsigned integer specified by\r
+  Value and returns the incremented value. The increment operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  @param  Value A pointer to the 32-bit value to increment.\r
+\r
+  @return The incremented value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InternalSyncIncrement (\r
+  IN      volatile UINT32           *Value\r
+  )\r
+{\r
+  return ++*Value;\r
+}\r
+\r
+/**\r
+  Performs an atomic decrement of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic decrement of the 32-bit unsigned integer specified by\r
+  Value and returns the decrement value. The decrement operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  @param  Value A pointer to the 32-bit value to decrement.\r
+\r
+  @return The decrement value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InternalSyncDecrement (\r
+  IN      volatile UINT32           *Value\r
+  )\r
+{\r
+  return --*Value;\r
+}\r
index 84762082ba4a508e8a9d890905e1de529a3fb23a..5498d2e99196084d01b6a52758ca40a9ded45ce9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 59a11432594d9d4a3d64c166a5e81a838c9c36ac..e82434b670d9c3f8c9ef27b1ee2f76be05d58865 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
index 07550ff412878cce644f788a7ec5f7ddbb891440..f8b1cdc7eef0cc01ee099a6676f1d5e5a39f0515 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
index 2373ad1a8ec1fddee3821e8c41e5ccf907650784..6f41e722277e837ec5da25100d353b3ee903129c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 2d7ec493cfef6e1c8fd21c371a938c16852d10ff..48554cc96bb7f672ace3c87859dd8e101011533c 100644 (file)
@@ -1,72 +1,67 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CpuIdEx.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   AsmCpuidEx function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    .686:\r
-    .code:\r
-\r
-#------------------------------------------------------------------------------\r
-#  UINT32\r
-#  EFIAPI\r
-#  AsmCpuidEx (\r
-#    IN   UINT32  RegisterInEax,\r
-#    IN   UINT32  RegisterInEcx,\r
-#    OUT  UINT32  *RegisterOutEax  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEdx  OPTIONAL\r
-#    )\r
-#------------------------------------------------------------------------------\r
-.globl ASM_PFX(AsmCpuidEx)\r
-ASM_PFX(AsmCpuidEx):\r
-    push    %ebx\r
-    push    %ebp\r
-    movl    %esp, %ebp\r
-    movl    12(%ebp), %eax\r
-    movl    16(%ebp), %ecx\r
-    cpuid\r
-    push    %ecx\r
-    movl    20(%ebp), %ecx\r
-    jecxz   L1\r
-    movl    %eax, (%ecx)\r
-L1:\r
-    movl    24(%ebp), %ecx\r
-    jecxz   L2\r
-    movl    %ebx, (%ecx)\r
-L2:\r
-    movl    28(%ebp), %ecx\r
-    jecxz   L3\r
-    popl    (%ecx)\r
-L3:\r
-    movl    32(%ebp), %edx\r
-    jecxz   L4\r
-    movl    %edx, (%ecx)\r
-L4:\r
-    movl    12(%ebp), %eax\r
-    leave\r
-    pop     %ebx\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CpuIdEx.Asm
+#
+# Abstract:
+#
+#   AsmCpuidEx function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+    .686:
+    .code:
+
+#------------------------------------------------------------------------------
+#  UINT32
+#  EFIAPI
+#  AsmCpuidEx (
+#    IN   UINT32  RegisterInEax,
+#    IN   UINT32  RegisterInEcx,
+#    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+#    )
+#------------------------------------------------------------------------------
+.globl ASM_PFX(AsmCpuidEx)
+ASM_PFX(AsmCpuidEx):
+    push    %ebx
+    push    %ebp
+    movl    %esp, %ebp
+    movl    12(%ebp), %eax
+    movl    16(%ebp), %ecx
+    cpuid
+    push    %ecx
+    movl    20(%ebp), %ecx
+    jecxz   L1
+    movl    %eax, (%ecx)
+L1:
+    movl    24(%ebp), %ecx
+    jecxz   L2
+    movl    %ebx, (%ecx)
+L2:
+    movl    28(%ebp), %ecx
+    jecxz   L3
+    popl    (%ecx)
+L3:
+    movl    32(%ebp), %edx
+    jecxz   L4
+    movl    %edx, (%ecx)
+L4:
+    movl    12(%ebp), %eax
+    leave
+    pop     %ebx
+    ret
index 3661b1ff8651708f1adf23a3b633a53710665289..5fef9c8d5cdf5215bf524676802d303b664043cf 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
index 8bf9d55ba72f50af010e9ecfa1a92689344b7ff0..ac39e8fcba395eb8bd9ebf9e50ed72a956ad278f 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
 #------------------------------------------------------------------------------ ;\r
 # Copyright (c) 2006, Intel Corporation\r
 # All rights reserved. This program and the accompanying materials\r
index 3a7a81d1b601081f3a5d9bd5880dbbbf359f98c4..ea04225fd67c1cff3663a6be0f889f4d62b10345 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f950b058b330d2f3eabb154b9e17dcf839234a8c..7898e8103a971c11313d997691e06783107a5ab2 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 170819858e784220f064e9aec8d9fa73b8e67fa4..b858278e6423d81464aeb844b268e70ee4df5f65 100644 (file)
@@ -1,46 +1,41 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   DivU64x32.asm\r
-#\r
-# Abstract:\r
-#\r
-#   Calculate the quotient of a 64-bit integer by a 32-bit integer\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl ASM_PFX(InternalMathDivU64x32)\r
-\r
-#------------------------------------------------------------------------------\r
-# UINT64\r
-# EFIAPI\r
-# InternalMathDivU64x32 (\r
-#   IN      UINT64                    Dividend,\r
-#   IN      UINT32                    Divisor\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMathDivU64x32):\r
-    movl    8(%esp), %eax\r
-    movl    12(%esp), %ecx\r
-    xorl    %edx, %edx\r
-    divl    %ecx\r
-    push    %eax\r
-    movl    8(%esp), %eax\r
-    divl    %ecx\r
-    pop     %edx\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   DivU64x32.asm
+#
+# Abstract:
+#
+#   Calculate the quotient of a 64-bit integer by a 32-bit integer
+#
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(InternalMathDivU64x32)
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathDivU64x32 (
+#   IN      UINT64                    Dividend,
+#   IN      UINT32                    Divisor
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(InternalMathDivU64x32):
+    movl    8(%esp), %eax
+    movl    12(%esp), %ecx
+    xorl    %edx, %edx
+    divl    %ecx
+    push    %eax
+    movl    8(%esp), %eax
+    divl    %ecx
+    pop     %edx
+    ret
index 987e0ead894038fea7bd1f8fc1243e6a00f4e5aa..974373d284859e849b3e4ef61a524b5e371a351e 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 36008bf567527754be77df56226b85aff79e8e89..cac7169d58cf919730a79d58e095b0960404b243 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 2799832d24b52e8ca00680125a3f9ca265ecb9a2..c5742aee53ce320b90b5afcb91302c554c863066 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 2c83e261a4099929396f2d96b0a17e37d7664d5f..2d608036f73d09bdcd1df5f48a1cee43906866e9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 054a5c9d06643a9e3861a559e326f2bfedc7401d..df5d67cfac1457413d109611b6f7ce916fed94c2 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 44b7e16558fd8cafdf08fdc63a532cc182a6b8c8..ffa9beb0a1544b6b28b701605fc9b716217d57f3 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 3755c0585b157c0aa72a12fae4a9db3ad4848f97..435bb391058fabcd55d4d28e5592987272469574 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index b8c87c23c1c6c6e71eb371ed4f901b8c5d74b029..07a92619d2c15853bcd03e8d333ede4775644bf5 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 4560751c62dbd2fd4fa7f0dc088da390fdf737a9..9cfa14be0fdb7320e382f3c7210a290a26e05935 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 343db36a9f9e30f72d345fde38b7a566f064d0b8..8857a8ec777b9a60e0b3f3c50a06f7b9530e3c79 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 0abb605aa3bff561ed8a2ef12b1d3dbc812f8857..a0a6ad9eb070aecabda8e4e226df57f4b3002e9c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ee3278ca09de3406213d142229d298c6ce18be83..98a20a5e294a4aba7b0ba807e5f8d189dbdc7793 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index a92ea6ba3723c58a51953c95e0ed4f1e13f1ab34..dc8f7215cc8a57d7d066f40d433b220203f19d94 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 88c35d5c0c830a1e216369503dc8e6acc26f9f26..ecbbc7540c87e8d394c5ede6d210c501bf59a975 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 4e85d2935fe4e47d501e402e4989be17136b93c4..0a0c1a244ad80995cf1020c3ec94703d2a925a66 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index fe3ab60af6f707f90e120a3bf77c937445156f37..3b866e27006c688d7447221896920b356b89b280 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 9c93242bd4ec219c57e422e8bd272db5736b9997..a4b99eb80a128a1f5b372e421836fbd0a509dea8 100644 (file)
@@ -1,46 +1,41 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   LShiftU64.asm\r
-#\r
-# Abstract:\r
-#\r
-#   64-bit left shift function for IA-32\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl ASM_PFX(InternalMathLShiftU64)\r
-\r
-#------------------------------------------------------------------------------\r
-# UINT64\r
-# EFIAPI\r
-# InternalMathLShiftU64 (\r
-#   IN      UINT64                    Operand,\r
-#   IN      UINTN                     Count\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMathLShiftU64):\r
-    movb    12(%esp), %cl\r
-    xorl    %eax, %eax\r
-    movl    4(%esp), %edx\r
-    testb   $32, %cl\r
-    cmovz   %edx, %eax\r
-    cmovz   0x8(%esp), %edx\r
-    shld    %cl, %eax, %edx\r
-    shl     %cl, %eax\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   LShiftU64.asm
+#
+# Abstract:
+#
+#   64-bit left shift function for IA-32
+#
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(InternalMathLShiftU64)
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathLShiftU64 (
+#   IN      UINT64                    Operand,
+#   IN      UINTN                     Count
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(InternalMathLShiftU64):
+    movb    12(%esp), %cl
+    xorl    %eax, %eax
+    movl    4(%esp), %edx
+    testb   $32, %cl
+    cmovz   %edx, %eax
+    cmovz   0x8(%esp), %edx
+    shld    %cl, %eax, %edx
+    shl     %cl, %eax
+    ret
index 95dd444913db74063a2edd03ba490535af1dd282..0b76896085ca2439891d21584beeda762edeb5ae 100644 (file)
@@ -1,46 +1,41 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   LongJump.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   Implementation of _LongJump() on IA-32.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl ASM_PFX(InternalLongJump)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# InternalLongJump (\r
-#   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
-#   IN      UINTN                     Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalLongJump):\r
-    pop     %eax\r
-    pop     %edx\r
-    pop     %eax\r
-    movl    (%edx), %ebx\r
-    movl    4(%edx), %esi\r
-    movl    8(%edx), %edi\r
-    movl    12(%edx), %ebp\r
-    movl    16(%edx), %esp\r
-    jmp     *20(%edx)\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   LongJump.Asm
+#
+# Abstract:
+#
+#   Implementation of _LongJump() on IA-32.
+#
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(InternalLongJump)
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalLongJump (
+#   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
+#   IN      UINTN                     Value
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(InternalLongJump):
+    pop     %eax
+    pop     %edx
+    pop     %eax
+    movl    (%edx), %ebx
+    movl    4(%edx), %esi
+    movl    8(%edx), %edi
+    movl    12(%edx), %ebp
+    movl    16(%edx), %esp
+    jmp     *20(%edx)
index decfeaac3b41cd69135823c4b45aeac2df94b90a..00dc6a08ab79b8b95c63c5117145b85d5a3dcd90 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 2651124ea347da11d1fb8d2f25d9287d60c7bd5d..6e9284dcd4d62fb1a4dba8399c1ed28641161afc 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 5c44957838432fcda854bda3f992c8f428abf0f9..b9d1eb8ca74818e1a3224866eb3f74d8ebec1260 100644 (file)
@@ -1,46 +1,41 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   MultU64x32.asm\r
-#\r
-# Abstract:\r
-#\r
-#   Calculate the product of a 64-bit integer and a 32-bit integer\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    .386:\r
-    .code:\r
-\r
-.globl ASM_PFX(InternalMathMultU64x32)\r
-\r
-#------------------------------------------------------------------------------\r
-# UINT64\r
-# EFIAPI\r
-# InternalMathMultU64x32 (\r
-#   IN      UINT64                    Multiplicand,\r
-#   IN      UINT32                    Multiplier\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMathMultU64x32):\r
-    movl    12(%esp), %ecx\r
-    movl    %ecx, %eax\r
-    imull   8(%esp), %ecx\r
-    mull    0x4(%esp)\r
-    addl    %ecx, %edx\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   MultU64x32.asm
+#
+# Abstract:
+#
+#   Calculate the product of a 64-bit integer and a 32-bit integer
+#
+#------------------------------------------------------------------------------
+
+    .386:
+    .code:
+
+.globl ASM_PFX(InternalMathMultU64x32)
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathMultU64x32 (
+#   IN      UINT64                    Multiplicand,
+#   IN      UINT32                    Multiplier
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(InternalMathMultU64x32):
+    movl    12(%esp), %ecx
+    movl    %ecx, %eax
+    imull   8(%esp), %ecx
+    mull    0x4(%esp)
+    addl    %ecx, %edx
+    ret
index 40dda6f1a485d4d1007afb257c976cacd66d1d46..03523865f6c71d3259533cbab179d6a467be0286 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 80782b7f847e7d2c3501481aa25877fc5ec25df7..12f6a87511d86db936a4d209f425d4e8383d76a7 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 7e8984287a803f87e3a0fdaf13153eb61f312674..35935639b9b68f0ebb9e2d222c4da2eb3fd0b19e 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 7d58fd6c4704e8f2f9a271ffc6180bb09e503156..ca78394e39ffc2ccd1b8624036381561951739c7 100644 (file)
@@ -1,49 +1,44 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   RShiftU64.asm\r
-#\r
-# Abstract:\r
-#\r
-#   64-bit logical right shift function for IA-32\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    .686:\r
-    .code:\r
-\r
-.globl ASM_PFX(InternalMathRShiftU64)\r
-\r
-#------------------------------------------------------------------------------\r
-# UINT64\r
-# EFIAPI\r
-# InternalMathRShiftU64 (\r
-#   IN      UINT64                    Operand,\r
-#   IN      UINTN                     Count\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(InternalMathRShiftU64):\r
-    movb    12(%esp), %cl\r
-    xorl    %edx, %edx\r
-    movl    8(%esp), %eax\r
-    testb   $32, %cl\r
-    cmovz   %eax, %edx\r
-    cmovz   0x4(%esp), %eax\r
-    shrdl   %cl, %edx, %eax\r
-    shr     %cl, %edx\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   RShiftU64.asm
+#
+# Abstract:
+#
+#   64-bit logical right shift function for IA-32
+#
+#------------------------------------------------------------------------------
+
+    .686:
+    .code:
+
+.globl ASM_PFX(InternalMathRShiftU64)
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathRShiftU64 (
+#   IN      UINT64                    Operand,
+#   IN      UINTN                     Count
+#   );
+#------------------------------------------------------------------------------
+ASM_PFX(InternalMathRShiftU64):
+    movb    12(%esp), %cl
+    xorl    %edx, %edx
+    movl    8(%esp), %eax
+    testb   $32, %cl
+    cmovz   %eax, %edx
+    cmovz   0x4(%esp), %eax
+    shrdl   %cl, %edx, %eax
+    shr     %cl, %edx
+    ret
index b08c7d75a73255dd4bcb7c08cd34a7eba0f99817..3433344b7b8c52899ca62e93d10cd230ed04b017 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 0b82a2590678606ab5b499eaaa342f21d898eac0..d308895367f827cfc67eda4ec8b94a89d7106dde 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f973dbef237ec246febfbfcf285ff5ed1eeb196c..aaec1f01d07fbe7a479dbbbb0b8162c952ae505c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ee94991e8c4c4d840eb0ec89d8c7987500e346a9..442d359eda2eafd6795ebbc246ace62302ef56f9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 7406cfba3a758491a81afb4d67352ddb1409b7ad..a3ad69d304aad18b0aaecb4f414b883975a332cb 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 1ba42d9e656375200cc31ac90c92865438b1a0a7..d4c61f1484e0d60d615eed598e0a5fe2baa98386 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 4fe89da5d74746e127be2b3f768b7d811a391f57..27c55542572b922b3faee79d8d7e172f33b8239f 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 916fad740d0991c16f1a6c67813b4425d664c613..cca84b9efdf7a86a4386a7fa2d01d7274802d6f2 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 3505589441428c716af5289378bff717285364fd..60b055038100c9054c1414e1339e12b779243bf4 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 44c56aa624e1f445fc22e50541a8ffa672c172a3..84883df9719b5d3dc77d5c75b84193313b348389 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 3a012256ef0d9bae9d027cdfd419c5794ec51e11..5abb226b9159d91595bf658372e4fbcbb02ffa57 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index e5857b055a8f1572be28ae9fa7726744712a5dea..9594851c7e8b8551568f95834cb730ee3eae8577 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 8054b968f1ee9bba30be61385cf3a64b69d025d6..4ba13efcb4dc3e0f1a2597bdfb4f5d8fdcfefd13 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 41e6bd4d9295af0ae2f99b387307dcfbd8ca352b..c3dc8451ad91919a9f40ea84d361f53b68dedffc 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 95b219159fc5fbe832d9c0b23b3b680ef07eca90..ab5e522739d728bef98b50496f51c2e1c68975cb 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ed60065fa267620596cfe436d32ae4c4607147d5..26ed55d9e191a8618ee7155cc171359c39a1be39 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 19d89ef7b3bd06274654ca73dc8b0f68f170068e..bd38c6ac105bef447cfee56170edf7232dc246b3 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ba6564c38ac3e0d21e51c1ae686f2bc69e101fff..8869164606d87ea79abefcf9ac87ac98f72f53fb 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 18625962880a62ce4c5356271031da144b078629..82b396661d57755735396c717138ee98d95138c9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 7880e7a8af86b5cbb577496c30b9cae0d175f4b0..0e5d32e3d8a3b33aa0fbe1074e0eee0021d56be5 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 301edbdced1bb3ea0103a62ad25f6e48776c80b3..addb1757d08814a0c4482371e8686c23626f56e3 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index c6434fcc79ea8e51653b5291fe4edb2fad4f7d35..f191337f68fa3e26abe8eebcf6927b64d5515189 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 775a517219f94b2cea1c148d56bd623e8afb155c..790541aaeb8675af038ef64a233f299a99d0aed3 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 7c23a67f68e1bf183158a12ac62dd1ade75bc1c8..231d62c762741218abf1d0a8e8e0751ddda84c73 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ad888b1be1900907641075ee4530b7b835d12a6d..1e1f6dd684f5a82dbe98fc026980507f94253fdc 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index a69e9149573565a56a4b42a19352d416390acdb1..5da446befedeffdef4139d15582c01d2b185e27c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index bc047a157f2d89b27fbbaee3a051154c05f0e08e..5528fe1812f5fc1dbc82deb5cac5c32f9a6bcdb9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index a16871779f955d1792669d2fe0414d51666350a4..5d9bd11269766b710e4ceb03249ab625c65bf74b 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index c273279171900a0f74ec869ab887066b058076f6..26866b6a09e8b496b4bbedbc905cd056e286f6c9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index e0655b207761ebfc0a786c298a5f54e9f142e492..505b7e688b80134f0ca12c5181cbc2bb6c66f3c9 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index fd75ef486ed0d5c5baa9e732308decee496f8ca0..055e99c25a41713686e760102260c54730641db0 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 752cb26081ac8ffbafa64caadc688742883a8c63..4f15248f1abcc0a2f13e97eaff082f9e7165f8d7 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 8b095bedd402029a56d777bfe2effdcb94343542..af12dd2f3f8433a80ab90cba010cf8edb1c1c37b 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index a4436dd2785433276bb03e1619f3c074f5629770..cab29661ae7972310a6e4573a43af1ea10077e08 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index a3a70b6cf1736a41db987081cd78b8e679fef179..c8993084acc67515b47023a78bd99da652a65347 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 313f4164faf0ef47afff39ee01bd0bf23823eab2..c15ca444f0fc87fa97b816540ebd71001657ab49 100644 (file)
@@ -1,43 +1,38 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CpuId.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   AsmCpuid function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# UINT64\r
-# EFIAPI\r
-# InternalMathSwapBytes64 (\r
-#   IN      UINT64                    Operand\r
-#   );\r
-#------------------------------------------------------------------------------\r
-.globl ASM_PFX(InternalMathSwapBytes64)\r
-ASM_PFX(InternalMathSwapBytes64):\r
-    movl    8(%esp), %eax\r
-    movl    4(%esp), %edx\r
-    bswapl  %eax\r
-    bswapl  %edx\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CpuId.Asm
+#
+# Abstract:
+#
+#   AsmCpuid function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InternalMathSwapBytes64 (
+#   IN      UINT64                    Operand
+#   );
+#------------------------------------------------------------------------------
+.globl ASM_PFX(InternalMathSwapBytes64)
+ASM_PFX(InternalMathSwapBytes64):
+    movl    8(%esp), %eax
+    movl    4(%esp), %edx
+    bswapl  %eax
+    bswapl  %edx
+    ret
index ca72d0b544ea24e48765979abb03a80866f6c378..c45cdb0a2d6598a80971c7eacdc9dc72f58b41d2 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 9c31adc589348b74f3029f8efa83737c18960609..b19348dad9ffcba9616a525890990891fbc7f3c0 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 5cd75cf33d8767d4956e0d3b7ff5e8b0e36faa3d..6bce3a4d50895b402baf5c45a39890cbd784c806 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 8128e8363d1471d5c03185f8190e1409c5757195..64d2c1b5344da7d39400086d00229ece14646b1c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 06f7208297769aa825fed2b3eea1ec7fc5397046..767182ee4e75009613ba3a18ddb7260ee2454f85 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f748c1884adadc68167f6e467fd2784d92aee45c..dc6828ac91d1771880e54acc07e5c18da5445e4e 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f1fd87858d728d54d889ead8deaede2f41d6670c..c05af0ec1e4054d53a72de9184742b3e14e0b1ae 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 291e63736a04d345abe9dc6c45aea142052ae25c..87031768aca9c38788cb7d14d42be79c8d8b06ee 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 6b6a50a1986c8c861451da50cd3798e6cb3dc347..ca4e301b934bca426d94f677150f0c44fcc8c340 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 4201c4a1deada38e22730bdb28807585d39bf421..ed23db7e9000cb0011db1b1b79a50e701287ff47 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ef76bddd1687beaa95e802629c7bdea8f2849248..d17595213a2c71f0e0e8695a80719d110088fbb7 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f10b56e8ee4208fdf505a5687e3614d75d77e74a..7e3bb94f1f6bfb5890c3d9b1602521baa5d0ecf0 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 1cdd8160c1802d90b591ff8bbbecf6bbc9e7683a..0827f347bd48def019da54c6001e997f7aef8f9a 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index ce1e29b09cdf0aef9f59d0c501c152b08e6e87da..1f3e9166751d7d7abc569274cea9283e42860f18 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 07ec92e44c492c6ec9cd33dc612e7508508d908b..3aedf7dd68c932a726f79a6c832199daaa2b5711 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 739edde618bcd2aca44992ed42b4624e6801d5e6..c3e6ad33532f42ea0280f6c84cbf2d6cc0339094 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 1bb467833748ce813325b41e373928a593db1e79..8b2cc3c029773574be131290aabed53f919392fa 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 87a28165bc8b15b3ccb60c70800db3d697df543d..ef70763e524dcca2bd9302bd52c0e3b0c5e91be0 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 05182fb0fc1b833421bffd2e866b7ec0968770c9..74a3d711b51b61ba3034d90dab3a4e6f44741b6f 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index c34ceccf1be167c37a0d68f34149aaea9b695917..a3c548dcecde0fb5b3a647475df0298af0c56edd 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 01250e8f44b335073fd9be3a38106a7b9edef6a0..98b11a58188e806b7d2b6dbe3ddb9a8a84e59467 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index cc6ec7d17314e7c124e97be0d8b7e4722c0a277b..107c695cf7b2aa2c10baeff75417553ea85c66e5 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index b0909614b5f142f6c3eec390cc4a1ab26498c8ac..be6a6f78b2ed9dce12606cdc2c22b1c007e2432c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 6d657c6673b40efb2b6a25750b577a504290c389..51a89734600259a9161ef673e903e185205fef85 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 52c599c0fd15239c46d4c5e3da3944f353cd0563..824bbeae1754c80923871a912f4b788a24c78956 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index f310e887aba3ef924bd02893bae18873235faf50..5c12c981a9037d9f762d8aa6da5607ff2f9661aa 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessDbr.s b/MdePkg/Library/BaseLib/Ipf/AccessDbr.s
new file mode 100644 (file)
index 0000000..49d1fec
--- /dev/null
@@ -0,0 +1,118 @@
+/// @file\r
+///  IPF specific Debug Breakpoint Registers accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessDbr.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadDbr\r
+//\r
+// This routine is used to Reads the current value of Data Breakpoint Register (DBR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit DBR index to read.\r
+//\r
+// Return Value: The current value of DBR by Index.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadDbr, @function\r
+.proc   AsmReadDbr\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmReadDbr::\r
+        mov             r8 = dbr[in0];;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadDbr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteDbr\r
+//\r
+// This routine is used to write the current value to Data Breakpoint Register (DBR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit DBR index to read.\r
+//            The value should be written to DBR\r
+//\r
+// Return Value: The value written to DBR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteDbr, @function\r
+.proc   AsmWriteDbr\r
+.regstk 2, 0, 0, 0\r
+\r
+AsmWriteDbr::\r
+        mov             dbr[in0] = in1\r
+        mov             r8 = in1;;\r
+        srlz.d;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteDbr\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIbr\r
+//\r
+// This routine is used to Reads the current value of Instruction Breakpoint Register (IBR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit IBR index.\r
+//\r
+// Return Value: The current value of IBR by Index.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIbr, @function\r
+.proc   AsmReadIbr\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmReadIbr::\r
+        mov             r8 = ibr[in0];;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadIbr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteIbr\r
+//\r
+// This routine is used to write the current value to Instruction Breakpoint Register (IBR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit IBR index.\r
+//            The value should be written to IBR\r
+//\r
+// Return Value: The value written to IBR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteIbr, @function\r
+.proc   AsmWriteIbr\r
+.regstk 2, 0, 0, 0\r
+\r
+AsmWriteIbr::\r
+        mov             ibr[in0] = in1\r
+        mov             r8 = in1;;\r
+        srlz.i;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteIbr\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessEicr.s b/MdePkg/Library/BaseLib/Ipf/AccessEicr.s
new file mode 100644 (file)
index 0000000..03d7e03
--- /dev/null
@@ -0,0 +1,512 @@
+/// @file\r
+///  IPF specific External Interrupt Control Registers accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessEicr.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadLid\r
+//\r
+// This routine is used to read the value of Local Interrupt ID Register (LID).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of LID.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadLid, @function\r
+.proc   AsmReadLid\r
+\r
+AsmReadLid::\r
+         mov            r8 = cr.lid;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadLid\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteLid\r
+//\r
+// This routine is used to write the value to Local Interrupt ID Register (LID).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The value need to be written to LID.\r
+//\r
+// Return Value: The value written to LID.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteLid, @function\r
+.proc   AsmWriteLid\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteLid::\r
+         mov            cr.lid = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteLid\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIvr\r
+//\r
+// This routine is used to read the value of External Interrupt Vector Register (IVR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IVR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIvr, @function\r
+.proc   AsmReadIvr\r
+\r
+AsmReadIvr::\r
+         mov            r8 = cr.ivr;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIvr\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadTpr\r
+//\r
+// This routine is used to read the value of Task Priority Register (TPR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of TPR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadTpr, @function\r
+.proc   AsmReadTpr\r
+\r
+AsmReadTpr::\r
+         mov            r8 = cr.tpr;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadTpr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteTpr\r
+//\r
+// This routine is used to write the value to Task Priority Register (TPR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The value need to be written to TPR.\r
+//\r
+// Return Value: The value written to TPR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteTpr, @function\r
+.proc   AsmWriteTpr\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteTpr::\r
+         mov            cr.tpr = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteTpr\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteEoi\r
+//\r
+// This routine is used to write the value to End of External Interrupt Register (EOI).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The value need to be written to EOI.\r
+//\r
+// Return Value: The value written to EOI.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteEoi, @function\r
+.proc   AsmWriteEoi\r
+\r
+AsmWriteEoi::\r
+         mov            cr.eoi = r0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteEoi\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIrr0\r
+//\r
+// This routine is used to Read the value of External Interrupt Request Register 0 (IRR0).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IRR0.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIrr0, @function\r
+.proc   AsmReadIrr0\r
+\r
+AsmReadIrr0::\r
+         mov            r8 = cr.irr0;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIrr0\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIrr1\r
+//\r
+// This routine is used to Read the value of External Interrupt Request Register 1 (IRR1).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IRR1.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIrr1, @function\r
+.proc   AsmReadIrr1\r
+\r
+AsmReadIrr1::\r
+         mov            r8 = cr.irr1;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIrr1\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIrr2\r
+//\r
+// This routine is used to Read the value of External Interrupt Request Register 2 (IRR2).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IRR2.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIrr2, @function\r
+.proc   AsmReadIrr2\r
+\r
+AsmReadIrr2::\r
+         mov            r8 = cr.irr2;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIrr2\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIrr3\r
+//\r
+// This routine is used to Read the value of External Interrupt Request Register 3 (IRR3).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IRR3.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIrr3, @function\r
+.proc   AsmReadIrr3\r
+\r
+AsmReadIrr3::\r
+         mov            r8 = cr.irr3;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIrr3\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadItv\r
+//\r
+// This routine is used to Read the value of Interval Timer Vector Register (ITV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of ITV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadItv, @function\r
+.proc   AsmReadItv\r
+\r
+AsmReadItv::\r
+         mov            r8 = cr.itv;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadItv\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteItv\r
+//\r
+// This routine is used to write the value to Interval Timer Vector Register (ITV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to ITV\r
+//\r
+// Return Value: The value written to ITV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteItv, @function\r
+.proc   AsmWriteItv\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteItv::\r
+         mov            cr.itv = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteItv\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadPmv\r
+//\r
+// This routine is used to Read the value of Performance Monitoring Vector Register (PMV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of PMV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadPmv, @function\r
+.proc   AsmReadPmv\r
+\r
+AsmReadPmv::\r
+         mov            r8 = cr.pmv;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadPmv\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWritePmv\r
+//\r
+// This routine is used to write the value to Performance Monitoring Vector Register (PMV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to PMV\r
+//\r
+// Return Value: The value written to PMV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWritePmv, @function\r
+.proc   AsmWritePmv\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWritePmv::\r
+         mov            cr.pmv = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWritePmv\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadCmcv\r
+//\r
+// This routine is used to Read the value of Corrected Machine Check Vector Register (CMCV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of CMCV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadCmcv, @function\r
+.proc   AsmReadCmcv\r
+\r
+AsmReadCmcv::\r
+         mov            r8 = cr.cmcv;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadCmcv\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteCmcv\r
+//\r
+// This routine is used to write the value to Corrected Machine Check Vector Register (CMCV).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to CMCV\r
+//\r
+// Return Value: The value written to CMCV.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteCmcv, @function\r
+.proc   AsmWriteCmcv\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteCmcv::\r
+         mov            cr.cmcv = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteCmcv\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadLrr0\r
+//\r
+// This routine is used to read the value of Local Redirection Register 0 (LRR0).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of LRR0.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadLrr0, @function\r
+.proc   AsmReadLrr0\r
+\r
+AsmReadLrr0::\r
+         mov            r8 = cr.lrr0;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadLrr0\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteLrr0\r
+//\r
+// This routine is used to write the value to Local Redirection Register 0 (LRR0).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The value need to be written to LRR0.\r
+//\r
+// Return Value: The value written to LRR0.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteLrr0, @function\r
+.proc   AsmWriteLrr0\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteLrr0::\r
+         mov            cr.lrr0 = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteLrr0\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadLrr1\r
+//\r
+// This routine is used to read the value of Local Redirection Register 1 (LRR1).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of LRR1.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadLrr1, @function\r
+.proc   AsmReadLrr1\r
+\r
+AsmReadLrr1::\r
+         mov            r8 = cr.lrr1;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadLrr1\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteLrr1\r
+//\r
+// This routine is used to write the value to Local Redirection Register 1 (LRR1).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The value need to be written to LRR1.\r
+//\r
+// Return Value: The value written to LRR1.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteLrr1, @function\r
+.proc   AsmWriteLrr1\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteLrr1::\r
+         mov            cr.lrr1 = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteLrr1\r
+\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessGcr.s b/MdePkg/Library/BaseLib/Ipf/AccessGcr.s
new file mode 100644 (file)
index 0000000..54b3a30
--- /dev/null
@@ -0,0 +1,264 @@
+/// @file\r
+///  IPF specific Global Control Registers accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessGcr.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadDcr\r
+//\r
+// This routine is used to Read the value of Default Control Register (DCR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of DCR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadDcr, @function\r
+.proc   AsmReadDcr\r
+\r
+AsmReadDcr::\r
+         mov            r8 = cr.dcr;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadDcr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteDcr\r
+//\r
+// This routine is used to write the value to Default Control Register (DCR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to DCR\r
+//\r
+// Return Value: The value written to DCR.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteDcr, @function\r
+.proc   AsmWriteDcr\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteDcr::\r
+         mov            cr.dcr = in0\r
+         mov            r8 = in0;;\r
+         srlz.i;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteDcr\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadItc\r
+//\r
+// This routine is used to Read the value of Interval Timer Counter Register (ITC).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of ITC.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadItc, @function\r
+.proc   AsmReadItc\r
+\r
+AsmReadItc::\r
+         mov            r8 = ar.itc;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadItc\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteItc\r
+//\r
+// This routine is used to write the value to Interval Timer Counter Register (ITC).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to the ITC\r
+//\r
+// Return Value: The value written to the ITC.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteItc, @function\r
+.proc   AsmWriteItc\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteItc::\r
+         mov            ar.itc = in0\r
+         mov            r8 = in0;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteItc\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadItm\r
+//\r
+// This routine is used to Read the value of Interval Timer Match Register (ITM).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of ITM.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadItm, @function\r
+.proc   AsmReadItm\r
+\r
+AsmReadItm::\r
+         mov            r8 = cr.itm;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadItm\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteItm\r
+//\r
+// This routine is used to write the value to Interval Timer Match Register (ITM).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to ITM\r
+//\r
+// Return Value: The value written to ITM.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteItm, @function\r
+.proc   AsmWriteItm\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteItm::\r
+         mov            cr.itm = in0\r
+         mov            r8 = in0;;\r
+         srlz.d;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteItm\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadIva\r
+//\r
+// This routine is used to read the value of Interruption Vector Address Register (IVA).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of IVA.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadIva, @function\r
+.proc   AsmReadIva\r
+\r
+AsmReadIva::\r
+         mov            r8 = cr.iva;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadIva\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteIva\r
+//\r
+// This routine is used to write the value to Interruption Vector Address Register (IVA).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to IVA\r
+//\r
+// Return Value: The value written to IVA.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteIva, @function\r
+.proc   AsmWriteIva\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteIva::\r
+         mov            cr.iva = in0\r
+         mov            r8 = in0;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWriteIva\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadPta\r
+//\r
+// This routine is used to read the value of Page Table Address Register (PTA).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current value of PTA.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadPta, @function\r
+.proc   AsmReadPta\r
+\r
+AsmReadPta::\r
+         mov            r8 = cr.pta;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmReadPta\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWritePta\r
+//\r
+// This routine is used to write the value to Page Table Address Register (PTA)).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written to PTA\r
+//\r
+// Return Value: The value written to PTA.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWritePta, @function\r
+.proc   AsmWritePta\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWritePta::\r
+         mov            cr.pta = in0\r
+         mov            r8 = in0;;\r
+         srlz.i;;\r
+         srlz.d;;\r
+         br.ret.dpnt    b0;;\r
+.endp    AsmWritePta
\ No newline at end of file
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessGp.s b/MdePkg/Library/BaseLib/Ipf/AccessGp.s
new file mode 100644 (file)
index 0000000..5c5f20f
--- /dev/null
@@ -0,0 +1,86 @@
+/// @file\r
+///  IPF specific Global Pointer and Stack Pointer accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessGp.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadGp\r
+//\r
+// This routine is used to read the current value of 64-bit Global Pointer (GP).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current GP value.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadGp, @function\r
+.proc   AsmReadGp\r
+\r
+AsmReadGp::\r
+        mov             r8 = gp;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadGp\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteGp\r
+//\r
+// This routine is used to write the current value of 64-bit Global Pointer (GP).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written.\r
+//\r
+// Return Value: The value have been written.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteGp, @function\r
+.proc   AsmWriteGp\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteGp::\r
+        mov             gp = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteGp\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadSp\r
+//\r
+// This routine is used to read the current value of 64-bit Stack Pointer (SP).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current SP value.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadSp, @function\r
+.proc   AsmReadSp\r
+\r
+AsmReadSp::\r
+        mov             r8 = sp;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadSp\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessKr.s b/MdePkg/Library/BaseLib/Ipf/AccessKr.s
new file mode 100644 (file)
index 0000000..5a38954
--- /dev/null
@@ -0,0 +1,400 @@
+/// @file\r
+///  IPF specific AsmReadKrX() and AsmWriteKrX functions, 'X' is from '0' to '7'\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessKr.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr0\r
+//\r
+// This routine is used to get KR0.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR0.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr0, @function\r
+.proc   AsmReadKr0\r
+\r
+AsmReadKr0::\r
+        mov             r8 = ar.k0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr0\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr0\r
+//\r
+// This routine is used to Write KR0.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR0.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+\r
+.text\r
+.type   AsmWriteKr0, @function\r
+.proc   AsmWriteKr0\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWriteKr0::\r
+        mov             ar.k0 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr0\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr1\r
+//\r
+// This routine is used to get KR1.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR1.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr1, @function\r
+.proc   AsmReadKr1\r
+\r
+AsmReadKr1::\r
+        mov             r8 = ar.k1;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr1\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr1\r
+//\r
+// This routine is used to Write KR1.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR1.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr1, @function\r
+.proc   AsmWriteKr1\r
+\r
+AsmWriteKr1::\r
+        mov             ar.k1 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr1\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr2\r
+//\r
+// This routine is used to get KR2.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR2.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr2, @function\r
+.proc   AsmReadKr2\r
+\r
+AsmReadKr2::\r
+        mov             r8 = ar.k2;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr2\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr2\r
+//\r
+// This routine is used to Write KR2.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR2.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr2, @function\r
+.proc   AsmWriteKr2\r
+\r
+AsmWriteKr2::\r
+        mov             ar.k2 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr2\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr3\r
+//\r
+// This routine is used to get KR3.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR3.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr3, @function\r
+.proc   AsmReadKr3\r
+\r
+AsmReadKr3::\r
+        mov             r8 = ar.k3;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr3\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr3\r
+//\r
+// This routine is used to Write KR3.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR3.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr3, @function\r
+.proc   AsmWriteKr3\r
+\r
+AsmWriteKr3::\r
+        mov             ar.k3 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr3\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr4\r
+//\r
+// This routine is used to get KR4.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR4.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr4, @function\r
+.proc   AsmReadKr4\r
+\r
+AsmReadKr4::\r
+        mov             r8 = ar.k4;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr4\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr4\r
+//\r
+// This routine is used to Write KR4.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR4.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr4, @function\r
+.proc   AsmWriteKr4\r
+\r
+AsmWriteKr4::\r
+        mov             ar.k4 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr4\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr5\r
+//\r
+// This routine is used to get KR5.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR5.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr5, @function\r
+.proc   AsmReadKr5\r
+\r
+AsmReadKr5::\r
+        mov             r8 = ar.k5;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr5\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr5\r
+//\r
+// This routine is used to Write KR5.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR5.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr5, @function\r
+.proc   AsmWriteKr5\r
+\r
+AsmWriteKr5::\r
+        mov             ar.k5 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr5\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr6\r
+//\r
+// This routine is used to get KR6.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR6.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr6, @function\r
+.proc   AsmReadKr6\r
+\r
+AsmReadKr6::\r
+        mov             r8 = ar.k6;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr6\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr6\r
+//\r
+// This routine is used to write KR6.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR6.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr6, @function\r
+.proc   AsmWriteKr6\r
+\r
+AsmWriteKr6::\r
+        mov             ar.k6 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr6\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadKr7\r
+//\r
+// This routine is used to get KR7.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value store in KR7.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadKr7, @function\r
+.proc   AsmReadKr7\r
+\r
+AsmReadKr7::\r
+        mov             r8 = ar.k7;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadKr7\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWriteKr7\r
+//\r
+// This routine is used to write KR7.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  None.\r
+//\r
+// Return Value: The value written to the KR7.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWriteKr7, @function\r
+.proc   AsmWriteKr7\r
+\r
+AsmWriteKr7::\r
+        mov             ar.k7 = in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWriteKr7\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessPmr.s b/MdePkg/Library/BaseLib/Ipf/AccessPmr.s
new file mode 100644 (file)
index 0000000..cea376c
--- /dev/null
@@ -0,0 +1,124 @@
+/// @file\r
+///  IPF specific Performance Monitor Configuration/Data Registers accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessPmr.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadPmc\r
+//\r
+// This routine is used to Reads the current value of Performance Monitor Configuration Register (PMC).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit PMC index.\r
+//\r
+// Return Value: The current value of PMC by Index.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadPmc, @function\r
+.proc   AsmReadPmc\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmReadPmc::\r
+        srlz.i;;\r
+        srlz.d;;\r
+        mov             r8 = pmc[in0];;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadPmc\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWritePmc\r
+//\r
+// This routine is used to write the current value to a Performance Monitor Configuration Register (PMC).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit PMC index.\r
+//            The value should be written to PMC\r
+//\r
+// Return Value: The value written to PMC.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWritePmc, @function\r
+.proc   AsmWritePmc\r
+.regstk 2, 0, 0, 0\r
+\r
+AsmWritePmc::\r
+        mov             pmc[in0] = in1\r
+        mov             r8 = in1;;\r
+        srlz.i;;\r
+        srlz.d;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWritePmc\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadPmd\r
+//\r
+// This routine is used to Reads the current value of Performance Monitor Data Register (PMD).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit PMD index.\r
+//\r
+// Return Value: The current value of PMD by Index.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadPmd, @function\r
+.proc   AsmReadPmd\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmReadPmd::\r
+        srlz.i;;\r
+        srlz.d;;\r
+        mov             r8 = pmd[in0];;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadPmd\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWritePmd\r
+//\r
+// This routine is used to write the current value to Performance Monitor Data Register (PMD).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit PMD index.\r
+//            The value should be written to PMD\r
+//\r
+// Return Value: The value written to PMD.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWritePmd, @function\r
+.proc   AsmWritePmd\r
+.regstk 2, 0, 0, 0\r
+\r
+AsmWritePmd::\r
+        mov             pmd[in0] = in1\r
+        mov             r8 = in1;;\r
+        srlz.i;;\r
+        srlz.d;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWritePmd\r
diff --git a/MdePkg/Library/BaseLib/Ipf/AccessPsr.s b/MdePkg/Library/BaseLib/Ipf/AccessPsr.s
new file mode 100644 (file)
index 0000000..9b4fe49
--- /dev/null
@@ -0,0 +1,110 @@
+/// @file\r
+///  IPF specific Processor Status Register accessing functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: AccessPsr.s\r
+///\r
+///\r
+\r
+#define CpuModeMask           0x0000001008020000\r
+\r
+#define CpuInVirtualMode             0x1\r
+#define CpuInPhysicalMode            0x0\r
+#define CpuInMixMode                 (0x0 - 0x1)\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadPsr\r
+//\r
+// This routine is used to read the current value of Processor Status Register (PSR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :\r
+//\r
+// Return Value: The current PSR value.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadPsr, @function\r
+.proc   AsmReadPsr\r
+\r
+AsmReadPsr::\r
+        mov             r8 = psr;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmReadPsr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmWritePsr\r
+//\r
+// This routine is used to write the value of Processor Status Register (PSR).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The value need to be written.\r
+//\r
+// Return Value: The value have been written.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmWritePsr, @function\r
+.proc   AsmWritePsr\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmWritePsr::\r
+        mov             psr.l = in0\r
+        mov             r8 = in0;;\r
+        srlz.d;;\r
+        srlz.i;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmWritePsr\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmCpuVirtual\r
+//\r
+// This routine is used to determines if the CPU is currently executing\r
+// in virtual, physical, or mixed mode.\r
+//\r
+// If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned.\r
+// If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned.\r
+// If the CPU is not in physical mode or virtual mode, then it is in mixed mode,\r
+// and -1 is returned.\r
+//\r
+// Arguments:\r
+//\r
+// On Entry: None\r
+//\r
+// Return Value: The CPU mode flag\r
+//               return  1  The CPU is in virtual mode.\r
+//               return  0  The CPU is in physical mode.\r
+//               return -1  The CPU is in mixed mode.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmCpuVirtual, @function\r
+.proc   AsmCpuVirtual\r
+\r
+AsmCpuVirtual::\r
+        mov            r29 = psr\r
+        movl           r30 = CpuModeMask;;\r
+        and            r28 = r30, r29;;\r
+        cmp.eq         p6, p7 = r30, r28;;\r
+(p6)    mov            r8 = CpuInVirtualMode;;\r
+(p7)    cmp.eq         p6, p7 = 0x0, r28;;\r
+(p6)    mov            r8 = CpuInPhysicalMode;;\r
+(p7)    mov            r8 = CpuInMixMode;;\r
+        br.ret.dpnt    b0;;\r
+.endp   AsmCpuVirtual
\ No newline at end of file
diff --git a/MdePkg/Library/BaseLib/Ipf/AsmPalCall.s b/MdePkg/Library/BaseLib/Ipf/AsmPalCall.s
new file mode 100644 (file)
index 0000000..9e70a78
--- /dev/null
@@ -0,0 +1,158 @@
+/// @file\r
+///   Contains an implementation of CallPalProcStacked on Itanium-based\r
+///   architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  AsmPalCall.s\r
+///\r
+///\r
+\r
+\r
+//-----------------------------------------------------------------------------\r
+//++\r
+//  AsmPalCall\r
+//\r
+//  Makes a PAL procedure call.\r
+//  This is function to make a PAL procedure call.  Based on the Index\r
+//  value this API will make static or stacked PAL call.  The following table\r
+//  describes the usage of PAL Procedure Index Assignment. Architected procedures\r
+//  may be designated as required or optional.  If a PAL procedure is specified\r
+//  as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the\r
+//  Status field of the PAL_CALL_RETURN structure.\r
+//  This indicates that the procedure is not present in this PAL implementation.\r
+//  It is the caller¡¯s responsibility to check for this return code after calling\r
+//  any optional PAL procedure.\r
+//  No parameter checking is performed on the 5 input parameters, but there are\r
+//  some common rules that the caller should follow when making a PAL call.  Any\r
+//  address passed to PAL as buffers for return parameters must be 8-byte aligned.\r
+//  Unaligned addresses may cause undefined results.  For those parameters defined\r
+//  as reserved or some fields defined as reserved must be zero filled or the invalid\r
+//  argument return value may be returned or undefined result may occur during the\r
+//  execution of the procedure.  If the PalEntryPoint  does not point to a valid\r
+//  PAL entry point then the system behavior is undefined.  This function is only\r
+//  available on IPF.\r
+//\r
+//  On Entry :\r
+//           in0:  PAL_PROC entrypoint\r
+//           in1-in4 : PAL_PROC arguments\r
+//\r
+//  Return Value:\r
+//\r
+//  As per stacked calling conventions.\r
+//\r
+//--\r
+//---------------------------------------------------------------------------\r
+\r
+//\r
+// PAL function calls\r
+//\r
+#define PAL_MC_CLEAR_LOG               0x0015\r
+#define PAL_MC_DYNAMIC_STATE           0x0018\r
+#define PAL_MC_ERROR_INFO              0x0019\r
+#define PAL_MC_RESUME                  0x001a\r
+\r
+\r
+.text\r
+.proc AsmPalCall\r
+.type AsmPalCall, @function\r
+\r
+AsmPalCall::\r
+         alloc          loc1 = ar.pfs,5,8,4,0\r
+         mov            loc0 = b0\r
+         mov            loc3 = b5\r
+         mov            loc4 = r2\r
+         mov            loc7 = r1\r
+         mov            r2 = psr;;\r
+         mov            r28 = in1\r
+         mov            loc5 = r2;;\r
+\r
+         movl           loc6 = 0x100;;\r
+         cmp.ge         p6,p7 = r28,loc6;;\r
+\r
+(p6)     movl           loc6 = 0x1FF;;\r
+(p7)     br.dpnt.few PalCallStatic;;                  // 0 ~ 255 make a static Pal Call\r
+(p6)     cmp.le         p6,p7 = r28,loc6;;\r
+(p6)     br.dpnt.few PalCallStacked;;                 // 256 ~ 511 make a stacked Pal Call\r
+(p7)     movl           loc6 = 0x300;;\r
+(p7)     cmp.ge         p6,p7 = r28,loc6;;\r
+(p7)     br.dpnt.few PalCallStatic;;                  // 512 ~ 767 make a static Pal Call\r
+(p6)     movl           loc6 = 0x3FF;;\r
+(p6)     cmp.le         p6,p7 = r28,loc6;;\r
+(p6)     br.dpnt.few PalCallStacked;;                 // 768 ~ 1023 make a stacked Pal Call\r
+\r
+(p7)     mov            r8 = 0xFFFFFFFFFFFFFFFF;;     // > 1024 return invalid\r
+(p7)     br.dpnt.few    ComeBackFromPALCall;;\r
+\r
+PalCallStatic:\r
+         movl           loc6 = PAL_MC_CLEAR_LOG;;\r
+         cmp.eq         p6,p7 = r28,loc6;;\r
+\r
+(p7)     movl           loc6 = PAL_MC_DYNAMIC_STATE;;\r
+(p7)     cmp.eq         p6,p7 = r28,loc6;;\r
+\r
+(p7)     movl           loc6 = PAL_MC_ERROR_INFO;;\r
+(p7)     cmp.eq         p6,p7 = r28,loc6;;\r
+\r
+(p7)     movl           loc6 = PAL_MC_RESUME;;\r
+(p7)     cmp.eq         p6,p7 = r28,loc6 ;;\r
+\r
+         mov            loc6 = 0x1;;\r
+(p7)     dep            r2 = loc6,r2,13,1;;           // psr.ic = 1\r
+\r
+// p6 will be true, if it is one of the MCHK calls. There has been lots of debate\r
+// on psr.ic for these values. For now, do not do any thing to psr.ic\r
+\r
+         dep            r2 = r0,r2,14,1;;             // psr.i = 0\r
+\r
+         mov            psr.l = r2\r
+         srlz.d                                       // Needs data serailization.\r
+         srlz.i                                       // Needs instruction serailization.\r
+\r
+StaticGetPALLocalIP:\r
+         mov            loc2 = ip;;\r
+         add            loc2 = ComeBackFromPALCall - StaticGetPALLocalIP,loc2;;\r
+         mov            b0 = loc2                     // return address after Pal call\r
+\r
+         mov            r29 = in2\r
+         mov            r30 = in3\r
+         mov            r31 = in4\r
+         mov            b5 = in0;;                    // get the PalProcEntrypt from input\r
+         br.sptk        b5;;                          // Take the plunge.\r
+\r
+PalCallStacked:\r
+         dep            r2 = r0,r2,14,1;;             // psr.i = 0\r
+         mov            psr.l = r2;;\r
+         srlz.d                                       // Needs data serailization.\r
+         srlz.i                                       // Needs instruction serailization.\r
+\r
+StackedGetPALLocalIP:\r
+         mov            out0 = in1\r
+         mov            out1 = in2\r
+         mov            out2 = in3\r
+         mov            out3 = in4\r
+         mov            b5 =  in0 ;;                  // get the PalProcEntrypt from input\r
+         br.call.dpnt   b0 = b5 ;;                    // Take the plunge.\r
+\r
+ComeBackFromPALCall:\r
+         mov            psr.l = loc5 ;;\r
+         srlz.d                                       // Needs data serailization.\r
+         srlz.i                                       // Needs instruction serailization.\r
+\r
+         mov            b5 = loc3\r
+         mov            r2 = loc4\r
+         mov            r1 = loc7\r
+\r
+         mov            b0 = loc0\r
+         mov            ar.pfs = loc1;;\r
+         br.ret.dpnt    b0;;\r
+\r
+.endp AsmPalCall\r
+\r
diff --git a/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c b/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c
new file mode 100644 (file)
index 0000000..3dcbecf
--- /dev/null
@@ -0,0 +1,123 @@
+/** @file\r
+  Base Library CPU functions for Itanium\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
+//\r
+// Include common header file for this module.\r
+//\r
+#include <BaseLibInternals.h>\r
+\r
+//void __mfa (void);\r
+\r
+#pragma intrinsic (_enable)\r
+#pragma intrinsic (_disable)\r
+#pragma intrinsic (__break)\r
+#pragma intrinsic (__mfa)\r
+\r
+\r
+/**\r
+  Generates a breakpoint on the CPU.\r
+\r
+  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
+  that code can resume normal execution after the breakpoint.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+  VOID\r
+  )\r
+{\r
+  __break (0);\r
+}\r
+\r
+/**\r
+  Used to serialize load and store operations.\r
+\r
+  All loads and stores that proceed calls to this function are guaranteed to be\r
+  globally visible when this function returns.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+MemoryFence (\r
+  VOID\r
+  )\r
+{\r
+  __mfa ();\r
+}\r
+\r
+/**\r
+  Disables CPU interrupts.\r
+\r
+  Disables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  _disable ();\r
+}\r
+\r
+/**\r
+  Enables CPU interrupts.\r
+\r
+  Enables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  _enable ();\r
+}\r
+\r
+/**\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  EnableInterrupts ();\r
+  DisableInterrupts ();\r
+}\r
+\r
+/**\r
+  Places the CPU in a sleep state until an interrupt is received.\r
+\r
+  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+  are disabled prior to calling this function, then the CPU will be placed in a\r
+  sleep state indefinitely.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+  VOID\r
+  )\r
+{\r
+  PalCallStatic (NULL, 29, 0, 0, 0);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s b/MdePkg/Library/BaseLib/Ipf/CpuFlushTlb.s
new file mode 100644 (file)
index 0000000..520c51f
--- /dev/null
@@ -0,0 +1,58 @@
+/// @file\r
+///   CpuFlushTlb() function for Itanium-based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  CpuFlushTlb.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.globl PalCallStatic\r
+.type   PalCallStatic, @function\r
+\r
+.proc   CpuFlushTlb\r
+.type   CpuFlushTlb, @function\r
+CpuFlushTlb::\r
+        alloc               loc0 = ar.pfs, 0, 3, 5, 0\r
+        mov                 out0 = 0\r
+        mov                 out1 = 6\r
+        mov                 out2 = 0\r
+        mov                 out3 = 0\r
+        mov                 loc1 = b0\r
+        mov                 out4 = 0\r
+        brl.call.sptk       b0  = PalCallStatic\r
+        mov                 loc2 = psr              // save PSR\r
+        mov                 ar.pfs = loc0\r
+        extr.u              r14 = r10, 32, 32       // r14 <- count1\r
+        rsm                 1 << 14                 // Disable interrupts\r
+        extr.u              r15 = r11, 32, 32       // r15 <- stride1\r
+        extr.u              r10 = r10, 0, 32        // r10 <- count2\r
+        add                 r10 = -1, r10\r
+        extr.u              r11 = r11, 0, 32        // r11 <- stride2\r
+        br.cond.sptk        LoopPredicate\r
+LoopOuter:\r
+        mov                 ar.lc = r10             // LC <- count2\r
+        mov                 ar.ec = r0              // EC <- 0\r
+Loop:\r
+        ptc.e               r9\r
+        add                 r9 = r11, r9            // r9 += stride2\r
+        br.ctop.sptk        Loop\r
+        add                 r9 = r15, r9            // r9 += stride1\r
+LoopPredicate:\r
+        cmp.ne              p6 = r0, r14            // count1 == 0?\r
+        add                 r14 = -1, r14\r
+(p6)    br.cond.sptk        LoopOuter\r
+        mov                 psr.l = loc2\r
+        mov                 b0  = loc1\r
+        br.ret.sptk.many    b0\r
+.endp\r
diff --git a/MdePkg/Library/BaseLib/Ipf/CpuPause.s b/MdePkg/Library/BaseLib/Ipf/CpuPause.s
new file mode 100644 (file)
index 0000000..f52692f
--- /dev/null
@@ -0,0 +1,25 @@
+/// @file\r
+///   CpuPause() function for Itanium-based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  CpuPause.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   CpuPause\r
+.type   CpuPause, @function\r
+CpuPause::\r
+        hint                @pause\r
+        br.ret.sptk.many    b0\r
+.endp\r
diff --git a/MdePkg/Library/BaseLib/Ipf/ExecFc.s b/MdePkg/Library/BaseLib/Ipf/ExecFc.s
new file mode 100644 (file)
index 0000000..a5a9e9b
--- /dev/null
@@ -0,0 +1,66 @@
+/// @file\r
+///  IPF specific AsmFc() and AsmFci () functions\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: ExecFc.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmFc\r
+//\r
+// This routine is used to execute a FC instruction on the specific address.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The specific address need to execute FC instruction.\r
+//\r
+// Return Value: The specific address have been execute FC instruction.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmFc, @function\r
+.proc   AsmFc\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmFc::\r
+        fc              in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmFc\r
+\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmFci\r
+//\r
+// This routine is used to execute a FC.i instruction on the specific address.\r
+//\r
+// Arguments :\r
+//\r
+// On Entry :  The specific address need to execute FC.i instruction.\r
+//\r
+// Return Value: The specific address have been execute FC.i instruction.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmFci, @function\r
+.proc   AsmFci\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmFci::\r
+        fc.i            in0\r
+        mov             r8 = in0;;\r
+        br.ret.dpnt     b0;;\r
+.endp   AsmFci
\ No newline at end of file
diff --git a/MdePkg/Library/BaseLib/Ipf/FlushCacheRange.s b/MdePkg/Library/BaseLib/Ipf/FlushCacheRange.s
new file mode 100644 (file)
index 0000000..6e467f0
--- /dev/null
@@ -0,0 +1,96 @@
+//++\r
+// Copyright (c) 2006, Intel Corporation                                                         \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
+//  Module Name:\r
+//    FlushCacheRange.s \r
+//\r
+//  Abstract:\r
+//    Assemble routine to flush cache lines \r
+//\r
+// Revision History:\r
+//\r
+//--\r
+.file  "IpfCpuCache.s"\r
+\r
+#include  "IpfMacro.i"\r
+//#include  "IpfDefines.h"\r
+\r
+//\r
+//  Invalidates a range of instruction cache lines in the cache coherency domain\r
+//  of the calling CPU.\r
+//\r
+//  Invalidates the instruction cache lines specified by Address and Length. If\r
+//  Address is not aligned on a cache line boundary, then entire instruction\r
+//  cache line containing Address is invalidated. If Address + Length is not\r
+//  aligned on a cache line boundary, then the entire instruction cache line\r
+//  containing Address + Length -1 is invalidated. This function may choose to\r
+//  invalidate the entire instruction cache if that is more efficient than\r
+//  invalidating the specified range. If Length is 0, the no instruction cache\r
+//  lines are invalidated. Address is returned.\r
+//\r
+//  If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
+//\r
+//  @param  Address The base address of the instruction cache lines to\r
+//                  invalidate. If the CPU is in a physical addressing mode, then\r
+//                  Address is a physical address. If the CPU is in a virtual\r
+//                  addressing mode, then Address is a virtual address.\r
+//\r
+//  @param  Length  The number of bytes to invalidate from the instruction cache.\r
+//\r
+//  @return Address\r
+//  \r
+//  VOID *\r
+//  EFIAPI\r
+//  IpfFlushCacheRange (\r
+//    IN      VOID                      *Address,\r
+//    IN      UINTN                     Length\r
+//    );\r
+//\r
+PROCEDURE_ENTRY (IpfFlushCacheRange)\r
+\r
+      NESTED_SETUP (5,8,0,0)\r
+            \r
+      mov         loc2 = ar.lc\r
+      \r
+      mov         loc3 = in0                  // Start address.\r
+      mov         loc4 = in1;;                // Length in bytes.\r
+      \r
+      cmp.eq  p6,p7 = loc4, r0;;               // If Length is zero then don't flush any cache\r
+      (p6)  br.spnt.many DoneFlushingC;;         \r
+      \r
+      add         loc4 = loc4,loc3 \r
+      mov         loc5 = 1;;\r
+      sub         loc4 = loc4, loc5 ;; // the End address to flush\r
+                                         \r
+      dep         loc3 = r0,loc3,0,5          \r
+      dep         loc4 = r0,loc4,0,5;;         \r
+      shr         loc3 = loc3,5             \r
+      shr         loc4 = loc4,5;;    // 32 byte cache line\r
+      \r
+      sub         loc4 = loc4,loc3;; // total flush count, It should be add 1 but \r
+                                     // the br.cloop will first execute one time \r
+      mov         loc3 = in0                  \r
+      mov         loc5 = 32      \r
+      mov         ar.lc = loc4;;\r
+\r
+StillFlushingC:\r
+      fc          loc3;; \r
+      sync.i;;\r
+      srlz.i;;\r
+      add         loc3 = loc5,loc3;;\r
+      br.cloop.sptk.few StillFlushingC;;\r
+\r
+DoneFlushingC:      \r
+      mov         ar.lc = loc2     \r
+      mov          r8   = in0       // return *Address\r
+      NESTED_RETURN\r
+\r
+PROCEDURE_EXIT (IpfFlushCacheRange)\r
+\r
diff --git a/MdePkg/Library/BaseLib/Ipf/GetInterruptState.s b/MdePkg/Library/BaseLib/Ipf/GetInterruptState.s
new file mode 100644 (file)
index 0000000..d5b5fc8
--- /dev/null
@@ -0,0 +1,27 @@
+/// @file\r
+///   Retrieve of the interrupt state of the running processor for the Itanium\r
+///   architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  GetInterruptState.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   GetInterruptState\r
+.type   GetInterruptState, @function\r
+GetInterruptState::\r
+        mov                 r8  = psr\r
+        extr.u              r8  = r8, 14, 1\r
+        br.ret.sptk.many    b0\r
+.endp   GetInterruptState\r
diff --git a/MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange32.s b/MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange32.s
new file mode 100644 (file)
index 0000000..3a278d7
--- /dev/null
@@ -0,0 +1,29 @@
+/// @file\r
+///   Contains an implementation of InterlockedCompareExchange32 on Itanium-\r
+///   based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  InterlockedCompareExchange32.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   InternalSyncCompareExchange32\r
+.type   InternalSyncCompareExchange32, @function\r
+InternalSyncCompareExchange32::\r
+        zxt4                r33 = r33\r
+        mov                 ar.ccv = r33\r
+        cmpxchg4.rel        r8  = [r32], r34\r
+        mf\r
+        br.ret.sptk.many    b0\r
+.endp   InternalSyncCompareExchange32
\ No newline at end of file
diff --git a/MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange64.s b/MdePkg/Library/BaseLib/Ipf/InterlockedCompareExchange64.s
new file mode 100644 (file)
index 0000000..88b9d2b
--- /dev/null
@@ -0,0 +1,28 @@
+/// @file\r
+///   Contains an implementation of InterlockedCompareExchange64 on Itanium-\r
+///   based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  InterlockedCompareExchange64.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   InternalSyncCompareExchange64\r
+.type   InternalSyncCompareExchange64, @function\r
+InternalSyncCompareExchange64::\r
+        mov                 ar.ccv = r33\r
+        cmpxchg8.rel        r8  = [r32], r34\r
+        mf\r
+        br.ret.sptk.many    b0\r
+.endp   InternalSyncCompareExchange64
\ No newline at end of file
diff --git a/MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c b/MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c
new file mode 100644 (file)
index 0000000..60d0a37
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  SwitchStack() function for IPF.\r
+\r
+  Copyright (c) 2007, 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
+  Module Name:  InternalSwitchStack.c\r
+\r
+**/\r
+\r
+#include <BaseLibInternals.h>\r
+\r
+/**
+  Transfers control to a function starting with a new stack.
+
+  Transfers control to the function specified by EntryPoint using the
+  new stack specified by NewStack and passing in the parameters specified
+  by Context1 and Context2.  Context1 and Context2 are optional and may
+  be NULL.  The function EntryPoint must never return.
+  Marker will be ignored on IA-32, x64, and EBC.
+  IPF CPUs expect one additional parameter of type VOID * that specifies
+  the new backing store pointer.\r
+
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+
+  @param  EntryPoint  A pointer to function to call with the new stack.
+  @param  Context1    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  Context2    A pointer to the context to pass into the EntryPoint
+                      function.
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint
+                      function.\r
+  @param  Marker      VA_LIST marker for the variable argument list.
+
+**/\r
+VOID
+EFIAPI
+InternalSwitchStack (
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
+  IN      VOID                      *Context1,   OPTIONAL
+  IN      VOID                      *Context2,   OPTIONAL
+  IN      VOID                      *NewStack,
+  IN      VA_LIST                   Marker
+  )\r
+\r
+{\r
+  VOID                      *NewBsp;\r
+\r
+  //\r
+  // Get new backing store pointer from variable list\r
+  //\r
+  NewBsp   = VA_ARG (Marker, VOID *);\r
+\r
+  //\r
+  // Stack should be aligned with CPU_STACK_ALIGNMENT\r
+  //\r
+  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+  ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
+\r
+  AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ipf/PalCallStatic.s b/MdePkg/Library/BaseLib/Ipf/PalCallStatic.s
new file mode 100644 (file)
index 0000000..c21d742
--- /dev/null
@@ -0,0 +1,48 @@
+/// @file\r
+///   Contains an implementation of CallPalProcStatic on Itanium-based\r
+///   architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name:  PalCallStatic.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   PalCallStatic\r
+.type   PalCallStatic, @function\r
+.regstk 5, 0, 0, 0\r
+PalCallStatic::\r
+        cmp.eq              p15 = in0, r0\r
+        mov                 r31 = in4\r
+        mov                 r8  = ip\r
+\r
+(p15)   mov                 in0 = ar.k5\r
+        add                 r8  = (_PalProcReturn - PalCallStatic), r8\r
+        mov                 r30 = in3\r
+\r
+        mov                 in4 = psr\r
+        mov                 in3 = b0\r
+        mov                 b7  = in0\r
+\r
+        rsm                 1 << 14                 // Disable interrupts\r
+        mov                 r29 = in2\r
+        mov                 r28 = in1\r
+\r
+        mov                 b0  = r8\r
+        br.cond.sptk.many   b7\r
+\r
+_PalProcReturn:\r
+        mov                 psr.l = in4\r
+        mov                 b0  = in3\r
+        br.ret.sptk.many    b0\r
+.endp   PalCallStatic\r
diff --git a/MdePkg/Library/BaseLib/Ipf/ReadCpuid.s b/MdePkg/Library/BaseLib/Ipf/ReadCpuid.s
new file mode 100644 (file)
index 0000000..2176dad
--- /dev/null
@@ -0,0 +1,40 @@
+/// @file\r
+///  IPF specific AsmReadCpuid()function\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: ReadCpuid.s\r
+///\r
+///\r
+\r
+//---------------------------------------------------------------------------------\r
+//++\r
+// AsmReadCpuid\r
+//\r
+// This routine is used to Reads the current value of Processor Identifier Register (CPUID).\r
+//\r
+// Arguments :\r
+//\r
+// On Entry : The 8-bit Processor Identifier Register index to read.\r
+//\r
+// Return Value: The current value of Processor Identifier Register specified by Index.\r
+//\r
+//--\r
+//----------------------------------------------------------------------------------\r
+.text\r
+.type   AsmReadCpuid, @function\r
+.proc   AsmReadCpuid\r
+.regstk 1, 0, 0, 0\r
+\r
+AsmReadCpuid::\r
+        mov             r8 = cpuid[in0];;\r
+        br.ret.dpnt     b0;;\r
+.endp    AsmReadCpuid\r
+\r
diff --git a/MdePkg/Library/BaseLib/Ipf/SwitchStack.s b/MdePkg/Library/BaseLib/Ipf/SwitchStack.s
new file mode 100644 (file)
index 0000000..a3c524f
--- /dev/null
@@ -0,0 +1,50 @@
+/// @file\r
+///  IPF specific SwitchStack() function\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: SwitchStack.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   AsmSwitchStackAndBackingStore\r
+.type   AsmSwitchStackAndBackingStore, @function\r
+.regstk 5, 0, 0, 0\r
+AsmSwitchStackAndBackingStore::\r
+        mov                 r14 = ar.rsc\r
+        movl                r2  = ~((((1 << 14) - 1) << 16) | 3)\r
+\r
+        mov                 r17 = in1\r
+        mov                 r18 = in2\r
+        and                 r2  = r14, r2\r
+\r
+        mov                 ar.rsc = r2\r
+        mov                 sp  = in3\r
+        mov                 r19 = in4\r
+\r
+        ld8.nt1             r16 = [in0], 8\r
+        ld8.nta             gp  = [in0]\r
+        mov                 r3  = -1\r
+\r
+        loadrs\r
+        mov                 ar.bspstore = r19\r
+        mov                 b7  = r16\r
+\r
+        alloc               r2  = ar.pfs, 0, 0, 2, 0\r
+        mov                 out0 = r17\r
+        mov                 out1 = r18\r
+\r
+        mov                 ar.rnat = r3\r
+        mov                 ar.rsc = r14\r
+        br.call.sptk.many   b0  = b7\r
+.endp   AsmSwitchStackAndBackingStore\r
diff --git a/MdePkg/Library/BaseLib/Ipf/Synchronization.c b/MdePkg/Library/BaseLib/Ipf/Synchronization.c
new file mode 100644 (file)
index 0000000..c29a876
--- /dev/null
@@ -0,0 +1,79 @@
+/** @file\r
+  Implementation of synchronization functions on Itanium.\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
+  Module Name:  Synchronization.c\r
+\r
+**/\r
+\r
+#include "BaseLibInternals.h"\r
+\r
+/**\r
+  Performs an atomic increment of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic increment of the 32-bit unsigned integer specified by\r
+  Value and returns the incremented value. The increment operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  @param  Value A pointer to the 32-bit value to increment.\r
+\r
+  @return The incremented value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InternalSyncIncrement (\r
+  IN      volatile UINT32           *Value\r
+  )\r
+{\r
+  UINT32                            OriginalValue;\r
+\r
+  do {\r
+    OriginalValue = *Value;\r
+  } while (OriginalValue != InternalSyncCompareExchange32 (\r
+                              Value,\r
+                              OriginalValue,\r
+                              OriginalValue + 1\r
+                              ));\r
+  return OriginalValue + 1;\r
+}\r
+\r
+/**\r
+  Performs an atomic decrement of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic decrement of the 32-bit unsigned integer specified by\r
+  Value and returns the decrement value. The decrement operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  @param  Value A pointer to the 32-bit value to decrement.\r
+\r
+  @return The decrement value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InternalSyncDecrement (\r
+  IN      volatile UINT32           *Value\r
+  )\r
+{\r
+  UINT32                            OriginalValue;\r
+\r
+  do {\r
+    OriginalValue = *Value;\r
+  } while (OriginalValue != InternalSyncCompareExchange32 (\r
+                              Value,\r
+                              OriginalValue,\r
+                              OriginalValue - 1\r
+                              ));\r
+  return OriginalValue - 1;\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ipf/Unaligned.c b/MdePkg/Library/BaseLib/Ipf/Unaligned.c
new file mode 100644 (file)
index 0000000..1c4a937
--- /dev/null
@@ -0,0 +1,248 @@
+/** @file\r
+  Unaligned access functions of BaseLib for IPF.\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
+  Module Name:  Unaligned.c\r
+\r
+**/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include <BaseLibInternals.h>\r
+\r
+/**\r
+  Reads a 16-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 16-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 16-bit value that may be unaligned.\r
+\r
+  @return *Uint16\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+ReadUnaligned16 (\r
+  IN      CONST UINT16              *Buffer\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  return (UINT16)(((UINT8*)Buffer)[0] | (((UINT8*)Buffer)[1] << 8));\r
+}\r
+\r
+/**\r
+  Writes a 16-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 16-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 16-bit value that may be unaligned.\r
+  @param  Value   16-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+WriteUnaligned16 (\r
+  OUT     UINT16                    *Buffer,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  ((UINT8*)Buffer)[0] = (UINT8)Value;\r
+  ((UINT8*)Buffer)[1] = (UINT8)(Value >> 8);\r
+\r
+  return Value;\r
+}\r
+\r
+/**\r
+  Reads a 24-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 24-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 24-bit value that may be unaligned.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ReadUnaligned24 (\r
+  IN      CONST UINT32              *Buffer\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  return (UINT32)(\r
+            ReadUnaligned16 ((UINT16*)Buffer) |\r
+            (((UINT8*)Buffer)[2] << 16)\r
+            );\r
+}\r
+\r
+/**\r
+  Writes a 24-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 24-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 24-bit value that may be unaligned.\r
+  @param  Value   24-bit value to write to Buffer.\r
+\r
+  @return The value written.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+WriteUnaligned24 (\r
+  OUT     UINT32                    *Buffer,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);\r
+  *(UINT8*)((UINT16*)Buffer + 1) = (UINT8)(Value >> 16);\r
+  return Value;\r
+}\r
+\r
+/**\r
+  Reads a 32-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 32-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 32-bit value that may be unaligned.\r
+\r
+  @return *Uint32\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ReadUnaligned32 (\r
+  IN      CONST UINT32              *Buffer\r
+  )\r
+{\r
+  UINT16  LowerBytes;\r
+  UINT16  HigherBytes;\r
+\r
+  ASSERT (Buffer != NULL);\r
+\r
+  LowerBytes  = ReadUnaligned16 ((UINT16*) Buffer);\r
+  HigherBytes = ReadUnaligned16 ((UINT16*) Buffer + 1);\r
+\r
+  return (UINT32) (LowerBytes | (HigherBytes << 16));\r
+}\r
+\r
+/**\r
+  Writes a 32-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 32-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 32-bit value that may be unaligned.\r
+  @param  Value   32-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+WriteUnaligned32 (\r
+  OUT     UINT32                    *Buffer,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);\r
+  WriteUnaligned16 ((UINT16*)Buffer + 1, (UINT16)(Value >> 16));\r
+  return Value;\r
+}\r
+\r
+/**\r
+  Reads a 64-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 64-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 64-bit value that may be unaligned.\r
+\r
+  @return *Uint64\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+ReadUnaligned64 (\r
+  IN      CONST UINT64              *Buffer\r
+  )\r
+{\r
+  UINT32  LowerBytes;\r
+  UINT32  HigherBytes;\r
+\r
+  ASSERT (Buffer != NULL);\r
+\r
+  LowerBytes  = ReadUnaligned32 ((UINT32*) Buffer);\r
+  HigherBytes = ReadUnaligned32 ((UINT32*) Buffer + 1);\r
+\r
+  return (UINT64) (LowerBytes | LShiftU64 (HigherBytes, 32));\r
+}\r
+\r
+/**\r
+  Writes a 64-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 64-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 64-bit value that may be unaligned.\r
+  @param  Value   64-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+WriteUnaligned64 (\r
+  OUT     UINT64                    *Buffer,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  ASSERT (Buffer != NULL);\r
+\r
+  WriteUnaligned32 ((UINT32*)Buffer, (UINT32)Value);\r
+  WriteUnaligned32 ((UINT32*)Buffer + 1, (UINT32)RShiftU64 (Value, 32));\r
+  return Value;\r
+}\r
diff --git a/MdePkg/Library/BaseLib/Ipf/asm.h b/MdePkg/Library/BaseLib/Ipf/asm.h
new file mode 100644 (file)
index 0000000..8ef0b30
--- /dev/null
@@ -0,0 +1,27 @@
+/// @file\r
+///   This module contains generic macros for an assembly writer.\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
+/// Module Name: asm.h\r
+///\r
+#ifndef _ASM_H\r
+#define _ASM_H\r
+\r
+#define TRUE  1\r
+#define FALSE 0\r
+#define PROCEDURE_ENTRY(name)   .##text;            \\r
+  .##type name, @function; \\r
+  .##proc name; \\r
+  name::\r
+\r
+#define PROCEDURE_EXIT(name)  .##endp name\r
+\r
+#endif // _ASM_H\r
diff --git a/MdePkg/Library/BaseLib/Ipf/ia_64gen.h b/MdePkg/Library/BaseLib/Ipf/ia_64gen.h
new file mode 100644 (file)
index 0000000..081cc4a
--- /dev/null
@@ -0,0 +1,205 @@
+/// @file\r
+/// \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
+/// Module Name: ia_64gen.h\r
+///\r
+#ifndef _IA64GEN_H\r
+#define _IA64GEN_H\r
+\r
+#define TT_UNAT           0\r
+#define C_PSR             0\r
+#define J_UNAT            0\r
+#define T_TYPE            0\r
+#define T_IPSR            0x8\r
+#define T_ISR             0x10\r
+#define T_IIP             0x18\r
+#define T_IFA             0x20\r
+#define T_IIPA            0x28\r
+#define T_IFS             0x30\r
+#define T_IIM             0x38\r
+#define T_RSC             0x40\r
+#define T_BSP             0x48\r
+#define T_BSPSTORE        0x50\r
+#define T_RNAT            0x58\r
+#define T_PFS             0x60\r
+#define T_KBSPSTORE       0x68\r
+#define T_UNAT            0x70\r
+#define T_CCV             0x78\r
+#define T_DCR             0x80\r
+#define T_PREDS           0x88\r
+#define T_NATS            0x90\r
+#define T_R1              0x98\r
+#define T_GP              0x98\r
+#define T_R2              0xa0\r
+#define T_R3              0xa8\r
+#define T_R4              0xb0\r
+#define T_R5              0xb8\r
+#define T_R6              0xc0\r
+#define T_R7              0xc8\r
+#define T_R8              0xd0\r
+#define T_R9              0xd8\r
+#define T_R10             0xe0\r
+#define T_R11             0xe8\r
+#define T_R12             0xf0\r
+#define T_SP              0xf0\r
+#define T_R13             0xf8\r
+#define T_R14             0x100\r
+#define T_R15             0x108\r
+#define T_R16             0x110\r
+#define T_R17             0x118\r
+#define T_R18             0x120\r
+#define T_R19             0x128\r
+#define T_R20             0x130\r
+#define T_R21             0x138\r
+#define T_R22             0x140\r
+#define T_R23             0x148\r
+#define T_R24             0x150\r
+#define T_R25             0x158\r
+#define T_R26             0x160\r
+#define T_R27             0x168\r
+#define T_R28             0x170\r
+#define T_R29             0x178\r
+#define T_R30             0x180\r
+#define T_R31             0x188\r
+#define T_F2              0x1f0\r
+#define T_F3              0x200\r
+#define T_F4              0x210\r
+#define T_F5              0x220\r
+#define T_F6              0x230\r
+#define T_F7              0x240\r
+#define T_F8              0x250\r
+#define T_F9              0x260\r
+#define T_F10             0x270\r
+#define T_F11             0x280\r
+#define T_F12             0x290\r
+#define T_F13             0x2a0\r
+#define T_F14             0x2b0\r
+#define T_F15             0x2c0\r
+#define T_F16             0x2d0\r
+#define T_F17             0x2e0\r
+#define T_F18             0x2f0\r
+#define T_F19             0x300\r
+#define T_F20             0x310\r
+#define T_F21             0x320\r
+#define T_F22             0x330\r
+#define T_F23             0x340\r
+#define T_F24             0x350\r
+#define T_F25             0x360\r
+#define T_F26             0x370\r
+#define T_F27             0x380\r
+#define T_F28             0x390\r
+#define T_F29             0x3a0\r
+#define T_F30             0x3b0\r
+#define T_F31             0x3c0\r
+#define T_FPSR            0x1e0\r
+#define T_B0              0x190\r
+#define T_B1              0x198\r
+#define T_B2              0x1a0\r
+#define T_B3              0x1a8\r
+#define T_B4              0x1b0\r
+#define T_B5              0x1b8\r
+#define T_B6              0x1c0\r
+#define T_B7              0x1c8\r
+#define T_EC              0x1d0\r
+#define T_LC              0x1d8\r
+#define J_NATS            0x8\r
+#define J_PFS             0x10\r
+#define J_BSP             0x18\r
+#define J_RNAT            0x20\r
+#define J_PREDS           0x28\r
+#define J_LC              0x30\r
+#define J_R4              0x38\r
+#define J_R5              0x40\r
+#define J_R6              0x48\r
+#define J_R7              0x50\r
+#define J_SP              0x58\r
+#define J_F2              0x60\r
+#define J_F3              0x70\r
+#define J_F4              0x80\r
+#define J_F5              0x90\r
+#define J_F16             0xa0\r
+#define J_F17             0xb0\r
+#define J_F18             0xc0\r
+#define J_F19             0xd0\r
+#define J_F20             0xe0\r
+#define J_F21             0xf0\r
+#define J_F22             0x100\r
+#define J_F23             0x110\r
+#define J_F24             0x120\r
+#define J_F25             0x130\r
+#define J_F26             0x140\r
+#define J_F27             0x150\r
+#define J_F28             0x160\r
+#define J_F29             0x170\r
+#define J_F30             0x180\r
+#define J_F31             0x190\r
+#define J_FPSR            0x1a0\r
+#define J_B0              0x1a8\r
+#define J_B1              0x1b0\r
+#define J_B2              0x1b8\r
+#define J_B3              0x1c0\r
+#define J_B4              0x1c8\r
+#define J_B5              0x1d0\r
+#define TRAP_FRAME_LENGTH 0x3d0\r
+#define C_UNAT            0x28\r
+#define C_NATS            0x30\r
+#define C_PFS             0x8\r
+#define C_BSPSTORE        0x10\r
+#define C_RNAT            0x18\r
+#define C_RSC             0x20\r
+#define C_PREDS           0x38\r
+#define C_LC              0x40\r
+#define C_DCR             0x48\r
+#define C_R1              0x50\r
+#define C_GP              0x50\r
+#define C_R4              0x58\r
+#define C_R5              0x60\r
+#define C_R6              0x68\r
+#define C_R7              0x70\r
+#define C_SP              0x78\r
+#define C_R13             0x80\r
+#define C_F2              0x90\r
+#define C_F3              0xa0\r
+#define C_F4              0xb0\r
+#define C_F5              0xc0\r
+#define C_F16             0xd0\r
+#define C_F17             0xe0\r
+#define C_F18             0xf0\r
+#define C_F19             0x100\r
+#define C_F20             0x110\r
+#define C_F21             0x120\r
+#define C_F22             0x130\r
+#define C_F23             0x140\r
+#define C_F24             0x150\r
+#define C_F25             0x160\r
+#define C_F26             0x170\r
+#define C_F27             0x180\r
+#define C_F28             0x190\r
+#define C_F29             0x1a0\r
+#define C_F30             0x1b0\r
+#define C_F31             0x1c0\r
+#define C_FPSR            0x1d0\r
+#define C_B0              0x1d8\r
+#define C_B1              0x1e0\r
+#define C_B2              0x1e8\r
+#define C_B3              0x1f0\r
+#define C_B4              0x1f8\r
+#define C_B5              0x200\r
+#define TT_R2             0x8\r
+#define TT_R3             0x10\r
+#define TT_R8             0x18\r
+#define TT_R9             0x20\r
+#define TT_R10            0x28\r
+#define TT_R11            0x30\r
+#define TT_R14            0x38\r
+\r
+#endif _IA64GEN_H\r
diff --git a/MdePkg/Library/BaseLib/Ipf/longjmp.s b/MdePkg/Library/BaseLib/Ipf/longjmp.s
new file mode 100644 (file)
index 0000000..20a0df1
--- /dev/null
@@ -0,0 +1,121 @@
+/// @file\r
+///  Contains an implementation of longjmp for the Itanium-based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: longjmp.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   InternalLongJump\r
+.type   InternalLongJump, @function\r
+.regstk 2, 0, 0, 0\r
+InternalLongJump::\r
+        add                 r10 = 0x10*20 + 8*14, in0\r
+        movl                r2  = ~((((1 << 14) - 1) << 16) | 3)\r
+\r
+        ld8.nt1             r14 = [r10], -8*2       // BSP, skip PFS\r
+        mov                 r15 = ar.bspstore       // BSPSTORE\r
+\r
+        ld8.nt1             r17 = [r10], -8         // UNAT after spill\r
+        mov                 r16 = ar.rsc            // RSC\r
+        cmp.leu             p6  = r14, r15\r
+\r
+        ld8.nt1             r18 = [r10], -8         // UNAT\r
+        ld8.nt1             r25 = [r10], -8         // b5\r
+        and                 r2  = r16, r2\r
+\r
+        ldf.fill.nt1        f2  = [in0], 0x10\r
+        ld8.nt1             r24 = [r10], -8         // b4\r
+        mov                 b5  = r25\r
+\r
+        mov                 ar.rsc = r2\r
+        ld8.nt1             r23 = [r10], -8         // b3\r
+        mov                 b4  = r24\r
+\r
+        ldf.fill.nt1        f3  = [in0], 0x10\r
+        mov                 ar.unat = r17\r
+(p6)    br.spnt.many        _skip_flushrs\r
+\r
+        flushrs\r
+        mov                 r15 = ar.bsp            // New BSPSTORE\r
+\r
+_skip_flushrs:\r
+        mov                 r31 = ar.rnat           // RNAT\r
+        loadrs\r
+\r
+        ldf.fill.nt1        f4  = [in0], 0x10\r
+        ld8.nt1             r22 = [r10], -8\r
+        dep                 r2  = -1, r14, 3, 6\r
+\r
+        ldf.fill.nt1        f5  = [in0], 0x10\r
+        ld8.nt1             r21 = [r10], -8\r
+        cmp.ltu             p6  = r2, r15\r
+\r
+        ld8.nt1             r20 = [r10], -0x10      // skip sp\r
+(p6)    ld8.nta             r31 = [r2]\r
+        mov                 b3  = r23\r
+\r
+        ldf.fill.nt1        f16 = [in0], 0x10\r
+        ld8.fill.nt1        r7  = [r10], -8\r
+        mov                 b2  = r22\r
+\r
+        ldf.fill.nt1        f17 = [in0], 0x10\r
+        ld8.fill.nt1        r6  = [r10], -8\r
+        mov                 b1  = r21\r
+\r
+        ldf.fill.nt1        f18 = [in0], 0x10\r
+        ld8.fill.nt1        r5  = [r10], -8\r
+        mov                 b0  = r20\r
+\r
+        ldf.fill.nt1        f19 = [in0], 0x10\r
+        ld8.fill.nt1        r4  = [r10], 8*13\r
+\r
+        ldf.fill.nt1        f20 = [in0], 0x10\r
+        ld8.nt1             r19 = [r10], 0x10       // PFS\r
+\r
+        ldf.fill.nt1        f21 = [in0], 0x10\r
+        ld8.nt1             r26 = [r10], 8          // Predicate\r
+        mov                 ar.pfs = r19\r
+\r
+        ldf.fill.nt1        f22 = [in0], 0x10\r
+        ld8.nt1             r27 = [r10], 8          // LC\r
+        mov                 pr  = r26, -1\r
+\r
+        ldf.fill.nt1        f23 = [in0], 0x10\r
+        ld8.nt1             r28 = [r10], -17*8 - 0x10\r
+        mov                 ar.lc = r27\r
+\r
+        ldf.fill.nt1        f24 = [in0], 0x10\r
+        ldf.fill.nt1        f25 = [in0], 0x10\r
+        mov                 r8  = in1\r
+\r
+        ldf.fill.nt1        f26 = [in0], 0x10\r
+        ldf.fill.nt1        f31 = [r10], -0x10\r
+\r
+        ldf.fill.nt1        f27 = [in0], 0x10\r
+        ldf.fill.nt1        f30 = [r10], -0x10\r
+\r
+        ldf.fill.nt1        f28 = [in0]\r
+        ldf.fill.nt1        f29 = [r10], 0x10*3 + 8*4\r
+\r
+        ld8.fill.nt1        sp  = [r10]\r
+        mov                 ar.unat = r18\r
+\r
+        mov                 ar.bspstore = r14\r
+        mov                 ar.rnat = r31\r
+\r
+        invala\r
+        mov                 ar.rsc = r16\r
+        br.ret.sptk         b0\r
+.endp\r
diff --git a/MdePkg/Library/BaseLib/Ipf/setjmp.s b/MdePkg/Library/BaseLib/Ipf/setjmp.s
new file mode 100644 (file)
index 0000000..e2b346e
--- /dev/null
@@ -0,0 +1,108 @@
+/// @file\r
+///  Contains an implementation of longjmp for the Itanium-based architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\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
+/// Module Name: longjmp.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.globl InternalAssertJumpBuffer\r
+.type   InternalAssertJumpBuffer, @function\r
+\r
+.proc   SetJump\r
+.type   SetJump, @function\r
+SetJump::\r
+        alloc               loc0 = ar.pfs, 1, 2, 1, 0\r
+        mov                 loc1 = b0\r
+        mov                 out0 = in0\r
+\r
+        brl.call.sptk.many  b0  = InternalAssertJumpBuffer\r
+\r
+        mov                 r14 = ar.unat\r
+        mov                 r15 = ar.bsp\r
+        add                 r10 = 0x10*20, in0\r
+\r
+        stf.spill.nta       [in0] = f2, 0x10\r
+        st8.spill.nta       [r10] = r4, 8\r
+        mov                 r21 = b1\r
+\r
+        stf.spill.nta       [in0] = f3, 0x10\r
+        st8.spill.nta       [r10] = r5, 8\r
+        mov                 r22 = b2\r
+\r
+        stf.spill.nta       [in0] = f4, 0x10\r
+        st8.spill.nta       [r10] = r6, 8\r
+        mov                 r23 = b3\r
+\r
+        stf.spill.nta       [in0] = f5, 0x10\r
+        st8.spill.nta       [r10] = r7, 8\r
+        mov                 r24 = b4\r
+\r
+        stf.spill.nta       [in0] = f16, 0x10\r
+        st8.spill.nta       [r10] = sp, 8\r
+        mov                 r25 = b5\r
+\r
+        stf.spill.nta       [in0] = f17, 0x10\r
+        st8.nta             [r10] = loc1, 8\r
+        mov                 r16 = pr\r
+\r
+        stf.spill.nta       [in0] = f18, 0x10\r
+        st8.nta             [r10] = r21, 8\r
+        mov                 r17 = ar.lc\r
+\r
+        stf.spill.nta       [in0] = f19, 0x10\r
+        st8.nta             [r10] = r22, 8\r
+\r
+        stf.spill.nta       [in0] = f20, 0x10\r
+        st8.nta             [r10] = r23, 8\r
+\r
+        stf.spill.nta       [in0] = f21, 0x10\r
+        st8.nta             [r10] = r24, 8\r
+\r
+        stf.spill.nta       [in0] = f22, 0x10\r
+        st8.nta             [r10] = r25, 8\r
+\r
+        stf.spill.nta       [in0] = f23, 0x10\r
+        mov                 r18 = ar.unat\r
+\r
+        stf.spill.nta       [in0] = f24, 0x10\r
+        st8.nta             [r10] = r14, 8          // UNAT\r
+\r
+        stf.spill.nta       [in0] = f25, 0x10\r
+        st8.nta             [r10] = r18, 8          // UNAT after spill\r
+\r
+        stf.spill.nta       [in0] = f26, 0x10\r
+        st8.nta             [r10] = loc0, 8         // PFS\r
+\r
+        stf.spill.nta       [in0] = f27, 0x10\r
+        st8.nta             [r10] = r15, 8          // BSP\r
+        mov                 r8  = 0\r
+\r
+        stf.spill.nta       [in0] = f28, 0x10\r
+        mov                 r19 = ar.fpsr\r
+\r
+        stf.spill.nta       [in0] = f29, 0x10\r
+        st8.nta             [r10] = r16, 8          // PR\r
+        mov                 ar.pfs = loc0\r
+\r
+        stf.spill.nta       [in0] = f30, 0x10\r
+        st8.nta             [r10] = r17, 8          // LC\r
+        mov                 b0  = loc1\r
+\r
+        stf.spill.nta       [in0] = f31, 0x10\r
+        st8.nta             [r10] = r19             // FPSR\r
+\r
+        mov                 ar.unat = r14\r
+        br.ret.sptk         b0\r
+.endp   SetJump\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.S b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.S
new file mode 100644 (file)
index 0000000..710006b
--- /dev/null
@@ -0,0 +1,25 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CpuBreakpoint.S
+#
+# Abstract:
+#
+#   Implementation of CpuBreakpoint() on x86_64
+#
+#------------------------------------------------------------------------------
+
+.global _CpuBreakpoint
+_CpuBreakpoint:
+       int $0x3
+       ret
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.asm
new file mode 100644 (file)
index 0000000..f1ebe47
--- /dev/null
@@ -0,0 +1,37 @@
+;------------------------------------------------------------------------------ ;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CpuBreakpoint.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CpuBreakpoint function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; CpuBreakpoint (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+CpuBreakpoint   PROC\r
+    int  3\r
+    ret\r
+CpuBreakpoint   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
new file mode 100644 (file)
index 0000000..01939e9
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  CpuBreakpoint function.\r
+\r
+  Copyright (c) 2006 - 2007, 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
+\r
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+void __debugbreak ();\r
+\r
+#pragma intrinsic(__debugbreak)\r
+\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+  VOID\r
+  )\r
+{\r
+  __debugbreak ();\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuFlushTlb.S b/MdePkg/Library/BaseLib/X64/CpuFlushTlb.S
new file mode 100644 (file)
index 0000000..2dbaf84
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------ \r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   CpuFlushTlb.Asm\r
+#\r
+# Abstract:\r
+#\r
+#   CpuFlushTlb function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+.global _CpuFlushTlb\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# CpuFlushTlb (\r
+#   VOID\r
+#   );\r
+#------------------------------------------------------------------------------\r
+_CpuFlushTlb:\r
+    mov     %cr3, %rax\r
+    mov     %rax, %cr3\r
+    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuFlushTlb.asm b/MdePkg/Library/BaseLib/X64/CpuFlushTlb.asm
new file mode 100644 (file)
index 0000000..c2c4490
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------ ;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CpuFlushTlb.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CpuFlushTlb function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; CpuFlushTlb (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+CpuFlushTlb PROC\r
+    mov     rax, cr3\r
+    mov     cr3, rax\r
+    ret\r
+CpuFlushTlb ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuId.S b/MdePkg/Library/BaseLib/X64/CpuId.S
new file mode 100644 (file)
index 0000000..98d7faa
--- /dev/null
@@ -0,0 +1,60 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CpuId.S
+#
+# Abstract:
+#
+#   AsmCpuid function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+#  VOID
+#  EFIAPI
+#  AsmCpuid (
+#    IN   UINT32  RegisterInEax,
+#    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+#    )
+#------------------------------------------------------------------------------
+.global _AsmCpuid;
+_AsmCpuid:
+    push    %rbx
+    mov     %ecx, %eax
+    push    %rax                         # save Index on stack
+    push    %rdx
+    cpuid
+    test    %r9, %r9
+    jz      L1
+    mov     %ecx, (%r9)
+L1:
+    pop     %rcx
+    jrcxz   L2
+    mov     %eax, (%rcx)
+L2:
+    mov     %r8, %rcx
+    jrcxz   L3
+    mov     %ebx, (%rcx)
+L3:
+    mov     0x38(%rsp), %rcx
+    jrcxz   L4
+    mov     %edx, (%rcx)
+L4:
+    pop     %rax                         # restore Index to rax as return value
+    pop     %rbx
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/CpuId.asm b/MdePkg/Library/BaseLib/X64/CpuId.asm
new file mode 100644 (file)
index 0000000..5e7ee19
--- /dev/null
@@ -0,0 +1,62 @@
+;------------------------------------------------------------------------------
+;
+; Copyright (c) 2006, Intel Corporation
+; All rights reserved. This program and the accompanying materials
+; are licensed and made available under the terms and conditions of the BSD License
+; which accompanies this distribution.  The full text of the license may be found at
+; http://opensource.org/licenses/bsd-license.php
+;
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+; Module Name:
+;
+;   CpuId.Asm
+;
+; Abstract:
+;
+;   AsmCpuid function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+    .code
+
+;------------------------------------------------------------------------------
+;  VOID
+;  EFIAPI
+;  AsmCpuid (
+;    IN   UINT32  RegisterInEax,
+;    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+;    )
+;------------------------------------------------------------------------------
+AsmCpuid    PROC    USES    rbx
+    mov     eax, ecx
+    push    rax                         ; save Index on stack
+    push    rdx
+    cpuid
+    test    r9, r9
+    jz      @F
+    mov     [r9], ecx
+@@:
+    pop     rcx
+    jrcxz   @F
+    mov     [rcx], eax
+@@:
+    mov     rcx, r8
+    jrcxz   @F
+    mov     [rcx], ebx
+@@:
+    mov     rcx, [rsp + 38h]
+    jrcxz   @F
+    mov     [rcx], edx
+@@:
+    pop     rax                         ; restore Index to rax as return value
+    ret
+AsmCpuid    ENDP
+
+    END
diff --git a/MdePkg/Library/BaseLib/X64/CpuIdEx.S b/MdePkg/Library/BaseLib/X64/CpuIdEx.S
new file mode 100644 (file)
index 0000000..e5317e0
--- /dev/null
@@ -0,0 +1,62 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CpuIdEx.Asm
+#
+# Abstract:
+#
+#   AsmCpuidEx function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+#  UINT32
+#  EFIAPI
+#  AsmCpuidEx (
+#    IN   UINT32  RegisterInEax,
+#    IN   UINT32  RegisterInEcx,
+#    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+#    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+#    )
+#------------------------------------------------------------------------------
+.global _AsmCpuidEx
+_AsmCpuidEx:
+    push    %rbx
+    movl    %ecx,%eax
+    movl    %edx,%ecx
+    push    %rax
+    cpuid
+    mov     0x38(%rsp), %r10
+    test    %r10, %r10
+    jz      L1
+    mov     %ecx,(%r10)
+L1: 
+    mov     %r8, %rcx
+    jrcxz   L2
+    movl    %eax,(%rcx)
+L2: 
+    mov     %r9, %rcx
+    jrcxz   L3
+    mov     %ebx, (%rcx)
+L3: 
+    mov     0x40(%rsp), %rcx
+    jrcxz   L4
+    mov     %edx, (%rcx)
+L4: 
+    pop     %rax
+    pop     %rbx
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/CpuIdEx.asm b/MdePkg/Library/BaseLib/X64/CpuIdEx.asm
new file mode 100644 (file)
index 0000000..450cf54
--- /dev/null
@@ -0,0 +1,64 @@
+;------------------------------------------------------------------------------
+;
+; Copyright (c) 2006, Intel Corporation
+; All rights reserved. This program and the accompanying materials
+; are licensed and made available under the terms and conditions of the BSD License
+; which accompanies this distribution.  The full text of the license may be found at
+; http://opensource.org/licenses/bsd-license.php
+;
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+; Module Name:
+;
+;   CpuIdEx.Asm
+;
+; Abstract:
+;
+;   AsmCpuidEx function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+    .code
+
+;------------------------------------------------------------------------------
+;  UINT32
+;  EFIAPI
+;  AsmCpuidEx (
+;    IN   UINT32  RegisterInEax,
+;    IN   UINT32  RegisterInEcx,
+;    OUT  UINT32  *RegisterOutEax  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEbx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEcx  OPTIONAL,
+;    OUT  UINT32  *RegisterOutEdx  OPTIONAL
+;    )
+;------------------------------------------------------------------------------
+AsmCpuidEx  PROC    USES    rbx
+    mov     eax, ecx
+    mov     ecx, edx
+    push    rax                         ; save Index on stack
+    cpuid
+    mov     r10, [rsp + 38h]
+    test    r10, r10
+    jz      @F
+    mov     [r10], ecx
+@@:
+    mov     rcx, r8
+    jrcxz   @F
+    mov     [rcx], eax
+@@:
+    mov     rcx, r9
+    jrcxz   @F
+    mov     [rcx], ebx
+@@:
+    mov     rcx, [rsp + 40h]
+    jrcxz   @F
+    mov     [rcx], edx
+@@:
+    pop     rax                         ; restore Index to rax as return value
+    ret
+AsmCpuidEx  ENDP
+
+    END
diff --git a/MdePkg/Library/BaseLib/X64/CpuPause.S b/MdePkg/Library/BaseLib/X64/CpuPause.S
new file mode 100644 (file)
index 0000000..0ecaa85
--- /dev/null
@@ -0,0 +1,34 @@
+#------------------------------------------------------------------------------ ;\r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   CpuPause.S\r
+#\r
+# Abstract:\r
+#\r
+#   CpuPause function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# CpuPause (\r
+#   VOID\r
+#   );\r
+#------------------------------------------------------------------------------\r
+.global _CpuPause;\r
+_CpuPause:\r
+    pause\r
+    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuPause.asm b/MdePkg/Library/BaseLib/X64/CpuPause.asm
new file mode 100644 (file)
index 0000000..d16da37
--- /dev/null
@@ -0,0 +1,37 @@
+;------------------------------------------------------------------------------ ;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CpuPause.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CpuPause function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; CpuPause (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+CpuPause    PROC\r
+    pause\r
+    ret\r
+CpuPause    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuSleep.S b/MdePkg/Library/BaseLib/X64/CpuSleep.S
new file mode 100644 (file)
index 0000000..681e4c1
--- /dev/null
@@ -0,0 +1,34 @@
+#------------------------------------------------------------------------------ ;\r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   CpuSleep.S\r
+#\r
+# Abstract:\r
+#\r
+#   CpuSleep function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# CpuSleep (\r
+#   VOID\r
+#   );\r
+#------------------------------------------------------------------------------\r
+.global _CpuSleep;\r
+_CpuSleep:\r
+    hlt\r
+    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuSleep.asm b/MdePkg/Library/BaseLib/X64/CpuSleep.asm
new file mode 100644 (file)
index 0000000..b2c4907
--- /dev/null
@@ -0,0 +1,37 @@
+;------------------------------------------------------------------------------ ;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CpuSleep.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CpuSleep function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; CpuSleep (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+CpuSleep    PROC\r
+    hlt\r
+    ret\r
+CpuSleep    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/DisableInterrupts.S b/MdePkg/Library/BaseLib/X64/DisableInterrupts.S
new file mode 100644 (file)
index 0000000..da16886
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   DisableInterrupts.S\r
+#\r
+# Abstract:\r
+#\r
+#   DisableInterrupts function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# DisableInterrupts (\r
+#   VOID\r
+#   );\r
+#------------------------------------------------------------------------------\r
+.global _DisableInterrupts;\r
+_DisableInterrupts:\r
+    cli\r
+    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/DisableInterrupts.asm b/MdePkg/Library/BaseLib/X64/DisableInterrupts.asm
new file mode 100644 (file)
index 0000000..586832c
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   DisableInterrupts.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   DisableInterrupts function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; DisableInterrupts (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+DisableInterrupts   PROC\r
+    cli\r
+    ret\r
+DisableInterrupts   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.S b/MdePkg/Library/BaseLib/X64/DisablePaging64.S
new file mode 100644 (file)
index 0000000..d23313d
--- /dev/null
@@ -0,0 +1,66 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   DisablePaging64.S
+#
+# Abstract:
+#
+#   AsmDisablePaging64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+    
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86DisablePaging64 (
+#   IN      UINT16                    Cs,                      %rdi
+#   IN      UINT64                    EntryPoint,              %rsi
+#   IN      UINT64                    Context1,  OPTIONAL      %rdx
+#   IN      UINT32                    Context2,  OPTIONAL      %rcx
+#   IN      UINT64                    NewStack                 %r8
+#   );
+#------------------------------------------------------------------------------
+
+.global _InternalX86DisablePaging64
+_InternalX86DisablePaging64:
+    cli    
+    shl    $0x20,%rcx
+    lea    (%rip), %eax
+    mov    %eax,%ecx
+    push   %rcx
+    mov    %edx,%ebx
+    mov    %r8d,%esi
+    mov    %r9d,%edi
+    mov    0x28(%rsp),%eax
+    lret   
+L1:
+    mov    %eax,%esp
+    mov    %cr0,%rax
+    btr    $0x1f,%eax
+    mov    %rax,%cr0
+    mov    $0xc0000080,%ecx
+    rdmsr  
+    and    $0xfe,%ah
+    wrmsr  
+    mov    %cr4,%rax
+    and    $0xdf,%al
+    mov    %rax,%cr4
+    push   %rdi
+    push   %rsi
+    callq  *%rbx
+    jmp    .
+
diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.asm b/MdePkg/Library/BaseLib/X64/DisablePaging64.asm
new file mode 100644 (file)
index 0000000..518137d
--- /dev/null
@@ -0,0 +1,65 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   DisablePaging64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmDisablePaging64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86DisablePaging64 (\r
+;   IN      UINT16                    Cs,\r
+;   IN      UINT32                    EntryPoint,\r
+;   IN      UINT32                    Context1,  OPTIONAL\r
+;   IN      UINT32                    Context2,  OPTIONAL\r
+;   IN      UINT32                    NewStack\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86DisablePaging64    PROC\r
+    cli\r
+    shl     rcx, 32                     ; rcx[32..47] <- Cs\r
+    lea     eax, @F\r
+    mov     esi, r8d\r
+    or      rcx, rax                    ; rcx[0..47] <- Cs:@F\r
+    mov     edi, r9d\r
+    mov     eax, [rsp + 28h]            ; eax <- New Stack\r
+    push    rcx\r
+    retf                                ; switch to compatibility mode\r
+@@:\r
+    mov     esp, eax                    ; set up new stack\r
+    mov     rax, cr0\r
+    btr     eax, 31\r
+    mov     cr0, rax                    ; disable paging\r
+    mov     ecx, 0c0000080h\r
+    rdmsr\r
+    and     ah, NOT 1                   ; clear LME\r
+    wrmsr\r
+    mov     rax, cr4\r
+    and     al, NOT (1 SHL 5)           ; clear PAE\r
+    mov     cr4, rax\r
+    push    rdi                         ; push Context2\r
+    push    rsi                         ; push Context1\r
+    call    rdx                         ; transfer control to EntryPoint\r
+    hlt                                 ; no one should get here\r
+InternalX86DisablePaging64    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S b/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S
new file mode 100644 (file)
index 0000000..581b7bb
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   EnableDisableInterrupts.S
+#
+# Abstract:
+#
+#   EnableDisableInterrupts function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# EnableDisableInterrupts (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _EnableDisableInterrupts;
+.align 16;
+_EnableDisableInterrupts:
+    sti
+    cli
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm b/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.asm
new file mode 100644 (file)
index 0000000..0d0400f
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   EnableDisableInterrupts.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   EnableDisableInterrupts function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; EnableDisableInterrupts (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EnableDisableInterrupts PROC\r
+    sti\r
+    cli\r
+    ret\r
+EnableDisableInterrupts ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/EnableInterrupts.S b/MdePkg/Library/BaseLib/X64/EnableInterrupts.S
new file mode 100644 (file)
index 0000000..b81bcd0
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   EnableInterrupts.S
+#
+# Abstract:
+#
+#   EnableInterrupts function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# EnableInterrupts (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _EnableInterrupts;
+_EnableInterrupts:
+    sti
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/EnableInterrupts.asm b/MdePkg/Library/BaseLib/X64/EnableInterrupts.asm
new file mode 100644 (file)
index 0000000..8fb4adf
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   EnableInterrupts.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   EnableInterrupts function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; EnableInterrupts (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+EnableInterrupts    PROC\r
+    sti\r
+    ret\r
+EnableInterrupts    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/EnablePaging64.S b/MdePkg/Library/BaseLib/X64/EnablePaging64.S
new file mode 100644 (file)
index 0000000..15209c0
--- /dev/null
@@ -0,0 +1,61 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   EnablePaging64.S
+#
+# Abstract:
+#
+#   AsmEnablePaging64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86EnablePaging64 (
+#   IN      UINT16                    Cs,                      %rdi
+#   IN      UINT64                    EntryPoint,              %rsi
+#   IN      UINT64                    Context1,  OPTIONAL      %rdx
+#   IN      UINT64                    Context2,  OPTIONAL      %rcx
+#   IN      UINT64                    NewStack                 %r8
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86EnablePaging64;
+_InternalX86EnablePaging64:
+    cli    
+    pop    %rax
+    callq  Base
+Base:
+    addl   $(L1-Base),(%rsp)
+    mov    %cr4,%rax
+    or     $0x20,%al
+    mov    %rax,%cr4
+    mov    $0xc0000080,%ecx
+    rdmsr  
+    or     $0x1,%ah
+    wrmsr  
+    mov    %cr0,%rax
+    bts    $0x1f,%eax
+    mov    %rax,%cr0
+    lret   
+L1:
+    addr32 mov (%esp),%rbx
+    addr32 mov 0x8(%esp),%rcx
+    addr32 mov 0x10(%esp),%rdx
+    addr32 mov 0x18(%esp),%rsp
+    add    $-0x20,%rsp
+    callq  *%rbx
+    jmp    .
diff --git a/MdePkg/Library/BaseLib/X64/EnablePaging64.asm b/MdePkg/Library/BaseLib/X64/EnablePaging64.asm
new file mode 100644 (file)
index 0000000..c548430
--- /dev/null
@@ -0,0 +1,64 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   EnablePaging64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmEnablePaging64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86EnablePaging64 (\r
+;   IN      UINT16                    Cs,\r
+;   IN      UINT64                    EntryPoint,\r
+;   IN      UINT64                    Context1,  OPTIONAL\r
+;   IN      UINT64                    Context2,  OPTIONAL\r
+;   IN      UINT64                    NewStack\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86EnablePaging64 PROC\r
+    cli\r
+    pop     rax                         ; skip the return address\r
+    call    @Base\r
+@Base:\r
+    add     dword ptr [rsp], @F - @Base ; offset for far retf, seg is the 1st arg\r
+    mov     rax, cr4                    ; mov eax, cr4\r
+    or      al, (1 SHL 5)\r
+    mov     cr4, rax                    ; enable PAE\r
+    mov     ecx, 0c0000080h\r
+    rdmsr\r
+    or      ah, 1                       ; set LME\r
+    wrmsr\r
+    mov     rax, cr0                    ; mov eax, cr0\r
+    bts     eax, 31\r
+    mov     cr0, rax                    ; enable paging\r
+    retf\r
+@@:                                     ; long mode starts here\r
+    mov     rbx, [esp]\r
+    mov     rcx, [esp + 8]\r
+    mov     rdx, [esp + 10h]\r
+    mov     rsp, [esp + 18h]\r
+    add     rsp, -20h\r
+    call    rbx\r
+    hlt                                 ; halt processor if EntryPoint() returned\r
+InternalX86EnablePaging64 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/FlushCacheLine.S b/MdePkg/Library/BaseLib/X64/FlushCacheLine.S
new file mode 100644 (file)
index 0000000..4c5a52f
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   FlushCacheLine.S
+#
+# Abstract:
+#
+#   AsmFlushCacheLine function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID *
+# EFIAPI 
+# AsmFlushCacheLine (
+#   IN      VOID                      *LinearAddress
+#   );
+#------------------------------------------------------------------------------
+.global _AsmFlushCacheLine;
+_AsmFlushCacheLine:
+    clflush (%rdi)
+    mov     %rdi, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/FlushCacheLine.asm b/MdePkg/Library/BaseLib/X64/FlushCacheLine.asm
new file mode 100644 (file)
index 0000000..83966a6
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   FlushCacheLine.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmFlushCacheLine function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; EFIAPI \r
+; AsmFlushCacheLine (\r
+;   IN      VOID                      *LinearAddress\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmFlushCacheLine   PROC\r
+    clflush [rcx]\r
+    mov     rax, rcx\r
+    ret\r
+AsmFlushCacheLine   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/FxRestore.S b/MdePkg/Library/BaseLib/X64/FxRestore.S
new file mode 100644 (file)
index 0000000..cc9750c
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   FxRestore.S
+#
+# Abstract:
+#
+#   AsmFxRestore function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86FxRestore (
+#   IN CONST IA32_FX_BUFFER *Buffer
+#   )#
+#------------------------------------------------------------------------------
+.global _InternalX86FxRestore;
+_InternalX86FxRestore:
+    fxrstor (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/FxRestore.asm b/MdePkg/Library/BaseLib/X64/FxRestore.asm
new file mode 100644 (file)
index 0000000..7e7037e
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   FxRestore.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmFxRestore function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86FxRestore (\r
+;   IN CONST IA32_FX_BUFFER *Buffer\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86FxRestore  PROC\r
+    fxrstor [rcx]\r
+    ret\r
+InternalX86FxRestore  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/FxSave.S b/MdePkg/Library/BaseLib/X64/FxSave.S
new file mode 100644 (file)
index 0000000..432d7b9
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   FxSave.S
+#
+# Abstract:
+#
+#   AsmFxSave function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86FxSave (
+#   OUT IA32_FX_BUFFER *Buffer
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86FxSave;
+_InternalX86FxSave:
+    fxsave  (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/FxSave.asm b/MdePkg/Library/BaseLib/X64/FxSave.asm
new file mode 100644 (file)
index 0000000..ea19cd1
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   FxSave.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmFxSave function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86FxSave (\r
+;   OUT IA32_FX_BUFFER *Buffer\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86FxSave PROC\r
+    fxsave  [rcx]\r
+    ret\r
+InternalX86FxSave ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.S b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.S
new file mode 100644 (file)
index 0000000..cd85279
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   InterlockedCompareExchange32.Asm\r
+#\r
+# Abstract:\r
+#\r
+#   InterlockedCompareExchange32 function\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# UINT32\r
+# EFIAPI\r
+# InterlockedCompareExchange32 (\r
+#   IN      UINT32                    *Value,\r
+#   IN      UINT32                    CompareValue,\r
+#   IN      UINT32                    ExchangeValue\r
+#   );\r
+#------------------------------------------------------------------------------\r
+.global _InternalSyncCompareExchange32;\r
+_InternalSyncCompareExchange32:\r
+    mov     %edx, %eax\r
+    lock    cmpxchg %r8d, (%rcx)\r
+    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.asm b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.asm
new file mode 100644 (file)
index 0000000..55b0554
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   InterlockedCompareExchange32.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   InterlockedCompareExchange32 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT32\r
+; EFIAPI\r
+; InterlockedCompareExchange32 (\r
+;   IN      UINT32                    *Value,\r
+;   IN      UINT32                    CompareValue,\r
+;   IN      UINT32                    ExchangeValue\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalSyncCompareExchange32   PROC\r
+    mov     eax, edx\r
+    lock    cmpxchg [rcx], r8d\r
+    ret\r
+InternalSyncCompareExchange32   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
new file mode 100644 (file)
index 0000000..4a9fe6a
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  InterlockedCompareExchange32 function\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+long _InterlockedCompareExchange(\r
+   long volatile * Destination,\r
+   long Exchange,\r
+   long Comperand\r
+);\r
+\r
+#pragma intrinsic(_InterlockedCompareExchange)\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncCompareExchange32 (\r
+  IN      UINT32                    *Value,\r
+  IN      UINT32                    CompareValue,\r
+  IN      UINT32                    ExchangeValue\r
+  )\r
+{\r
+  return _InterlockedCompareExchange (Value, ExchangeValue, CompareValue);\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.S b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.S
new file mode 100644 (file)
index 0000000..ae27964
--- /dev/null
@@ -0,0 +1,39 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   InterlockedCompareExchange64.S
+#
+# Abstract:
+#
+#   InterlockedCompareExchange64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# InterlockedCompareExchange64 (
+#   IN      UINT64                    *Value,
+#   IN      UINT64                    CompareValue,
+#   IN      UINT64                    ExchangeValue
+#   );
+#------------------------------------------------------------------------------
+.global _InternalSyncCompareExchange64;
+.align 16;
+_InternalSyncCompareExchange64:
+    mov     %rsi, %rax
+    lock    cmpxchg %rdx,(%rdi)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.asm b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.asm
new file mode 100644 (file)
index 0000000..88c25a5
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   InterlockedCompareExchange64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   InterlockedCompareExchange64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; InterlockedCompareExchange64 (\r
+;   IN      UINT64                    *Value,\r
+;   IN      UINT64                    CompareValue,\r
+;   IN      UINT64                    ExchangeValue\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalSyncCompareExchange64   PROC\r
+    mov     rax, rdx\r
+    lock    cmpxchg [rcx], r8\r
+    ret\r
+InternalSyncCompareExchange64   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c
new file mode 100644 (file)
index 0000000..bed1dc8
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  InterlockedCompareExchange64 function\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+__int64 _InterlockedCompareExchange64(\r
+   __int64 volatile * Destination,\r
+   __int64 Exchange,\r
+   __int64 Comperand\r
+);\r
+\r
+#pragma intrinsic(_InterlockedCompareExchange64)\r
+\r
+UINT64\r
+EFIAPI\r
+InternalSyncCompareExchange64 (\r
+  IN      UINT64                    *Value,\r
+  IN      UINT64                    CompareValue,\r
+  IN      UINT64                    ExchangeValue\r
+  )\r
+{\r
+  return _InterlockedCompareExchange64 (Value, ExchangeValue, CompareValue);\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedDecrement.S b/MdePkg/Library/BaseLib/X64/InterlockedDecrement.S
new file mode 100644 (file)
index 0000000..59ca54b
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   InterlockedDecrement.S
+#
+# Abstract:
+#
+#   InterlockedDecrement function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT32
+# EFIAPI
+# InterlockedDecrement (
+#   IN      UINT32                    *Value
+#   );
+#------------------------------------------------------------------------------
+.global _InternalSyncDecrement;
+_InternalSyncDecrement:
+    lock    decl (%rcx)
+    mov     (%rcx), %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedDecrement.asm b/MdePkg/Library/BaseLib/X64/InterlockedDecrement.asm
new file mode 100644 (file)
index 0000000..f907fed
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   InterlockedDecrement.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   InterlockedDecrement function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT32\r
+; EFIAPI\r
+; InterlockedDecrement (\r
+;   IN      UINT32                    *Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalSyncDecrement   PROC\r
+    lock    dec     dword ptr [rcx]\r
+    mov     eax, [rcx]\r
+    ret\r
+InternalSyncDecrement   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c b/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c
new file mode 100644 (file)
index 0000000..19e6a5d
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  InterlockedDecrement function\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+long _InterlockedDecrement(\r
+   long * lpAddend\r
+);\r
+\r
+#pragma intrinsic(_InterlockedDecrement)\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncDecrement (\r
+  IN      UINT32                    *Value\r
+  )\r
+{\r
+  return _InterlockedDecrement (Value);\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedIncrement.S b/MdePkg/Library/BaseLib/X64/InterlockedIncrement.S
new file mode 100644 (file)
index 0000000..df4cb97
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   InterlockedIncrement.S
+#
+# Abstract:
+#
+#   InterlockedIncrement function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT32
+# EFIAPI
+# InterlockedIncrement (
+#   IN      UINT32                    *Value
+#   );
+#------------------------------------------------------------------------------
+.global _InternalSyncIncrement;
+_InternalSyncIncrement:
+    lock    incl  (%rcx)
+    mov     (%rcx), %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedIncrement.asm b/MdePkg/Library/BaseLib/X64/InterlockedIncrement.asm
new file mode 100644 (file)
index 0000000..f5a4130
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   InterlockedIncrement.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   InterlockedIncrement function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT32\r
+; EFIAPI\r
+; InterlockedIncrement (\r
+;   IN      UINT32                    *Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalSyncIncrement   PROC\r
+    lock    inc     dword ptr [rcx]\r
+    mov     eax, [rcx]\r
+    ret\r
+InternalSyncIncrement   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c b/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c
new file mode 100644 (file)
index 0000000..eda9f79
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  InterLockedIncrement function\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+long _InterlockedIncrement(\r
+   long * lpAddend\r
+);\r
+\r
+#pragma intrinsic(_InterlockedIncrement)\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncIncrement (\r
+  IN      UINT32                    *Value\r
+  )\r
+{\r
+  return _InterlockedIncrement (Value);\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/Invd.S b/MdePkg/Library/BaseLib/X64/Invd.S
new file mode 100644 (file)
index 0000000..030ae45
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   Invd.S
+#
+# Abstract:
+#
+#   AsmInvd function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmInvd (
+#   VOID
+#   )#
+#------------------------------------------------------------------------------
+.global _AsmInvd;
+_AsmInvd:
+    invd
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/Invd.asm b/MdePkg/Library/BaseLib/X64/Invd.asm
new file mode 100644 (file)
index 0000000..4465879
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   Invd.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmInvd function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmInvd (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmInvd PROC\r
+    invd\r
+    ret\r
+AsmInvd ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/LongJump.S b/MdePkg/Library/BaseLib/X64/LongJump.S
new file mode 100644 (file)
index 0000000..1a6f859
--- /dev/null
@@ -0,0 +1,42 @@
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006, Intel Corporation\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
+# Module Name:\r
+#\r
+#   LongJump.Asm\r
+#\r
+# Abstract:\r
+#\r
+#   Implementation of _LongJump() on x64.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# InternalLongJump (\r
+#   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
+#   IN      UINTN                     Value\r
+#   );\r
+#------------------------------------------------------------------------------\r
+.global _InternalLongJump\r
+_InternalLongJump:\r
+    mov     (%rcx), %rbx\r
+    mov     0x8(%rcx), %rsp\r
+    mov     0x10(%rcx), %rbp\r
+    mov     0x18(%rcx), %rdi\r
+    mov     0x20(%rcx), %rsi\r
+    mov     0x28(%rcx), %r12\r
+    mov     0x30(%rcx), %r13\r
+    mov     0x38(%rcx), %r14\r
+    mov     0x40(%rcx), %r15\r
+    mov     %rdx, %rax\r
+    jmp     *0x48(%rcx)\r
diff --git a/MdePkg/Library/BaseLib/X64/LongJump.asm b/MdePkg/Library/BaseLib/X64/LongJump.asm
new file mode 100644 (file)
index 0000000..38e5606
--- /dev/null
@@ -0,0 +1,46 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   LongJump.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   Implementation of _LongJump() on x64.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalLongJump (\r
+;   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
+;   IN      UINTN                     Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalLongJump    PROC\r
+    mov     rbx, [rcx]\r
+    mov     rsp, [rcx + 8]\r
+    mov     rbp, [rcx + 10h]\r
+    mov     rdi, [rcx + 18h]\r
+    mov     rsi, [rcx + 20h]\r
+    mov     r12, [rcx + 28h]\r
+    mov     r13, [rcx + 30h]\r
+    mov     r14, [rcx + 38h]\r
+    mov     r15, [rcx + 40h]\r
+    mov     rax, rdx                    ; set return value\r
+    jmp     qword ptr [rcx + 48h]\r
+InternalLongJump    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/Monitor.S b/MdePkg/Library/BaseLib/X64/Monitor.S
new file mode 100644 (file)
index 0000000..13da27d
--- /dev/null
@@ -0,0 +1,41 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   Monitor.S
+#
+# Abstract:
+#
+#   AsmMonitor function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmMonitor (
+#   IN      UINTN                     Eax,
+#   IN      UINTN                     Ecx,
+#   IN      UINTN                     Edx
+#   );
+#------------------------------------------------------------------------------
+.global _AsmMonitor;
+.align 16;
+_AsmMonitor:
+    mov    %ecx,%eax
+    mov    %edx,%ecx
+    mov    %r8d,%edx
+    monitor
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/Monitor.asm b/MdePkg/Library/BaseLib/X64/Monitor.asm
new file mode 100644 (file)
index 0000000..ec9c3f8
--- /dev/null
@@ -0,0 +1,43 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   Monitor.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmMonitor function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmMonitor (\r
+;   IN      UINTN                     Eax,\r
+;   IN      UINTN                     Ecx,\r
+;   IN      UINTN                     Edx\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmMonitor  PROC\r
+    mov     eax, ecx\r
+    mov     ecx, edx\r
+    mov     edx, r8d\r
+    DB      0fh, 1, 0c8h                ; monitor\r
+    ret\r
+AsmMonitor  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/Mwait.S b/MdePkg/Library/BaseLib/X64/Mwait.S
new file mode 100644 (file)
index 0000000..a32d004
--- /dev/null
@@ -0,0 +1,39 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   Mwait.S
+#
+# Abstract:
+#
+#   AsmMwait function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmMwait (
+#   IN      UINTN                     Eax,
+#   IN      UINTN                     Ecx
+#   );
+#------------------------------------------------------------------------------
+.global _AsmMwait;
+.align 16;
+_AsmMwait:
+    mov    %ecx,%eax
+    mov    %edx,%ecx
+    mwait  %rax,%rcx
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/Mwait.asm b/MdePkg/Library/BaseLib/X64/Mwait.asm
new file mode 100644 (file)
index 0000000..aae1d42
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   Mwait.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmMwait function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmMwait (\r
+;   IN      UINTN                     Eax,\r
+;   IN      UINTN                     Ecx\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmMwait    PROC\r
+    mov     eax, ecx\r
+    mov     ecx, edx\r
+    DB      0fh, 1, 0c9h                ; mwait\r
+    ret\r
+AsmMwait    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/Non-existing.c b/MdePkg/Library/BaseLib/X64/Non-existing.c
new file mode 100644 (file)
index 0000000..4f0c932
--- /dev/null
@@ -0,0 +1,110 @@
+/** @file\r
+  Non-existing BaseLib functions on x64\r
+\r
+  Copyright (c) 2006, Intel Corporation\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
+  Module Name:  Non-existing.c\r
+\r
+**/\r
+\r
+#include "../BaseLibInternals.h"\r
+\r
+/**\r
+  Enables the 32-bit paging mode on the CPU.\r
+\r
+  Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
+  must be properly initialized prior to calling this service. This function\r
+  assumes the current execution mode is 32-bit protected mode. This function is\r
+  only available on IA-32. After the 32-bit paging mode is enabled, control is\r
+  transferred to the function specified by EntryPoint using the new stack\r
+  specified by NewStack and passing in the parameters specified by Context1 and\r
+  Context2. Context1 and Context2 are optional and may be NULL. The function\r
+  EntryPoint must never return.\r
+\r
+  There are a number of constraints that must be followed before calling this\r
+  function:\r
+  1)  Interrupts must be disabled.\r
+  2)  The caller must be in 32-bit protected mode with flat descriptors. This\r
+      means all descriptors must have a base of 0 and a limit of 4GB.\r
+  3)  CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
+      descriptors.\r
+  4)  CR3 must point to valid page tables that will be used once the transition\r
+      is complete, and those page tables must guarantee that the pages for this\r
+      function and the stack are identity mapped.\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack after\r
+                      paging is enabled.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function as the first parameter after paging is enabled.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function as the second parameter after paging is enabled.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function after paging is enabled.\r
+\r
+**/\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
+  //\r
+  // This function cannot work on X64 platform\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+  Disables the 32-bit paging mode on the CPU.\r
+\r
+  Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
+  mode. This function assumes the current execution mode is 32-paged protected\r
+  mode. This function is only available on IA-32. After the 32-bit paging mode\r
+  is disabled, control is transferred to the function specified by EntryPoint\r
+  using the new stack specified by NewStack and passing in the parameters\r
+  specified by Context1 and Context2. Context1 and Context2 are optional and\r
+  may be NULL. The function EntryPoint must never return.\r
+\r
+  There are a number of constraints that must be followed before calling this\r
+  function:\r
+  1)  Interrupts must be disabled.\r
+  2)  The caller must be in 32-bit paged mode.\r
+  3)  CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
+  4)  CR3 must point to valid page tables that guarantee that the pages for\r
+      this function and the stack are identity mapped.\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack after\r
+                      paging is disabled.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function as the first parameter after paging is disabled.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function as the second parameter after paging is\r
+                      disabled.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function after paging is disabled.\r
+\r
+**/\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
+  //\r
+  // This function cannot work on X64 platform\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr0.S b/MdePkg/Library/BaseLib/X64/ReadCr0.S
new file mode 100644 (file)
index 0000000..fa916d0
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadCr0.S
+#
+# Abstract:
+#
+#   AsmReadCr0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadCr0 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadCr0;
+.align 16;
+_AsmReadCr0:
+    mov     %cr0, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr0.asm b/MdePkg/Library/BaseLib/X64/ReadCr0.asm
new file mode 100644 (file)
index 0000000..3e369c3
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadCr0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadCr0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadCr0 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadCr0  PROC\r
+    mov     rax, cr0\r
+    ret\r
+AsmReadCr0  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr2.S b/MdePkg/Library/BaseLib/X64/ReadCr2.S
new file mode 100644 (file)
index 0000000..96361be
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadCr2.S
+#
+# Abstract:
+#
+#   AsmReadCr2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadCr2 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadCr2;
+.align 16;
+_AsmReadCr2:
+    mov     %cr2, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr2.asm b/MdePkg/Library/BaseLib/X64/ReadCr2.asm
new file mode 100644 (file)
index 0000000..8476f5a
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadCr2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadCr2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadCr2 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadCr2  PROC\r
+    mov     rax, cr2\r
+    ret\r
+AsmReadCr2  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr3.S b/MdePkg/Library/BaseLib/X64/ReadCr3.S
new file mode 100644 (file)
index 0000000..480486f
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadCr3.S
+#
+# Abstract:
+#
+#   AsmReadCr3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadCr3 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadCr3;
+.align 16;
+_AsmReadCr3:
+    mov     %cr3, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr3.asm b/MdePkg/Library/BaseLib/X64/ReadCr3.asm
new file mode 100644 (file)
index 0000000..af54d46
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadCr3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadCr3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadCr3 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadCr3  PROC\r
+    mov     rax, cr3\r
+    ret\r
+AsmReadCr3  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr4.S b/MdePkg/Library/BaseLib/X64/ReadCr4.S
new file mode 100644 (file)
index 0000000..e89b5cd
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadCr4.S
+#
+# Abstract:
+#
+#   AsmReadCr4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadCr4 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadCr4;
+.align 16;
+_AsmReadCr4:
+    mov     %cr4, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCr4.asm b/MdePkg/Library/BaseLib/X64/ReadCr4.asm
new file mode 100644 (file)
index 0000000..c8a881d
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadCr4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadCr4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadCr4 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadCr4  PROC\r
+    mov     rax, cr4\r
+    ret\r
+AsmReadCr4  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadCs.S b/MdePkg/Library/BaseLib/X64/ReadCs.S
new file mode 100644 (file)
index 0000000..677747b
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadCs.S
+#
+# Abstract:
+#
+#   AsmReadCs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadCs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadCs;
+.align 16;
+_AsmReadCs:
+    mov     %cs, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadCs.asm b/MdePkg/Library/BaseLib/X64/ReadCs.asm
new file mode 100644 (file)
index 0000000..642ce5b
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadCs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadCs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadCs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadCs   PROC\r
+    mov     eax, cs\r
+    ret\r
+AsmReadCs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr0.S b/MdePkg/Library/BaseLib/X64/ReadDr0.S
new file mode 100644 (file)
index 0000000..1b441c3
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr0.S
+#
+# Abstract:
+#
+#   AsmReadDr0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr0 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr0;
+.align 16;
+_AsmReadDr0:
+    mov     %dr0, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr0.asm b/MdePkg/Library/BaseLib/X64/ReadDr0.asm
new file mode 100644 (file)
index 0000000..7e0d6b7
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr0 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr0  PROC\r
+    mov     rax, dr0\r
+    ret\r
+AsmReadDr0  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr1.S b/MdePkg/Library/BaseLib/X64/ReadDr1.S
new file mode 100644 (file)
index 0000000..5151a80
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr1.S
+#
+# Abstract:
+#
+#   AsmReadDr1 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr1 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr1;
+.align 16;
+_AsmReadDr1:
+    mov     %dr1, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr1.asm b/MdePkg/Library/BaseLib/X64/ReadDr1.asm
new file mode 100644 (file)
index 0000000..22f11c4
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr1.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr1 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr1 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr1  PROC\r
+    mov     rax, dr1\r
+    ret\r
+AsmReadDr1  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr2.S b/MdePkg/Library/BaseLib/X64/ReadDr2.S
new file mode 100644 (file)
index 0000000..f4516af
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr2.S
+#
+# Abstract:
+#
+#   AsmReadDr2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr2 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr2;
+.align 16;
+_AsmReadDr2:
+    mov     %dr2, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr2.asm b/MdePkg/Library/BaseLib/X64/ReadDr2.asm
new file mode 100644 (file)
index 0000000..3b81605
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr2 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr2  PROC\r
+    mov     rax, dr2\r
+    ret\r
+AsmReadDr2  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr3.S b/MdePkg/Library/BaseLib/X64/ReadDr3.S
new file mode 100644 (file)
index 0000000..c5c679c
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr3.S
+#
+# Abstract:
+#
+#   AsmReadDr3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr3 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr3;
+.align 16;
+_AsmReadDr3:
+    mov     %dr3, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr3.asm b/MdePkg/Library/BaseLib/X64/ReadDr3.asm
new file mode 100644 (file)
index 0000000..1968fd0
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr3 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr3  PROC\r
+    mov     rax, dr3\r
+    ret\r
+AsmReadDr3  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr4.S b/MdePkg/Library/BaseLib/X64/ReadDr4.S
new file mode 100644 (file)
index 0000000..f98c9ed
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr4.S
+#
+# Abstract:
+#
+#   AsmReadDr4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr4 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr4;
+.align 16;
+_AsmReadDr4:
+    #DB      0fh, 21h, 0e0h
+    mov     %dr4, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr4.asm b/MdePkg/Library/BaseLib/X64/ReadDr4.asm
new file mode 100644 (file)
index 0000000..2bed129
--- /dev/null
@@ -0,0 +1,42 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr4 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr4  PROC\r
+    ;\r
+    ; There's no obvious reason to access this register, since it's aliased to\r
+    ; DR7 when DE=0 or an exception generated when DE=1\r
+    ;\r
+    DB      0fh, 21h, 0e0h\r
+    ret\r
+AsmReadDr4  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr5.S b/MdePkg/Library/BaseLib/X64/ReadDr5.S
new file mode 100644 (file)
index 0000000..421f57a
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr5.S
+#
+# Abstract:
+#
+#   AsmReadDr5 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr5 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr5;
+.align 16;
+_AsmReadDr5:
+    mov        %dr5, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr5.asm b/MdePkg/Library/BaseLib/X64/ReadDr5.asm
new file mode 100644 (file)
index 0000000..3bee3a5
--- /dev/null
@@ -0,0 +1,42 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr5.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr5 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr5 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr5  PROC\r
+    ;\r
+    ; There's no obvious reason to access this register, since it's aliased to\r
+    ; DR7 when DE=0 or an exception generated when DE=1\r
+    ;\r
+    DB      0fh, 21h, 0e8h\r
+    ret\r
+AsmReadDr5  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr6.S b/MdePkg/Library/BaseLib/X64/ReadDr6.S
new file mode 100644 (file)
index 0000000..6a159d8
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr6.S
+#
+# Abstract:
+#
+#   AsmReadDr6 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr6 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr6;
+.align 16;
+_AsmReadDr6:
+    mov        %dr6, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr6.asm b/MdePkg/Library/BaseLib/X64/ReadDr6.asm
new file mode 100644 (file)
index 0000000..a3dafb9
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr6.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr6 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr6 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr6  PROC\r
+    mov     rax, dr6\r
+    ret\r
+AsmReadDr6  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr7.S b/MdePkg/Library/BaseLib/X64/ReadDr7.S
new file mode 100644 (file)
index 0000000..9ffb09d
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDr7.S
+#
+# Abstract:
+#
+#   AsmReadDr7 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadDr7 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDr7;
+.align 16;
+_AsmReadDr7:
+    mov        %dr7, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDr7.asm b/MdePkg/Library/BaseLib/X64/ReadDr7.asm
new file mode 100644 (file)
index 0000000..0cff14b
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDr7.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDr7 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadDr7 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDr7  PROC\r
+    mov     rax, dr7\r
+    ret\r
+AsmReadDr7  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadDs.S b/MdePkg/Library/BaseLib/X64/ReadDs.S
new file mode 100644 (file)
index 0000000..58bee11
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadDs.S
+#
+# Abstract:
+#
+#   AsmReadDs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadDs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadDs;
+.align 16;
+_AsmReadDs:
+    movl       %ds, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadDs.asm b/MdePkg/Library/BaseLib/X64/ReadDs.asm
new file mode 100644 (file)
index 0000000..6f26298
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadDs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadDs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadDs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadDs   PROC\r
+    mov     eax, ds\r
+    ret\r
+AsmReadDs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadEflags.S b/MdePkg/Library/BaseLib/X64/ReadEflags.S
new file mode 100644 (file)
index 0000000..e895387
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadEflags.S
+#
+# Abstract:
+#
+#   AsmReadEflags function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmReadEflags (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadEflags;
+.align 16;
+_AsmReadEflags:
+    pushfq
+    pop     %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadEflags.asm b/MdePkg/Library/BaseLib/X64/ReadEflags.asm
new file mode 100644 (file)
index 0000000..174ae95
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadEflags.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadEflags function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmReadEflags (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadEflags   PROC\r
+    pushfq\r
+    pop     rax\r
+    ret\r
+AsmReadEflags   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadEs.S b/MdePkg/Library/BaseLib/X64/ReadEs.S
new file mode 100644 (file)
index 0000000..93df650
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadEs.S
+#
+# Abstract:
+#
+#   AsmReadEs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadEs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadEs;
+.align 16;
+_AsmReadEs:
+    mov     %es, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadEs.asm b/MdePkg/Library/BaseLib/X64/ReadEs.asm
new file mode 100644 (file)
index 0000000..d5fe84d
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadEs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadEs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadEs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadEs   PROC\r
+    mov     eax, es\r
+    ret\r
+AsmReadEs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadFs.S b/MdePkg/Library/BaseLib/X64/ReadFs.S
new file mode 100644 (file)
index 0000000..ff658e1
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadFs.S
+#
+# Abstract:
+#
+#   AsmReadFs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadFs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadFs;
+.align 16;
+_AsmReadFs:
+    mov     %fs, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadFs.asm b/MdePkg/Library/BaseLib/X64/ReadFs.asm
new file mode 100644 (file)
index 0000000..d44ee54
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadFs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadFs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadFs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadFs   PROC\r
+    mov     eax, fs\r
+    ret\r
+AsmReadFs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadGdtr.S b/MdePkg/Library/BaseLib/X64/ReadGdtr.S
new file mode 100644 (file)
index 0000000..c271a02
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadGdtr.S
+#
+# Abstract:
+#
+#   AsmReadGdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86ReadGdtr (
+#   OUT IA32_DESCRIPTOR  *Gdtr
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86ReadGdtr;
+.align 16;
+_InternalX86ReadGdtr:
+    sgdt  (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadGdtr.asm b/MdePkg/Library/BaseLib/X64/ReadGdtr.asm
new file mode 100644 (file)
index 0000000..0bc2949
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadGdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadGdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86ReadGdtr (\r
+;   OUT IA32_DESCRIPTOR  *Gdtr\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86ReadGdtr   PROC\r
+    sgdt    fword ptr [rcx]\r
+    ret\r
+InternalX86ReadGdtr   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadGs.S b/MdePkg/Library/BaseLib/X64/ReadGs.S
new file mode 100644 (file)
index 0000000..f92776c
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadGs.S
+#
+# Abstract:
+#
+#   AsmReadGs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadGs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadGs;
+.align 16;
+_AsmReadGs:
+    mov     %gs, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadGs.asm b/MdePkg/Library/BaseLib/X64/ReadGs.asm
new file mode 100644 (file)
index 0000000..bc5de76
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadGs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadGs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadGs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadGs   PROC\r
+    mov     eax, gs\r
+    ret\r
+AsmReadGs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadIdtr.S b/MdePkg/Library/BaseLib/X64/ReadIdtr.S
new file mode 100644 (file)
index 0000000..cd7c09e
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadIdtr.AS
+#
+# Abstract:
+#
+#   AsmReadIdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86ReadIdtr (
+#   OUT     IA32_DESCRIPTOR           *Idtr
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86ReadIdtr;
+.align 16;
+_InternalX86ReadIdtr:
+    sidt    (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadIdtr.asm b/MdePkg/Library/BaseLib/X64/ReadIdtr.asm
new file mode 100644 (file)
index 0000000..db684f3
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadIdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadIdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86ReadIdtr (\r
+;   OUT     IA32_DESCRIPTOR           *Idtr\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86ReadIdtr   PROC\r
+    sidt    fword ptr [rcx]\r
+    ret\r
+InternalX86ReadIdtr   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadLdtr.S b/MdePkg/Library/BaseLib/X64/ReadLdtr.S
new file mode 100644 (file)
index 0000000..fac8e25
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadLdtr.AS
+#
+# Abstract:
+#
+#   AsmReadLdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadLdtr (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadLdtr;
+.align 16;
+_AsmReadLdtr:
+    sldt    %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadLdtr.asm b/MdePkg/Library/BaseLib/X64/ReadLdtr.asm
new file mode 100644 (file)
index 0000000..3d6a2f8
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadLdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadLdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadLdtr (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadLdtr PROC\r
+    sldt    eax\r
+    ret\r
+AsmReadLdtr ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm0.S b/MdePkg/Library/BaseLib/X64/ReadMm0.S
new file mode 100644 (file)
index 0000000..b5912ca
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm0.S
+#
+# Abstract:
+#
+#   AsmReadMm0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm0 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm0;
+.align 16;
+_AsmReadMm0:
+    #DB      48h, 0fh, 7eh, 0c0h
+    movd       %mm0, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm0.asm b/MdePkg/Library/BaseLib/X64/ReadMm0.asm
new file mode 100644 (file)
index 0000000..0ed5c8f
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm0 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm0  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0c0h\r
+    ret\r
+AsmReadMm0  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm1.S b/MdePkg/Library/BaseLib/X64/ReadMm1.S
new file mode 100644 (file)
index 0000000..1f26cd4
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm1.S
+#
+# Abstract:
+#
+#   AsmReadMm1 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm1 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm1;
+.align 16;
+_AsmReadMm1:
+    #DB      48h, 0fh, 7eh, 0c8h
+    movd       %mm1, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm1.asm b/MdePkg/Library/BaseLib/X64/ReadMm1.asm
new file mode 100644 (file)
index 0000000..e24fcb5
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm1.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm1 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm1 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm1  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0c8h\r
+    ret\r
+AsmReadMm1  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm2.S b/MdePkg/Library/BaseLib/X64/ReadMm2.S
new file mode 100644 (file)
index 0000000..ef864af
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm2.S
+#
+# Abstract:
+#
+#   AsmReadMm2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm2 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm2;
+.align 16;
+_AsmReadMm2:
+    #DB      48h, 0fh, 7eh, 0d0h
+    movd       %mm2, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm2.asm b/MdePkg/Library/BaseLib/X64/ReadMm2.asm
new file mode 100644 (file)
index 0000000..860326b
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm2 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm2  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0d0h\r
+    ret\r
+AsmReadMm2  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm3.S b/MdePkg/Library/BaseLib/X64/ReadMm3.S
new file mode 100644 (file)
index 0000000..bd76cb2
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm3.S
+#
+# Abstract:
+#
+#   AsmReadMm3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm3 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm3;
+.align 16;
+_AsmReadMm3:
+    #DB      48h, 0fh, 7eh, 0d8h
+    movd       %mm3, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm3.asm b/MdePkg/Library/BaseLib/X64/ReadMm3.asm
new file mode 100644 (file)
index 0000000..aca6f3d
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm3 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm3  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0d8h\r
+    ret\r
+AsmReadMm3  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm4.S b/MdePkg/Library/BaseLib/X64/ReadMm4.S
new file mode 100644 (file)
index 0000000..99d7668
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm4.AS
+#
+# Abstract:
+#
+#   AsmReadMm4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm4 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm4;
+.align 16;
+_AsmReadMm4:
+    #DB      48h, 0fh, 7eh, 0e0h
+    movd       %mm4, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm4.asm b/MdePkg/Library/BaseLib/X64/ReadMm4.asm
new file mode 100644 (file)
index 0000000..dd52f99
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm4 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm4  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0e0h\r
+    ret\r
+AsmReadMm4  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm5.S b/MdePkg/Library/BaseLib/X64/ReadMm5.S
new file mode 100644 (file)
index 0000000..7a01c53
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm5.S
+#
+# Abstract:
+#
+#   AsmReadMm5 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm5 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm5;
+.align 16;
+_AsmReadMm5:
+    #DB      48h, 0fh, 7eh, 0e8h
+    movd       %mm5, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm5.asm b/MdePkg/Library/BaseLib/X64/ReadMm5.asm
new file mode 100644 (file)
index 0000000..1f30e4b
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm5.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm5 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm5 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm5  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0e8h\r
+    ret\r
+AsmReadMm5  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm6.S b/MdePkg/Library/BaseLib/X64/ReadMm6.S
new file mode 100644 (file)
index 0000000..0c7ea79
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm6.S
+#
+# Abstract:
+#
+#   AsmReadMm6 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm6 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm6;
+.align 16;
+_AsmReadMm6:
+    #DB      48h, 0fh, 7eh, 0f0h
+    movd       %mm6, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm6.asm b/MdePkg/Library/BaseLib/X64/ReadMm6.asm
new file mode 100644 (file)
index 0000000..4e1f2a8
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm6.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm6 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm6 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm6  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0f0h\r
+    ret\r
+AsmReadMm6  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm7.S b/MdePkg/Library/BaseLib/X64/ReadMm7.S
new file mode 100644 (file)
index 0000000..68f1dbd
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMm7.S
+#
+# Abstract:
+#
+#   AsmReadMm7 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMm7 (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMm7;
+.align 16;
+_AsmReadMm7:
+    #DB      48h, 0fh, 7eh, 0f8h
+    movd       %mm7, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMm7.asm b/MdePkg/Library/BaseLib/X64/ReadMm7.asm
new file mode 100644 (file)
index 0000000..d871a9f
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMm7.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMm7 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMm7 (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMm7  PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 7eh, 0f8h\r
+    ret\r
+AsmReadMm7  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.S b/MdePkg/Library/BaseLib/X64/ReadMsr64.S
new file mode 100644 (file)
index 0000000..ac101cd
--- /dev/null
@@ -0,0 +1,38 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadMsr64.S
+#
+# Abstract:
+#
+#   AsmReadMsr64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadMsr64 (
+#   IN UINT32  Index
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadMsr64;
+.align 16;
+_AsmReadMsr64:
+    rdmsr                               # edx & eax are zero extended
+    shl     $0x20, %rdx
+    or      %rdx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.asm b/MdePkg/Library/BaseLib/X64/ReadMsr64.asm
new file mode 100644 (file)
index 0000000..580c076
--- /dev/null
@@ -0,0 +1,40 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadMsr64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadMsr64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadMsr64 (\r
+;   IN UINT32  Index\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadMsr64    PROC\r
+    rdmsr                               ; edx & eax are zero extended\r
+    shl     rdx, 20h\r
+    or      rax, rdx\r
+    ret\r
+AsmReadMsr64    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.c b/MdePkg/Library/BaseLib/X64/ReadMsr64.c
new file mode 100644 (file)
index 0000000..15a573f
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  CpuBreakpoint function.\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+unsigned __int64 __readmsr (int register);\r
+\r
+#pragma intrinsic(__readmsr)\r
+\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMsr64 (\r
+  IN UINT32  Index\r
+  )\r
+{\r
+  return __readmsr (Index);\r
+}\r
+\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadPmc.S b/MdePkg/Library/BaseLib/X64/ReadPmc.S
new file mode 100644 (file)
index 0000000..115f633
--- /dev/null
@@ -0,0 +1,38 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadPmc.S
+#
+# Abstract:
+#
+#   AsmReadPmc function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadPmc (
+#   IN UINT32   PmcIndex
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadPmc;
+.align 16;
+_AsmReadPmc:
+    rdpmc
+    shl     $0x20, %rdx
+    or      %rdx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadPmc.asm b/MdePkg/Library/BaseLib/X64/ReadPmc.asm
new file mode 100644 (file)
index 0000000..5ca60fa
--- /dev/null
@@ -0,0 +1,40 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadPmc.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadPmc function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadPmc (\r
+;   IN UINT32   PmcIndex\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadPmc  PROC\r
+    rdpmc\r
+    shl     rdx, 20h\r
+    or      rax, rdx\r
+    ret\r
+AsmReadPmc  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadSs.S b/MdePkg/Library/BaseLib/X64/ReadSs.S
new file mode 100644 (file)
index 0000000..a93a703
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadSs.S
+#
+# Abstract:
+#
+#   AsmReadSs function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadSs (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadSs;
+.align 16;
+_AsmReadSs:
+    movl     %ss, %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadSs.asm b/MdePkg/Library/BaseLib/X64/ReadSs.asm
new file mode 100644 (file)
index 0000000..2c2be56
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadSs.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadSs function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadSs (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadSs   PROC\r
+    mov     eax, ss\r
+    ret\r
+AsmReadSs   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadTr.S b/MdePkg/Library/BaseLib/X64/ReadTr.S
new file mode 100644 (file)
index 0000000..5e3146b
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadTr.S
+#
+# Abstract:
+#
+#   AsmReadTr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT16
+# EFIAPI
+# AsmReadTr (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadTr;
+.align 16;
+_AsmReadTr: 
+    str     %eax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadTr.asm b/MdePkg/Library/BaseLib/X64/ReadTr.asm
new file mode 100644 (file)
index 0000000..7cf8cdf
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadTr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadTr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT16\r
+; EFIAPI\r
+; AsmReadTr (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadTr   PROC\r
+    str     eax\r
+    ret\r
+AsmReadTr   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/ReadTsc.S b/MdePkg/Library/BaseLib/X64/ReadTsc.S
new file mode 100644 (file)
index 0000000..776ffc2
--- /dev/null
@@ -0,0 +1,38 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ReadTsc.S
+#
+# Abstract:
+#
+#   AsmReadTsc function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmReadTsc (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmReadTsc;
+.align 16;
+_AsmReadTsc:
+    rdtsc
+    shl     $0x20, %rdx
+    or      %rdx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/ReadTsc.asm b/MdePkg/Library/BaseLib/X64/ReadTsc.asm
new file mode 100644 (file)
index 0000000..7c45eeb
--- /dev/null
@@ -0,0 +1,40 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ReadTsc.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmReadTsc function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmReadTsc (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmReadTsc  PROC\r
+    rdtsc\r
+    shl     rdx, 20h\r
+    or      rax, rdx\r
+    ret\r
+AsmReadTsc  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/SetJump.S b/MdePkg/Library/BaseLib/X64/SetJump.S
new file mode 100644 (file)
index 0000000..eaaa43b
--- /dev/null
@@ -0,0 +1,42 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetJump.S
+#
+# Abstract:
+#
+#   Implementation of SetJump() on x86_64
+#
+#------------------------------------------------------------------------------
+
+.extern InternalAssertJumpBuffer;
+.global _SetJump;
+_SetJump:
+    push   %rcx
+    add    $0xffffffffffffffe0,%rsp
+    call   _InternalAssertJumpBuffer
+    add    $0x20,%rsp
+    pop    %rcx
+    pop    %rdx
+    mov    %rbx,(%rcx)
+    mov    %rsp,0x8(%rcx)
+    mov    %rbp,0x10(%rcx)
+    mov    %rdi,0x18(%rcx)
+    mov    %rsi,0x20(%rcx)
+    mov    %r12,0x28(%rcx)
+    mov    %r13,0x30(%rcx)
+    mov    %r14,0x38(%rcx)
+    mov    %r15,0x40(%rcx)
+    mov    %rdx,0x48(%rcx)
+    xor    %rax,%rax
+    jmpq   *%rdx
diff --git a/MdePkg/Library/BaseLib/X64/SetJump.asm b/MdePkg/Library/BaseLib/X64/SetJump.asm
new file mode 100644 (file)
index 0000000..2ed581e
--- /dev/null
@@ -0,0 +1,54 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetJump.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   Implementation of SetJump() on x64.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+EXTERNDEF   InternalAssertJumpBuffer:PROC\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; SetJump (\r
+;   OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+;   );\r
+;------------------------------------------------------------------------------\r
+SetJump     PROC\r
+    push    rcx\r
+    add     rsp, -20h\r
+    call    InternalAssertJumpBuffer\r
+    add     rsp, 20h\r
+    pop     rcx\r
+    pop     rdx\r
+    mov     [rcx], rbx\r
+    mov     [rcx + 8], rsp\r
+    mov     [rcx + 10h], rbp\r
+    mov     [rcx + 18h], rdi\r
+    mov     [rcx + 20h], rsi\r
+    mov     [rcx + 28h], r12\r
+    mov     [rcx + 30h], r13\r
+    mov     [rcx + 38h], r14\r
+    mov     [rcx + 40h], r15\r
+    mov     [rcx + 48h], rdx\r
+    xor     rax, rax\r
+    jmp     rdx\r
+SetJump     ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/SwitchStack.S b/MdePkg/Library/BaseLib/X64/SwitchStack.S
new file mode 100644 (file)
index 0000000..85cdb43
--- /dev/null
@@ -0,0 +1,44 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SwitchStack.S
+#
+# Abstract:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# Routine Description:
+#
+#   Routine for switching stacks with 1 parameter
+#
+# Arguments:
+#
+#   (rdi) EntryPoint    - Entry point with new stack.
+#   (rsi) Context1      - Parameter1 for entry point.
+#   (rdx)  Context2     - Parameter2 for entry point.
+#   (rcx)  NewStack     - Pointer to new stack.
+#
+# Returns:
+#
+#   None
+#
+#------------------------------------------------------------------------------
+.global _InternalSwitchStack;
+_InternalSwitchStack:
+    mov     %rcx, %rax
+    mov     %rdx, %rcx
+    mov     %r8, %rdx
+    lea     -0x20(%r9), %rsp
+    call    *%rax
diff --git a/MdePkg/Library/BaseLib/X64/SwitchStack.asm b/MdePkg/Library/BaseLib/X64/SwitchStack.asm
new file mode 100644 (file)
index 0000000..53d1417
--- /dev/null
@@ -0,0 +1,47 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SwitchStack.Asm\r
+;\r
+; Abstract:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; Routine Description:\r
+;\r
+;   Routine for switching stacks with 1 parameter\r
+;\r
+; Arguments:\r
+;\r
+;   (rcx) EntryPoint    - Entry point with new stack.\r
+;   (rdx) Context       - Parameter for entry point.\r
+;   (r8)  Context2      - Parameter2 for entry point.\r
+;   (r9)  NewStack      - Pointer to new stack.\r
+;\r
+; Returns:\r
+;\r
+;   None\r
+;\r
+;------------------------------------------------------------------------------\r
+InternalSwitchStack PROC\r
+    mov     rax, rcx\r
+    mov     rcx, rdx\r
+    mov     rdx, r8\r
+    lea     rsp, [r9 - 20h]\r
+    call    rax\r
+InternalSwitchStack ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.S b/MdePkg/Library/BaseLib/X64/Thunk16.S
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.asm b/MdePkg/Library/BaseLib/X64/Thunk16.asm
new file mode 100644 (file)
index 0000000..ef4d9fc
--- /dev/null
@@ -0,0 +1,289 @@
+//\r
+// Include common header file for this module.\r
+//\r
+#include <BaseLibInternals.h>\r
+\r
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   Thunk.asm\r
+;\r
+; Abstract:\r
+;\r
+;   Real mode thunk\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+EXTERNDEF   m16Start:BYTE\r
+EXTERNDEF   m16Size:WORD\r
+EXTERNDEF   mThunk16Attr:WORD\r
+EXTERNDEF   m16Gdt:WORD\r
+EXTERNDEF   m16GdtrBase:WORD\r
+EXTERNDEF   mTransition:WORD\r
+\r
+IA32_REGS   STRUC   4t\r
+_EDI        DD      ?\r
+_ESI        DD      ?\r
+_EBP        DD      ?\r
+_ESP        DD      ?\r
+_EBX        DD      ?\r
+_EDX        DD      ?\r
+_ECX        DD      ?\r
+_EAX        DD      ?\r
+_DS         DW      ?\r
+_ES         DW      ?\r
+_FS         DW      ?\r
+_GS         DW      ?\r
+_EFLAGS     DQ      ?\r
+_EIP        DD      ?\r
+_CS         DW      ?\r
+_SS         DW      ?\r
+IA32_REGS   ENDS\r
+\r
+    .const\r
+\r
+m16Size         DW      InternalAsmThunk16 - m16Start\r
+mThunk16Attr    DW      _ThunkAttr - m16Start\r
+m16Gdt          DW      _NullSeg - m16Start\r
+m16GdtrBase     DW      _16GdtrBase - m16Start\r
+mTransition     DW      _EntryPoint - m16Start\r
+\r
+    .code\r
+\r
+m16Start    LABEL   BYTE\r
+\r
+SavedGdt    LABEL   FWORD\r
+            DW      ?\r
+            DQ      ?\r
+\r
+;------------------------------------------------------------------------------\r
+; _BackFromUserCode() takes control in real mode after 'retf' has been executed\r
+; by user code. It will be shadowed to somewhere in memory below 1MB.\r
+;------------------------------------------------------------------------------\r
+_BackFromUserCode   PROC\r
+    ;\r
+    ; The order of saved registers on the stack matches the order they appears\r
+    ; in IA32_REGS structure. This facilitates wrapper function to extract them\r
+    ; into that structure.\r
+    ;\r
+    ; Some instructions for manipulation of segment registers have to be written\r
+    ; in opcode since 64-bit MASM prevents accesses to those registers.\r
+    ;\r
+    DB      16h                         ; push ss\r
+    DB      0eh                         ; push cs\r
+    DB      66h\r
+    call    @Base                       ; push eip\r
+@Base:\r
+    DB      66h\r
+    push    0                           ; reserved high order 32 bits of EFlags\r
+    pushf                               ; pushfd actually\r
+    cli                                 ; disable interrupts\r
+    push    gs\r
+    push    fs\r
+    DB      6                           ; push es\r
+    DB      1eh                         ; push ds\r
+    DB      66h, 60h                    ; pushad\r
+    DB      66h, 0bah                   ; mov edx, imm32\r
+_ThunkAttr  DD      ?\r
+    test    dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15\r
+    jz      @1\r
+    mov     eax, 15cd2401h              ; mov ax, 2401h & int 15h\r
+    cli                                 ; disable interrupts\r
+    jnc     @2\r
+@1:\r
+    test    dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL\r
+    jz      @2\r
+    in      al, 92h\r
+    or      al, 2\r
+    out     92h, al                     ; deactivate A20M#\r
+@2:\r
+    mov     eax, ss\r
+    lea     bp, [esp + sizeof (IA32_REGS)]\r
+    ;\r
+    ; rsi in the following 2 instructions is indeed bp in 16-bit code\r
+    ;\r
+    mov     word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp\r
+    DB      66h\r
+    mov     ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP\r
+    shl     ax, 4                       ; shl eax, 4\r
+    add     bp, ax                      ; add ebp, eax\r
+    mov     ax, cs\r
+    shl     ax, 4\r
+    lea     ax, [eax + ebx + (@64BitCode - @Base)]\r
+    DB      66h, 2eh, 89h, 87h          ; mov cs:[bx + (@64Eip - @Base)], eax\r
+    DW      @64Eip - @Base\r
+    DB      66h, 0b8h                   ; mov eax, imm32\r
+SavedCr4    DD      ?\r
+    mov     cr4, rax\r
+    ;\r
+    ; rdi in the instruction below is indeed bx in 16-bit code\r
+    ;\r
+    DB      66h, 2eh                    ; 2eh is "cs:" segment override\r
+    lgdt    fword ptr [rdi + (SavedGdt - @Base)]\r
+    DB      66h\r
+    mov     ecx, 0c0000080h\r
+    rdmsr\r
+    or      ah, 1\r
+    wrmsr\r
+    DB      66h, 0b8h                   ; mov eax, imm32\r
+SavedCr0    DD      ?\r
+    mov     cr0, rax\r
+    DB      66h, 0eah                   ; jmp far cs:@64Bit\r
+@64Eip      DD      ?\r
+SavedCs     DW      ?\r
+@64BitCode:\r
+    mov     rsp, r8                     ; restore stack\r
+    ret\r
+_BackFromUserCode   ENDP\r
+\r
+_EntryPoint DD      _ToUserCode - m16Start\r
+            DW      CODE16\r
+_16Gdtr     LABEL   FWORD\r
+            DW      GDT_SIZE - 1\r
+_16GdtrBase DQ      _NullSeg\r
+_16Idtr     FWORD   (1 SHL 10) - 1\r
+\r
+;------------------------------------------------------------------------------\r
+; _ToUserCode() takes control in real mode before passing control to user code.\r
+; It will be shadowed to somewhere in memory below 1MB.\r
+;------------------------------------------------------------------------------\r
+_ToUserCode PROC\r
+    mov     ss, edx                     ; set new segment selectors\r
+    mov     ds, edx\r
+    mov     es, edx\r
+    mov     fs, edx\r
+    mov     gs, edx\r
+    DB      66h\r
+    mov     ecx, 0c0000080h\r
+    mov     cr0, rax                    ; real mode starts at next instruction\r
+    rdmsr\r
+    and     ah, NOT 1\r
+    wrmsr\r
+    mov     cr4, rbp\r
+    mov     ss, esi                     ; set up 16-bit stack segment\r
+    mov     sp, bx                      ; set up 16-bit stack pointer\r
+    DB      66h                         ; make the following call 32-bit\r
+    call    @Base                       ; push eip\r
+@Base:\r
+    pop     bp                          ; ebp <- address of @Base\r
+    push    [esp + sizeof (IA32_REGS) + 2]\r
+    lea     eax, [rsi + (@RealMode - @Base)]    ; rsi is "bp" in 16-bit code\r
+    push    rax\r
+    retf                                ; execution begins at next instruction\r
+@RealMode:\r
+    DB      66h, 2eh                    ; CS and operand size override\r
+    lidt    fword ptr [rsi + (_16Idtr - @Base)]\r
+    DB      66h, 61h                    ; popad\r
+    DB      1fh                         ; pop ds\r
+    DB      07h                         ; pop es\r
+    pop     fs\r
+    pop     gs\r
+    popf                                ; popfd\r
+    lea     sp, [esp + 4]               ; skip high order 32 bits of EFlags\r
+    DB      66h                         ; make the following retf 32-bit\r
+    retf                                ; transfer control to user code\r
+_ToUserCode ENDP\r
+\r
+CODE16  = _16Code - $\r
+DATA16  = _16Data - $\r
+DATA32  = _32Data - $\r
+\r
+_NullSeg    DQ      0\r
+_16Code     LABEL   QWORD\r
+            DW      -1\r
+            DW      0\r
+            DB      0\r
+            DB      9bh\r
+            DB      8fh                 ; 16-bit segment, 4GB limit\r
+            DB      0\r
+_16Data     LABEL   QWORD\r
+            DW      -1\r
+            DW      0\r
+            DB      0\r
+            DB      93h\r
+            DB      8fh                 ; 16-bit segment, 4GB limit\r
+            DB      0\r
+_32Data     LABEL   QWORD\r
+            DW      -1\r
+            DW      0\r
+            DB      0\r
+            DB      93h\r
+            DB      0cfh                ; 16-bit segment, 4GB limit\r
+            DB      0\r
+\r
+GDT_SIZE = $ - _NullSeg\r
+\r
+;------------------------------------------------------------------------------\r
+; IA32_REGISTER_SET *\r
+; EFIAPI\r
+; InternalAsmThunk16 (\r
+;   IN      IA32_REGISTER_SET         *RegisterSet,\r
+;   IN OUT  VOID                      *Transition\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalAsmThunk16  PROC    USES    rbp rbx rsi rdi\r
+    mov     r10d, ds                    ; r9 ~ r11 are not accessible in 16-bit\r
+    mov     r11d, es                    ; so use them for saving seg registers\r
+    mov     r9d, ss\r
+    push    fs\r
+    push    gs\r
+    mov     rsi, rcx\r
+    movzx   r8d, (IA32_REGS ptr [rsi])._SS\r
+    mov     edi, (IA32_REGS ptr [rsi])._ESP\r
+    lea     rdi, [edi - (sizeof (IA32_REGS) + 4)]\r
+    imul    eax, r8d, 16                ; eax <- r8d(stack segment) * 16\r
+    mov     ebx, edi                    ; ebx <- stack for 16-bit code\r
+    push    sizeof (IA32_REGS) / 4\r
+    add     edi, eax                    ; edi <- linear address of 16-bit stack\r
+    pop     rcx\r
+    rep     movsd                       ; copy RegSet\r
+    lea     ecx, [rdx + (SavedCr4 - m16Start)]\r
+    mov     eax, edx                    ; eax <- transition code address\r
+    and     edx, 0fh\r
+    shl     eax, 12                     ; segment address in high order 16 bits\r
+    lea     ax, [rdx + (_BackFromUserCode - m16Start)]  ; offset address\r
+    stosd                               ; [edi] <- return address of user code\r
+    sgdt    fword ptr [rcx + (SavedGdt - SavedCr4)]\r
+    sidt    fword ptr [rsp + 38h]       ; save IDT stack in argument space\r
+    mov     rax, cr0\r
+    mov     [rcx + (SavedCr0 - SavedCr4)], eax\r
+    and     eax, 7ffffffeh              ; clear PE, PG bits\r
+    mov     rbp, cr4\r
+    mov     [rcx], ebp                  ; save CR4 in SavedCr4\r
+    and     ebp, 300h                   ; clear all but PCE and OSFXSR bits\r
+    mov     esi, r8d                    ; esi <- 16-bit stack segment\r
+    DB      6ah, DATA32                 ; push DATA32\r
+    pop     rdx                         ; rdx <- 32-bit data segment selector\r
+    lgdt    fword ptr [rcx + (_16Gdtr - SavedCr4)]\r
+    mov     ss, edx\r
+    pushfq\r
+    lea     edx, [rdx + DATA16 - DATA32]\r
+    lea     r8, @RetFromRealMode\r
+    push    r8\r
+    mov     r8d, cs\r
+    mov     [rcx + (SavedCs - SavedCr4)], r8w\r
+    mov     r8, rsp\r
+    jmp     fword ptr [rcx + (_EntryPoint - SavedCr4)]\r
+@RetFromRealMode:\r
+    popfq\r
+    lidt    fword ptr [rsp + 38h]       ; restore protected mode IDTR\r
+    lea     eax, [rbp - sizeof (IA32_REGS)]\r
+    pop     gs\r
+    pop     fs\r
+    mov     ss, r9d\r
+    mov     es, r11d\r
+    mov     ds, r10d\r
+    ret\r
+InternalAsmThunk16  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/Wbinvd.S b/MdePkg/Library/BaseLib/X64/Wbinvd.S
new file mode 100644 (file)
index 0000000..a4b9704
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   Wbinvd.S
+#
+# Abstract:
+#
+#   AsmWbinvd function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWbinvd (
+#   VOID
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWbinvd;
+.align 16;
+_AsmWbinvd:
+    wbinvd
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/Wbinvd.asm b/MdePkg/Library/BaseLib/X64/Wbinvd.asm
new file mode 100644 (file)
index 0000000..ca0cb25
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   Wbinvd.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWbinvd function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWbinvd (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWbinvd   PROC\r
+    wbinvd\r
+    ret\r
+AsmWbinvd   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr0.S b/MdePkg/Library/BaseLib/X64/WriteCr0.S
new file mode 100644 (file)
index 0000000..f77dc81
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteCr0.S
+#
+# Abstract:
+#
+#   AsmWriteCr0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteCr0 (
+#   UINTN  Cr0
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteCr0;
+_AsmWriteCr0:
+    mov    %rcx,%cr0
+    mov    %rcx,%rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr0.asm b/MdePkg/Library/BaseLib/X64/WriteCr0.asm
new file mode 100644 (file)
index 0000000..caf1904
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteCr0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteCr0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteCr0 (\r
+;   UINTN  Cr0\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteCr0 PROC\r
+    mov     cr0, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteCr0 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr2.S b/MdePkg/Library/BaseLib/X64/WriteCr2.S
new file mode 100644 (file)
index 0000000..6682161
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteCr2.S
+#
+# Abstract:
+#
+#   AsmWriteCr2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteCr2 (
+#   UINTN  Cr2
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteCr2;
+_AsmWriteCr0:
+    mov    %rcx,%cr2
+    mov    %rcx,%rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr2.asm b/MdePkg/Library/BaseLib/X64/WriteCr2.asm
new file mode 100644 (file)
index 0000000..ee5b546
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteCr2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteCr2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteCr2 (\r
+;   UINTN  Cr2\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteCr2 PROC\r
+    mov     cr2, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteCr2 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr3.S b/MdePkg/Library/BaseLib/X64/WriteCr3.S
new file mode 100644 (file)
index 0000000..880ed97
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteCr3.S
+#
+# Abstract:
+#
+#   AsmWriteCr3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteCr3 (
+#   UINTN  Cr3
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteCr3;
+_AsmWriteCr3:
+    mov    %rcx,%cr3
+    mov    %rcx,%rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr3.asm b/MdePkg/Library/BaseLib/X64/WriteCr3.asm
new file mode 100644 (file)
index 0000000..e632298
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteCr3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteCr3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteCr3 (\r
+;   UINTN  Cr3\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteCr3 PROC\r
+    mov     cr3, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteCr3 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr4.S b/MdePkg/Library/BaseLib/X64/WriteCr4.S
new file mode 100644 (file)
index 0000000..0469363
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteCr4.S
+#
+# Abstract:
+#
+#   AsmWriteCr4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteCr4 (
+#   UINTN  Cr4
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteCr4;
+_AsmWriteCr4:
+    mov    %rcx,%cr4
+    mov    %rcx,%rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteCr4.asm b/MdePkg/Library/BaseLib/X64/WriteCr4.asm
new file mode 100644 (file)
index 0000000..3e79fe2
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteCr4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteCr4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteCr4 (\r
+;   UINTN  Cr4\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteCr4 PROC\r
+    mov     cr4, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteCr4 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr0.S b/MdePkg/Library/BaseLib/X64/WriteDr0.S
new file mode 100644 (file)
index 0000000..080e56a
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr0.S
+#
+# Abstract:
+#
+#   AsmWriteDr0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr0 (
+#   UINTN  Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr0;
+.align 16;
+_AsmWriteDr0:
+    mov     %rcx, %dr0
+    mov     %rcx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr0.asm b/MdePkg/Library/BaseLib/X64/WriteDr0.asm
new file mode 100644 (file)
index 0000000..a1131fe
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr0 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr0 PROC\r
+    mov     dr0, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr0 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr1.S b/MdePkg/Library/BaseLib/X64/WriteDr1.S
new file mode 100644 (file)
index 0000000..af61b68
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr1.S
+#
+# Abstract:
+#
+#   AsmWriteDr1 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr1 (
+#   UINTN  Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr1;
+.align 16;
+_AsmWriteDr1:
+    mov     %rcx, %dr1
+    mov     %rcx, rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr1.asm b/MdePkg/Library/BaseLib/X64/WriteDr1.asm
new file mode 100644 (file)
index 0000000..366edb6
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr1.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr1 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr1 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr1 PROC\r
+    mov     dr1, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr1 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr2.S b/MdePkg/Library/BaseLib/X64/WriteDr2.S
new file mode 100644 (file)
index 0000000..a9e5369
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr2.S
+#
+# Abstract:
+#
+#   AsmWriteDr2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr2 (
+#   UINTN  Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr2;
+.align 16;
+_AsmWriteDr2:
+    mov     %rcx, %dr2
+    mov     %rcx, rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr2.asm b/MdePkg/Library/BaseLib/X64/WriteDr2.asm
new file mode 100644 (file)
index 0000000..bde8e3d
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr2 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr2 PROC\r
+    mov     dr2, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr2 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr3.S b/MdePkg/Library/BaseLib/X64/WriteDr3.S
new file mode 100644 (file)
index 0000000..04017cc
--- /dev/null
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr3.S
+#
+# Abstract:
+#
+#   AsmWriteDr3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr3 (
+#   UINTN  Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr3;
+.align 16;
+_AsmWriteDr3:
+    mov     %rcx, %dr3
+    mov     %rcx, rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr3.asm b/MdePkg/Library/BaseLib/X64/WriteDr3.asm
new file mode 100644 (file)
index 0000000..65180a2
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr3 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr3 PROC\r
+    mov     dr3, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr3 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr4.S b/MdePkg/Library/BaseLib/X64/WriteDr4.S
new file mode 100644 (file)
index 0000000..b6b4e78
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr4.S
+#
+# Abstract:
+#
+#   AsmWriteDr4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr4 (
+#   IN UINTN Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr4;
+_AsmWriteDr4:
+    mov     %rcx, %dr4
+    mov     %rcx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr4.asm b/MdePkg/Library/BaseLib/X64/WriteDr4.asm
new file mode 100644 (file)
index 0000000..188a9d4
--- /dev/null
@@ -0,0 +1,43 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr4 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr4 PROC\r
+    ;\r
+    ; There's no obvious reason to access this register, since it's aliased to\r
+    ; DR6 when DE=0 or an exception generated when DE=1\r
+    ;\r
+    DB      0fh, 23h, 0e1h\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr4 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr5.S b/MdePkg/Library/BaseLib/X64/WriteDr5.S
new file mode 100644 (file)
index 0000000..7539095
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr5.S
+#
+# Abstract:
+#
+#   AsmWriteDr5 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr5 (
+#   IN UINTN Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr5;
+_AsmWriteDr5:
+    mov     %rcx, %dr5
+    mov     %rcx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr5.asm b/MdePkg/Library/BaseLib/X64/WriteDr5.asm
new file mode 100644 (file)
index 0000000..86009c3
--- /dev/null
@@ -0,0 +1,43 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr5.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr5 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr6 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr5 PROC\r
+    ;\r
+    ; There's no obvious reason to access this register, since it's aliased to\r
+    ; DR7 when DE=0 or an exception generated when DE=1\r
+    ;\r
+    DB      0fh, 23h, 0e9h\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr5 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr6.S b/MdePkg/Library/BaseLib/X64/WriteDr6.S
new file mode 100644 (file)
index 0000000..8627260
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr6.S
+#
+# Abstract:
+#
+#   AsmWriteDr6 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr6 (
+#   IN UINTN Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr6;
+_AsmWriteDr6:
+    mov     %rcx, %dr6
+    mov     %rcx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr6.asm b/MdePkg/Library/BaseLib/X64/WriteDr6.asm
new file mode 100644 (file)
index 0000000..f1ddae8
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr6.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr6 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr6 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr6 PROC\r
+    mov     dr6, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr6 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr7.S b/MdePkg/Library/BaseLib/X64/WriteDr7.S
new file mode 100644 (file)
index 0000000..8699d95
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteDr7.S
+#
+# Abstract:
+#
+#   AsmWriteDr7 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINTN
+# EFIAPI
+# AsmWriteDr7 (
+#   IN UINTN Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteDr7;
+_AsmWriteDr7:
+    mov     %rcx, %dr7
+    mov     %rcx, %rax
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteDr7.asm b/MdePkg/Library/BaseLib/X64/WriteDr7.asm
new file mode 100644 (file)
index 0000000..6a0cbfa
--- /dev/null
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteDr7.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteDr7 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; AsmWriteDr7 (\r
+;   IN UINTN Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteDr7 PROC\r
+    mov     dr7, rcx\r
+    mov     rax, rcx\r
+    ret\r
+AsmWriteDr7 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteGdtr.S b/MdePkg/Library/BaseLib/X64/WriteGdtr.S
new file mode 100644 (file)
index 0000000..1e9d84b
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteGdtr.S
+#
+# Abstract:
+#
+#   AsmWriteGdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86WriteGdtr (
+#   IN      CONST IA32_DESCRIPTOR     *Idtr
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86WriteGdtr;
+_InternalX86WriteGdtr:
+    lgdt    (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteGdtr.asm b/MdePkg/Library/BaseLib/X64/WriteGdtr.asm
new file mode 100644 (file)
index 0000000..fa99a49
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteGdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteGdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86WriteGdtr (\r
+;   IN      CONST IA32_DESCRIPTOR     *Idtr\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86WriteGdtr  PROC\r
+    lgdt    fword ptr [rcx]\r
+    ret\r
+InternalX86WriteGdtr  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteIdtr.S b/MdePkg/Library/BaseLib/X64/WriteIdtr.S
new file mode 100644 (file)
index 0000000..feb085f
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteIdtr.S
+#
+# Abstract:
+#
+#   AsmWriteIdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# InternalX86WriteIdtr (
+#   IN      CONST IA32_DESCRIPTOR     *Idtr
+#   );
+#------------------------------------------------------------------------------
+.global _InternalX86WriteIdtr;
+.align 16;
+_InternalX86WriteIdtr:
+    lidt    (%rcx)
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteIdtr.asm b/MdePkg/Library/BaseLib/X64/WriteIdtr.asm
new file mode 100644 (file)
index 0000000..2f6c081
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteIdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteIdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; InternalX86WriteIdtr (\r
+;   IN      CONST IA32_DESCRIPTOR     *Idtr\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalX86WriteIdtr  PROC\r
+    lidt    fword ptr [rcx]\r
+    ret\r
+InternalX86WriteIdtr  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteLdtr.S b/MdePkg/Library/BaseLib/X64/WriteLdtr.S
new file mode 100644 (file)
index 0000000..c07ab83
--- /dev/null
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteLdtr.S
+#
+# Abstract:
+#
+#   AsmWriteLdtr function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteLdtr (
+#   IN UINT16 Ldtr
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteLdtr;
+.align 16;
+_AsmWriteLdtr:
+    lldt    %cx
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteLdtr.asm b/MdePkg/Library/BaseLib/X64/WriteLdtr.asm
new file mode 100644 (file)
index 0000000..d85ae38
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteLdtr.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteLdtr function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteLdtr (\r
+;   IN UINT16 Ldtr\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteLdtr    PROC\r
+    lldt    cx\r
+    ret\r
+AsmWriteLdtr    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm0.S b/MdePkg/Library/BaseLib/X64/WriteMm0.S
new file mode 100644 (file)
index 0000000..2d805a1
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm0.S
+#
+# Abstract:
+#
+#   AsmWriteMm0 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm0 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm0;
+_AsmWriteMm0:
+    movd       %rcx, %xmm0
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm0.asm b/MdePkg/Library/BaseLib/X64/WriteMm0.asm
new file mode 100644 (file)
index 0000000..7496362
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm0.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm0 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm0 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm0 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0c1h\r
+    ret\r
+AsmWriteMm0 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm1.S b/MdePkg/Library/BaseLib/X64/WriteMm1.S
new file mode 100644 (file)
index 0000000..ff8162e
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm1.S
+#
+# Abstract:
+#
+#   AsmWriteMm1 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm1 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm1;
+_AsmWriteMm1:
+    movd       %rcx, %mm1
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm1.asm b/MdePkg/Library/BaseLib/X64/WriteMm1.asm
new file mode 100644 (file)
index 0000000..a00f551
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm1.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm1 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm1 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm1 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0c9h\r
+    ret\r
+AsmWriteMm1 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm2.S b/MdePkg/Library/BaseLib/X64/WriteMm2.S
new file mode 100644 (file)
index 0000000..a98e736
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm2.S
+#
+# Abstract:
+#
+#   AsmWriteMm2 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm2 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm2; 
+_AsmWriteMm2:
+    movd       %rcx, %mm2
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm2.asm b/MdePkg/Library/BaseLib/X64/WriteMm2.asm
new file mode 100644 (file)
index 0000000..01db790
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm2.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm2 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm2 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm2 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0d1h\r
+    ret\r
+AsmWriteMm2 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm3.S b/MdePkg/Library/BaseLib/X64/WriteMm3.S
new file mode 100644 (file)
index 0000000..81561e3
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm3.S
+#
+# Abstract:
+#
+#   AsmWriteMm3 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm3 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm3;
+_AsmWriteMm3:
+    movd       %rcx, %mm3
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm3.asm b/MdePkg/Library/BaseLib/X64/WriteMm3.asm
new file mode 100644 (file)
index 0000000..5946464
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm3.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm3 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm3 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm3 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0d9h\r
+    ret\r
+AsmWriteMm3 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm4.S b/MdePkg/Library/BaseLib/X64/WriteMm4.S
new file mode 100644 (file)
index 0000000..124d946
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm4.S
+#
+# Abstract:
+#
+#   AsmWriteMm4 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm4 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm4;
+_AsmWriteMm4:
+    movd       %rcx, %mm4
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm4.asm b/MdePkg/Library/BaseLib/X64/WriteMm4.asm
new file mode 100644 (file)
index 0000000..6848dbf
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm4.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm4 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm4 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm4 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0e1h\r
+    ret\r
+AsmWriteMm4 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm5.S b/MdePkg/Library/BaseLib/X64/WriteMm5.S
new file mode 100644 (file)
index 0000000..0935ddc
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm5.S
+#
+# Abstract:
+#
+#   AsmWriteMm5 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm5 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm5;
+_AsmWriteMm5:
+    movd       %rcx, %mm5
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm5.asm b/MdePkg/Library/BaseLib/X64/WriteMm5.asm
new file mode 100644 (file)
index 0000000..fbe44ae
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm5.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm5 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm5 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm5 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0e9h\r
+    ret\r
+AsmWriteMm5 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm6.S b/MdePkg/Library/BaseLib/X64/WriteMm6.S
new file mode 100644 (file)
index 0000000..02b50cf
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm6.S
+#
+# Abstract:
+#
+#   AsmWriteMm6 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm6 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm6;
+_AsmWriteMm6:
+    movd       %rcx, %mm6
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm6.asm b/MdePkg/Library/BaseLib/X64/WriteMm6.asm
new file mode 100644 (file)
index 0000000..cd59388
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm6.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm6 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm6 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm6 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0f1h\r
+    ret\r
+AsmWriteMm6 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm7.S b/MdePkg/Library/BaseLib/X64/WriteMm7.S
new file mode 100644 (file)
index 0000000..6029272
--- /dev/null
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMm7.S
+#
+# Abstract:
+#
+#   AsmWriteMm7 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# AsmWriteMm7 (
+#   IN UINT64   Value
+#   );
+#------------------------------------------------------------------------------
+.global _AsmWriteMm7;
+_AsmWriteMm7:
+    movd       %rcx, %mm7
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMm7.asm b/MdePkg/Library/BaseLib/X64/WriteMm7.asm
new file mode 100644 (file)
index 0000000..9636a4c
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMm7.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMm7 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmWriteMm7 (\r
+;   IN UINT64   Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMm7 PROC\r
+    ;\r
+    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
+    ;\r
+    DB      48h, 0fh, 6eh, 0f9h\r
+    ret\r
+AsmWriteMm7 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.S b/MdePkg/Library/BaseLib/X64/WriteMsr64.S
new file mode 100644 (file)
index 0000000..88ff48b
--- /dev/null
@@ -0,0 +1,40 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   WriteMsr64.S
+#
+# Abstract:
+#
+#   AsmWriteMsr64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# UINT64
+# EFIAPI
+# AsmWriteMsr64 (
+#   IN UINT32  Index,
+#   IN UINT64  Value
+#   );
+# TODO:
+#------------------------------------------------------------------------------
+.global _AsmWriteMsr64;
+.align 16;
+_AsmWriteMsr64:
+    mov        %rdx, %rax
+    shr $0x20, %rdx
+    wrmsr
+    ret
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.asm b/MdePkg/Library/BaseLib/X64/WriteMsr64.asm
new file mode 100644 (file)
index 0000000..b7704b8
--- /dev/null
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   WriteMsr64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmWriteMsr64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmWriteMsr64 (\r
+;   IN UINT32  Index,\r
+;   IN UINT64  Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+AsmWriteMsr64   PROC\r
+    mov     rax, rdx                    ; meanwhile, rax <- return value\r
+    shr     rdx, 20h                    ; edx:eax contains the value to write\r
+    wrmsr\r
+    ret\r
+AsmWriteMsr64   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.c b/MdePkg/Library/BaseLib/X64/WriteMsr64.c
new file mode 100644 (file)
index 0000000..1d1e0bc
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  CpuBreakpoint function.\r
+\r
+  Copyright (c) 2006 - 2007, 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
+//\r
+// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
+//\r
+void __writemsr (unsigned long Register, unsigned __int64 Value);\r
+\r
+#pragma intrinsic(__writemsr)\r
+\r
+UINT64\r
+EFIAPI\r
+AsmWriteMsr64 (\r
+  IN UINT32  Index,\r
+  IN UINT64  Value\r
+  )\r
+{\r
+  __writemsr (Index, Value);\r
+  return Value;\r
+}\r
+\r
index 3968604ca6e21f087f40df20788a24e53f4b3146..725367b2f96e00fe834e446b7381793d9779c5ec 100644 (file)
@@ -1,58 +1,53 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CompareMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   CompareMem function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemCompareMem\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-#   IN      CONST VOID                *DestinationBuffer,\r
-#   IN      CONST VOID                *SourceBuffer,\r
-#   IN      UINTN                     Length\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemCompareMem:\r
-    push    %esi\r
-    push    %edi\r
-    movl    12(%esp), %esi\r
-    movl    16(%esp), %edi\r
-    movl    20(%esp), %ecx\r
-    repe    cmpsb\r
-    movzbl  -1(%esi), %eax\r
-    movzbl  -1(%edi), %edx\r
-    subl    %edx, %eax\r
-    pop     %edi\r
-    pop     %esi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CompareMem.Asm
+#
+# Abstract:
+#
+#   CompareMem function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCompareMem
+
+#------------------------------------------------------------------------------
+# INTN
+# EFIAPI
+# InternalMemCompareMem (
+#   IN      CONST VOID                *DestinationBuffer,
+#   IN      CONST VOID                *SourceBuffer,
+#   IN      UINTN                     Length
+#   );
+#------------------------------------------------------------------------------
+_InternalMemCompareMem:
+    push    %esi
+    push    %edi
+    movl    12(%esp), %esi
+    movl    16(%esp), %edi
+    movl    20(%esp), %ecx
+    repe    cmpsb
+    movzbl  -1(%esi), %eax
+    movzbl  -1(%edi), %edx
+    subl    %edx, %eax
+    pop     %edi
+    pop     %esi
+    ret
index 2509e40bd89149384c29346109870e91b4c1f118..1d0e7fad3978badad720a7beef77a03eb861469b 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index a83fc04634dd5e7de120fa48bacc79643aaea073..a95b33759c3aced3d898e7263394d2cfa0aa76a1 100644 (file)
@@ -1,70 +1,65 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CopyMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemCopyMem\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  EFIAPI\r
-#  InternalMemCopyMem (\r
-#    IN VOID   *Destination,\r
-#    IN VOID   *Source,\r
-#    IN UINTN  Count\r
-#    );\r
-#------------------------------------------------------------------------------\r
-_InternalMemCopyMem:\r
-    push    %esi\r
-    push    %edi\r
-    movl    16(%esp), %esi              # esi <- Source\r
-    movl    12(%esp), %edi              # edi <- Destination\r
-    movl    20(%esp), %edx              # edx <- Count\r
-    leal    -1(%esi, %edx), %eax        # eax <- End of Source\r
-    cmpl    %edi, %esi\r
-    jae     L0\r
-    cmpl    %edi, %eax\r
-    jae     L_CopyBackward              # Copy backward if overlapped\r
-L0:\r
-    movl    %edx, %ecx\r
-    andl    $3, %edx\r
-    shrl    $2, %ecx\r
-    rep\r
-    movsl                               # Copy as many Dwords as possible\r
-    jmp     L_CopyBytes\r
-L_CopyBackward:\r
-    movl    %eax, %esi                  # esi <- End of Source\r
-    leal    -1(%edi, %edx), %edi        # edi <- End of Destination\r
-    std\r
-L_CopyBytes:\r
-    movl    %edx, %ecx\r
-    rep\r
-    movsb                               # Copy bytes backward\r
-    cld\r
-    movl    12(%esp), %eax              # eax <- Destination as return value\r
-    pop     %edi\r
-    pop     %esi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CopyMem.Asm
+#
+# Abstract:
+#
+#   CopyMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCopyMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemCopyMem (
+#    IN VOID   *Destination,
+#    IN VOID   *Source,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemCopyMem:
+    push    %esi
+    push    %edi
+    movl    16(%esp), %esi              # esi <- Source
+    movl    12(%esp), %edi              # edi <- Destination
+    movl    20(%esp), %edx              # edx <- Count
+    leal    -1(%esi, %edx), %eax        # eax <- End of Source
+    cmpl    %edi, %esi
+    jae     L0
+    cmpl    %edi, %eax
+    jae     L_CopyBackward              # Copy backward if overlapped
+L0:
+    movl    %edx, %ecx
+    andl    $3, %edx
+    shrl    $2, %ecx
+    rep
+    movsl                               # Copy as many Dwords as possible
+    jmp     L_CopyBytes
+L_CopyBackward:
+    movl    %eax, %esi                  # esi <- End of Source
+    leal    -1(%edi, %edx), %edi        # edi <- End of Destination
+    std
+L_CopyBytes:
+    movl    %edx, %ecx
+    rep
+    movsb                               # Copy bytes backward
+    cld
+    movl    12(%esp), %eax              # eax <- Destination as return value
+    pop     %edi
+    pop     %esi
+    ret
index 8b4366e976baea764c8b9e728cfeab991b09b28c..86677ef614ba9bca9c981274489aa4ab10f6f373 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 276b4ff29f7a6118c8dd0e710735dd5b0c0f7de2..5e65b9667a23e2177791cae71abd460251d00fb9 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem16.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem16\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT16                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem16:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movl    16(%esp), %eax\r
-    repne   scasw\r
-    leal    -2(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem16.Asm
+#
+# Abstract:
+#
+#   ScanMem16 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem16
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem16 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT16                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem16:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasw
+    leal    -2(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index 6b5c81f5566da4935f9b6e46501bba7d356438f5..57fab61b775bf69a6e752c600ee4df67f7dfe02f 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index fced1b2362fa2f19fcf0bc7bd1aa46398e8c7110..5d46ed2bc18ecb8eaff1fcf0c46f4cccbf73fdb3 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem32.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem32\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT32                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem32:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movl    16(%esp), %eax\r
-    repne   scasl\r
-    leal    -4(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem32.Asm
+#
+# Abstract:
+#
+#   ScanMem32 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem32
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem32 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT32                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem32:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasl
+    leal    -4(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index cb0feed6be6f56225ef634ae4ed33dc9e9a030c2..6ac857ce163abb5e2cf3aadc49d8865d8bdfb383 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 37dc3bbf67355f48b0cb4c031e12a72b5e0d60b7..3ba69650ab37d2448606afc8969e5c5df070742b 100644 (file)
@@ -1,64 +1,59 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem64.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem64\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT64                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem64:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    16(%esp), %eax\r
-    movl    20(%esp), %edx\r
-    movl    8(%esp), %edi\r
-L0:\r
-    cmpl    (%edi), %eax\r
-    leal    8(%edi), %edi\r
-    loopne  L0\r
-    jne     L1\r
-    cmpl    -4(%edi), %edx\r
-    jecxz   L1\r
-    jne     L0\r
-L1:\r
-    leal    -8(%edi), %eax\r
-    cmovne  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem64.Asm
+#
+# Abstract:
+#
+#   ScanMem64 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem64
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem64 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT64                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem64:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    16(%esp), %eax
+    movl    20(%esp), %edx
+    movl    8(%esp), %edi
+L0:
+    cmpl    (%edi), %eax
+    leal    8(%edi), %edi
+    loopne  L0
+    jne     L1
+    cmpl    -4(%edi), %edx
+    jecxz   L1
+    jne     L0
+L1:
+    leal    -8(%edi), %eax
+    cmovne  %ecx, %eax
+    pop     %edi
+    ret
index ee0deddc61f9979c42050592d8dd154fb0092856..ca54f13738b2f7b4c1be26760b40bc70c54e755d 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index e7d2a26cadfa3500d616023857dbca3bc8f9d82e..7a834a56351e05ab35f7aa2827af89ea24521897 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem8.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem8\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT8                     Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem8:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movb    16(%esp), %al\r
-    repne   scasb\r
-    leal    -1(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem8.Asm
+#
+# Abstract:
+#
+#   ScanMem8 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem8
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem8 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT8                     Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem8:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movb    16(%esp), %al
+    repne   scasb
+    leal    -1(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index 97d201abb575d99723b9e429720d0424f54df66a..a3f65b64fac29b0de29ac05f54cf645127457737 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 46029950be1e1e61129a085a1ba2480e45c97099..4ddf6c490b028edceee569dd31466df1709b2b68 100644 (file)
@@ -1,51 +1,46 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    .386:\r
-    .code:\r
-\r
-.globl _InternalMemSetMem\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  InternalMemSetMem (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT8  Value\r
-#    )\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem:\r
-    push    %edi\r
-    movl    16(%esp),%eax\r
-    movl    8(%esp),%edi\r
-    movl    12(%esp),%ecx\r
-    rep\r
-    stosb\r
-    movl    8(%esp),%eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem.Asm
+#
+# Abstract:
+#
+#   SetMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+    .386:
+    .code:
+
+.globl _InternalMemSetMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT8  Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem:
+    push    %edi
+    movl    16(%esp),%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    rep
+    stosb
+    movl    8(%esp),%eax
+    pop     %edi
+    ret
index b48cffc1ee14c54f94696a6f7c0da1ab801e48c3..98b1ed84c271b854070a193da404c53773a84de2 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index ff62e947a41c0c84fee5b281c19af3003894d434..6e7c136222bf94b978ed8739974a7e16bd0c6aea 100644 (file)
@@ -1,48 +1,43 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem16.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemSetMem16\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  InternalMemSetMem16 (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT16 Value\r
-#    )\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem16:\r
-    push    %edi\r
-    movl    16(%esp), %eax\r
-    movl    8(%esp), %edi\r
-    movl    12(%esp), %ecx\r
-    rep\r
-    stosw\r
-    movl    8(%esp), %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem16.Asm
+#
+# Abstract:
+#
+#   SetMem16 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem16
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem16 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT16 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem16:
+    push    %edi
+    movl    16(%esp), %eax
+    movl    8(%esp), %edi
+    movl    12(%esp), %ecx
+    rep
+    stosw
+    movl    8(%esp), %eax
+    pop     %edi
+    ret
index 1319614d516a6771bd4e95aed3a23d07ff4f1889..7f4a8955f946eb6135e4dbf77cc122cb4f40a7e0 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 8b94d563af6d87e8f29f8b1e4a9d8ec8c72783b2..455af205730ddf77eeb48b2b7453d4be73f0068e 100644 (file)
@@ -1,48 +1,43 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem32.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemSetMem32\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  InternalMemSetMem32 (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT32 Value\r
-#    )\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem32:\r
-    push    %edi\r
-    movl    16(%esp),%eax\r
-    movl    8(%esp),%edi\r
-    movl    12(%esp),%ecx\r
-    rep\r
-    stosl\r
-    movl    8(%esp),%eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem32.Asm
+#
+# Abstract:
+#
+#   SetMem32 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem32
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem32 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT32 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem32:
+    push    %edi
+    movl    16(%esp),%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    rep
+    stosl
+    movl    8(%esp),%eax
+    pop     %edi
+    ret
index 34f4b8e5d7a8c114b54fddc0d8e0898649d2cbdf..5876f4a7418dc68ee357c63376727f4851dd1082 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 68418cca6cdf6fae0e9bcddb0fddbd0b901b694e..b4afff0fd4819ace608d6b4f3ee174e56f895b08 100644 (file)
@@ -1,51 +1,46 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem64.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemSetMem64\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  InternalMemSetMem64 (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT64 Value\r
-#    )\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem64:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    16(%esp), %eax\r
-    movl    20(%esp), %edx\r
-    movl    8(%esp), %edi\r
-L0:\r
-    mov     %eax, -8(%edi, %ecx, 8)\r
-    mov     %edx, -4(%edi, %ecx, 8)\r
-    loop    L0\r
-    movl    %edi, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem64.Asm
+#
+# Abstract:
+#
+#   SetMem64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem64
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem64 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT64 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem64:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    16(%esp), %eax
+    movl    20(%esp), %edx
+    movl    8(%esp), %edi
+L0:
+    mov     %eax, -8(%edi, %ecx, 8)
+    mov     %edx, -4(%edi, %ecx, 8)
+    loop    L0
+    movl    %edi, %eax
+    pop     %edi
+    ret
index 3aa24ef7e435473c6e7bcd248c85b1db3608bceb..687c18f312c5bc34878da034491305ac7b46e843 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 9551c1a4a63c88910e3c3ed58000cbab6e78c524..8465d7cf65fd7c22b1e3711cfc4015840b1da535 100644 (file)
@@ -1,54 +1,49 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ZeroMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemZeroMem\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  InternalMemZeroMem (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count\r
-#    );\r
-#------------------------------------------------------------------------------\r
-_InternalMemZeroMem:\r
-    push    %edi\r
-    xorl    %eax,%eax\r
-    movl    8(%esp),%edi\r
-    movl    12(%esp),%ecx\r
-    movl    %ecx,%edx\r
-    shrl    $2,%ecx\r
-    andl    $3,%edx\r
-    pushl   %edi\r
-    rep\r
-    stosl\r
-    movl    %edx,%ecx\r
-    rep\r
-    stosb\r
-    popl    %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ZeroMem.Asm
+#
+# Abstract:
+#
+#   ZeroMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemZeroMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemZeroMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemZeroMem:
+    push    %edi
+    xorl    %eax,%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    movl    %ecx,%edx
+    shrl    $2,%ecx
+    andl    $3,%edx
+    pushl   %edi
+    rep
+    stosl
+    movl    %edx,%ecx
+    rep
+    stosb
+    popl    %eax
+    pop     %edi
+    ret
index fe569250ae8868b25778f554ff63b96a72350bff..b3b8b5d1f1ae36ec8d9bb37a759d33d2531ce46c 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/CompareMem.asm
new file mode 100644 (file)
index 0000000..554bc07
--- /dev/null
@@ -0,0 +1,52 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CompareMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CompareMem function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; INTN\r
+; EFIAPI\r
+; InternalMemCompareMem (\r
+;   IN      CONST VOID                *DestinationBuffer,\r
+;   IN      CONST VOID                *SourceBuffer,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemCompareMem   PROC    USES    rsi rdi\r
+    mov     rsi, rcx\r
+    mov     rdi, rdx\r
+    mov     rcx, r8\r
+    repe    cmpsb\r
+    movzx   rax, byte ptr [rsi - 1]\r
+    movzx   rdx, byte ptr [rdi - 1]\r
+    sub     rax, rdx\r
+    ret\r
+InternalMemCompareMem   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm
new file mode 100644 (file)
index 0000000..a2e0405
--- /dev/null
@@ -0,0 +1,61 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CopyMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemCopyMem (\r
+;    IN VOID   *Destination,\r
+;    IN VOID   *Source,\r
+;    IN UINTN  Count\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemCopyMem  PROC    USES    rsi rdi\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
+    cmp     rsi, rdi\r
+    mov     rax, rdi                    ; rax <- Destination as return value\r
+    jae     @F\r
+    cmp     r9, rsi\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 7\r
+    shr     rcx, 3\r
+    rep     movsq                       ; Copy as many Qwords as possible\r
+    jmp     @CopyBytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
+    std                                 ; set direction flag\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb                       ; Copy bytes backward\r
+    cld\r
+    ret\r
+InternalMemCopyMem  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem16.asm
new file mode 100644 (file)
index 0000000..a2538c2
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem16.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem16 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem16 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT16                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem16    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasw\r
+    lea     rax, [rdi - 2]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem16    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem32.asm
new file mode 100644 (file)
index 0000000..e0523d8
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem32.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem32 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem32 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT32                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem32    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasd\r
+    lea     rax, [rdi - 4]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem32    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem64.asm
new file mode 100644 (file)
index 0000000..0e7e9c7
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem64 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem64 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT64                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem64    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasq\r
+    lea     rax, [rdi - 8]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem64    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ScanMem8.asm
new file mode 100644 (file)
index 0000000..879273f
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem8.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem8 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem8 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT8                     Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem8 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rcx, rdx\r
+    mov     rax, r8\r
+    repne   scasb\r
+    lea     rax, [rdi - 1]\r
+    cmovnz  rax, rcx                    ; set rax to 0 if not found\r
+    ret\r
+InternalMemScanMem8 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem.asm
new file mode 100644 (file)
index 0000000..5306520
--- /dev/null
@@ -0,0 +1,44 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemSetMem (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT8  Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem   PROC    USES    rdi\r
+    mov     rax, r8\r
+    mov     rdi, rcx\r
+    xchg    rcx, rdx\r
+    rep     stosb\r
+    mov     rax, rdx\r
+    ret\r
+InternalMemSetMem   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem16.asm
new file mode 100644 (file)
index 0000000..fce9ed7
--- /dev/null
@@ -0,0 +1,44 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem16.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem16 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemSetMem16 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT16 Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem16 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    xchg    rcx, rdx\r
+    rep     stosw\r
+    mov     rax, rdx\r
+    ret\r
+InternalMemSetMem16 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem32.asm
new file mode 100644 (file)
index 0000000..ce9e54d
--- /dev/null
@@ -0,0 +1,44 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem32.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem32 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemSetMem32 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT32 Value\r
+;    );\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem32 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    xchg    rcx, rdx\r
+    rep     stosd\r
+    mov     rax, rdx\r
+    ret\r
+InternalMemSetMem32 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/SetMem64.asm
new file mode 100644 (file)
index 0000000..97884a3
--- /dev/null
@@ -0,0 +1,43 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemSetMem64 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT64 Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem64 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    xchg    rcx, rdx\r
+    rep     stosq\r
+    mov     rax, rdx\r
+    ret\r
+InternalMemSetMem64 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/x64/ZeroMem.asm
new file mode 100644 (file)
index 0000000..c01af8e
--- /dev/null
@@ -0,0 +1,47 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ZeroMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemZeroMem (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count\r
+;    );\r
+;------------------------------------------------------------------------------\r
+InternalMemZeroMem  PROC    USES    rdi\r
+    push    rcx\r
+    xor     rax, rax\r
+    mov     rdi, rcx\r
+    mov     rcx, rdx\r
+    shr     rcx, 3\r
+    and     rdx, 7\r
+    rep     stosq\r
+    mov     ecx, edx\r
+    rep     stosb\r
+    pop     rax\r
+    ret\r
+InternalMemZeroMem  ENDP\r
+\r
+    END\r
index 3968604ca6e21f087f40df20788a24e53f4b3146..725367b2f96e00fe834e446b7381793d9779c5ec 100644 (file)
@@ -1,58 +1,53 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CompareMem.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   CompareMem function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemCompareMem\r
-\r
-#------------------------------------------------------------------------------\r
-# INTN\r
-# EFIAPI\r
-# InternalMemCompareMem (\r
-#   IN      CONST VOID                *DestinationBuffer,\r
-#   IN      CONST VOID                *SourceBuffer,\r
-#   IN      UINTN                     Length\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemCompareMem:\r
-    push    %esi\r
-    push    %edi\r
-    movl    12(%esp), %esi\r
-    movl    16(%esp), %edi\r
-    movl    20(%esp), %ecx\r
-    repe    cmpsb\r
-    movzbl  -1(%esi), %eax\r
-    movzbl  -1(%edi), %edx\r
-    subl    %edx, %eax\r
-    pop     %edi\r
-    pop     %esi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CompareMem.Asm
+#
+# Abstract:
+#
+#   CompareMem function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCompareMem
+
+#------------------------------------------------------------------------------
+# INTN
+# EFIAPI
+# InternalMemCompareMem (
+#   IN      CONST VOID                *DestinationBuffer,
+#   IN      CONST VOID                *SourceBuffer,
+#   IN      UINTN                     Length
+#   );
+#------------------------------------------------------------------------------
+_InternalMemCompareMem:
+    push    %esi
+    push    %edi
+    movl    12(%esp), %esi
+    movl    16(%esp), %edi
+    movl    20(%esp), %ecx
+    repe    cmpsb
+    movzbl  -1(%esi), %eax
+    movzbl  -1(%edi), %edx
+    subl    %edx, %eax
+    pop     %edi
+    pop     %esi
+    ret
index 2509e40bd89149384c29346109870e91b4c1f118..1d0e7fad3978badad720a7beef77a03eb861469b 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 82a2b94d0b2c11618b8b5f6bd5b03091eacc99e7..ddbcbaf1b143c41e8d203aaeba4b07551138a550 100644 (file)
@@ -1,90 +1,85 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   CopyMem.asm\r
-#\r
-# Abstract:\r
-#\r
-#   CopyMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemCopyMem\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  EFIAPI\r
-#  InternalMemCopyMem (\r
-#    IN VOID   *Destination,\r
-#    IN VOID   *Source,\r
-#    IN UINTN  Count\r
-#    );\r
-#------------------------------------------------------------------------------\r
-_InternalMemCopyMem:\r
-    push    %esi\r
-    push    %edi\r
-    movl    16(%esp), %esi              # esi <- Source\r
-    movl    12(%esp), %edi              # edi <- Destination\r
-    movl    20(%esp), %edx              # edx <- Count\r
-    leal    -1(%esi,%edx,), %eax        # eax <- End of Source\r
-    cmpl    %edi, %esi\r
-    jae     L0\r
-    cmpl    %edi, %eax                  # Overlapped?\r
-    jae     L_CopyBackward               # Copy backward if overlapped\r
-L0:\r
-    xorl    %ecx, %ecx\r
-    subl    %edi, %ecx\r
-    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary\r
-    jz      L1\r
-    cmpl    %edx, %ecx\r
-    cmova   %edx, %ecx\r
-    subl    %ecx, %edx                  # edx <- remaining bytes to copy\r
-    rep\r
-    movsb\r
-L1:\r
-    movl    %edx, %ecx\r
-    andl    $15, %edx\r
-    shrl    $4, %ecx                    # ecx <- # of DQwords to copy\r
-    jz      L_CopyBytes\r
-    addl    $-16, %esp\r
-    movdqu  %xmm0, (%esp)\r
-L2:\r
-    movdqu  (%esi), %xmm0\r
-    movntdq %xmm0, (%edi)\r
-    addl    $16, %esi\r
-    addl    $16, %edi\r
-    loop    L2\r
-    mfence\r
-    movdqu  (%esp),%xmm0\r
-    addl    $16, %esp                   # stack cleanup\r
-    jmp     L_CopyBytes\r
-L_CopyBackward:\r
-    movl    %eax, %esi                  # esi <- Last byte in Source\r
-    leal    -1(%edi,%edx,), %edi        # edi <- Last byte in Destination\r
-    std\r
-L_CopyBytes:\r
-    movl    %edx, %ecx\r
-    rep\r
-    movsb\r
-    cld\r
-    movl    12(%esp), %eax              # eax <- Destination as return value\r
-    pop     %edi\r
-    pop     %esi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   CopyMem.asm
+#
+# Abstract:
+#
+#   CopyMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCopyMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemCopyMem (
+#    IN VOID   *Destination,
+#    IN VOID   *Source,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemCopyMem:
+    push    %esi
+    push    %edi
+    movl    16(%esp), %esi              # esi <- Source
+    movl    12(%esp), %edi              # edi <- Destination
+    movl    20(%esp), %edx              # edx <- Count
+    leal    -1(%esi,%edx,), %eax        # eax <- End of Source
+    cmpl    %edi, %esi
+    jae     L0
+    cmpl    %edi, %eax                  # Overlapped?
+    jae     L_CopyBackward               # Copy backward if overlapped
+L0:
+    xorl    %ecx, %ecx
+    subl    %edi, %ecx
+    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary
+    jz      L1
+    cmpl    %edx, %ecx
+    cmova   %edx, %ecx
+    subl    %ecx, %edx                  # edx <- remaining bytes to copy
+    rep
+    movsb
+L1:
+    movl    %edx, %ecx
+    andl    $15, %edx
+    shrl    $4, %ecx                    # ecx <- # of DQwords to copy
+    jz      L_CopyBytes
+    addl    $-16, %esp
+    movdqu  %xmm0, (%esp)
+L2:
+    movdqu  (%esi), %xmm0
+    movntdq %xmm0, (%edi)
+    addl    $16, %esi
+    addl    $16, %edi
+    loop    L2
+    mfence
+    movdqu  (%esp),%xmm0
+    addl    $16, %esp                   # stack cleanup
+    jmp     L_CopyBytes
+L_CopyBackward:
+    movl    %eax, %esi                  # esi <- Last byte in Source
+    leal    -1(%edi,%edx,), %edi        # edi <- Last byte in Destination
+    std
+L_CopyBytes:
+    movl    %edx, %ecx
+    rep
+    movsb
+    cld
+    movl    12(%esp), %eax              # eax <- Destination as return value
+    pop     %edi
+    pop     %esi
+    ret
index 034918af2fc9a16abf5b78ac8671eecfb35c07c5..77fb786d985ccc064d0534479ce223712c1ab581 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 276b4ff29f7a6118c8dd0e710735dd5b0c0f7de2..5e65b9667a23e2177791cae71abd460251d00fb9 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem16.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem16 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem16\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem16 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT16                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem16:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movl    16(%esp), %eax\r
-    repne   scasw\r
-    leal    -2(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem16.Asm
+#
+# Abstract:
+#
+#   ScanMem16 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem16
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem16 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT16                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem16:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasw
+    leal    -2(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index 6b5c81f5566da4935f9b6e46501bba7d356438f5..57fab61b775bf69a6e752c600ee4df67f7dfe02f 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index fced1b2362fa2f19fcf0bc7bd1aa46398e8c7110..5d46ed2bc18ecb8eaff1fcf0c46f4cccbf73fdb3 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem32.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem32 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem32\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem32 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT32                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem32:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movl    16(%esp), %eax\r
-    repne   scasl\r
-    leal    -4(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem32.Asm
+#
+# Abstract:
+#
+#   ScanMem32 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem32
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem32 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT32                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem32:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasl
+    leal    -4(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index cb0feed6be6f56225ef634ae4ed33dc9e9a030c2..6ac857ce163abb5e2cf3aadc49d8865d8bdfb383 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 37dc3bbf67355f48b0cb4c031e12a72b5e0d60b7..3ba69650ab37d2448606afc8969e5c5df070742b 100644 (file)
@@ -1,64 +1,59 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem64.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem64 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem64\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem64 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT64                    Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem64:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    16(%esp), %eax\r
-    movl    20(%esp), %edx\r
-    movl    8(%esp), %edi\r
-L0:\r
-    cmpl    (%edi), %eax\r
-    leal    8(%edi), %edi\r
-    loopne  L0\r
-    jne     L1\r
-    cmpl    -4(%edi), %edx\r
-    jecxz   L1\r
-    jne     L0\r
-L1:\r
-    leal    -8(%edi), %eax\r
-    cmovne  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem64.Asm
+#
+# Abstract:
+#
+#   ScanMem64 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem64
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem64 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT64                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem64:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    16(%esp), %eax
+    movl    20(%esp), %edx
+    movl    8(%esp), %edi
+L0:
+    cmpl    (%edi), %eax
+    leal    8(%edi), %edi
+    loopne  L0
+    jne     L1
+    cmpl    -4(%edi), %edx
+    jecxz   L1
+    jne     L0
+L1:
+    leal    -8(%edi), %eax
+    cmovne  %ecx, %eax
+    pop     %edi
+    ret
index ee0deddc61f9979c42050592d8dd154fb0092856..ca54f13738b2f7b4c1be26760b40bc70c54e755d 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index e7d2a26cadfa3500d616023857dbca3bc8f9d82e..7a834a56351e05ab35f7aa2827af89ea24521897 100644 (file)
@@ -1,55 +1,50 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ScanMem8.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   ScanMem8 function\r
-#\r
-# Notes:\r
-#\r
-#   The following BaseMemoryLib instances share the same version of this file:\r
-#\r
-#       BaseMemoryLibRepStr\r
-#       BaseMemoryLibMmx\r
-#       BaseMemoryLibSse2\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemScanMem8\r
-\r
-#------------------------------------------------------------------------------\r
-# CONST VOID *\r
-# EFIAPI\r
-# InternalMemScanMem8 (\r
-#   IN      CONST VOID                *Buffer,\r
-#   IN      UINTN                     Length,\r
-#   IN      UINT8                     Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-_InternalMemScanMem8:\r
-    push    %edi\r
-    movl    12(%esp), %ecx\r
-    movl    8(%esp), %edi\r
-    movb    16(%esp), %al\r
-    repne   scasb\r
-    leal    -1(%edi), %eax\r
-    cmovnz  %ecx, %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ScanMem8.Asm
+#
+# Abstract:
+#
+#   ScanMem8 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem8
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem8 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT8                     Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem8:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movb    16(%esp), %al
+    repne   scasb
+    leal    -1(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
index 97d201abb575d99723b9e429720d0424f54df66a..a3f65b64fac29b0de29ac05f54cf645127457737 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index aa6f59fb4f8a230958bd3bf14d9a2d9469a1478d..86bba889f284c8ce4370f340c8e5d454e9323fa9 100644 (file)
@@ -1,81 +1,76 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem.asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    .686:\r
-    #.MODEL flat,C\r
-    .xmm:\r
-    .code:\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  _mem_SetMem (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT8  Value\r
-#    );\r
-#------------------------------------------------------------------------------\r
-.globl _InternalMemSetMem\r
-_InternalMemSetMem:\r
-    push    %edi\r
-    movl    12(%esp), %edx              # edx <- Count\r
-    movl    8(%esp), %edi               # edi <- Buffer\r
-    movb    16(%esp), %al               # al <- Value\r
-    xorl    %ecx, %ecx\r
-    subl    %edi, %ecx\r
-    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary\r
-    jz      L0\r
-    cmpl    %edx, %ecx\r
-    cmova   %edx, %ecx\r
-    subl    %ecx, %edx\r
-    rep\r
-    stosb\r
-L0:\r
-    movl    %edx, %ecx\r
-    andl    $15, %edx\r
-    shrl    $4, %ecx                    # ecx <- # of DQwords to set\r
-    jz      L_SetBytes\r
-    movb    %al, %ah                    # ax <- Value | (Value << 8)\r
-    addl    $-16, %esp\r
-    movdqu  %xmm0, (%esp)\r
-    movd    %eax, %xmm0\r
-    pshuflw $0, %xmm0, %xmm0\r
-    movlhps %xmm0, %xmm0\r
-L1:\r
-    movntdq %xmm0, (%edi)\r
-    addl    $16, %edi\r
-    loop   L1\r
-    mfence\r
-    movdqu  (%esp), %xmm0\r
-    addl    $16, %esp                   # stack cleanup\r
-L_SetBytes:\r
-    movl    %edx, %ecx\r
-    rep\r
-    stosb\r
-    movl    8(%esp), %eax               # eax <- Buffer as return value\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem.asm
+#
+# Abstract:
+#
+#   SetMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+    .686:
+    #.MODEL flat,C
+    .xmm:
+    .code:
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  _mem_SetMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT8  Value
+#    );
+#------------------------------------------------------------------------------
+.globl _InternalMemSetMem
+_InternalMemSetMem:
+    push    %edi
+    movl    12(%esp), %edx              # edx <- Count
+    movl    8(%esp), %edi               # edi <- Buffer
+    movb    16(%esp), %al               # al <- Value
+    xorl    %ecx, %ecx
+    subl    %edi, %ecx
+    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary
+    jz      L0
+    cmpl    %edx, %ecx
+    cmova   %edx, %ecx
+    subl    %ecx, %edx
+    rep
+    stosb
+L0:
+    movl    %edx, %ecx
+    andl    $15, %edx
+    shrl    $4, %ecx                    # ecx <- # of DQwords to set
+    jz      L_SetBytes
+    movb    %al, %ah                    # ax <- Value | (Value << 8)
+    addl    $-16, %esp
+    movdqu  %xmm0, (%esp)
+    movd    %eax, %xmm0
+    pshuflw $0, %xmm0, %xmm0
+    movlhps %xmm0, %xmm0
+L1:
+    movntdq %xmm0, (%edi)
+    addl    $16, %edi
+    loop   L1
+    mfence
+    movdqu  (%esp), %xmm0
+    addl    $16, %esp                   # stack cleanup
+L_SetBytes:
+    movl    %edx, %ecx
+    rep
+    stosb
+    movl    8(%esp), %eax               # eax <- Buffer as return value
+    pop     %edi
+    ret
index ab89482d6f965bb9f96a7d6ceac452f92823f0ec..a4de29c5212e4b91a30de08b4ee698a6706eb83a 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index fac9a722b0bd900403857169dccd27da5d249a91..8ec96a9b6c8d265d2d2eb6c92912392448feb586 100644 (file)
@@ -1,74 +1,69 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem16.asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem16 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemSetMem16\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  EFIAPI\r
-#  InternalMemSetMem16 (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT16 Value\r
-#    )\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem16:\r
-    push    %edi\r
-    movl    12(%esp), %edx\r
-    movl    8(%esp), %edi\r
-    xorl    %ecx, %ecx\r
-    subl    %edi, %ecx\r
-    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary\r
-    movl    16(%esp), %eax\r
-    jz      L0\r
-    shrl    %ecx\r
-    cmpl    %edx, %ecx\r
-    cmova   %edx, %ecx\r
-    subl    %ecx, %edx\r
-    rep\r
-    stosw\r
-L0:\r
-    movl    %edx, %ecx\r
-    andl    $7, %edx\r
-    shrl    $3, %ecx\r
-    jz      L_SetWords\r
-    movd    %eax, %xmm0\r
-    pshuflw $0, %xmm0, %xmm0\r
-    movlhps %xmm0, %xmm0\r
-L1:\r
-    movntdq %xmm0, (%edi)\r
-    addl    $16, %edi\r
-    loop    L1\r
-    mfence\r
-L_SetWords:\r
-    movl    %edx, %ecx\r
-    rep\r
-    stosw\r
-    movl    8(%esp), %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem16.asm
+#
+# Abstract:
+#
+#   SetMem16 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem16
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemSetMem16 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT16 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem16:
+    push    %edi
+    movl    12(%esp), %edx
+    movl    8(%esp), %edi
+    xorl    %ecx, %ecx
+    subl    %edi, %ecx
+    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary
+    movl    16(%esp), %eax
+    jz      L0
+    shrl    %ecx
+    cmpl    %edx, %ecx
+    cmova   %edx, %ecx
+    subl    %ecx, %edx
+    rep
+    stosw
+L0:
+    movl    %edx, %ecx
+    andl    $7, %edx
+    shrl    $3, %ecx
+    jz      L_SetWords
+    movd    %eax, %xmm0
+    pshuflw $0, %xmm0, %xmm0
+    movlhps %xmm0, %xmm0
+L1:
+    movntdq %xmm0, (%edi)
+    addl    $16, %edi
+    loop    L1
+    mfence
+L_SetWords:
+    movl    %edx, %ecx
+    rep
+    stosw
+    movl    8(%esp), %eax
+    pop     %edi
+    ret
index 75abe18b1d1b855de02d7e5af458b0b51c8c9f09..a709899fe257cfa18408d17a94d7406cf68bfc1a 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 8b0095a1e2b53b47a67763781076f0c983177c10..f91169a6e00b3e96da3ee8a0b1f1013b10faf874 100644 (file)
@@ -1,73 +1,68 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   SetMem32.asm\r
-#\r
-# Abstract:\r
-#\r
-#   SetMem32 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemSetMem32\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  EFIAPI\r
-#  InternalMemSetMem32 (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count,\r
-#    IN UINT32 Value\r
-#    );\r
-#------------------------------------------------------------------------------\r
-_InternalMemSetMem32:\r
-    push    %edi\r
-    movl    12(%esp), %edx\r
-    movl    8(%esp), %edi\r
-    xorl    %ecx, %ecx\r
-    subl    %edi, %ecx\r
-    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary\r
-    movl    16(%esp), %eax\r
-    jz      L0\r
-    shrl    $2, %ecx\r
-    cmpl    %edx, %ecx\r
-    cmova   %edx, %ecx\r
-    subl    %ecx, %edx\r
-    rep\r
-    stosl\r
-L0:\r
-    movl    %edx, %ecx\r
-    andl    $3, %edx\r
-    shrl    $2, %ecx\r
-    jz      L_SetDwords\r
-    movd    %eax, %xmm0\r
-    pshufd  $0, %xmm0, %xmm0\r
-L1:\r
-    movntdq %xmm0, (%edi)\r
-    addl    $16, %edi\r
-    loop    L1\r
-    mfence\r
-L_SetDwords:\r
-    movl    %edx, %ecx\r
-    rep\r
-    stosl\r
-    movl    8(%esp), %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   SetMem32.asm
+#
+# Abstract:
+#
+#   SetMem32 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem32
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemSetMem32 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT32 Value
+#    );
+#------------------------------------------------------------------------------
+_InternalMemSetMem32:
+    push    %edi
+    movl    12(%esp), %edx
+    movl    8(%esp), %edi
+    xorl    %ecx, %ecx
+    subl    %edi, %ecx
+    andl    $15, %ecx                   # ecx + edi aligns on 16-byte boundary
+    movl    16(%esp), %eax
+    jz      L0
+    shrl    $2, %ecx
+    cmpl    %edx, %ecx
+    cmova   %edx, %ecx
+    subl    %ecx, %edx
+    rep
+    stosl
+L0:
+    movl    %edx, %ecx
+    andl    $3, %edx
+    shrl    $2, %ecx
+    jz      L_SetDwords
+    movd    %eax, %xmm0
+    pshufd  $0, %xmm0, %xmm0
+L1:
+    movntdq %xmm0, (%edi)
+    addl    $16, %edi
+    loop    L1
+    mfence
+L_SetDwords:
+    movl    %edx, %ecx
+    rep
+    stosl
+    movl    8(%esp), %eax
+    pop     %edi
+    ret
index c12af90e7925b97aca1a13b2c379f4fda468aa2b..99954a5e4b4d33fb9d8a4f140abd70912535f998 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index bf42354572022d5d7b85a5e12563aad262fcefd0..ef9918f0f963de354a7d220db3652f210f134794 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2006, Intel Corporation\r
index 17f0eb4bea66615bac2f216ddaf63bfd9a312a9d..69406707a615dc471365542435fc9700b03a571b 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
index 657584d4df6829d6fc72c0b1ddf053eaad6834f2..8b4157f741770bbe625da36bd927082f4b0fcaf1 100644 (file)
@@ -1,70 +1,65 @@
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
-\r
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006, Intel Corporation\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
-# Module Name:\r
-#\r
-#   ZeroMem.asm\r
-#\r
-# Abstract:\r
-#\r
-#   ZeroMem function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl _InternalMemZeroMem\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID *\r
-#  EFIAPI\r
-#  InternalMemZeroMem (\r
-#    IN VOID   *Buffer,\r
-#    IN UINTN  Count\r
-#    );\r
-#------------------------------------------------------------------------------\r
-_InternalMemZeroMem:\r
-    push    %edi\r
-    movl    8(%esp), %edi\r
-    movl    12(%esp), %edx\r
-    xorl    %ecx, %ecx\r
-    subl    %edi, %ecx\r
-    xorl    %eax, %eax\r
-    andl    $15, %ecx\r
-    jz      L0\r
-    cmpl    %edx, %ecx\r
-    cmova   %edx, %ecx\r
-    subl    %ecx, %edx\r
-    rep\r
-    stosb\r
-L0:\r
-    movl    %edx, %ecx\r
-    andl    $15, %edx\r
-    shrl    $4, %ecx\r
-    jz      L_ZeroBytes\r
-    pxor    %xmm0, %xmm0\r
-L1:\r
-    movntdq %xmm0, (%edi)\r
-    addl    $16, %edi\r
-    loop    L1\r
-    mfence\r
-L_ZeroBytes:\r
-    movl    %edx, %ecx\r
-    rep\r
-    stosb\r
-    movl    8(%esp), %eax\r
-    pop     %edi\r
-    ret\r
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+#   ZeroMem.asm
+#
+# Abstract:
+#
+#   ZeroMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemZeroMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemZeroMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemZeroMem:
+    push    %edi
+    movl    8(%esp), %edi
+    movl    12(%esp), %edx
+    xorl    %ecx, %ecx
+    subl    %edi, %ecx
+    xorl    %eax, %eax
+    andl    $15, %ecx
+    jz      L0
+    cmpl    %edx, %ecx
+    cmova   %edx, %ecx
+    subl    %ecx, %edx
+    rep
+    stosb
+L0:
+    movl    %edx, %ecx
+    andl    $15, %edx
+    shrl    $4, %ecx
+    jz      L_ZeroBytes
+    pxor    %xmm0, %xmm0
+L1:
+    movntdq %xmm0, (%edi)
+    addl    $16, %edi
+    loop    L1
+    mfence
+L_ZeroBytes:
+    movl    %edx, %ecx
+    rep
+    stosb
+    movl    8(%esp), %eax
+    pop     %edi
+    ret
index 294e8ce04128c94338b088065f1537768da0a7fa..3792c8887976e2d47822089ab1397fe3ad8bd625 100644 (file)
@@ -1,8 +1,3 @@
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/CompareMem.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/CompareMem.asm
new file mode 100644 (file)
index 0000000..554bc07
--- /dev/null
@@ -0,0 +1,52 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CompareMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CompareMem function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; INTN\r
+; EFIAPI\r
+; InternalMemCompareMem (\r
+;   IN      CONST VOID                *DestinationBuffer,\r
+;   IN      CONST VOID                *SourceBuffer,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemCompareMem   PROC    USES    rsi rdi\r
+    mov     rsi, rcx\r
+    mov     rdi, rdx\r
+    mov     rcx, r8\r
+    repe    cmpsb\r
+    movzx   rax, byte ptr [rsi - 1]\r
+    movzx   rdx, byte ptr [rdi - 1]\r
+    sub     rax, rdx\r
+    ret\r
+InternalMemCompareMem   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/CopyMem.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/CopyMem.asm
new file mode 100644 (file)
index 0000000..03ffe0c
--- /dev/null
@@ -0,0 +1,79 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   CopyMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemCopyMem (\r
+;    IN VOID   *Destination,\r
+;    IN VOID   *Source,\r
+;    IN UINTN  Count\r
+;    );\r
+;------------------------------------------------------------------------------\r
+InternalMemCopyMem  PROC    USES    rsi rdi\r
+    mov     rsi, rdx                    ; rsi <- Source\r
+    mov     rdi, rcx                    ; rdi <- Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- Last byte of Source\r
+    cmp     rsi, rdi\r
+    mov     rax, rdi                    ; rax <- Destination as return value\r
+    jae     @F                          ; Copy forward if Source > Destination\r
+    cmp     r9, rdi                     ; Overlapped?\r
+    jae     @CopyBackward               ; Copy backward if overlapped\r
+@@:\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi                    ; rcx <- -rdi\r
+    and     rcx, 15                     ; rcx + rsi should be 16 bytes aligned\r
+    jz      @F                          ; skip if rcx == 0\r
+    cmp     rcx, r8\r
+    cmova   rcx, r8\r
+    sub     r8, rcx\r
+    rep     movsb\r
+@@:\r
+    mov     rcx, r8\r
+    and     r8, 15\r
+    shr     rcx, 4                      ; rcx <- # of DQwords to copy\r
+    jz      @CopyBytes\r
+    movdqa  [rsp + 18h], xmm0           ; save xmm0 on stack\r
+@@:\r
+    movdqu  xmm0, [rsi]                 ; rsi may not be 16-byte aligned\r
+    movntdq [rdi], xmm0                 ; rdi should be 16-byte aligned\r
+    add     rsi, 16\r
+    add     rdi, 16\r
+    loop    @B\r
+    mfence\r
+    movdqa  xmm0, [rsp + 18h]           ; restore xmm0\r
+    jmp     @CopyBytes                  ; copy remaining bytes\r
+@CopyBackward:\r
+    mov     rsi, r9                     ; rsi <- Last byte of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; rdi <- Last byte of Destination\r
+    std\r
+@CopyBytes:\r
+    mov     rcx, r8\r
+    rep     movsb\r
+    cld\r
+    ret\r
+InternalMemCopyMem  ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem16.asm
new file mode 100644 (file)
index 0000000..a2538c2
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem16.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem16 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem16 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT16                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem16    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasw\r
+    lea     rax, [rdi - 2]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem16    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem32.asm
new file mode 100644 (file)
index 0000000..e0523d8
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem32.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem32 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem32 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT32                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem32    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasd\r
+    lea     rax, [rdi - 4]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem32    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem64.asm
new file mode 100644 (file)
index 0000000..0e7e9c7
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem64.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem64 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem64 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT64                    Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem64    PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rax, r8\r
+    mov     rcx, rdx\r
+    repne   scasq\r
+    lea     rax, [rdi - 8]\r
+    cmovnz  rax, rcx\r
+    ret\r
+InternalMemScanMem64    ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem8.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/ScanMem8.asm
new file mode 100644 (file)
index 0000000..879273f
--- /dev/null
@@ -0,0 +1,51 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ScanMem8.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   ScanMem8 function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances share the same version of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+; CONST VOID *\r
+; EFIAPI\r
+; InternalMemScanMem8 (\r
+;   IN      CONST VOID                *Buffer,\r
+;   IN      UINTN                     Length,\r
+;   IN      UINT8                     Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+InternalMemScanMem8 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     rcx, rdx\r
+    mov     rax, r8\r
+    repne   scasb\r
+    lea     rax, [rdi - 1]\r
+    cmovnz  rax, rcx                    ; set rax to 0 if not found\r
+    ret\r
+InternalMemScanMem8 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem.asm
new file mode 100644 (file)
index 0000000..25cfcf0
--- /dev/null
@@ -0,0 +1,69 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemSetMem (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT8  Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem   PROC    USES    rdi\r
+    mov     rdi, rcx                    ; rdi <- Buffer\r
+    mov     al, r8b                     ; al <- Value\r
+    mov     r9, rdi                     ; r9 <- Buffer as return value\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi\r
+    and     rcx, 15                     ; rcx + rdi aligns on 16-byte boundary\r
+    jz      @F\r
+    cmp     rcx, rdx\r
+    cmova   rcx, rdx\r
+    sub     rdx, rcx\r
+    rep     stosb\r
+@@:\r
+    mov     rcx, rdx\r
+    and     rdx, 15\r
+    shr     rcx, 4\r
+    jz      @SetBytes\r
+    mov     ah, al                      ; ax <- Value repeats twice\r
+    movdqa  [rsp + 10h], xmm0           ; save xmm0\r
+    movd    xmm0, eax                   ; xmm0[0..16] <- Value repeats twice\r
+    pshuflw xmm0, xmm0, 0               ; xmm0[0..63] <- Value repeats 8 times\r
+    movlhps xmm0, xmm0                  ; xmm0 <- Value repeats 16 times\r
+@@:\r
+    movntdq [rdi], xmm0                 ; rdi should be 16-byte aligned\r
+    add     rdi, 16\r
+    loop    @B\r
+    mfence\r
+    movdqa  xmm0, [rsp + 10h]           ; restore xmm0\r
+@SetBytes:\r
+    mov     ecx, edx                    ; high 32 bits of rcx are always zero\r
+    rep     stosb\r
+    mov     rax, r9                     ; rax <- Return value\r
+    ret\r
+InternalMemSetMem   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem16.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem16.asm
new file mode 100644 (file)
index 0000000..77b8cf4
--- /dev/null
@@ -0,0 +1,67 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem16.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem16 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemSetMem16 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT16 Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem16 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     r9, rdi\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi\r
+    and     rcx, 15\r
+    mov     rax, r8\r
+    jz      @F\r
+    shr     rcx, 1\r
+    cmp     rcx, rdx\r
+    cmova   rcx, rdx\r
+    sub     rdx, rcx\r
+    rep     stosw\r
+@@:\r
+    mov     rcx, rdx\r
+    and     edx, 7\r
+    shr     rcx, 3\r
+    jz      @SetWords\r
+    movd    xmm0, eax\r
+    pshuflw xmm0, xmm0, 0\r
+    movlhps xmm0, xmm0\r
+@@:\r
+    movntdq [rdi], xmm0\r
+    add     rdi, 16\r
+    loop    @B\r
+    mfence\r
+@SetWords:\r
+    mov     ecx, edx\r
+    rep     stosw\r
+    mov     rax, r9\r
+    ret\r
+InternalMemSetMem16 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem32.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem32.asm
new file mode 100644 (file)
index 0000000..eba29bb
--- /dev/null
@@ -0,0 +1,66 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem32.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem32 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemSetMem32 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT8  Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem32 PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    mov     r9, rdi\r
+    xor     rcx, rcx\r
+    sub     rcx, rdi\r
+    and     rcx, 15\r
+    mov     rax, r8\r
+    jz      @F\r
+    shr     rcx, 2\r
+    cmp     rcx, rdx\r
+    cmova   rcx, rdx\r
+    sub     rdx, rcx\r
+    rep     stosd\r
+@@:\r
+    mov     rcx, rdx\r
+    and     edx, 3\r
+    shr     rcx, 2\r
+    jz      @SetDwords\r
+    movd    xmm0, eax\r
+    pshufd  xmm0, xmm0, 0\r
+@@:\r
+    movntdq [rdi], xmm0\r
+    add     rdi, 16\r
+    loop    @B\r
+    mfence\r
+@SetDwords:\r
+    mov     ecx, edx\r
+    rep     stosd\r
+    mov     rax, r9\r
+    ret\r
+InternalMemSetMem32 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem64.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/SetMem64.asm
new file mode 100644 (file)
index 0000000..a26b941
--- /dev/null
@@ -0,0 +1,59 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   SetMem64.asm\r
+;\r
+; Abstract:\r
+;\r
+;   SetMem64 function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemSetMem64 (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT64 Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemSetMem64 PROC\r
+    mov     rax, rcx                    ; rax <- Buffer\r
+    xchg    rcx, rdx                    ; rcx <- Count & rdx <- Buffer\r
+    test    dl, 8\r
+    movd    xmm0, r8\r
+    jz      @F\r
+    mov     [rdx], r8\r
+    add     rdx, 8\r
+    dec     rcx\r
+@@:\r
+    shr     rcx, 1\r
+    jz      @SetQwords\r
+    movlhps xmm0, xmm0\r
+@@:\r
+    movntdq [rdx], xmm0\r
+    lea     rdx, [rdx + 16]\r
+    loop    @B\r
+    mfence\r
+@SetQwords:\r
+    jnc     @F\r
+    mov     [rdx], r8\r
+@@:\r
+    ret\r
+InternalMemSetMem64 ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibSse2/x64/ZeroMem.asm b/MdePkg/Library/BaseMemoryLibSse2/x64/ZeroMem.asm
new file mode 100644 (file)
index 0000000..7eebd3a
--- /dev/null
@@ -0,0 +1,63 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+;   ZeroMem.asm\r
+;\r
+; Abstract:\r
+;\r
+;   ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  InternalMemZeroMem (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count\r
+;    )\r
+;------------------------------------------------------------------------------\r
+InternalMemZeroMem  PROC    USES    rdi\r
+    mov     rdi, rcx\r
+    xor     rcx, rcx\r
+    xor     eax, eax\r
+    sub     rcx, rdi\r
+    and     rcx, 15\r
+    mov     r8, rdi\r
+    jz      @F\r
+    cmp     rcx, rdx\r
+    cmova   rcx, rdx\r
+    sub     rdx, rcx\r
+    rep     stosb\r
+@@:\r
+    mov     rcx, rdx\r
+    and     edx, 15\r
+    shr     rcx, 4\r
+    jz      @ZeroBytes\r
+    pxor    xmm0, xmm0\r
+@@:\r
+    movntdq [rdi], xmm0                 ; rdi should be 16-byte aligned\r
+    add     rdi, 16\r
+    loop    @B\r
+    mfence\r
+@ZeroBytes:\r
+    mov     ecx, edx\r
+    rep     stosb\r
+    mov     rax, r8\r
+    ret\r
+InternalMemZeroMem  ENDP\r
+\r
+    END\r
index e90d5da488d74a898a1fa18ff88d995b06f46414..bcebb4dac009e8271d039d573a17685dd21eb3f2 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 # Runtime driver library\r
 #\r
 #/** @file\r
 # Runtime driver library\r
 #\r
-# Instance of runtime driver library, Hook VitualAddressChange and \r
+# Instance of runtime driver library, Hook VitualAddressChange and\r
 #  BooterviceExit event and provide runtime service.\r
 # Copyright (c) 2006 - 2007, Intel Corporation.\r
 #\r
 #  BooterviceExit event and provide runtime service.\r
 # Copyright (c) 2006 - 2007, Intel Corporation.\r
 #\r
 ################################################################################\r
 [Defines]\r
   INF_VERSION                    = 0x00010005\r
 ################################################################################\r
 [Defines]\r
   INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = EdkUefiRuntimeLib\r
+  BASE_NAME                      = UefiRuntimeLib\r
   FILE_GUID                      = b1ee6c28-54aa-4d17-b705-3e28ccb27b2e\r
   MODULE_TYPE                    = DXE_RUNTIME_DRIVER\r
   VERSION_STRING                 = 1.0\r
   FILE_GUID                      = b1ee6c28-54aa-4d17-b705-3e28ccb27b2e\r
   MODULE_TYPE                    = DXE_RUNTIME_DRIVER\r
   VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = UefiRuntimeLib|DXE_RUNTIME_DRIVER DXE_SAL_DRIVER \r
+  LIBRARY_CLASS                  = UefiRuntimeLib|DXE_RUNTIME_DRIVER DXE_SAL_DRIVER\r
   EDK_RELEASE_VERSION            = 0x00020000\r
   EFI_SPECIFICATION_VERSION      = 0x00020000\r
 \r
   EDK_RELEASE_VERSION            = 0x00020000\r
   EFI_SPECIFICATION_VERSION      = 0x00020000\r
 \r
@@ -36,7 +36,7 @@
 #\r
 # The following information is for reference only and not required by the build tools.\r
 #\r
 #\r
 # The following information is for reference only and not required by the build tools.\r
 #\r
-#  VALID_ARCHITECTURES           = IA32 X64 EBC\r
+  VALID_ARCHITECTURES           = IA32 X64 EBC\r
 #\r
 \r
 ################################################################################\r
 #\r
 \r
 ################################################################################\r
index d109164c24c253f2d55de7bf9a52ffc0e039eebb..6067d4086e7cf69a1d3c61c1b92ed393738ec0d5 100644 (file)
   ${WORKSPACE}/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
 #  ${WORKSPACE}/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
 #  ${WORKSPACE}/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
-#  ${WORKSPACE}/MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
+  ${WORKSPACE}/MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
 #  ${WORKSPACE}/MdePkg/Library/PeiSmbusLib/PeiSmbusLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
   ${WORKSPACE}/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
 #  ${WORKSPACE}/MdePkg/Library/PeiSmbusLib/PeiSmbusLib.inf\r
-  ${WORKSPACE}/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
   ${WORKSPACE}/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   ${WORKSPACE}/MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiLib/UefiLib.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiLib/UefiLib.inf\r
-  ${WORKSPACE}/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
   ${WORKSPACE}/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   ${WORKSPACE}\MdePkg\Library/UefiScsiLib/UefiScsiLib.inf\r
 \r
   ${WORKSPACE}/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   ${WORKSPACE}\MdePkg\Library/UefiScsiLib/UefiScsiLib.inf\r
 \r
 [Components.IA32]\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf\r
 [Components.IA32]\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf\r
+  ${WORKSPACE}/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
+  ${WORKSPACE}/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
 \r
 [Components.X64]\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf\r
 \r
 [Components.X64]\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf\r
   ${WORKSPACE}\MdePkg\Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf\r
+  ${WORKSPACE}/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
+  ${WORKSPACE}/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
 \r
 \r
-\r
+[Components.IPF]\r
+  ${WORKSPACE}/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r