1. Updated function headers in all assembly files.

2. Split x86LowLevel.c into a bunch of C files to make images linked with BaseLib smaller.
3. Fixed a few minor bugs.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1066 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
bxing 2006-07-21 08:47:38 +00:00
parent 31a9215c32
commit 3f566587ae
252 changed files with 1840 additions and 2009 deletions

View File

@ -83,8 +83,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Filename>SwapBytes32.c</Filename>
<Filename>SwapBytes64.c</Filename>
<Filename>SwitchStack.c</Filename>
<Filename SupArchList="IA32">x86LowLevel.c</Filename>
<Filename SupArchList="IA32">x86DisablePaging32.c</Filename>
<Filename SupArchList="IA32">x86DisablePaging64.c</Filename>
<Filename SupArchList="IA32">x86EnablePaging32.c</Filename>
<Filename SupArchList="IA32">x86EnablePaging64.c</Filename>
<Filename SupArchList="IA32">x86FxRestore.c</Filename>
<Filename SupArchList="IA32">x86FxSave.c</Filename>
<Filename SupArchList="IA32">x86GetInterruptState.c</Filename>
<Filename SupArchList="IA32">x86MemoryFence.c</Filename>
<Filename SupArchList="IA32">x86Msr.c</Filename>
<Filename SupArchList="IA32">x86ReadGdtr.c</Filename>
<Filename SupArchList="IA32">x86ReadIdtr.c</Filename>
<Filename SupArchList="IA32">x86Thunk.c</Filename>
<Filename SupArchList="IA32">x86WriteGdtr.c</Filename>
<Filename SupArchList="IA32">x86WriteIdtr.c</Filename>
<Filename SupArchList="IA32">Unaligned.c</Filename>
<Filename SupArchList="IA32">Ia32/Non-existing.c</Filename>
<Filename SupArchList="IA32">Ia32/InternalSwitchStack.c</Filename>
@ -107,7 +119,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Filename SupArchList="IA32">Ia32/CpuIdEx.asm</Filename>
<Filename SupArchList="IA32">Ia32/ReadEflags.asm</Filename>
<Filename SupArchList="IA32">Ia32/ReadMsr64.asm</Filename>
<Filename SupArchList="IA32">Ia32/WriteMsr32.asm</Filename>
<Filename SupArchList="IA32">Ia32/WriteMsr64.asm</Filename>
<Filename SupArchList="IA32">Ia32/ReadCr0.asm</Filename>
<Filename SupArchList="IA32">Ia32/ReadCr2.asm</Filename>
@ -205,7 +216,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Filename SupArchList="IA32">Ia32/CpuIdEx.S</Filename>
<Filename SupArchList="IA32">Ia32/ReadEflags.S</Filename>
<Filename SupArchList="IA32">Ia32/ReadMsr64.S</Filename>
<Filename SupArchList="IA32">Ia32/WriteMsr32.S</Filename>
<Filename SupArchList="IA32">Ia32/WriteMsr64.S</Filename>
<Filename SupArchList="IA32">Ia32/ReadCr0.S</Filename>
<Filename SupArchList="IA32">Ia32/ReadCr2.S</Filename>
@ -284,8 +294,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Filename SupArchList="IA32">Ia32/CpuBreakpoint.S</Filename>
<Filename SupArchList="IA32">Ia32/CpuFlushTlb.S</Filename>
<Filename SupArchList="IA32">Ia32/Thunk16.S</Filename>
<Filename SupArchList="X64">x86LowLevel.c</Filename>
<Filename SupArchList="X64">x86DisablePaging32.c</Filename>
<Filename SupArchList="X64">x86DisablePaging64.c</Filename>
<Filename SupArchList="X64">x86EnablePaging32.c</Filename>
<Filename SupArchList="X64">x86EnablePaging64.c</Filename>
<Filename SupArchList="X64">x86FxRestore.c</Filename>
<Filename SupArchList="X64">x86FxSave.c</Filename>
<Filename SupArchList="X64">x86GetInterruptState.c</Filename>
<Filename SupArchList="X64">x86MemoryFence.c</Filename>
<Filename SupArchList="X64">x86Msr.c</Filename>
<Filename SupArchList="X64">x86ReadGdtr.c</Filename>
<Filename SupArchList="X64">x86ReadIdtr.c</Filename>
<Filename SupArchList="X64">x86Thunk.c</Filename>
<Filename SupArchList="X64">x86WriteGdtr.c</Filename>
<Filename SupArchList="X64">x86WriteIdtr.c</Filename>
<Filename SupArchList="X64">Unaligned.c</Filename>
<Filename SupArchList="X64">Math64.c</Filename>
<Filename SupArchList="X64">X64/Non-existing.c</Filename>
@ -295,9 +317,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Filename SupArchList="X64">X64/CpuId.asm</Filename>
<Filename SupArchList="X64">X64/CpuIdEx.asm</Filename>
<Filename SupArchList="X64">X64/ReadEflags.asm</Filename>
<Filename SupArchList="X64">X64/ReadMsr32.asm</Filename>
<Filename SupArchList="X64">X64/ReadMsr64.asm</Filename>
<Filename SupArchList="X64">X64/WriteMsr32.asm</Filename>
<Filename SupArchList="X64">X64/WriteMsr64.asm</Filename>
<Filename SupArchList="X64">X64/ReadCr0.asm</Filename>
<Filename SupArchList="X64">X64/ReadCr2.asm</Filename>

View File

@ -19,21 +19,23 @@
#
#------------------------------------------------------------------------------
.global _InternalMathARShiftU64
_InternalMathARShiftU64:
movb 12(%esp),%cl
movl 8(%esp),%eax
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathARShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMathARShiftU64:
movb 12(%esp), %cl
movl 8(%esp), %eax
cltd
testb $32,%cl
testb $32, %cl
cmovz %eax, %edx
cmovz 4(%esp), %eax
shrdl %cl,%edx,%eax
sar %cl,%edx
shrdl %cl, %edx, %eax
sar %cl, %edx
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathARShiftU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
InternalMathARShiftU64 PROC
mov cl, [esp + 12]
mov eax, [esp + 8]
@ -35,4 +43,4 @@ InternalMathARShiftU64 PROC
ret
InternalMathARShiftU64 ENDP
END
END

View File

@ -20,10 +20,7 @@
#
#------------------------------------------------------------------------------
.global _CpuBreakpoint
#------------------------------------------------------------------------------
# VOID
@ -32,10 +29,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuBreakpoint
_CpuBreakpoint:
_CpuBreakpoint:
int $3
ret

View File

@ -20,9 +20,7 @@
#
#------------------------------------------------------------------------------
.global _CpuFlushTlb
#------------------------------------------------------------------------------
# VOID
@ -31,11 +29,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuFlushTlb
_CpuFlushTlb:
_CpuFlushTlb:
movl %cr3, %eax
movl %eax, %cr3
ret

View File

@ -21,7 +21,7 @@
;------------------------------------------------------------------------------
.386p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -31,10 +31,10 @@
; VOID
; );
;------------------------------------------------------------------------------
_CpuFlushTlb PROC
CpuFlushTlb PROC
mov eax, cr3
mov cr3, eax
ret
_CpuFlushTlb ENDP
CpuFlushTlb ENDP
END

View File

@ -21,6 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _AsmCpuid
#------------------------------------------------------------------------------
# VOID
@ -33,33 +34,30 @@
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
.globl _AsmCpuid
_AsmCpuid:
pushl %ebx
pushl %ebp
push %ebx
push %ebp
movl %esp, %ebp
movl 12(%ebp), %eax
cpuid
pushl %ecx
push %ecx
movl 16(%ebp), %ecx
jecxz L1
movl %eax, (%ecx)
L1:
L1:
movl 20(%ebp), %ecx
jecxz L2
movl %ebx, (%ecx)
L2:
L2:
movl 24(%ebp), %ecx
jecxz L3
popl (%ecx)
L3:
L3:
movl 28(%ebp), %ecx
jecxz L4
movl %edx, (%ecx)
L4:
L4:
movl 12(%ebp), %eax
leave
popl %ebx
pop %ebx
ret

View File

@ -34,7 +34,7 @@
; OUT UINT32 *RegisterOutEbx OPTIONAL,
; OUT UINT32 *RegisterOutEcx OPTIONAL,
; OUT UINT32 *RegisterOutEdx OPTIONAL
; )
; );
;------------------------------------------------------------------------------
AsmCpuid PROC USES ebx
push ebp

View File

@ -21,8 +21,8 @@
#
#------------------------------------------------------------------------------
.686:
.code:
.686:
.code:
#------------------------------------------------------------------------------
# UINT32
@ -39,28 +39,28 @@
.globl _AsmCpuidEx
_AsmCpuidEx:
push %ebx
pushl %ebp
push %ebp
movl %esp, %ebp
movl 12(%ebp), %eax
movl 16(%ebp), %ecx
cpuid
pushl %ecx
push %ecx
movl 20(%ebp), %ecx
jecxz L1
movl %eax, (%ecx)
L1:
L1:
movl 24(%ebp), %ecx
jecxz L2
movl %ebx, (%ecx)
L2:
L2:
movl 28(%ebp), %ecx
jecxz L3
popl (%ecx)
L3:
L3:
movl 32(%ebp), %edx
jecxz L4
movl %edx, (%ecx)
L4:
L4:
movl 12(%ebp), %eax
leave
pop %ebx

View File

@ -20,10 +20,7 @@
#
#------------------------------------------------------------------------------
.global _CpuPause
#------------------------------------------------------------------------------
# VOID
@ -32,10 +29,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuPause
_CpuPause:
_CpuPause:
pause
ret

View File

@ -21,7 +21,7 @@
;------------------------------------------------------------------------------
.686
.model flat
.model flat,C
.xmm
.code
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_CpuPause PROC
CpuPause PROC
pause
ret
_CpuPause ENDP
CpuPause ENDP
END

View File

@ -20,9 +20,7 @@
#
#------------------------------------------------------------------------------
.global _CpuSleep
#------------------------------------------------------------------------------
# VOID
@ -31,10 +29,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _CpuSleep
_CpuSleep:
_CpuSleep:
hlt
ret

View File

@ -21,7 +21,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -31,9 +31,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_CpuSleep PROC
CpuSleep PROC
hlt
ret
_CpuSleep ENDP
CpuSleep ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _DisableInterrupts
#------------------------------------------------------------------------------
# VOID
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _DisableInterrupts
_DisableInterrupts:
_DisableInterrupts:
cli
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_DisableInterrupts PROC
DisableInterrupts PROC
cli
ret
_DisableInterrupts ENDP
DisableInterrupts ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalX86DisablePaging32
#------------------------------------------------------------------------------
# VOID
@ -35,24 +33,20 @@
# IN VOID *NewStack
# );
#------------------------------------------------------------------------------
.global _InternalX86DisablePaging32
_InternalX86DisablePaging32:
movl 4(%esp),%ebx
movl 8(%esp),%ecx
movl 12(%esp),%edx
_InternalX86DisablePaging32:
movl 4(%esp), %ebx
movl 8(%esp), %ecx
movl 12(%esp), %edx
pushfl
popl %edi
pop %edi
cli
movl %cr0, %eax
btrl $31,%eax
movl 16(%esp),%esp
btrl $31, %eax
movl 16(%esp), %esp
movl %eax, %cr0
pushl %edi
push %edi
popfl
pushl %edx
pushl %ecx
push %edx
push %ecx
call *%ebx
jmp .

View File

@ -40,18 +40,18 @@ InternalX86DisablePaging32 PROC
mov ecx, [esp + 8]
mov edx, [esp + 12]
pushfd
pop edi
pop edi ; save EFLAGS to edi
cli
mov eax, cr0
btr eax, 31
mov esp, [esp + 16]
mov cr0, eax
push edi
popfd
popfd ; restore EFLAGS from edi
push edx
push ecx
call ebx
jmp $
jmp $ ; EntryPoint() should not return
InternalX86DisablePaging32 ENDP
END

View File

@ -19,17 +19,23 @@
#
#------------------------------------------------------------------------------
.386:
.code:
.global _InternalMathDivU64x32
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathDivU64x32 (
# IN UINT64 Dividend,
# IN UINT32 Divisor
# );
#------------------------------------------------------------------------------
_InternalMathDivU64x32:
movl 8(%esp),%eax
movl 12(%esp),%ecx
xorl %edx,%edx
movl 8(%esp), %eax
movl 12(%esp), %ecx
xorl %edx, %edx
divl %ecx
pushl %eax
movl 8(%esp),%eax
push %eax
movl 8(%esp), %eax
divl %ecx
popl %edx
pop %edx
ret

View File

@ -23,15 +23,23 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathDivU64x32 (
; IN UINT64 Dividend,
; IN UINT32 Divisor
; );
;------------------------------------------------------------------------------
InternalMathDivU64x32 PROC
mov eax, [esp + 8]
mov ecx, [esp + 12]
xor edx, edx
div ecx
push eax
push eax ; save quotient on stack
mov eax, [esp + 8]
div ecx
pop edx
pop edx ; restore high-order dword of the quotient
ret
InternalMathDivU64x32 ENDP

View File

@ -19,25 +19,28 @@
#
#------------------------------------------------------------------------------
.global _InternalMathDivRemU64x32
_InternalMathDivRemU64x32:
movl 12(%esp),%ecx
movl 8(%esp),%eax
xorl %edx,%edx
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathDivRemU64x32 (
# IN UINT64 Dividend,
# IN UINT32 Divisor,
# OUT UINT32 *Remainder
# );
#------------------------------------------------------------------------------
_InternalMathDivRemU64x32:
movl 12(%esp), %ecx
movl 8(%esp), %eax
xorl %edx, %edx
divl %ecx
pushl %eax
movl 8(%esp),%eax
push %eax
movl 8(%esp), %eax
divl %ecx
movl 20(%esp),%ecx
movl 20(%esp), %ecx
jecxz L1
movl %edx,(%ecx)
L1:
popl %edx
movl %edx, (%ecx)
L1:
pop %edx
ret

View File

@ -23,6 +23,15 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathDivRemU64x32 (
; IN UINT64 Dividend,
; IN UINT32 Divisor,
; OUT UINT32 *Remainder
; );
;------------------------------------------------------------------------------
InternalMathDivRemU64x32 PROC
mov ecx, [esp + 12]
mov eax, [esp + 8]
@ -32,7 +41,7 @@ InternalMathDivRemU64x32 PROC
mov eax, [esp + 8]
div ecx
mov ecx, [esp + 20]
jecxz @F
jecxz @F ; abandon remainder if Remainder == NULL
mov [ecx], edx
@@:
pop edx

View File

@ -20,69 +20,70 @@
#
#------------------------------------------------------------------------------
.global _InternalMathDivRemU64x32, _InternalMathDivRemU64x64
.extern _InternalMathDivRemU64x32
.global _InternalMathDivRemU64x64
_InternalMathDivRemU64x64:
movl 16(%esp),%ecx
testl %ecx,%ecx
jnz _DivRemU64x64
movl 20(%esp),%ecx
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathDivRemU64x64 (
# IN UINT64 Dividend,
# IN UINT64 Divisor,
# OUT UINT64 *Remainder OPTIONAL
# );
#------------------------------------------------------------------------------
_InternalMathDivRemU64x64:
movl 16(%esp), %ecx
testl %ecx, %ecx
jnz Hard
movl 20(%esp), %ecx
jecxz L1
and $0,4(%ecx)
movl %ecx,16(%esp)
L1:
and $0, 4(%ecx)
movl %ecx, 16(%esp)
L1:
jmp _InternalMathDivRemU64x32
.global _DivRemU64x64
_DivRemU64x64:
push %ebx
push %esi
push %edi
Hard:
push %ebx
push %esi
push %edi
mov 20(%esp), %edx
mov 16(%esp), %eax
movl %edx,%edi
movl %eax,%esi
movl %edx, %edi
movl %eax, %esi
mov 24(%esp), %ebx
L2:
L2:
shrl %edx
rcrl $1,%eax
shrdl $1,%ecx,%ebx
rcrl $1, %eax
shrdl $1, %ecx, %ebx
shrl %ecx
jnz L2
divl %ebx
movl %eax,%ebx
movl 28(%esp),%ecx
movl %eax, %ebx
movl 28(%esp), %ecx
mull 24(%esp)
imull %ebx,%ecx
addl %ecx,%edx
imull %ebx, %ecx
addl %ecx, %edx
mov 32(%esp), %ecx
jc TooLarge
cmpl %edx,%edi
cmpl %edx, %edi
ja Correct
jb TooLarge
cmpl %eax,%esi
cmpl %eax, %esi
jae Correct
TooLarge:
TooLarge:
decl %ebx
jecxz Return
sub 24(%esp), %eax
sbb 28(%esp), %edx
Correct:
Correct:
jecxz Return
subl %eax,%esi
sbbl %edx,%edi
movl %esi,(%ecx)
movl %edi,4(%ecx)
Return:
movl %ebx,%eax
xorl %edx,%edx
push %edi
push %esi
push %ebx
subl %eax, %esi
sbbl %edx, %edi
movl %esi, (%ecx)
movl %edi, 4(%ecx)
Return:
movl %ebx, %eax
xorl %edx, %edx
pop %edi
pop %esi
pop %ebx
ret

View File

@ -26,10 +26,19 @@
EXTERN InternalMathDivRemU64x32:PROC
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathDivRemU64x64 (
; IN UINT64 Dividend,
; IN UINT64 Divisor,
; OUT UINT64 *Remainder OPTIONAL
; );
;------------------------------------------------------------------------------
InternalMathDivRemU64x64 PROC
mov ecx, [esp + 16]
test ecx, ecx
jnz _@DivRemU64x64
jnz _@DivRemU64x64 ; call _@DivRemU64x64 if Divisor > 2^32
mov ecx, [esp + 20]
jecxz @F
and dword ptr [ecx + 4], 0
@ -40,10 +49,10 @@ InternalMathDivRemU64x64 ENDP
_@DivRemU64x64 PROC USES ebx esi edi
mov edx, dword ptr [esp + 20]
mov eax, dword ptr [esp + 16]
mov eax, dword ptr [esp + 16] ; edx:eax <- dividend
mov edi, edx
mov esi, eax
mov ebx, dword ptr [esp + 24]
mov esi, eax ; edi:esi <- dividend
mov ebx, dword ptr [esp + 24] ; ecx:ebx <- divisor
@@:
shr edx, 1
rcr eax, 1
@ -51,31 +60,31 @@ _@DivRemU64x64 PROC USES ebx esi edi
shr ecx, 1
jnz @B
div ebx
mov ebx, eax
mov ebx, eax ; ebx <- quotient
mov ecx, [esp + 28]
mul dword ptr [esp + 24]
imul ecx, ebx
add edx, ecx
mov ecx, dword ptr [esp + 32]
jc @TooLarge
cmp edi, edx
jc @TooLarge ; product > 2^64
cmp edi, edx ; compare high 32 bits
ja @Correct
jb @TooLarge
jb @TooLarge ; product > dividend
cmp esi, eax
jae @Correct
jae @Correct ; product <= dividend
@TooLarge:
dec ebx
jecxz @Return
dec ebx ; adjust quotient by -1
jecxz @Return ; return if Remainder == NULL
sub eax, dword ptr [esp + 24]
sbb edx, dword ptr [esp + 28]
@Correct:
jecxz @Return
sub esi, eax
sbb edi, edx
sbb edi, edx ; edi:esi <- remainder
mov [ecx], esi
mov [ecx + 4], edi
@Return:
mov eax, ebx
mov eax, ebx ; eax <- quotient
xor edx, edx
ret
_@DivRemU64x64 ENDP

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _EnableDisableInterrupts
#------------------------------------------------------------------------------
# VOID
@ -32,11 +30,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _EnableDisableInterrupts
_EnableDisableInterrupts:
_EnableDisableInterrupts:
sti
cli
ret

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _EnableInterrupts
#------------------------------------------------------------------------------
# VOID
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _EnableInterrupts
_EnableInterrupts:
_EnableInterrupts:
sti
ret

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalX86EnablePaging32
#------------------------------------------------------------------------------
# VOID
@ -35,24 +33,20 @@
# IN VOID *NewStack
# );
#------------------------------------------------------------------------------
.global _InternalX86EnablePaging32
_InternalX86EnablePaging32:
movl 4(%esp),%ebx
movl 8(%esp),%ecx
movl 12(%esp),%edx
_InternalX86EnablePaging32:
movl 4(%esp), %ebx
movl 8(%esp), %ecx
movl 12(%esp), %edx
pushfl
popl %edi
pop %edi
cli
movl %cr0, %eax
btsl $31,%eax
movl 16(%esp),%esp
btsl $31, %eax
movl 16(%esp), %esp
movl %eax, %cr0
pushl %edi
push %edi
popfl
pushl %edx
pushl %ecx
push %edx
push %ecx
call *%ebx
jmp .

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
#.MODEL flat
.global _InternalX86EnablePaging64
#------------------------------------------------------------------------------
# VOID
@ -36,7 +34,6 @@
# IN UINT64 NewStack
# );
#------------------------------------------------------------------------------
.global _InternalX86EnablePaging64
_InternalX86EnablePaging64:
cli
movl $LongStart, (%esp)
@ -52,13 +49,13 @@ _InternalX86EnablePaging64:
movl %eax, %cr0 # enable paging
lret
LongStart: # long mode starts here
.byte 0x67,0x48
.byte 0x67, 0x48
movl (%esp), %ebx # mov rbx, [esp]
.byte 0x67,0x48
.byte 0x67, 0x48
movl 8(%esp), %ecx # mov rcx, [esp + 8]
.byte 0x67,0x48
.byte 0x67, 0x48
movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
.byte 0x67,0x48
.byte 0x67, 0x48
movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
.byte 0x48
addl $0x-20, %esp # add rsp, -20h

View File

@ -25,9 +25,20 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; InternalX86EnablePaging64 (
; IN UINT16 Cs,
; IN UINT64 EntryPoint,
; IN UINT64 Context1, OPTIONAL
; IN UINT64 Context2, OPTIONAL
; IN UINT64 NewStack
; );
;------------------------------------------------------------------------------
InternalX86EnablePaging64 PROC
cli
mov [esp], @F ; offset for far retf
mov [esp], @F ; offset for far retf, seg is the 1st arg
mov eax, cr4
or al, (1 SHL 5)
mov cr4, eax ; enable PAE

View File

@ -21,10 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmFlushCacheLine
#------------------------------------------------------------------------------
# VOID
@ -33,11 +30,7 @@
# IN VOID *LinearAddress
# );
#------------------------------------------------------------------------------
.global _AsmFlushCacheLine
_AsmFlushCacheLine:
movl 4(%esp),%eax
_AsmFlushCacheLine:
movl 4(%esp), %eax
clflush (%eax)
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586P
.model flat
.model flat,C
.xmm
.code
@ -33,10 +33,10 @@
; IN VOID *LinearAddress
; );
;------------------------------------------------------------------------------
_AsmFlushCacheLine PROC
AsmFlushCacheLine PROC
mov eax, [esp + 4]
clflush [eax]
ret
_AsmFlushCacheLine ENDP
AsmFlushCacheLine ENDP
END

View File

@ -21,10 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalX86FxRestore
#------------------------------------------------------------------------------
# VOID
@ -33,11 +30,7 @@
# IN CONST IA32_FX_BUFFER *Buffer
# );
#------------------------------------------------------------------------------
.global _InternalX86FxRestore
_InternalX86FxRestore:
movl 4(%esp),%eax
_InternalX86FxRestore:
movl 4(%esp), %eax
fxrstor (%eax)
ret

View File

@ -21,7 +21,7 @@
;
;------------------------------------------------------------------------------
.586P
.586
.model flat,C
.xmm
.code

View File

@ -21,10 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalX86FxSave
#------------------------------------------------------------------------------
# VOID
@ -33,11 +30,7 @@
# OUT IA32_FX_BUFFER *Buffer
# );
#------------------------------------------------------------------------------
.global _InternalX86FxSave
_InternalX86FxSave:
movl 4(%esp),%eax
_InternalX86FxSave:
movl 4(%esp), %eax
fxsave (%eax)
ret

View File

@ -21,7 +21,7 @@
;
;------------------------------------------------------------------------------
.586P
.586
.model flat,C
.xmm
.code

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange32
#------------------------------------------------------------------------------
# UINT32
@ -34,13 +32,10 @@
# IN UINT32 ExchangeValue
# );
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange32
_InternalSyncCompareExchange32:
movl 4(%esp),%ecx
movl 8(%esp),%eax
movl 12(%esp),%edx
lock cmpxchgl %edx,(%ecx)
_InternalSyncCompareExchange32:
movl 4(%esp), %ecx
movl 8(%esp), %eax
movl 12(%esp), %edx
lock
cmpxchgl %edx, (%ecx)
ret

View File

@ -28,7 +28,7 @@
;------------------------------------------------------------------------------
; UINT32
; EFIAPI
; InterlockedCompareExchange32 (
; InternalSyncCompareExchange32 (
; IN UINT32 *Value,
; IN UINT32 CompareValue,
; IN UINT32 ExchangeValue

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange64
#------------------------------------------------------------------------------
# UINT64
@ -34,20 +32,16 @@
# IN UINT64 ExchangeValue
# );
#------------------------------------------------------------------------------
.global _InternalSyncCompareExchange64
_InternalSyncCompareExchange64:
push %esi
push %ebx
movl 12(%esp),%esi
movl 16(%esp),%eax
movl 20(%esp),%edx
movl 24(%esp),%ebx
movl 28(%esp),%ecx
lock
movl 12(%esp), %esi
movl 16(%esp), %eax
movl 20(%esp), %edx
movl 24(%esp), %ebx
movl 28(%esp), %ecx
lock
cmpxchg8b (%esi)
pop %ebx
pop %esi
ret

View File

@ -28,7 +28,7 @@
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InterlockedCompareExchange64 (
; InternalSyncCompareExchange64 (
; IN UINT64 *Value,
; IN UINT64 CompareValue,
; IN UINT64 ExchangeValue

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalSyncDecrement
#------------------------------------------------------------------------------
# UINT32
@ -32,13 +30,9 @@
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
.global _InternalSyncDecrement
_InternalSyncDecrement:
movl 4(%esp),%eax
lock
decl (%eax)
movl (%eax),%eax
_InternalSyncDecrement:
movl 4(%esp), %eax
lock
decl (%eax)
movl (%eax), %eax
ret

View File

@ -28,7 +28,7 @@
;------------------------------------------------------------------------------
; UINT32
; EFIAPI
; InterlockedDecrement (
; InternalSyncDecrement (
; IN UINT32 *Value
; );
;------------------------------------------------------------------------------

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalSyncIncrement
#------------------------------------------------------------------------------
# UINT32
@ -32,13 +30,9 @@
# IN UINT32 *Value
# );
#------------------------------------------------------------------------------
.global _InternalSyncIncrement
_InternalSyncIncrement:
movl 4(%esp),%eax
lock
incl (%eax)
movl (%eax),%eax
_InternalSyncIncrement:
movl 4(%esp), %eax
lock
incl (%eax)
movl (%eax), %eax
ret

View File

@ -28,7 +28,7 @@
;------------------------------------------------------------------------------
; UINT32
; EFIAPI
; InterlockedIncrement (
; InternalSyncIncrement (
; IN UINT32 *Value
; );
;------------------------------------------------------------------------------

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmInvd
#------------------------------------------------------------------------------
# VOID
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmInvd
_AsmInvd:
_AsmInvd:
invd
ret

View File

@ -19,26 +19,28 @@
#
#------------------------------------------------------------------------------
.global _InternalMathLRotU64
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathLRotU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMathLRotU64:
push %ebx
movb 16(%esp),%cl
movl 12(%esp),%edx
movl 8(%esp),%eax
shldl %cl,%edx,%ebx
shldl %cl,%eax,%edx
rorl %cl,%ebx
shldl %cl,%ebx,%eax
testb $32,%cl
movb 16(%esp), %cl
movl 12(%esp), %edx
movl 8(%esp), %eax
shldl %cl, %edx, %ebx
shldl %cl, %eax, %edx
rorl %cl, %ebx
shldl %cl, %ebx, %eax
testb $32, %cl
cmovnz %eax, %ecx
cmovnz %edx, %eax
cmovnz %edx, %eax
cmovnz %ecx, %edx
pop %ebx
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathLRotU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
InternalMathLRotU64 PROC USES ebx
mov cl, [esp + 16]
mov edx, [esp + 12]
@ -31,7 +39,7 @@ InternalMathLRotU64 PROC USES ebx
shld edx, eax, cl
ror ebx, cl
shld eax, ebx, cl
test cl, 32
test cl, 32 ; Count >= 32?
cmovnz ecx, eax
cmovnz eax, edx
cmovnz edx, ecx

View File

@ -19,11 +19,16 @@
#
#------------------------------------------------------------------------------
.686:
#.MODEL flat,C
.code:
.global _InternalMathLShiftU64
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathLShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMathLShiftU64:
movb 12(%esp), %cl
xorl %eax, %eax
@ -31,6 +36,6 @@ _InternalMathLShiftU64:
testb $32, %cl
cmovz %edx, %eax
cmovz 0x8(%esp), %edx
shld %cl,%eax,%edx
shld %cl, %eax, %edx
shl %cl, %eax
ret

View File

@ -23,11 +23,19 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathLShiftU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
InternalMathLShiftU64 PROC
mov cl, [esp + 12]
xor eax, eax
mov edx, [esp + 4]
test cl, 32
test cl, 32 ; Count >= 32?
cmovz eax, edx
cmovz edx, [esp + 8]
shld edx, eax, cl

View File

@ -19,20 +19,23 @@
#
#------------------------------------------------------------------------------
.386:
.code:
.global _InternalLongJump
.globl _InternalLongJump
#------------------------------------------------------------------------------
# VOID
# EFIAPI
# InternalLongJump (
# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
# IN UINTN Value
# );
#------------------------------------------------------------------------------
_InternalLongJump:
popl %eax
popl %edx
popl %eax
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)
#InternalLongJump ENDP

View File

@ -23,10 +23,18 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; InternalLongJump (
; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
; IN UINTN Value
; );
;------------------------------------------------------------------------------
InternalLongJump PROC
pop eax
pop edx
pop eax
pop eax ; skip return address
pop edx ; edx <- JumpBuffer
pop eax ; eax <- Value
mov ebx, [edx]
mov esi, [edx + 4]
mov edi, [edx + 8]

View File

@ -19,20 +19,22 @@
#
#------------------------------------------------------------------------------
.global _InternalMathModU64x32
_InternalMathModU64x32:
movl 8(%esp),%eax
movl 12(%esp),%ecx
xorl %edx,%edx
#------------------------------------------------------------------------------
# UINT32
# EFIAPI
# InternalMathModU64x32 (
# IN UINT64 Dividend,
# IN UINT32 Divisor
# );
#------------------------------------------------------------------------------
_InternalMathModU64x32:
movl 8(%esp), %eax
movl 12(%esp), %ecx
xorl %edx, %edx
divl %ecx
movl 4(%esp),%eax
movl 4(%esp), %eax
divl %ecx
movl %edx,%eax
movl %edx, %eax
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT32
; EFIAPI
; InternalMathModU64x32 (
; IN UINT64 Dividend,
; IN UINT32 Divisor
; );
;------------------------------------------------------------------------------
InternalMathModU64x32 PROC
mov eax, [esp + 8]
mov ecx, [esp + 12]

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmMonitor
#------------------------------------------------------------------------------
# UINT64
@ -34,13 +32,9 @@
# IN UINTN Edx
# );
#------------------------------------------------------------------------------
.global _AsmMonitor
_AsmMonitor:
movl 4(%esp),%eax
movl 8(%esp),%ecx
movl 12(%esp),%edx
monitor %eax,%ecx,%edx
_AsmMonitor:
movl 4(%esp), %eax
movl 8(%esp), %ecx
movl 12(%esp), %edx
monitor %eax, %ecx, %edx
ret

View File

@ -22,11 +22,11 @@
;------------------------------------------------------------------------------
.686
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; UINTN
; EFIAPI
; AsmMonitor (
; IN UINTN Eax,
@ -34,12 +34,12 @@
; IN UINTN Edx
; );
;------------------------------------------------------------------------------
_AsmMonitor PROC
AsmMonitor PROC
mov eax, [esp + 4]
mov ecx, [esp + 8]
mov edx, [esp + 12]
DB 0fh, 1, 0c8h
DB 0fh, 1, 0c8h ; monitor
ret
_AsmMonitor ENDP
AsmMonitor ENDP
END

View File

@ -19,14 +19,23 @@
#
#------------------------------------------------------------------------------
.386:
.code:
.386:
.code:
.global _InternalMathMultU64x32
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathMultU64x32 (
# IN UINT64 Multiplicand,
# IN UINT32 Multiplier
# );
#------------------------------------------------------------------------------
_InternalMathMultU64x32:
movl 12(%esp),%ecx
movl %ecx,%eax
imull 8(%esp),%ecx
mull 0x4(%esp)
addl %ecx,%edx
movl 12(%esp), %ecx
movl %ecx, %eax
imull 8(%esp), %ecx
mull 0x4(%esp)
addl %ecx, %edx
ret

View File

@ -23,10 +23,18 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathMultU64x32 (
; IN UINT64 Multiplicand,
; IN UINT32 Multiplier
; );
;------------------------------------------------------------------------------
InternalMathMultU64x32 PROC
mov ecx, [esp + 12]
mov eax, ecx
imul ecx, [esp + 8]
imul ecx, [esp + 8] ; overflow not detectable
mul dword ptr [esp + 4]
add edx, ecx
ret

View File

@ -19,24 +19,26 @@
#
#------------------------------------------------------------------------------
.global _InternalMathMultU64x64
_InternalMathMultU64x64:
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathMultU64x64 (
# IN UINT64 Multiplicand,
# IN UINT64 Multiplier
# );
#------------------------------------------------------------------------------
_InternalMathMultU64x64:
push %ebx
movl 8(%esp),%ebx
movl 16(%esp),%edx
movl %ebx,%ecx
movl %edx,%eax
imull 20(%esp),%ebx
imull 12(%esp),%edx
addl %edx,%ebx
movl 8(%esp), %ebx
movl 16(%esp), %edx
movl %ebx, %ecx
movl %edx, %eax
imull 20(%esp), %ebx
imull 12(%esp), %edx
addl %edx, %ebx
mull %ecx
addl %ebx,%edx
addl %ebx, %edx
pop %ebx
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathMultU64x64 (
; IN UINT64 Multiplicand,
; IN UINT64 Multiplier
; );
;------------------------------------------------------------------------------
InternalMathMultU64x64 PROC USES ebx
mov ebx, [esp + 8]
mov edx, [esp + 16]

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmMwait
#------------------------------------------------------------------------------
# UINT64
@ -33,12 +31,8 @@
# IN UINTN Ecx
# );
#------------------------------------------------------------------------------
.global _AsmMwait
_AsmMwait:
movl 4(%esp),%eax
movl 8(%esp),%ecx
mwait %eax,%ecx
_AsmMwait:
movl 4(%esp), %eax
movl 8(%esp), %ecx
mwait %eax, %ecx
ret

View File

@ -22,22 +22,22 @@
;------------------------------------------------------------------------------
.686
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; UINTN
; EFIAPI
; AsmMwait (
; IN UINTN Eax,
; IN UINTN Ecx
; );
;------------------------------------------------------------------------------
_AsmMwait PROC
AsmMwait PROC
mov eax, [esp + 4]
mov ecx, [esp + 8]
DB 0fh, 1, 0c9h
DB 0fh, 1, 0c9h ; mwait
ret
_AsmMwait ENDP
AsmMwait ENDP
END

View File

@ -19,26 +19,28 @@
#
#------------------------------------------------------------------------------
.global _InternalMathRRotU64
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathRRotU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMathRRotU64:
push %ebx
movb 16(%esp),%cl
movl 8(%esp),%eax
movl 12(%esp),%edx
shrdl %cl,%eax,%ebx
shrdl %cl,%edx,%eax
roll %cl,%ebx
shrdl %cl,%ebx,%edx
testb $32,%cl
movb 16(%esp), %cl
movl 8(%esp), %eax
movl 12(%esp), %edx
shrdl %cl, %eax, %ebx
shrdl %cl, %edx, %eax
roll %cl, %ebx
shrdl %cl, %ebx, %edx
testb $32, %cl
cmovnz %eax, %ecx
cmovnz %edx, %eax
cmovnz %ecx, %edx
pop %ebx
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathRRotU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
InternalMathRRotU64 PROC USES ebx
mov cl, [esp + 16]
mov eax, [esp + 8]
@ -31,7 +39,7 @@ InternalMathRRotU64 PROC USES ebx
shrd eax, edx, cl
rol ebx, cl
shrd edx, ebx, cl
test cl, 32
test cl, 32 ; Count >= 32?
cmovnz ecx, eax
cmovnz eax, edx
cmovnz edx, ecx

View File

@ -19,17 +19,26 @@
#
#------------------------------------------------------------------------------
.686:
.code:
.686:
.code:
.global _InternalMathRShiftU64
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathRShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMathRShiftU64:
movb 12(%esp),%cl
xorl %edx,%edx
movl 8(%esp),%eax
testb $32,%cl
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
shrdl %cl, %edx, %eax
shr %cl, %edx
ret

View File

@ -23,6 +23,14 @@
.model flat,C
.code
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathRShiftU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
InternalMathRShiftU64 PROC
mov cl, [esp + 12]
xor edx, edx
@ -35,4 +43,4 @@ InternalMathRShiftU64 PROC
ret
InternalMathRShiftU64 ENDP
END
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadCr0
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr0
_AsmReadCr0:
_AsmReadCr0:
movl %cr0, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadCr0 PROC
AsmReadCr0 PROC
mov eax, cr0
ret
_AsmReadCr0 ENDP
AsmReadCr0 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadCr2
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr2
_AsmReadCr2:
_AsmReadCr2:
movl %cr2, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadCr2 PROC
AsmReadCr2 PROC
mov eax, cr2
ret
_AsmReadCr2 ENDP
AsmReadCr2 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadCr3
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr3
_AsmReadCr3:
_AsmReadCr3:
movl %cr3, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadCr3 PROC
AsmReadCr3 PROC
mov eax, cr3
ret
_AsmReadCr3 ENDP
AsmReadCr3 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadCr4
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCr4
_AsmReadCr4:
_AsmReadCr4:
movl %cr4, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadCr4 PROC
AsmReadCr4 PROC
mov eax, cr4
ret
_AsmReadCr4 ENDP
AsmReadCr4 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadCs
#------------------------------------------------------------------------------
# UINT16
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadCs
_AsmReadCs:
movw %cs,%ax
_AsmReadCs:
movl %cs, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadCs PROC
mov ax, cs
AsmReadCs PROC
mov eax, cs
ret
_AsmReadCs ENDP
AsmReadCs ENDP
END

View File

@ -21,8 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr0
#------------------------------------------------------------------------------
# UINTN
@ -31,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr0
_AsmReadDr0:
_AsmReadDr0:
movl %dr0, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr0 PROC
AsmReadDr0 PROC
mov eax, dr0
ret
_AsmReadDr0 ENDP
AsmReadDr0 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr1
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr1
_AsmReadDr1:
_AsmReadDr1:
movl %dr1, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr1 PROC
AsmReadDr1 PROC
mov eax, dr1
ret
_AsmReadDr1 ENDP
AsmReadDr1 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr2
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr2
_AsmReadDr2:
_AsmReadDr2:
movl %dr2, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr2 PROC
AsmReadDr2 PROC
mov eax, dr2
ret
_AsmReadDr2 ENDP
AsmReadDr2 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr3
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr3
_AsmReadDr3:
_AsmReadDr3:
movl %dr3, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr3 PROC
AsmReadDr3 PROC
mov eax, dr3
ret
_AsmReadDr3 ENDP
AsmReadDr3 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr4
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr4
_AsmReadDr4:
_AsmReadDr4:
movl %dr4, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr4 PROC
AsmReadDr4 PROC
DB 0fh, 21h, 0e0h
ret
_AsmReadDr4 ENDP
AsmReadDr4 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr5
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr5
_AsmReadDr5:
_AsmReadDr5:
movl %dr5, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr5 PROC
AsmReadDr5 PROC
DB 0fh, 21h, 0e8h
ret
_AsmReadDr5 ENDP
AsmReadDr5 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr6
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr6
_AsmReadDr6:
_AsmReadDr6:
movl %dr6, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr6 PROC
AsmReadDr6 PROC
mov eax, dr6
ret
_AsmReadDr6 ENDP
AsmReadDr6 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadDr7
#------------------------------------------------------------------------------
# UINTN
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDr7
_AsmReadDr7:
_AsmReadDr7:
movl %dr7, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.586p
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDr7 PROC
AsmReadDr7 PROC
mov eax, dr7
ret
_AsmReadDr7 ENDP
AsmReadDr7 ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadEflags
#------------------------------------------------------------------------------
# UINT16
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadDs
_AsmReadDs:
movw %ds,%ax
_AsmReadDs:
movl %ds, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadDs PROC
mov ax, ds
AsmReadDs PROC
mov eax, ds
ret
_AsmReadDs ENDP
AsmReadDs ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadEflags
#------------------------------------------------------------------------------
# UINTN
@ -32,11 +30,7 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadEflags
_AsmReadEflags:
_AsmReadEflags:
pushfl
popl %eax
pop %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,10 +32,10 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadEflags PROC
AsmReadEflags PROC
pushfd
pop eax
ret
_AsmReadEflags ENDP
AsmReadEflags ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadEs
#------------------------------------------------------------------------------
# UINT16
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadEs
_AsmReadEs:
movw %es,%ax
_AsmReadEs:
movl %es, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadEs PROC
mov ax, es
AsmReadEs PROC
mov eax, es
ret
_AsmReadEs ENDP
AsmReadEs ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadFs
#------------------------------------------------------------------------------
# UINT16
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadFs
_AsmReadFs:
movw %fs,%ax
_AsmReadFs:
movl %fs, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadFs PROC
mov ax, fs
AsmReadFs PROC
mov eax, fs
ret
_AsmReadFs ENDP
AsmReadFs ENDP
END

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _InternalX86ReadGdtr
#------------------------------------------------------------------------------
# VOID
@ -32,11 +30,7 @@
# OUT IA32_DESCRIPTOR *Gdtr
# );
#------------------------------------------------------------------------------
.global _InternalX86ReadGdtr
_InternalX86ReadGdtr:
movl 4(%esp),%eax
_InternalX86ReadGdtr:
movl 4(%esp), %eax
sgdt (%eax)
ret

View File

@ -21,9 +21,7 @@
#
#------------------------------------------------------------------------------
.global _AsmReadGs
#------------------------------------------------------------------------------
# UINT16
@ -32,10 +30,6 @@
# VOID
# );
#------------------------------------------------------------------------------
.global _AsmReadGs
_AsmReadGs:
movw %gs,%ax
_AsmReadGs:
movl %gs, %eax
ret

View File

@ -22,7 +22,7 @@
;------------------------------------------------------------------------------
.386
.model flat
.model flat,C
.code
;------------------------------------------------------------------------------
@ -32,9 +32,9 @@
; VOID
; );
;------------------------------------------------------------------------------
_AsmReadGs PROC
mov ax, gs
AsmReadGs PROC
mov eax, gs
ret
_AsmReadGs ENDP
AsmReadGs ENDP
END

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