Gcc cleanup for baselib & basememorylib in mdepkg/library/

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5587 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2008-07-31 06:23:32 +00:00
parent 5f87392966
commit 85c25283ed
104 changed files with 285 additions and 290 deletions

View File

@ -19,7 +19,7 @@
#
#------------------------------------------------------------------------------
.global _CpuBreakpoint
_CpuBreakpoint:
.global ASM_PFX(CpuBreakpoint)
ASM_PFX(CpuBreakpoint):
int $0x3
ret

View File

@ -32,8 +32,8 @@
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
.global _AsmCpuid;
_AsmCpuid:
.global ASM_PFX(AsmCpuid)
ASM_PFX(AsmCpuid):
push %rbx
mov %ecx, %eax
push %rax # save Index on stack

View File

@ -33,8 +33,8 @@
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
.global _AsmCpuidEx
_AsmCpuidEx:
.global ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx):
push %rbx
movl %ecx,%eax
movl %edx,%ecx

View File

@ -28,7 +28,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuPause;
_CpuPause:
.global ASM_PFX(CpuPause)
ASM_PFX(CpuPause):
pause
ret

View File

@ -28,7 +28,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuSleep;
_CpuSleep:
.global ASM_PFX(CpuSleep)
ASM_PFX(CpuSleep):
hlt
ret

View File

@ -29,7 +29,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _DisableInterrupts;
_DisableInterrupts:
.global ASM_PFX(DisableInterrupts)
ASM_PFX(DisableInterrupts):
cli
ret

View File

@ -35,8 +35,8 @@
# );
#------------------------------------------------------------------------------
.global _InternalX86DisablePaging64
_InternalX86DisablePaging64:
.global ASM_PFX(InternalX86DisablePaging64)
ASM_PFX(InternalX86DisablePaging64):
cli
shl $0x20,%rcx
lea (%rip), %eax

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _EnableDisableInterrupts;
.align 16;
_EnableDisableInterrupts:
.global ASM_PFX(EnableDisableInterrupts)
.align 16
ASM_PFX(EnableDisableInterrupts):
sti
cli
ret

View File

@ -29,7 +29,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _EnableInterrupts;
_EnableInterrupts:
.global ASM_PFX(EnableInterrupts)
ASM_PFX(EnableInterrupts):
sti
ret

View File

@ -33,8 +33,8 @@
# IN UINT64 NewStack %r8
# );
#------------------------------------------------------------------------------
.global _InternalX86EnablePaging64;
_InternalX86EnablePaging64:
.global ASM_PFX(InternalX86EnablePaging64)
ASM_PFX(InternalX86EnablePaging64):
cli
pop %rax
callq Base

View File

@ -29,8 +29,8 @@
# IN VOID *LinearAddress
# );
#------------------------------------------------------------------------------
.global _AsmFlushCacheLine;
_AsmFlushCacheLine:
.global ASM_PFX(AsmFlushCacheLine)
ASM_PFX(AsmFlushCacheLine):
clflush (%rdi)
mov %rdi, %rax
ret

View File

@ -29,7 +29,7 @@
# IN CONST IA32_FX_BUFFER *Buffer
# )#
#------------------------------------------------------------------------------
.global _InternalX86FxRestore;
_InternalX86FxRestore:
.global ASM_PFX(InternalX86FxRestore)
ASM_PFX(InternalX86FxRestore):
fxrstor (%rcx)
ret

View File

@ -29,7 +29,7 @@
# OUT IA32_FX_BUFFER *Buffer
# );
#------------------------------------------------------------------------------
.global _InternalX86FxSave;
_InternalX86FxSave:
.global ASM_PFX(InternalX86FxSave)
ASM_PFX(InternalX86FxSave):
fxsave (%rcx)
ret

View File

@ -30,8 +30,8 @@
# IN UINT32 ExchangeValue
# );
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange32;
_InternalSyncCompareExchange32:
.global ASM_PFX(InternalSyncCompareExchange32)
ASM_PFX(InternalSyncCompareExchange32):
mov %edx, %eax
lock cmpxchg %r8d, (%rcx)
ret

View File

@ -31,9 +31,9 @@
# IN UINT64 ExchangeValue
# );
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange64;
.align 16;
_InternalSyncCompareExchange64:
.global ASM_PFX(InternalSyncCompareExchange64)
.align 16
ASM_PFX(InternalSyncCompareExchange64):
mov %rsi, %rax
lock cmpxchg %rdx,(%rdi)
ret

View File

@ -29,8 +29,8 @@
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
.global _InternalSyncDecrement;
_InternalSyncDecrement:
.global ASM_PFX(InternalSyncDecrement)
ASM_PFX(InternalSyncDecrement):
lock decl (%rcx)
mov (%rcx), %eax
ret

View File

@ -29,8 +29,8 @@
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
.global _InternalSyncIncrement;
_InternalSyncIncrement:
.global ASM_PFX(InternalSyncIncrement)
ASM_PFX(InternalSyncIncrement):
lock incl (%rcx)
mov (%rcx), %eax
ret

View File

@ -29,7 +29,7 @@
# VOID
# )#
#------------------------------------------------------------------------------
.global _AsmInvd;
_AsmInvd:
.global ASM_PFX(AsmInvd)
ASM_PFX(AsmInvd):
invd
ret

View File

@ -27,8 +27,8 @@
# IN UINTN Value
# );
#------------------------------------------------------------------------------
.global _InternalLongJump
_InternalLongJump:
.global ASM_PFX(InternalLongJump)
ASM_PFX(InternalLongJump):
mov (%rcx), %rbx
mov 0x8(%rcx), %rsp
mov 0x10(%rcx), %rbp

View File

@ -31,9 +31,9 @@
# IN UINTN Edx
# );
#------------------------------------------------------------------------------
.global _AsmMonitor;
.align 16;
_AsmMonitor:
.global ASM_PFX(AsmMonitor)
.align 16
ASM_PFX(AsmMonitor):
mov %ecx,%eax
mov %edx,%ecx
mov %r8d,%edx

View File

@ -30,9 +30,9 @@
# IN UINTN Ecx
# );
#------------------------------------------------------------------------------
.global _AsmMwait;
.align 16;
_AsmMwait:
.global ASM_PFX(AsmMwait)
.align 16
ASM_PFX(AsmMwait):
mov %ecx,%eax
mov %edx,%ecx
mwait %rax,%rcx

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr0;
.align 16;
_AsmReadCr0:
.global ASM_PFX(AsmReadCr0)
.align 16
ASM_PFX(AsmReadCr0):
mov %cr0, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr2;
.align 16;
_AsmReadCr2:
.global ASM_PFX(AsmReadCr2
.align 16
ASM_PFX(AsmReadCr2):
mov %cr2, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr3;
.align 16;
_AsmReadCr3:
.global ASM_PFX(AsmReadCr3)
.align 16
ASM_PFX(AsmReadCr3):
mov %cr3, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr4;
.align 16;
_AsmReadCr4:
.global ASM_PFX(AsmReadCr4)
.align 16
ASM_PFX(AsmReadCr4):
mov %cr4, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCs;
.align 16;
_AsmReadCs:
.global ASM_PFX(AsmReadCs)
.align 16
ASM_PFX(AsmReadCs):
mov %cs, %eax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr0;
.align 16;
_AsmReadDr0:
.global ASM_PFX(AsmReadDr0)
.align 16
ASM_PFX(AsmReadDr0):
mov %dr0, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr1;
.align 16;
_AsmReadDr1:
.global ASM_PFX(AsmReadDr1)
.align 16
ASM_PFX(AsmReadDr1):
mov %dr1, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr2;
.align 16;
_AsmReadDr2:
.global ASM_PFX(AsmReadDr2)
.align 16
ASM_PFX(AsmReadDr2):
mov %dr2, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr3;
.align 16;
_AsmReadDr3:
.global ASM_PFX(AsmReadDr3)
.align 16
ASM_PFX(AsmReadDr3):
mov %dr3, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr4;
.align 16;
_AsmReadDr4:
.global ASM_PFX(AsmReadDr4)
.align 16
ASM_PFX(AsmReadDr4):
#DB 0fh, 21h, 0e0h
mov %dr4, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr5;
.align 16;
_AsmReadDr5:
.global ASM_PFX(AsmReadDr5)
.align 16
ASM_PFX(AsmReadDr5):
mov %dr5, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr6;
.align 16;
_AsmReadDr6:
.global ASM_PFX(AsmReadDr6)
.align 16
ASM_PFX(AsmReadDr6):
mov %dr6, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr7;
.align 16;
_AsmReadDr7:
.global ASM_PFX(AsmReadDr7)
.align 16
ASM_PFX(AsmReadDr7):
mov %dr7, %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDs;
.align 16;
_AsmReadDs:
.global ASM_PFX(AsmReadDs)
.align 16
ASM_PFX(AsmReadDs):
movl %ds, %eax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadEflags;
.align 16;
_AsmReadEflags:
.global ASM_PFX(AsmReadEflags)
.align 16
ASM_PFX(AsmReadEflags):
pushfq
pop %rax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadEs;
.align 16;
_AsmReadEs:
.global ASM_PFX(AsmReadEs)
.align 16
ASM_PFX(AsmReadEs):
mov %es, %eax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadFs;
.align 16;
_AsmReadFs:
.global ASM_PFX(AsmReadFs)
.align 16
ASM_PFX(AsmReadFs):
mov %fs, %eax
ret

View File

@ -29,8 +29,8 @@
# OUT IA32_DESCRIPTOR *Gdtr
# );
#------------------------------------------------------------------------------
.global _InternalX86ReadGdtr;
.align 16;
_InternalX86ReadGdtr:
.global ASM_PFX(InternalX86ReadGdtr)
.align 16
ASM_PFX(InternalX86ReadGdtr):
sgdt (%rcx)
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadGs;
.align 16;
_AsmReadGs:
.global ASM_PFX(AsmReadGs)
.align 16
ASM_PFX(AsmReadGs):
mov %gs, %eax
ret

View File

@ -29,8 +29,8 @@
# OUT IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
.global _InternalX86ReadIdtr;
.align 16;
_InternalX86ReadIdtr:
.global ASM_PFX(InternalX86ReadIdtr)
.align 16
ASM_PFX(InternalX86ReadIdtr):
sidt (%rcx)
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadLdtr;
.align 16;
_AsmReadLdtr:
.global ASM_PFX(AsmReadLdtr)
.align 16
ASM_PFX(AsmReadLdtr):
sldt %eax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm0;
.align 16;
_AsmReadMm0:
.global ASM_PFX(AsmReadMm0)
.align 16
ASM_PFX(AsmReadMm0:
#DB 48h, 0fh, 7eh, 0c0h
movd %mm0, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm1;
.align 16;
_AsmReadMm1:
.global ASM_PFX(AsmReadMm1)
.align 16
ASM_PFX(AsmReadMm1):
#DB 48h, 0fh, 7eh, 0c8h
movd %mm1, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm2;
.align 16;
_AsmReadMm2:
.global ASM_PFX(AsmReadMm2)
.align 16
ASM_PFX(AsmReadMm2):
#DB 48h, 0fh, 7eh, 0d0h
movd %mm2, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm3;
.align 16;
_AsmReadMm3:
.global ASM_PFX(AsmReadMm3)
.align 16
ASM_PFX(AsmReadMm3):
#DB 48h, 0fh, 7eh, 0d8h
movd %mm3, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm4;
.align 16;
_AsmReadMm4:
.global ASM_PFX(AsmReadMm4)
.align 16
ASM_PFX(AsmReadMm4):
#DB 48h, 0fh, 7eh, 0e0h
movd %mm4, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm5;
.align 16;
_AsmReadMm5:
.global ASM_PFX(AsmReadMm5)
.align 16
ASM_PFX(AsmReadMm5):
#DB 48h, 0fh, 7eh, 0e8h
movd %mm5, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm6;
.align 16;
_AsmReadMm6:
.global ASM_PFX(AsmReadMm6)
.align 16
ASM_PFX(AsmReadMm6):
#DB 48h, 0fh, 7eh, 0f0h
movd %mm6, %rax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadMm7;
.align 16;
_AsmReadMm7:
.global ASM_PFX(AsmReadMm7)
.align 16
ASM_PFX(AsmReadMm7):
#DB 48h, 0fh, 7eh, 0f8h
movd %mm7, %rax
ret

View File

@ -29,9 +29,9 @@
# IN UINT32 Index
# );
#------------------------------------------------------------------------------
.global _AsmReadMsr64;
.align 16;
_AsmReadMsr64:
.global ASM_PFX(AsmReadMsr64)
.align 16
ASM_PFX(AsmReadMsr64):
rdmsr # edx & eax are zero extended
shl $0x20, %rdx
or %rdx, %rax

View File

@ -29,9 +29,9 @@
# IN UINT32 PmcIndex
# );
#------------------------------------------------------------------------------
.global _AsmReadPmc;
.align 16;
_AsmReadPmc:
.global ASM_PFX(AsmReadPmc)
.align 16
ASM_PFX(AsmReadPmc):
rdpmc
shl $0x20, %rdx
or %rdx, %rax

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadSs;
.align 16;
_AsmReadSs:
.global ASM_PFX(AsmReadSs)
.align 16
ASM_PFX(AsmReadSs):
movl %ss, %eax
ret

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadTr;
.align 16;
_AsmReadTr:
.global ASM_PFX(AsmReadTr)
.align 16
ASM_PFX(AsmReadTr):
str %eax
ret

View File

@ -29,9 +29,9 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadTsc;
.align 16;
_AsmReadTsc:
.global ASM_PFX(AsmReadTsc)
.align 16
ASM_PFX(AsmReadTsc):
rdtsc
shl $0x20, %rdx
or %rdx, %rax

View File

@ -19,12 +19,12 @@
#
#------------------------------------------------------------------------------
.extern InternalAssertJumpBuffer;
.global _SetJump;
_SetJump:
.extern ASM_PFX(InternalAssertJumpBuffer)
.global ASM_PFX(SetJump)
ASM_PFX(SetJump):
push %rcx
add $0xffffffffffffffe0,%rsp
call _InternalAssertJumpBuffer
call ASM_PFX(InternalAssertJumpBuffer)
add $0x20,%rsp
pop %rcx
pop %rdx

View File

@ -35,14 +35,14 @@
# None
#
#------------------------------------------------------------------------------
.global _InternalSwitchStack;
_InternalSwitchStack:
.global ASM_PFX(InternalSwitchStack)
ASM_PFX(InternalSwitchStack):
mov %rcx, %rax
mov %rdx, %rcx
mov %r8, %rdx
#
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them.
#
# Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
# in case the callee wishes to spill them.
#
lea -0x20(%r9), %rsp
call *%rax

View File

@ -29,8 +29,8 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmWbinvd;
.align 16;
_AsmWbinvd:
.global ASM_PFX(AsmWbinvd)
.align 16
ASM_PFX(AsmWbinvd):
wbinvd
ret

View File

@ -29,8 +29,8 @@
# UINTN Cr0
# );
#------------------------------------------------------------------------------
.global _AsmWriteCr0;
_AsmWriteCr0:
.global ASM_PFX(AsmWriteCr0)
ASM_PFX(AsmWriteCr0):
mov %rcx,%cr0
mov %rcx,%rax
ret

View File

@ -29,8 +29,8 @@
# UINTN Cr2
# );
#------------------------------------------------------------------------------
.global _AsmWriteCr2;
_AsmWriteCr2:
.global ASM_PFX(AsmWriteCr2)
ASM_PFX(AsmWriteCr2):
mov %rcx,%cr2
mov %rcx,%rax
ret

View File

@ -29,8 +29,8 @@
# UINTN Cr3
# );
#------------------------------------------------------------------------------
.global _AsmWriteCr3;
_AsmWriteCr3:
.global ASM_PFX(AsmWriteCr3)
ASM_PFX(AsmWriteCr3):
mov %rcx,%cr3
mov %rcx,%rax
ret

View File

@ -29,8 +29,8 @@
# UINTN Cr4
# );
#------------------------------------------------------------------------------
.global _AsmWriteCr4;
_AsmWriteCr4:
.global ASM_PFX(AsmWriteCr4)
ASM_PFX(AsmWriteCr4):
mov %rcx,%cr4
mov %rcx,%rax
ret

View File

@ -29,9 +29,9 @@
# UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr0;
.align 16;
_AsmWriteDr0:
.global ASM_PFX(AsmWriteDr0)
.align 16
ASM_PFX(AsmWriteDr0):
mov %rcx, %dr0
mov %rcx, %rax
ret

View File

@ -29,9 +29,9 @@
# UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr1;
.align 16;
_AsmWriteDr1:
.global ASM_PFX(AsmWriteDr1)
.align 16
ASM_PFX(AsmWriteDr1):
mov %rcx, %dr1
mov %rcx, %rax
ret

View File

@ -29,9 +29,9 @@
# UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr2;
.align 16;
_AsmWriteDr2:
.global ASM_PFX(AsmWriteDr2)
.align 16
ASM_PFX(AsmWriteDr2):
mov %rcx, %dr2
mov %rcx, %rax
ret

View File

@ -29,9 +29,9 @@
# UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr3;
.align 16;
_AsmWriteDr3:
.global ASM_PFX(AsmWriteDr3)
.align 16
ASM_PFX(AsmWriteDr3):
mov %rcx, %dr3
mov %rcx, %rax
ret

View File

@ -29,8 +29,8 @@
# IN UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr4;
_AsmWriteDr4:
.global ASM_PFX(AsmWriteDr4)
ASM_PFX(AsmWriteDr4):
mov %rcx, %dr4
mov %rcx, %rax
ret

View File

@ -29,8 +29,8 @@
# IN UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr5;
_AsmWriteDr5:
.global ASM_PFX(AsmWriteDr5)
ASM_PFX(AsmWriteDr5):
mov %rcx, %dr5
mov %rcx, %rax
ret

View File

@ -29,8 +29,8 @@
# IN UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr6;
_AsmWriteDr6:
.global ASM_PFX(AsmWriteDr6)
ASM_PFX(AsmWriteDr6):
mov %rcx, %dr6
mov %rcx, %rax
ret

View File

@ -29,8 +29,8 @@
# IN UINTN Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteDr7;
_AsmWriteDr7:
.global ASM_PFX(AsmWriteDr7)
ASM_PFX(AsmWriteDr7):
mov %rcx, %dr7
mov %rcx, %rax
ret

View File

@ -29,7 +29,7 @@
# IN CONST IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
.global _InternalX86WriteGdtr;
_InternalX86WriteGdtr:
.global ASM_PFX(InternalX86WriteGdtr)
ASM_PFX(InternalX86WriteGdtr):
lgdt (%rcx)
ret

View File

@ -29,8 +29,8 @@
# IN CONST IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
.global _InternalX86WriteIdtr;
.align 16;
_InternalX86WriteIdtr:
.global ASM_PFX(InternalX86WriteIdtr)
.align 16
ASM_PFX(InternalX86WriteIdtr):
lidt (%rcx)
ret

View File

@ -29,8 +29,8 @@
# IN UINT16 Ldtr
# );
#------------------------------------------------------------------------------
.global _AsmWriteLdtr;
.align 16;
_AsmWriteLdtr:
.global ASM_PFX(AsmWriteLdtr)
.align 16
ASM_PFX(AsmWriteLdtr):
lldt %cx
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm0;
_AsmWriteMm0:
.global ASM_PFX(AsmWriteMm0)
ASM_PFX(AsmWriteMm0):
movd %rcx, %xmm0
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm1;
_AsmWriteMm1:
.global ASM_PFX(AsmWriteMm1)
ASM_PFX(AsmWriteMm1):
movd %rcx, %mm1
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm2;
_AsmWriteMm2:
.global ASM_PFX(AsmWriteMm2)
ASM_PFX(AsmWriteMm2):
movd %rcx, %mm2
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm3;
_AsmWriteMm3:
.global ASM_PFX(AsmWriteMm3)
ASM_PFX(AsmWriteMm3):
movd %rcx, %mm3
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm4;
_AsmWriteMm4:
.global ASM_PFX(AsmWriteMm4)
ASM_PFX(AsmWriteMm4):
movd %rcx, %mm4
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm5;
_AsmWriteMm5:
.global ASM_PFX(AsmWriteMm5)
ASM_PFX(AsmWriteMm5):
movd %rcx, %mm5
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm6;
_AsmWriteMm6:
.global ASM_PFX(AsmWriteMm6)
ASM_PFX(AsmWriteMm6):
movd %rcx, %mm6
ret

View File

@ -29,7 +29,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
.global _AsmWriteMm7;
_AsmWriteMm7:
.global ASM_PFX(AsmWriteMm7)
ASM_PFX(AsmWriteMm7):
movd %rcx, %mm7
ret

View File

@ -31,9 +31,9 @@
# );
# TODO:
#------------------------------------------------------------------------------
.global _AsmWriteMsr64;
.align 16;
_AsmWriteMsr64:
.global ASM_PFX(AsmWriteMsr64)
.align 16
ASM_PFX(AsmWriteMsr64):
mov %rdx, %rax
shr $0x20, %rdx
wrmsr

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemCompareMem
.globl ASM_PFX(InternalMemCompareMem)
#------------------------------------------------------------------------------
# INTN
@ -38,7 +38,7 @@
# IN UINTN Length
# );
#------------------------------------------------------------------------------
_InternalMemCompareMem:
ASM_PFX(InternalMemCompareMem):
push %esi
push %edi
movl 12(%esp), %esi

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemCopyMem
.globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------
# VOID *
@ -32,7 +32,7 @@
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMemCopyMem:
ASM_PFX(InternalMemCopyMem):
push %esi
push %edi
movl 16(%esp), %esi # esi <- Source

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem16
.globl ASM_PFX(InternalMemScanMem16)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT16 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem16:
ASM_PFX(InternalMemScanMem16):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem32
.globl ASM_PFX(InternalMemScanMem32)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem32:
ASM_PFX(InternalMemScanMem32):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem64
.globl ASM_PFX(InternalMemScanMem64)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem64:
ASM_PFX(InternalMemScanMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem8
.globl ASM_PFX(InternalMemScanMem8)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT8 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem8:
ASM_PFX(InternalMemScanMem8):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -24,7 +24,7 @@
.386:
.code:
.globl _InternalMemSetMem
.globl ASM_PFX(InternalMemSetMem)
#------------------------------------------------------------------------------
# VOID *
@ -34,20 +34,20 @@
# IN UINT8 Value
# )
#------------------------------------------------------------------------------
_InternalMemSetMem:
ASM_PFX(InternalMemSetMem):
push %edi
movl 12(%esp),%ecx
movb 16(%esp),%al
movb %ah, %al
movb %ah, %al
shrd $16, %eax, %edx
shld $16, %edx, %eax
movl %edx, %ecx
movl %edx, %ecx
movl 8(%esp),%edi
shrd $2, %ecx, %ecx
rep
stosl
movl %ecx, %edx
andl $3, %ecx
shrd $2, %ecx, %ecx
rep
stosl
movl %ecx, %edx
andl $3, %ecx
rep
stosb
movl 8(%esp),%eax

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemSetMem16
.globl ASM_PFX(InternalMemSetMem16)
#------------------------------------------------------------------------------
# VOID *
@ -31,7 +31,7 @@
# IN UINT16 Value
# )
#------------------------------------------------------------------------------
_InternalMemSetMem16:
ASM_PFX(InternalMemSetMem16):
push %edi
movl 16(%esp), %eax
movl 8(%esp), %edi

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemSetMem32
.globl ASM_PFX(InternalMemSetMem32)
#------------------------------------------------------------------------------
# VOID *
@ -31,7 +31,7 @@
# IN UINT32 Value
# )
#------------------------------------------------------------------------------
_InternalMemSetMem32:
ASM_PFX(InternalMemSetMem32):
push %edi
movl 16(%esp),%eax
movl 8(%esp),%edi

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemSetMem64
.globl ASM_PFX(InternalMemSetMem64)
#------------------------------------------------------------------------------
# VOID *
@ -31,7 +31,7 @@
# IN UINT64 Value
# )
#------------------------------------------------------------------------------
_InternalMemSetMem64:
ASM_PFX(InternalMemSetMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemZeroMem
.globl ASM_PFX(InternalMemZeroMem)
#------------------------------------------------------------------------------
# VOID *
@ -30,7 +30,7 @@
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMemZeroMem:
ASM_PFX(InternalMemZeroMem):
push %edi
xorl %eax,%eax
movl 8(%esp),%edi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemCompareMem
.globl ASM_PFX(InternalMemCompareMem)
#------------------------------------------------------------------------------
# INTN
@ -38,7 +38,7 @@
# IN UINTN Length
# );
#------------------------------------------------------------------------------
_InternalMemCompareMem:
ASM_PFX(InternalMemCompareMem):
push %esi
push %edi
movl 12(%esp), %esi

View File

@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemCopyMem
.globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------
# VOID *
@ -32,30 +32,30 @@
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMemCopyMem:
ASM_PFX(InternalMemCopyMem):
push %esi
push %edi
movl 16(%esp), %esi # esi <- Source
movl 12(%esp), %edi # edi <- Destination
movl 20(%esp), %edx # edx <- Count
cmpl %esi, %edi
je L_CopyDone
cmpl %esi, %edi
je L_CopyDone
cmpl $0, %edx
je L_CopyDone
je L_CopyDone
leal -1(%esi, %edx), %eax # eax <- End of Source
cmpl %esi, %edi
jae L_CopyBytes
cmpl %eax, %edi
jb L_CopyBytes # Copy backward if overlapped
movl %esi, %eax # esi <- End of Source
cmpl %edi, %esi
jae L_CopyBytes
cmpl %edi, %eax
jb L_CopyBytes # Copy backward if overlapped
movl %eax, %esi # esi <- End of Source
leal -1(%edi, %edx), %edi # edi <- End of Destination
std
L_CopyBytes:
movl %ecx, %edx
std
L_CopyBytes:
movl %edx, %ecx
rep
movsb # Copy bytes backward
cld
L_CopyDone:
L_CopyDone:
movl 12(%esp), %eax # eax <- Destination as return value
pop %edi
pop %esi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem16
.globl ASM_PFX(InternalMemScanMem16)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT16 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem16:
ASM_PFX(InternalMemScanMem16):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem32
.globl ASM_PFX(InternalMemScanMem32)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem32:
ASM_PFX(InternalMemScanMem32):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem64
.globl ASM_PFX(InternalMemScanMem64)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem64:
ASM_PFX(InternalMemScanMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax

View File

@ -27,7 +27,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemScanMem8
.globl ASM_PFX(InternalMemScanMem8)
#------------------------------------------------------------------------------
# CONST VOID *
@ -38,7 +38,7 @@
# IN UINT8 Value
# );
#------------------------------------------------------------------------------
_InternalMemScanMem8:
ASM_PFX(InternalMemScanMem8):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi

View File

@ -21,10 +21,7 @@
#
#------------------------------------------------------------------------------
.386:
.code:
.globl _InternalMemSetMem
.globl ASM_PFX(InternalMemSetMem)
#------------------------------------------------------------------------------
# VOID *
@ -34,22 +31,20 @@
# IN UINT8 Value
# )
#------------------------------------------------------------------------------
_InternalMemSetMem:
ASM_PFX(InternalMemSetMem):
push %edi
movl 12(%esp),%ecx
movb 16(%esp),%al
movb %ah, %al
movb %al, %ah
shrd $16, %eax, %edx
shld $16, %edx, %eax
movl %edx, %ecx
movl %ecx, %edx
movl 8(%esp),%edi
shrd $2, %ecx, %ecx
rep
stosl
movl %ecx, %edx
andl $3, %ecx
rep
stosb
shr $2, %ecx
rep stosl
movl %edx, %ecx
andl $3, %ecx
rep stosb
movl 8(%esp),%eax
pop %edi
ret

Some files were not shown because too many files have changed in this diff Show More