#
#------------------------------------------------------------------------------
-.global _CpuBreakpoint
-_CpuBreakpoint:
+.global ASM_PFX(CpuBreakpoint)
+ASM_PFX(CpuBreakpoint):
int $0x3
ret
# 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
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
-.global _AsmCpuidEx
-_AsmCpuidEx:
+.global ASM_PFX(AsmCpuidEx)
+ASM_PFX(AsmCpuidEx):
push %rbx
movl %ecx,%eax
movl %edx,%ecx
# VOID\r
# );\r
#------------------------------------------------------------------------------\r
-.global _CpuPause;\r
-_CpuPause:\r
+.global ASM_PFX(CpuPause)\r
+ASM_PFX(CpuPause):\r
pause\r
ret\r
# VOID\r
# );\r
#------------------------------------------------------------------------------\r
-.global _CpuSleep;\r
-_CpuSleep:\r
+.global ASM_PFX(CpuSleep)\r
+ASM_PFX(CpuSleep):\r
hlt\r
ret\r
# VOID\r
# );\r
#------------------------------------------------------------------------------\r
-.global _DisableInterrupts;\r
-_DisableInterrupts:\r
+.global ASM_PFX(DisableInterrupts)\r
+ASM_PFX(DisableInterrupts):\r
cli\r
ret\r
# );
#------------------------------------------------------------------------------
-.global _InternalX86DisablePaging64
-_InternalX86DisablePaging64:
+.global ASM_PFX(InternalX86DisablePaging64)
+ASM_PFX(InternalX86DisablePaging64):
cli
shl $0x20,%rcx
lea (%rip), %eax
# VOID
# );
#------------------------------------------------------------------------------
-.global _EnableDisableInterrupts;
-.align 16;
-_EnableDisableInterrupts:
+.global ASM_PFX(EnableDisableInterrupts)
+.align 16
+ASM_PFX(EnableDisableInterrupts):
sti
cli
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _EnableInterrupts;
-_EnableInterrupts:
+.global ASM_PFX(EnableInterrupts)
+ASM_PFX(EnableInterrupts):
sti
ret
# IN UINT64 NewStack %r8
# );
#------------------------------------------------------------------------------
-.global _InternalX86EnablePaging64;
-_InternalX86EnablePaging64:
+.global ASM_PFX(InternalX86EnablePaging64)
+ASM_PFX(InternalX86EnablePaging64):
cli
pop %rax
callq Base
# IN VOID *LinearAddress
# );
#------------------------------------------------------------------------------
-.global _AsmFlushCacheLine;
-_AsmFlushCacheLine:
+.global ASM_PFX(AsmFlushCacheLine)
+ASM_PFX(AsmFlushCacheLine):
clflush (%rdi)
mov %rdi, %rax
ret
# IN CONST IA32_FX_BUFFER *Buffer
# )#
#------------------------------------------------------------------------------
-.global _InternalX86FxRestore;
-_InternalX86FxRestore:
+.global ASM_PFX(InternalX86FxRestore)
+ASM_PFX(InternalX86FxRestore):
fxrstor (%rcx)
ret
# OUT IA32_FX_BUFFER *Buffer
# );
#------------------------------------------------------------------------------
-.global _InternalX86FxSave;
-_InternalX86FxSave:
+.global ASM_PFX(InternalX86FxSave)
+ASM_PFX(InternalX86FxSave):
fxsave (%rcx)
ret
# IN UINT32 ExchangeValue\r
# );\r
#------------------------------------------------------------------------------\r
-.global _InternalSyncCompareExchange32;\r
-_InternalSyncCompareExchange32:\r
+.global ASM_PFX(InternalSyncCompareExchange32)\r
+ASM_PFX(InternalSyncCompareExchange32):\r
mov %edx, %eax\r
lock cmpxchg %r8d, (%rcx)\r
ret\r
# 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
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
-.global _InternalSyncDecrement;
-_InternalSyncDecrement:
+.global ASM_PFX(InternalSyncDecrement)
+ASM_PFX(InternalSyncDecrement):
lock decl (%rcx)
mov (%rcx), %eax
ret
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
-.global _InternalSyncIncrement;
-_InternalSyncIncrement:
+.global ASM_PFX(InternalSyncIncrement)
+ASM_PFX(InternalSyncIncrement):
lock incl (%rcx)
mov (%rcx), %eax
ret
# VOID
# )#
#------------------------------------------------------------------------------
-.global _AsmInvd;
-_AsmInvd:
+.global ASM_PFX(AsmInvd)
+ASM_PFX(AsmInvd):
invd
ret
# IN UINTN Value\r
# );\r
#------------------------------------------------------------------------------\r
-.global _InternalLongJump\r
-_InternalLongJump:\r
+.global ASM_PFX(InternalLongJump)\r
+ASM_PFX(InternalLongJump):\r
mov (%rcx), %rbx\r
mov 0x8(%rcx), %rsp\r
mov 0x10(%rcx), %rbp\r
# 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
# 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
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadCr0;
-.align 16;
-_AsmReadCr0:
+.global ASM_PFX(AsmReadCr0)
+.align 16
+ASM_PFX(AsmReadCr0):
mov %cr0, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadCr2;
-.align 16;
-_AsmReadCr2:
+.global ASM_PFX(AsmReadCr2
+.align 16
+ASM_PFX(AsmReadCr2):
mov %cr2, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadCr3;
-.align 16;
-_AsmReadCr3:
+.global ASM_PFX(AsmReadCr3)
+.align 16
+ASM_PFX(AsmReadCr3):
mov %cr3, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadCr4;
-.align 16;
-_AsmReadCr4:
+.global ASM_PFX(AsmReadCr4)
+.align 16
+ASM_PFX(AsmReadCr4):
mov %cr4, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadCs;
-.align 16;
-_AsmReadCs:
+.global ASM_PFX(AsmReadCs)
+.align 16
+ASM_PFX(AsmReadCs):
mov %cs, %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr0;
-.align 16;
-_AsmReadDr0:
+.global ASM_PFX(AsmReadDr0)
+.align 16
+ASM_PFX(AsmReadDr0):
mov %dr0, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr1;
-.align 16;
-_AsmReadDr1:
+.global ASM_PFX(AsmReadDr1)
+.align 16
+ASM_PFX(AsmReadDr1):
mov %dr1, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr2;
-.align 16;
-_AsmReadDr2:
+.global ASM_PFX(AsmReadDr2)
+.align 16
+ASM_PFX(AsmReadDr2):
mov %dr2, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr3;
-.align 16;
-_AsmReadDr3:
+.global ASM_PFX(AsmReadDr3)
+.align 16
+ASM_PFX(AsmReadDr3):
mov %dr3, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr4;
-.align 16;
-_AsmReadDr4:
+.global ASM_PFX(AsmReadDr4)
+.align 16
+ASM_PFX(AsmReadDr4):
#DB 0fh, 21h, 0e0h
mov %dr4, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr5;
-.align 16;
-_AsmReadDr5:
+.global ASM_PFX(AsmReadDr5)
+.align 16
+ASM_PFX(AsmReadDr5):
mov %dr5, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr6;
-.align 16;
-_AsmReadDr6:
+.global ASM_PFX(AsmReadDr6)
+.align 16
+ASM_PFX(AsmReadDr6):
mov %dr6, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDr7;
-.align 16;
-_AsmReadDr7:
+.global ASM_PFX(AsmReadDr7)
+.align 16
+ASM_PFX(AsmReadDr7):
mov %dr7, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadDs;
-.align 16;
-_AsmReadDs:
+.global ASM_PFX(AsmReadDs)
+.align 16
+ASM_PFX(AsmReadDs):
movl %ds, %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadEflags;
-.align 16;
-_AsmReadEflags:
+.global ASM_PFX(AsmReadEflags)
+.align 16
+ASM_PFX(AsmReadEflags):
pushfq
pop %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadEs;
-.align 16;
-_AsmReadEs:
+.global ASM_PFX(AsmReadEs)
+.align 16
+ASM_PFX(AsmReadEs):
mov %es, %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadFs;
-.align 16;
-_AsmReadFs:
+.global ASM_PFX(AsmReadFs)
+.align 16
+ASM_PFX(AsmReadFs):
mov %fs, %eax
ret
# OUT IA32_DESCRIPTOR *Gdtr
# );
#------------------------------------------------------------------------------
-.global _InternalX86ReadGdtr;
-.align 16;
-_InternalX86ReadGdtr:
+.global ASM_PFX(InternalX86ReadGdtr)
+.align 16
+ASM_PFX(InternalX86ReadGdtr):
sgdt (%rcx)
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadGs;
-.align 16;
-_AsmReadGs:
+.global ASM_PFX(AsmReadGs)
+.align 16
+ASM_PFX(AsmReadGs):
mov %gs, %eax
ret
# OUT IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
-.global _InternalX86ReadIdtr;
-.align 16;
-_InternalX86ReadIdtr:
+.global ASM_PFX(InternalX86ReadIdtr)
+.align 16
+ASM_PFX(InternalX86ReadIdtr):
sidt (%rcx)
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadLdtr;
-.align 16;
-_AsmReadLdtr:
+.global ASM_PFX(AsmReadLdtr)
+.align 16
+ASM_PFX(AsmReadLdtr):
sldt %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm0;
-.align 16;
-_AsmReadMm0:
+.global ASM_PFX(AsmReadMm0)
+.align 16
+ASM_PFX(AsmReadMm0:
#DB 48h, 0fh, 7eh, 0c0h
movd %mm0, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm1;
-.align 16;
-_AsmReadMm1:
+.global ASM_PFX(AsmReadMm1)
+.align 16
+ASM_PFX(AsmReadMm1):
#DB 48h, 0fh, 7eh, 0c8h
movd %mm1, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm2;
-.align 16;
-_AsmReadMm2:
+.global ASM_PFX(AsmReadMm2)
+.align 16
+ASM_PFX(AsmReadMm2):
#DB 48h, 0fh, 7eh, 0d0h
movd %mm2, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm3;
-.align 16;
-_AsmReadMm3:
+.global ASM_PFX(AsmReadMm3)
+.align 16
+ASM_PFX(AsmReadMm3):
#DB 48h, 0fh, 7eh, 0d8h
movd %mm3, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm4;
-.align 16;
-_AsmReadMm4:
+.global ASM_PFX(AsmReadMm4)
+.align 16
+ASM_PFX(AsmReadMm4):
#DB 48h, 0fh, 7eh, 0e0h
movd %mm4, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm5;
-.align 16;
-_AsmReadMm5:
+.global ASM_PFX(AsmReadMm5)
+.align 16
+ASM_PFX(AsmReadMm5):
#DB 48h, 0fh, 7eh, 0e8h
movd %mm5, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm6;
-.align 16;
-_AsmReadMm6:
+.global ASM_PFX(AsmReadMm6)
+.align 16
+ASM_PFX(AsmReadMm6):
#DB 48h, 0fh, 7eh, 0f0h
movd %mm6, %rax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadMm7;
-.align 16;
-_AsmReadMm7:
+.global ASM_PFX(AsmReadMm7)
+.align 16
+ASM_PFX(AsmReadMm7):
#DB 48h, 0fh, 7eh, 0f8h
movd %mm7, %rax
ret
# 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
# IN UINT32 PmcIndex
# );
#------------------------------------------------------------------------------
-.global _AsmReadPmc;
-.align 16;
-_AsmReadPmc:
+.global ASM_PFX(AsmReadPmc)
+.align 16
+ASM_PFX(AsmReadPmc):
rdpmc
shl $0x20, %rdx
or %rdx, %rax
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadSs;
-.align 16;
-_AsmReadSs:
+.global ASM_PFX(AsmReadSs)
+.align 16
+ASM_PFX(AsmReadSs):
movl %ss, %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadTr;
-.align 16;
-_AsmReadTr:
+.global ASM_PFX(AsmReadTr)
+.align 16
+ASM_PFX(AsmReadTr):
str %eax
ret
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmReadTsc;
-.align 16;
-_AsmReadTsc:
+.global ASM_PFX(AsmReadTsc)
+.align 16
+ASM_PFX(AsmReadTsc):
rdtsc
shl $0x20, %rdx
or %rdx, %rax
#
#------------------------------------------------------------------------------
-.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
# None
#
#------------------------------------------------------------------------------
-.global _InternalSwitchStack;
-_InternalSwitchStack:
+.global ASM_PFX(InternalSwitchStack)
+ASM_PFX(InternalSwitchStack):
mov %rcx, %rax
mov %rdx, %rcx
mov %r8, %rdx
- #\r
- # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,\r
- # in case the callee wishes to spill them.\r
+ #
+ # 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
# VOID
# );
#------------------------------------------------------------------------------
-.global _AsmWbinvd;
-.align 16;
-_AsmWbinvd:
+.global ASM_PFX(AsmWbinvd)
+.align 16
+ASM_PFX(AsmWbinvd):
wbinvd
ret
# UINTN Cr0
# );
#------------------------------------------------------------------------------
-.global _AsmWriteCr0;
-_AsmWriteCr0:
+.global ASM_PFX(AsmWriteCr0)
+ASM_PFX(AsmWriteCr0):
mov %rcx,%cr0
mov %rcx,%rax
ret
# UINTN Cr2
# );
#------------------------------------------------------------------------------
-.global _AsmWriteCr2;
-_AsmWriteCr2:
+.global ASM_PFX(AsmWriteCr2)
+ASM_PFX(AsmWriteCr2):
mov %rcx,%cr2
mov %rcx,%rax
ret
# UINTN Cr3
# );
#------------------------------------------------------------------------------
-.global _AsmWriteCr3;
-_AsmWriteCr3:
+.global ASM_PFX(AsmWriteCr3)
+ASM_PFX(AsmWriteCr3):
mov %rcx,%cr3
mov %rcx,%rax
ret
# UINTN Cr4
# );
#------------------------------------------------------------------------------
-.global _AsmWriteCr4;
-_AsmWriteCr4:
+.global ASM_PFX(AsmWriteCr4)
+ASM_PFX(AsmWriteCr4):
mov %rcx,%cr4
mov %rcx,%rax
ret
# UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr0;
-.align 16;
-_AsmWriteDr0:
+.global ASM_PFX(AsmWriteDr0)
+.align 16
+ASM_PFX(AsmWriteDr0):
mov %rcx, %dr0
mov %rcx, %rax
ret
# UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr1;
-.align 16;
-_AsmWriteDr1:
+.global ASM_PFX(AsmWriteDr1)
+.align 16
+ASM_PFX(AsmWriteDr1):
mov %rcx, %dr1
mov %rcx, %rax
ret
# UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr2;
-.align 16;
-_AsmWriteDr2:
+.global ASM_PFX(AsmWriteDr2)
+.align 16
+ASM_PFX(AsmWriteDr2):
mov %rcx, %dr2
mov %rcx, %rax
ret
# UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr3;
-.align 16;
-_AsmWriteDr3:
+.global ASM_PFX(AsmWriteDr3)
+.align 16
+ASM_PFX(AsmWriteDr3):
mov %rcx, %dr3
mov %rcx, %rax
ret
# IN UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr4;
-_AsmWriteDr4:
+.global ASM_PFX(AsmWriteDr4)
+ASM_PFX(AsmWriteDr4):
mov %rcx, %dr4
mov %rcx, %rax
ret
# IN UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr5;
-_AsmWriteDr5:
+.global ASM_PFX(AsmWriteDr5)
+ASM_PFX(AsmWriteDr5):
mov %rcx, %dr5
mov %rcx, %rax
ret
# IN UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr6;
-_AsmWriteDr6:
+.global ASM_PFX(AsmWriteDr6)
+ASM_PFX(AsmWriteDr6):
mov %rcx, %dr6
mov %rcx, %rax
ret
# IN UINTN Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteDr7;
-_AsmWriteDr7:
+.global ASM_PFX(AsmWriteDr7)
+ASM_PFX(AsmWriteDr7):
mov %rcx, %dr7
mov %rcx, %rax
ret
# IN CONST IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
-.global _InternalX86WriteGdtr;
-_InternalX86WriteGdtr:
+.global ASM_PFX(InternalX86WriteGdtr)
+ASM_PFX(InternalX86WriteGdtr):
lgdt (%rcx)
ret
# IN CONST IA32_DESCRIPTOR *Idtr
# );
#------------------------------------------------------------------------------
-.global _InternalX86WriteIdtr;
-.align 16;
-_InternalX86WriteIdtr:
+.global ASM_PFX(InternalX86WriteIdtr)
+.align 16
+ASM_PFX(InternalX86WriteIdtr):
lidt (%rcx)
ret
# IN UINT16 Ldtr
# );
#------------------------------------------------------------------------------
-.global _AsmWriteLdtr;
-.align 16;
-_AsmWriteLdtr:
+.global ASM_PFX(AsmWriteLdtr)
+.align 16
+ASM_PFX(AsmWriteLdtr):
lldt %cx
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm0;
-_AsmWriteMm0:
+.global ASM_PFX(AsmWriteMm0)
+ASM_PFX(AsmWriteMm0):
movd %rcx, %xmm0
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm1;
-_AsmWriteMm1:
+.global ASM_PFX(AsmWriteMm1)
+ASM_PFX(AsmWriteMm1):
movd %rcx, %mm1
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm2;
-_AsmWriteMm2:
+.global ASM_PFX(AsmWriteMm2)
+ASM_PFX(AsmWriteMm2):
movd %rcx, %mm2
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm3;
-_AsmWriteMm3:
+.global ASM_PFX(AsmWriteMm3)
+ASM_PFX(AsmWriteMm3):
movd %rcx, %mm3
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm4;
-_AsmWriteMm4:
+.global ASM_PFX(AsmWriteMm4)
+ASM_PFX(AsmWriteMm4):
movd %rcx, %mm4
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm5;
-_AsmWriteMm5:
+.global ASM_PFX(AsmWriteMm5)
+ASM_PFX(AsmWriteMm5):
movd %rcx, %mm5
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm6;
-_AsmWriteMm6:
+.global ASM_PFX(AsmWriteMm6)
+ASM_PFX(AsmWriteMm6):
movd %rcx, %mm6
ret
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-.global _AsmWriteMm7;
-_AsmWriteMm7:
+.global ASM_PFX(AsmWriteMm7)
+ASM_PFX(AsmWriteMm7):
movd %rcx, %mm7
ret
# );
# TODO:
#------------------------------------------------------------------------------
-.global _AsmWriteMsr64;
-.align 16;
-_AsmWriteMsr64:
+.global ASM_PFX(AsmWriteMsr64)
+.align 16
+ASM_PFX(AsmWriteMsr64):
mov %rdx, %rax
shr $0x20, %rdx
wrmsr
#
#------------------------------------------------------------------------------
-.globl _InternalMemCompareMem
+.globl ASM_PFX(InternalMemCompareMem)
#------------------------------------------------------------------------------
# INTN
# IN UINTN Length
# );
#------------------------------------------------------------------------------
-_InternalMemCompareMem:
+ASM_PFX(InternalMemCompareMem):
push %esi
push %edi
movl 12(%esp), %esi
#
#------------------------------------------------------------------------------
-.globl _InternalMemCopyMem
+.globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------
# VOID *
# IN UINTN Count
# );
#------------------------------------------------------------------------------
-_InternalMemCopyMem:
+ASM_PFX(InternalMemCopyMem):
push %esi
push %edi
movl 16(%esp), %esi # esi <- Source
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem16
+.globl ASM_PFX(InternalMemScanMem16)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT16 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem16:
+ASM_PFX(InternalMemScanMem16):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem32
+.globl ASM_PFX(InternalMemScanMem32)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem32:
+ASM_PFX(InternalMemScanMem32):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem64
+.globl ASM_PFX(InternalMemScanMem64)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem64:
+ASM_PFX(InternalMemScanMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem8
+.globl ASM_PFX(InternalMemScanMem8)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT8 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem8:
+ASM_PFX(InternalMemScanMem8):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
.386:
.code:
-.globl _InternalMemSetMem
+.globl ASM_PFX(InternalMemSetMem)
#------------------------------------------------------------------------------
# VOID *
# IN UINT8 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem:
+ASM_PFX(InternalMemSetMem):
push %edi
movl 12(%esp),%ecx
movb 16(%esp),%al
- movb %ah, %al\r
+ movb %ah, %al
shrd $16, %eax, %edx
shld $16, %edx, %eax
- movl %edx, %ecx\r
+ movl %edx, %ecx
movl 8(%esp),%edi
- shrd $2, %ecx, %ecx\r
- rep \r
- stosl\r
- movl %ecx, %edx\r
- andl $3, %ecx\r
+ shrd $2, %ecx, %ecx
+ rep
+ stosl
+ movl %ecx, %edx
+ andl $3, %ecx
rep
stosb
movl 8(%esp),%eax
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem16
+.globl ASM_PFX(InternalMemSetMem16)
#------------------------------------------------------------------------------
# VOID *
# IN UINT16 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem16:
+ASM_PFX(InternalMemSetMem16):
push %edi
movl 16(%esp), %eax
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem32
+.globl ASM_PFX(InternalMemSetMem32)
#------------------------------------------------------------------------------
# VOID *
# IN UINT32 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem32:
+ASM_PFX(InternalMemSetMem32):
push %edi
movl 16(%esp),%eax
movl 8(%esp),%edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem64
+.globl ASM_PFX(InternalMemSetMem64)
#------------------------------------------------------------------------------
# VOID *
# IN UINT64 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem64:
+ASM_PFX(InternalMemSetMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax
#
#------------------------------------------------------------------------------
-.globl _InternalMemZeroMem
+.globl ASM_PFX(InternalMemZeroMem)
#------------------------------------------------------------------------------
# VOID *
# IN UINTN Count
# );
#------------------------------------------------------------------------------
-_InternalMemZeroMem:
+ASM_PFX(InternalMemZeroMem):
push %edi
xorl %eax,%eax
movl 8(%esp),%edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemCompareMem
+.globl ASM_PFX(InternalMemCompareMem)
#------------------------------------------------------------------------------
# INTN
# IN UINTN Length
# );
#------------------------------------------------------------------------------
-_InternalMemCompareMem:
+ASM_PFX(InternalMemCompareMem):
push %esi
push %edi
movl 12(%esp), %esi
#
#------------------------------------------------------------------------------
-.globl _InternalMemCopyMem
+.globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------
# VOID *
# 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\r
- je L_CopyDone\r
+ cmpl %esi, %edi
+ je L_CopyDone
cmpl $0, %edx
- je L_CopyDone\r
+ je L_CopyDone
leal -1(%esi, %edx), %eax # eax <- End of Source
- cmpl %esi, %edi\r
- jae L_CopyBytes\r
- cmpl %eax, %edi\r
- jb L_CopyBytes # Copy backward if overlapped\r
- movl %esi, %eax # esi <- End of Source\r
+ 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\r
-L_CopyBytes:\r
- movl %ecx, %edx\r
+ std
+L_CopyBytes:
+ movl %edx, %ecx
rep
movsb # Copy bytes backward
cld
-L_CopyDone:\r
+L_CopyDone:
movl 12(%esp), %eax # eax <- Destination as return value
pop %edi
pop %esi
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem16
+.globl ASM_PFX(InternalMemScanMem16)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT16 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem16:
+ASM_PFX(InternalMemScanMem16):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem32
+.globl ASM_PFX(InternalMemScanMem32)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT32 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem32:
+ASM_PFX(InternalMemScanMem32):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem64
+.globl ASM_PFX(InternalMemScanMem64)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT64 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem64:
+ASM_PFX(InternalMemScanMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax
#
#------------------------------------------------------------------------------
-.globl _InternalMemScanMem8
+.globl ASM_PFX(InternalMemScanMem8)
#------------------------------------------------------------------------------
# CONST VOID *
# IN UINT8 Value
# );
#------------------------------------------------------------------------------
-_InternalMemScanMem8:
+ASM_PFX(InternalMemScanMem8):
push %edi
movl 12(%esp), %ecx
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
- .386:
- .code:
-
-.globl _InternalMemSetMem
+.globl ASM_PFX(InternalMemSetMem)
#------------------------------------------------------------------------------
# VOID *
# IN UINT8 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem:
+ASM_PFX(InternalMemSetMem):
push %edi
movl 12(%esp),%ecx
movb 16(%esp),%al
- movb %ah, %al\r
+ movb %al, %ah
shrd $16, %eax, %edx
shld $16, %edx, %eax
- movl %edx, %ecx\r
+ movl %ecx, %edx
movl 8(%esp),%edi
- shrd $2, %ecx, %ecx\r
- rep \r
- stosl\r
- movl %ecx, %edx\r
- andl $3, %ecx\r
- rep
- stosb
+ shr $2, %ecx
+ rep stosl
+ movl %edx, %ecx
+ andl $3, %ecx
+ rep stosb
movl 8(%esp),%eax
pop %edi
ret
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem16
+.globl ASM_PFX(InternalMemSetMem16)
#------------------------------------------------------------------------------
# VOID *
# IN UINT16 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem16:
+ASM_PFX(InternalMemSetMem16):
push %edi
movl 16(%esp), %eax
movl 8(%esp), %edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem32
+.globl ASM_PFX(InternalMemSetMem32)
#------------------------------------------------------------------------------
# VOID *
# IN UINT32 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem32:
+ASM_PFX(InternalMemSetMem32):
push %edi
movl 16(%esp),%eax
movl 8(%esp),%edi
#
#------------------------------------------------------------------------------
-.globl _InternalMemSetMem64
+.globl ASM_PFX(InternalMemSetMem64)
#------------------------------------------------------------------------------
# VOID *
# IN UINT64 Value
# )
#------------------------------------------------------------------------------
-_InternalMemSetMem64:
+ASM_PFX(InternalMemSetMem64):
push %edi
movl 12(%esp), %ecx
movl 16(%esp), %eax
#
#------------------------------------------------------------------------------
-.globl _InternalMemZeroMem
+.globl ASM_PFX(InternalMemZeroMem)
#------------------------------------------------------------------------------
# VOID *
# IN UINTN Count
# );
#------------------------------------------------------------------------------
-_InternalMemZeroMem:
+ASM_PFX(InternalMemZeroMem):
push %edi
xorl %eax,%eax
movl 8(%esp),%edi