From: qhuang8 Date: Tue, 11 Jul 2006 10:25:13 +0000 (+0000) Subject: sync GCC assembly files with MASM assembly files X-Git-Tag: edk2-stable201903~24976 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=bd0cd44be53b858f9a4aae532525f7b5ada962c9 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 --- diff --git a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S index d6af974d0f..426ce5bd26 100644 --- a/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S +++ b/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S @@ -23,15 +23,13 @@ -.global _ARShiftU64 -_ARShiftU64: +.global _InternalMathARShiftU64 +_InternalMathARShiftU64: movb 12(%esp),%cl movl 8(%esp),%eax cltd testb $32,%cl -# MISMATCH: " cmovz edx, eax" cmovz %eax, %edx -# MISMATCH: " cmovz eax, [esp + 4]" cmovz 4(%esp), %eax shrdl %cl,%edx,%eax sar %cl,%edx diff --git a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S index 21e8a82c0e..b4e488ffe6 100644 --- a/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S +++ b/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmDisablePaging32 function +# InternalX86DisablePaging32 function # # Notes: # @@ -28,15 +28,15 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmDisablePaging32 ( +# InternalX86DisablePaging32 ( # IN SWITCH_STACK_ENTRY_POINT EntryPoint, # IN VOID *Context1, OPTIONAL # IN VOID *Context2, OPTIONAL # IN VOID *NewStack # ); #------------------------------------------------------------------------------ -.global _AsmDisablePaging32 -_AsmDisablePaging32: +.global _InternalX86DisablePaging32 +_InternalX86DisablePaging32: movl 4(%esp),%ebx movl 8(%esp),%ecx movl 12(%esp),%edx diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S index f604f7c72e..df1e6ad495 100644 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S @@ -39,9 +39,8 @@ L1: jmp _InternalMathDivRemU64x32 -.global DivRemU64x64 -DivRemU64x64: -# MISMATCH: "DivRemU64x64: USES ebx esi edi" +.global _DivRemU64x64 +_DivRemU64x64: push %ebx push %esi push %edi diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S index 6f9befcb4a..7c97a502da 100644 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmEnablePaging32 function +# InternalX86EnablePaging32 function # # Notes: # @@ -28,15 +28,15 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmEnablePaging32 ( +# InternalX86EnablePaging32 ( # IN SWITCH_STACK_ENTRY_POINT EntryPoint, # IN VOID *Context1, OPTIONAL # IN VOID *Context2, OPTIONAL # IN VOID *NewStack # ); #------------------------------------------------------------------------------ -.global _AsmEnablePaging32 -_AsmEnablePaging32: +.global _InternalX86EnablePaging32 +_InternalX86EnablePaging32: movl 4(%esp),%ebx movl 8(%esp),%ecx movl 12(%esp),%edx diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S index b365ea762a..3758479980 100644 --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmEnablePaging64 function +# InternalX86EnablePaging64 function # # Notes: # @@ -28,7 +28,7 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmEnablePaging64 ( +# InternalX86EnablePaging64 ( # IN UINT16 CodeSelector, # IN UINT64 EntryPoint, # IN UINT64 Context1, OPTIONAL @@ -36,10 +36,10 @@ # IN UINT64 NewStack # ); #------------------------------------------------------------------------------ -.global _AsmEnablePaging64 -_AsmEnablePaging64: +.global _InternalX86EnablePaging64 +_InternalX86EnablePaging64: cli - movl $$LongStart, (%esp) + movl $LongStart, (%esp) movl %cr4, %eax orb $0x20, %al movl %eax, %cr4 # enable PAE diff --git a/MdePkg/Library/BaseLib/Ia32/FxRestore.S b/MdePkg/Library/BaseLib/Ia32/FxRestore.S index 631a3ef68a..cc840de464 100644 --- a/MdePkg/Library/BaseLib/Ia32/FxRestore.S +++ b/MdePkg/Library/BaseLib/Ia32/FxRestore.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmFxRestore function +# InternalX86FxRestore function # # Notes: # @@ -29,12 +29,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmFxRestore ( +# InternalX86FxRestore ( # IN CONST IA32_FX_BUFFER *Buffer # ); #------------------------------------------------------------------------------ -.global _AsmFxRestore -_AsmFxRestore: +.global _InternalX86FxRestore +_InternalX86FxRestore: movl 4(%esp),%eax fxrstor (%eax) ret diff --git a/MdePkg/Library/BaseLib/Ia32/FxSave.S b/MdePkg/Library/BaseLib/Ia32/FxSave.S index 44a55126a9..a558816e1d 100644 --- a/MdePkg/Library/BaseLib/Ia32/FxSave.S +++ b/MdePkg/Library/BaseLib/Ia32/FxSave.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmFxSave function +# InternalX86FxSave function # # Notes: # @@ -29,12 +29,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmFxSave ( +# InternalX86FxSave ( # OUT IA32_FX_BUFFER *Buffer # ); #------------------------------------------------------------------------------ -.global _AsmFxSave -_AsmFxSave: +.global _InternalX86FxSave +_InternalX86FxSave: movl 4(%esp),%eax fxsave (%eax) ret diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S index 43bb92526e..b53ca0fb93 100644 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange32.S @@ -15,7 +15,7 @@ # # Abstract: # -# InterlockedCompareExchange32 function +# InternalSyncCompareExchange32 function # # 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 # EFIAPI -# InterlockedCompareExchange32 ( +# InternalSyncCompareExchange32 ( # IN UINT32 *Value, # IN UINT32 CompareValue, # IN UINT32 ExchangeValue # ); #------------------------------------------------------------------------------ -.global _InterlockedCompareExchange32 -_InterlockedCompareExchange32: +.global _InternalSyncCompareExchange32 +_InternalSyncCompareExchange32: movl 4(%esp),%ecx movl 8(%esp),%eax movl 12(%esp),%edx diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S index abc51e905b..383503fbfe 100644 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S @@ -15,7 +15,7 @@ # # Abstract: # -# InterlockedCompareExchange64 function +# InternalSyncCompareExchange64 function # # Notes: # @@ -28,13 +28,14 @@ #------------------------------------------------------------------------------ # UINT64 # EFIAPI -# InterlockedCompareExchange64 ( +# InternalSyncCompareExchange64 ( # IN UINT64 *Value, # IN UINT64 CompareValue, # IN UINT64 ExchangeValue # ); #------------------------------------------------------------------------------ -.global _InterlockedCompareExchange64 +.global _InternalSyncCompareExchange64 +_InternalSyncCompareExchange64: push %esi push %ebx movl 12(%esp),%esi diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S index a7b653ac20..4256b60ee9 100644 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedDecrement.S @@ -15,7 +15,7 @@ # # Abstract: # -# InterlockedDecrement function +# InternalSyncDecrement function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # UINT32 # EFIAPI -# InterlockedDecrement ( +# InternalSyncDecrement ( # IN UINT32 *Value # ); #------------------------------------------------------------------------------ -.global _InterlockedDecrement -_InterlockedDecrement: +.global _InternalSyncDecrement +_InternalSyncDecrement: movl 4(%esp),%eax lock decl (%eax) diff --git a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S index 3f9beec211..02cb33b29b 100644 --- a/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S +++ b/MdePkg/Library/BaseLib/Ia32/InterlockedIncrement.S @@ -15,7 +15,7 @@ # # Abstract: # -# InterlockedIncrement function +# InternalSyncIncrement function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # UINT32 # EFIAPI -# InterlockedIncrement ( +# InternalSyncIncrement ( # IN UINT32 *Value # ); #------------------------------------------------------------------------------ -.global _InterlockedIncrement -_InterlockedIncrement: +.global _InternalSyncIncrement +_InternalSyncIncrement: movl 4(%esp),%eax lock incl (%eax) diff --git a/MdePkg/Library/BaseLib/Ia32/LRotU64.S b/MdePkg/Library/BaseLib/Ia32/LRotU64.S index 9c961ce378..54cdfadcc8 100644 --- a/MdePkg/Library/BaseLib/Ia32/LRotU64.S +++ b/MdePkg/Library/BaseLib/Ia32/LRotU64.S @@ -23,7 +23,8 @@ -.global _LRotU64 +.global _InternalMathLRotU64 +_InternalMathLRotU64: push %ebx movb 16(%esp),%cl movl 12(%esp),%edx diff --git a/MdePkg/Library/BaseLib/Ia32/MultU64x64.S b/MdePkg/Library/BaseLib/Ia32/MultU64x64.S index 8841fc44dc..641b0d652c 100644 --- a/MdePkg/Library/BaseLib/Ia32/MultU64x64.S +++ b/MdePkg/Library/BaseLib/Ia32/MultU64x64.S @@ -23,15 +23,8 @@ -.global _MultS64x64 -_MultS64x64: - # - # MultS64x32 shares the same implementation with _MultU64x32, and thus no - # code inside this function. - # - - -.global _MultU64x64 +.global _InternalMathMultU64x64 +_InternalMathMultU64x64: push %ebx movl 8(%esp),%ebx movl 16(%esp),%edx diff --git a/MdePkg/Library/BaseLib/Ia32/RRotU64.S b/MdePkg/Library/BaseLib/Ia32/RRotU64.S index 541e420a3c..2d4f42fe36 100644 --- a/MdePkg/Library/BaseLib/Ia32/RRotU64.S +++ b/MdePkg/Library/BaseLib/Ia32/RRotU64.S @@ -23,7 +23,8 @@ -.global _RRotU64 +.global _InternalMathRRotU64 +_InternalMathRRotU64: push %ebx movb 16(%esp),%cl movl 8(%esp),%eax diff --git a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S index f03a05696d..ebfe800e68 100644 --- a/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S +++ b/MdePkg/Library/BaseLib/Ia32/ReadGdtr.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmReadGdtr function +# InternalX86ReadGdtr function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmReadGdtr ( +# InternalX86ReadGdtr ( # OUT IA32_DESCRIPTOR *Gdtr # ); #------------------------------------------------------------------------------ -.global _AsmReadGdtr -_AsmReadGdtr: +.global _InternalX86ReadGdtr +_InternalX86ReadGdtr: movl 4(%esp),%eax sgdt (%eax) ret diff --git a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S index fa72d3ba7d..052c745534 100644 --- a/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S +++ b/MdePkg/Library/BaseLib/Ia32/ReadIdtr.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmReadIdtr function +# InternalX86ReadIdtr function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmReadIdtr ( +# InternalX86ReadIdtr ( # OUT IA32_DESCRIPTOR *Idtr # ); #------------------------------------------------------------------------------ -.global _AsmReadIdtr -_AsmReadIdtr: +.global _InternalX86ReadIdtr +_InternalX86ReadIdtr: movl 4(%esp),%eax sidt (%eax) ret diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.S b/MdePkg/Library/BaseLib/Ia32/Thunk16.S index fa7be9192d..b3ac412efe 100644 --- a/MdePkg/Library/BaseLib/Ia32/Thunk16.S +++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.S @@ -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! # ########## + # This function won't work for now. + # it will directly enter dead loop. + jmp . + \ No newline at end of file diff --git a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S index c3eb63d9e4..50600717bf 100644 --- a/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S +++ b/MdePkg/Library/BaseLib/Ia32/WriteGdtr.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmWriteGdtr function +# InternalX86WriteGdtr function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmWriteGdtr ( +# InternalX86WriteGdtr ( # OUT IA32_DESCRIPTOR *Gdtr # ); #------------------------------------------------------------------------------ -.global _AsmWriteGdtr -_AsmWriteGdtr: +.global _InternalX86WriteGdtr +_InternalX86WriteGdtr: movl 4(%esp),%eax lgdt (%eax) ret diff --git a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S index f71b696d97..3e6da5c1c5 100644 --- a/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S +++ b/MdePkg/Library/BaseLib/Ia32/WriteIdtr.S @@ -15,7 +15,7 @@ # # Abstract: # -# AsmWriteIdtr function +# InternalX86WriteIdtr function # # Notes: # @@ -28,12 +28,12 @@ #------------------------------------------------------------------------------ # VOID # EFIAPI -# AsmWriteIdtr ( +# InternalX86WriteIdtr ( # OUT IA32_DESCRIPTOR *Idtr # ); #------------------------------------------------------------------------------ -.global _AsmWriteIdtr -_AsmWriteIdtr: +.global _InternalX86WriteIdtr +_InternalX86WriteIdtr: movl 4(%esp),%eax lidt (%eax) ret diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S index a1a0eaf02e..27fd6174bd 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S @@ -52,7 +52,7 @@ L0: mfence @SetDwords: testb $1, %dl - jz @F + jz L1 movd %mm0, (%edi) L1: pop %edi