sync GCC assembly files with MASM assembly files

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@878 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2006-07-11 10:25:13 +00:00
parent 983ba75c92
commit bd0cd44be5
20 changed files with 82 additions and 90 deletions

View File

@@ -23,15 +23,13 @@
.global _ARShiftU64 .global _InternalMathARShiftU64
_ARShiftU64: _InternalMathARShiftU64:
movb 12(%esp),%cl movb 12(%esp),%cl
movl 8(%esp),%eax movl 8(%esp),%eax
cltd cltd
testb $32,%cl testb $32,%cl
# MISMATCH: " cmovz edx, eax"
cmovz %eax, %edx cmovz %eax, %edx
# MISMATCH: " cmovz eax, [esp + 4]"
cmovz 4(%esp), %eax cmovz 4(%esp), %eax
shrdl %cl,%edx,%eax shrdl %cl,%edx,%eax
sar %cl,%edx sar %cl,%edx

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmDisablePaging32 function # InternalX86DisablePaging32 function
# #
# Notes: # Notes:
# #
@@ -28,15 +28,15 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmDisablePaging32 ( # InternalX86DisablePaging32 (
# IN SWITCH_STACK_ENTRY_POINT EntryPoint, # IN SWITCH_STACK_ENTRY_POINT EntryPoint,
# IN VOID *Context1, OPTIONAL # IN VOID *Context1, OPTIONAL
# IN VOID *Context2, OPTIONAL # IN VOID *Context2, OPTIONAL
# IN VOID *NewStack # IN VOID *NewStack
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmDisablePaging32 .global _InternalX86DisablePaging32
_AsmDisablePaging32: _InternalX86DisablePaging32:
movl 4(%esp),%ebx movl 4(%esp),%ebx
movl 8(%esp),%ecx movl 8(%esp),%ecx
movl 12(%esp),%edx movl 12(%esp),%edx

View File

@@ -39,9 +39,8 @@ L1:
jmp _InternalMathDivRemU64x32 jmp _InternalMathDivRemU64x32
.global DivRemU64x64 .global _DivRemU64x64
DivRemU64x64: _DivRemU64x64:
# MISMATCH: "DivRemU64x64: USES ebx esi edi"
push %ebx push %ebx
push %esi push %esi
push %edi push %edi

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmEnablePaging32 function # InternalX86EnablePaging32 function
# #
# Notes: # Notes:
# #
@@ -28,15 +28,15 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmEnablePaging32 ( # InternalX86EnablePaging32 (
# IN SWITCH_STACK_ENTRY_POINT EntryPoint, # IN SWITCH_STACK_ENTRY_POINT EntryPoint,
# IN VOID *Context1, OPTIONAL # IN VOID *Context1, OPTIONAL
# IN VOID *Context2, OPTIONAL # IN VOID *Context2, OPTIONAL
# IN VOID *NewStack # IN VOID *NewStack
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmEnablePaging32 .global _InternalX86EnablePaging32
_AsmEnablePaging32: _InternalX86EnablePaging32:
movl 4(%esp),%ebx movl 4(%esp),%ebx
movl 8(%esp),%ecx movl 8(%esp),%ecx
movl 12(%esp),%edx movl 12(%esp),%edx

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmEnablePaging64 function # InternalX86EnablePaging64 function
# #
# Notes: # Notes:
# #
@@ -28,7 +28,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmEnablePaging64 ( # InternalX86EnablePaging64 (
# IN UINT16 CodeSelector, # IN UINT16 CodeSelector,
# IN UINT64 EntryPoint, # IN UINT64 EntryPoint,
# IN UINT64 Context1, OPTIONAL # IN UINT64 Context1, OPTIONAL
@@ -36,10 +36,10 @@
# IN UINT64 NewStack # IN UINT64 NewStack
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmEnablePaging64 .global _InternalX86EnablePaging64
_AsmEnablePaging64: _InternalX86EnablePaging64:
cli cli
movl $$LongStart, (%esp) movl $LongStart, (%esp)
movl %cr4, %eax movl %cr4, %eax
orb $0x20, %al orb $0x20, %al
movl %eax, %cr4 # enable PAE movl %eax, %cr4 # enable PAE

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmFxRestore function # InternalX86FxRestore function
# #
# Notes: # Notes:
# #
@@ -29,12 +29,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmFxRestore ( # InternalX86FxRestore (
# IN CONST IA32_FX_BUFFER *Buffer # IN CONST IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmFxRestore .global _InternalX86FxRestore
_AsmFxRestore: _InternalX86FxRestore:
movl 4(%esp),%eax movl 4(%esp),%eax
fxrstor (%eax) fxrstor (%eax)
ret ret

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmFxSave function # InternalX86FxSave function
# #
# Notes: # Notes:
# #
@@ -29,12 +29,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmFxSave ( # InternalX86FxSave (
# OUT IA32_FX_BUFFER *Buffer # OUT IA32_FX_BUFFER *Buffer
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmFxSave .global _InternalX86FxSave
_AsmFxSave: _InternalX86FxSave:
movl 4(%esp),%eax movl 4(%esp),%eax
fxsave (%eax) fxsave (%eax)
ret ret

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# InterlockedCompareExchange32 function # InternalSyncCompareExchange32 function
# #
# Notes: # Notes:
# #
@@ -25,35 +25,17 @@
#------------------------------------------------------------------------------
# VOID *
# EFIAPI
# InterlockedCompareExchangePointer (
# IN VOID **Value,
# IN VOID *CompareValue,
# IN VOID *ExchangeValue
# );
#------------------------------------------------------------------------------
.global _InterlockedCompareExchangePointer
_InterlockedCompareExchangePointer:
#
# InterlockedCompareExchangePointer() shares the same code as
# InterlockedCompareExchange32() on IA32 and thus no code inside this
# function
#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedCompareExchange32 ( # InternalSyncCompareExchange32 (
# IN UINT32 *Value, # IN UINT32 *Value,
# IN UINT32 CompareValue, # IN UINT32 CompareValue,
# IN UINT32 ExchangeValue # IN UINT32 ExchangeValue
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _InterlockedCompareExchange32 .global _InternalSyncCompareExchange32
_InterlockedCompareExchange32: _InternalSyncCompareExchange32:
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl 8(%esp),%eax movl 8(%esp),%eax
movl 12(%esp),%edx movl 12(%esp),%edx

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# InterlockedCompareExchange64 function # InternalSyncCompareExchange64 function
# #
# Notes: # Notes:
# #
@@ -28,13 +28,14 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT64 # UINT64
# EFIAPI # EFIAPI
# InterlockedCompareExchange64 ( # InternalSyncCompareExchange64 (
# IN UINT64 *Value, # IN UINT64 *Value,
# IN UINT64 CompareValue, # IN UINT64 CompareValue,
# IN UINT64 ExchangeValue # IN UINT64 ExchangeValue
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _InterlockedCompareExchange64 .global _InternalSyncCompareExchange64
_InternalSyncCompareExchange64:
push %esi push %esi
push %ebx push %ebx
movl 12(%esp),%esi movl 12(%esp),%esi

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# InterlockedDecrement function # InternalSyncDecrement function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedDecrement ( # InternalSyncDecrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _InterlockedDecrement .global _InternalSyncDecrement
_InterlockedDecrement: _InternalSyncDecrement:
movl 4(%esp),%eax movl 4(%esp),%eax
lock lock
decl (%eax) decl (%eax)

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# InterlockedIncrement function # InternalSyncIncrement function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# UINT32 # UINT32
# EFIAPI # EFIAPI
# InterlockedIncrement ( # InternalSyncIncrement (
# IN UINT32 *Value # IN UINT32 *Value
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _InterlockedIncrement .global _InternalSyncIncrement
_InterlockedIncrement: _InternalSyncIncrement:
movl 4(%esp),%eax movl 4(%esp),%eax
lock lock
incl (%eax) incl (%eax)

View File

@@ -23,7 +23,8 @@
.global _LRotU64 .global _InternalMathLRotU64
_InternalMathLRotU64:
push %ebx push %ebx
movb 16(%esp),%cl movb 16(%esp),%cl
movl 12(%esp),%edx movl 12(%esp),%edx

View File

@@ -23,15 +23,8 @@
.global _MultS64x64 .global _InternalMathMultU64x64
_MultS64x64: _InternalMathMultU64x64:
#
# MultS64x32 shares the same implementation with _MultU64x32, and thus no
# code inside this function.
#
.global _MultU64x64
push %ebx push %ebx
movl 8(%esp),%ebx movl 8(%esp),%ebx
movl 16(%esp),%edx movl 16(%esp),%edx

View File

@@ -23,7 +23,8 @@
.global _RRotU64 .global _InternalMathRRotU64
_InternalMathRRotU64:
push %ebx push %ebx
movb 16(%esp),%cl movb 16(%esp),%cl
movl 8(%esp),%eax movl 8(%esp),%eax

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmReadGdtr function # InternalX86ReadGdtr function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmReadGdtr ( # InternalX86ReadGdtr (
# OUT IA32_DESCRIPTOR *Gdtr # OUT IA32_DESCRIPTOR *Gdtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmReadGdtr .global _InternalX86ReadGdtr
_AsmReadGdtr: _InternalX86ReadGdtr:
movl 4(%esp),%eax movl 4(%esp),%eax
sgdt (%eax) sgdt (%eax)
ret ret

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmReadIdtr function # InternalX86ReadIdtr function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmReadIdtr ( # InternalX86ReadIdtr (
# OUT IA32_DESCRIPTOR *Idtr # OUT IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmReadIdtr .global _InternalX86ReadIdtr
_AsmReadIdtr: _InternalX86ReadIdtr:
movl 4(%esp),%eax movl 4(%esp),%eax
sidt (%eax) sidt (%eax)
ret ret

View File

@@ -19,9 +19,26 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _m16Start, _m16Size, _mThunk16Attr, _m16GdtBase, _m16Gdt, _m16GdtrBase, _mTransition
##########
# FIXME! #
##########
# The following data are INVALID!!
# They just follow GAS syntax.
_m16Start: .byte 0x00
_m16Size: .word 0x00
_mThunk16Attr: .word 0x00
_m16Gdt: .word 0x00
_m16GdtrBase: .word 0x00
_mTransition: .word 0x00
.global _InternalAsmThunk16
_InternalAsmThunk16:
########## ##########
# FIXME! # # FIXME! #
########## ##########
# This function won't work for now.
# it will directly enter dead loop.
jmp .

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmWriteGdtr function # InternalX86WriteGdtr function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteGdtr ( # InternalX86WriteGdtr (
# OUT IA32_DESCRIPTOR *Gdtr # OUT IA32_DESCRIPTOR *Gdtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmWriteGdtr .global _InternalX86WriteGdtr
_AsmWriteGdtr: _InternalX86WriteGdtr:
movl 4(%esp),%eax movl 4(%esp),%eax
lgdt (%eax) lgdt (%eax)
ret ret

View File

@@ -15,7 +15,7 @@
# #
# Abstract: # Abstract:
# #
# AsmWriteIdtr function # InternalX86WriteIdtr function
# #
# Notes: # Notes:
# #
@@ -28,12 +28,12 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# VOID # VOID
# EFIAPI # EFIAPI
# AsmWriteIdtr ( # InternalX86WriteIdtr (
# OUT IA32_DESCRIPTOR *Idtr # OUT IA32_DESCRIPTOR *Idtr
# ); # );
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.global _AsmWriteIdtr .global _InternalX86WriteIdtr
_AsmWriteIdtr: _InternalX86WriteIdtr:
movl 4(%esp),%eax movl 4(%esp),%eax
lidt (%eax) lidt (%eax)
ret ret

View File

@@ -52,7 +52,7 @@ L0:
mfence mfence
@SetDwords: @SetDwords:
testb $1, %dl testb $1, %dl
jz @F jz L1
movd %mm0, (%edi) movd %mm0, (%edi)
L1: L1:
pop %edi pop %edi