[ros-diffs] [tkreuzer] 49399: [RTL] Make asm files ML compatible

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon Nov 1 11:41:05 UTC 2010


Author: tkreuzer
Date: Mon Nov  1 11:41:01 2010
New Revision: 49399

URL: http://svn.reactos.org/svn/reactos?rev=49399&view=rev
Log:
[RTL]
Make asm files ML compatible

Modified:
    branches/cmake-bringup/lib/rtl/i386/debug_asm.S
    branches/cmake-bringup/lib/rtl/i386/except_asm.s
    branches/cmake-bringup/lib/rtl/i386/interlck.S
    branches/cmake-bringup/lib/rtl/i386/res_asm.s
    branches/cmake-bringup/lib/rtl/i386/rtlmem.s

Modified: branches/cmake-bringup/lib/rtl/i386/debug_asm.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/i386/debug_asm.S?rev=49399&r1=49398&r2=49399&view=diff
==============================================================================
--- branches/cmake-bringup/lib/rtl/i386/debug_asm.S [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/i386/debug_asm.S [iso-8859-1] Mon Nov  1 11:41:01 2010
@@ -6,43 +6,39 @@
  * PROGRAMER:         Alex Ionescu (alex at relsoft.net)
  */
 
-.intel_syntax noprefix
+#include <reactos/asm.h>
 
 /* GLOBALS ****************************************************************/
 
-.globl _DbgBreakPoint at 0
-.globl _DbgBreakPointWithStatus at 4
-.globl _DbgUserBreakPoint at 0
-.globl _DebugService at 20
-.globl _DebugService2 at 12
-.globl _DbgBreakPointNoBugCheck at 0
-.globl _RtlpBreakWithStatusInstruction at 0
+PUBLIC _DbgBreakPoint at 0
+PUBLIC _DbgBreakPointWithStatus at 4
+PUBLIC _DbgUserBreakPoint at 0
+PUBLIC _DebugService at 20
+PUBLIC _DebugService2 at 12
+PUBLIC _DbgBreakPointNoBugCheck at 0
+PUBLIC _RtlpBreakWithStatusInstruction at 0
 
 /* FUNCTIONS ***************************************************************/
 
-.func DbgBreakPointNoBugCheck at 0
+.code
+
 _DbgBreakPointNoBugCheck at 0:
     int 3
     ret
-.endfunc
 
-.func DbgBreakPoint at 0
 _DbgBreakPoint at 0:
 _DbgUserBreakPoint at 0:
     int 3
     ret
-.endfunc
 
-.func DbgBreakPointWithStatus at 4
 _DbgBreakPointWithStatus at 4:
     mov eax, [esp+4]
 
 _RtlpBreakWithStatusInstruction at 0:
     int 3
     ret 4
-.endfunc
 
-.func DebugService2 at 12
+
 _DebugService2 at 12:
 
     /* Setup the stack */
@@ -53,15 +49,14 @@
     mov eax, [ebp+16]
     mov ecx, [ebp+8]
     mov edx, [ebp+12]
-    int 0x2D
+    int HEX(2D)
     int 3
 
     /* Restore stack */
     pop ebp
     ret 12
-.endfunc
 
-.func DebugService at 20
+
 _DebugService at 20:
 
     /* Setup the stack */
@@ -78,7 +73,7 @@
     mov edx, [ebp+16]
     mov ebx, [ebp+20]
     mov edi, [ebp+24]
-    int 0x2D
+    int HEX(2D)
     int 3
  
     /* Restore registers */
@@ -88,4 +83,5 @@
     /* Return */
     pop ebp
     ret 20
-.endfunc
+
+END

Modified: branches/cmake-bringup/lib/rtl/i386/except_asm.s
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/i386/except_asm.s?rev=49399&r1=49398&r2=49399&view=diff
==============================================================================
--- branches/cmake-bringup/lib/rtl/i386/except_asm.s [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/i386/except_asm.s [iso-8859-1] Mon Nov  1 11:41:01 2010
@@ -9,8 +9,13 @@
 
 /* INCLUDES ******************************************************************/
 
+#include <reactos/asm.h>
 #include <ndk/asm.h>
-.intel_syntax noprefix
+
+EXTERN _RtlpCheckForActiveDebugger at 0:PROC
+EXTERN _RtlDispatchException at 8:PROC
+EXTERN _ZwContinue at 8:PROC
+EXTERN _ZwRaiseException at 12:PROC
 
 #define ExceptionContinueSearch     1
 #define ExceptionNestedException    2
@@ -18,17 +23,17 @@
 
 /* FUNCTIONS *****************************************************************/
 
-.func RtlpGetExceptionList at 0
-.globl _RtlpGetExceptionList at 0
+.code
+
+PUBLIC _RtlpGetExceptionList at 0
 _RtlpGetExceptionList at 0:
 
     /* Return the exception list */
     mov eax, fs:[TEB_EXCEPTION_LIST]
     ret
-.endfunc
-
-.func RtlpSetExceptionList at 4
-.globl _RtlpSetExceptionList at 4
+
+
+PUBLIC _RtlpSetExceptionList at 4
 _RtlpSetExceptionList at 4:
 
     /* Get the new list */
@@ -40,10 +45,9 @@
 
     /* Return */
     ret 4
-.endfunc
-
-.func RtlCaptureContext at 4
-.globl _RtlCaptureContext at 4
+
+
+PUBLIC _RtlCaptureContext at 4
 _RtlCaptureContext at 4:
 
     /* Preserve EBX and put the context in it */
@@ -61,10 +65,9 @@
 
     /* Capture the other regs */
     jmp CaptureRest
-.endfunc
-
-.func RtlpCaptureContext at 4
-.globl _RtlpCaptureContext at 4
+
+
+PUBLIC _RtlpCaptureContext at 4
 _RtlpCaptureContext at 4:
 
     /* Preserve EBX and put the context in it */
@@ -107,10 +110,9 @@
     /* Return to the caller */
     pop ebx
     ret 4
-.endfunc
-
-.func RtlpExecuteHandlerForException at 20
-.globl _RtlpExecuteHandlerForException at 20
+
+
+PUBLIC _RtlpExecuteHandlerForException at 20
 _RtlpExecuteHandlerForException at 20:
 
     /* Copy the routine in EDX */
@@ -118,16 +120,14 @@
 
     /* Jump to common routine */
     jmp _RtlpExecuteHandler at 20
-.endfunc
-
-.func RtlpExecuteHandlerForUnwind at 20
-.globl _RtlpExecuteHandlerForUnwind at 20
+
+
+PUBLIC _RtlpExecuteHandlerForUnwind at 20
 _RtlpExecuteHandlerForUnwind at 20:
     /* Copy the routine in EDX */
     mov edx, offset _RtlpUnwindProtector
-.endfunc
-
-.func RtlpExecuteHandler at 20
+
+
 _RtlpExecuteHandler at 20:
 
     /* Save non-volatile */
@@ -142,22 +142,21 @@
     xor edi, edi
 
     /* Call the 2nd-stage executer */
-    push [esp+0x20]
-    push [esp+0x20]
-    push [esp+0x20]
-    push [esp+0x20]
-    push [esp+0x20]
+    push [esp+32]
+    push [esp+32]
+    push [esp+32]
+    push [esp+32]
+    push [esp+32]
     call _RtlpExecuteHandler2 at 20
 
     /* Restore non-volatile */
     pop edi
     pop esi
     pop ebx
-    ret 0x14
-.endfunc
-
-.func RtlpExecuteHandler2 at 20
-.globl _RtlpExecuteHandler2 at 20
+    ret 20
+
+
+PUBLIC _RtlpExecuteHandler2 at 20
 _RtlpExecuteHandler2 at 20:
 
     /* Set up stack frame */
@@ -165,7 +164,7 @@
     mov ebp, esp
 
     /* Save the Frame */
-    push [ebp+0xC]
+    push [ebp+12]
 
     /* Push handler address */
     push edx
@@ -177,11 +176,11 @@
     mov [fs:TEB_EXCEPTION_LIST], esp
 
     /* Call the handler */
-    push [ebp+0x14]
-    push [ebp+0x10]
-    push [ebp+0xC]
+    push [ebp+20]
+    push [ebp+16]
+    push [ebp+12]
     push [ebp+8]
-    mov ecx, [ebp+0x18]
+    mov ecx, [ebp+24]
     call ecx
 
     /* Unlink us */
@@ -193,10 +192,9 @@
     /* Undo stack frame and return */
     mov esp, ebp
     pop ebp
-    ret 0x14
-.endfunc
-
-.func RtlpExceptionProtector
+    ret 20
+
+
 _RtlpExceptionProtector:
 
     /* Assume we'll continue */
@@ -222,9 +220,8 @@
 
 return:
     ret 16
-.endfunc
-
-.func RtlpUnwindProtector
+
+
 _RtlpUnwindProtector:
 
     /* Assume we'll continue */
@@ -250,10 +247,9 @@
 
 .return:
     ret 16
-.endfunc
-
-.func RtlRaiseException at 4
-.globl _RtlRaiseException at 4
+
+
+PUBLIC _RtlRaiseException at 4
 _RtlRaiseException at 4:
 
     /* Set up stack frame */
@@ -325,10 +321,9 @@
     /* If we returned, raise a status */
     push eax
     call _RtlRaiseStatus at 4
-.endfunc
-
-.func RtlRaiseStatus at 4
-.globl _RtlRaiseStatus at 4
+
+
+PUBLIC _RtlRaiseStatus at 4
 _RtlRaiseStatus at 4:
 
     /* Set up stack frame */
@@ -398,4 +393,5 @@
     /* If we returned, raise a status */
     push eax
     call _RtlRaiseStatus at 4
-.endfunc
+
+END

Modified: branches/cmake-bringup/lib/rtl/i386/interlck.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/i386/interlck.S?rev=49399&r1=49398&r2=49399&view=diff
==============================================================================
--- branches/cmake-bringup/lib/rtl/i386/interlck.S [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/i386/interlck.S [iso-8859-1] Mon Nov  1 11:41:01 2010
@@ -6,20 +6,20 @@
  * PROGRAMMERS:     Timo Kreuzer
  */
 
-.intel_syntax noprefix
+#include <reactos/asm.h>
 
 /* FUNCTIONS ****************************************************************/
-
+.code
 
 /* PSLIST_ENTRY
  * NTAPI
  * RtlInterlockedPopEntrySList(
  *     IN PSLIST_HEADER ListHead);
  */
-.global _ExpInterlockedPopEntrySListResume at 0
-.global _ExpInterlockedPopEntrySListEnd at 0
-.global _ExpInterlockedPopEntrySListFault at 0
-.global _RtlInterlockedPopEntrySList at 4
+PUBLIC _ExpInterlockedPopEntrySListResume at 0
+PUBLIC _ExpInterlockedPopEntrySListEnd at 0
+PUBLIC _ExpInterlockedPopEntrySListFault at 0
+PUBLIC _RtlInterlockedPopEntrySList at 4
 _RtlInterlockedPopEntrySList at 4:
 
     /* Save registers */
@@ -35,10 +35,9 @@
     /* Load ListHead->Depth and ListHead->Sequence into edx */
     mov edx, [ebp + 4]
 
-1:
     /* Check if ListHead->Next is NULL */
     or eax, eax
-    jz 2f
+    jz _ExpInterlockedPopEntrySList2
 
     /* Copy Depth and Sequence number and adjust Depth */
     lea ecx, [edx - 1]
@@ -54,7 +53,7 @@
     jnz _ExpInterlockedPopEntrySListResume at 0
 
     /* Restore registers and return */
-2:
+_ExpInterlockedPopEntrySList2:
     pop ebp
     pop ebx
     ret 4
@@ -66,7 +65,7 @@
  *     IN PSLIST_HEADER ListHead,
  *     IN PSLIST_ENTRY ListEntry);
  */
-.global _RtlInterlockedPushEntrySList at 8
+PUBLIC _RtlInterlockedPushEntrySList at 8
 _RtlInterlockedPushEntrySList at 8:
 
     /* Save registers */
@@ -85,18 +84,18 @@
     /* Load ListHead->Depth and ListHead->Sequence into edx */
     mov edx, [ebp + 4]
 
-1:
+_RtlpInterlockedPushEntrySListResume:
     /* Set ListEntry->Next to ListHead->Next */
     mov [ebx], eax
 
     /* Copy ListHead->Depth and ListHead->Sequence and adjust them */
-    lea ecx, [edx + 0x10001]
+    lea ecx, [edx + HEX(10001)]
 
     /* If [ebp] equals edx:eax, exchange it with ecx:ebx */
     LOCK cmpxchg8b qword ptr [ebp]
  
     /* If not equal, retry with edx:eax, being the content of [ebp] now */
-    jnz 1b
+    jnz _RtlpInterlockedPushEntrySListResume
 
     /* Restore registers and return */
     pop ebp
@@ -109,7 +108,7 @@
  * RtlInterlockedFlushSList(
  *     IN PSINGLE_LIST_ENTRY ListHead);
  */
-.global _RtlInterlockedFlushSList at 4
+PUBLIC _RtlInterlockedFlushSList at 4
 _RtlInterlockedFlushSList at 4:
 
     /* Save registers */
@@ -128,10 +127,10 @@
     /* Load ListHead->Depth and ListHead->Sequence into edx */
     mov edx, [ebp + 4]
 
-1:
+_RtlpInterlockedFlushSListResume:
     /* Check if ListHead->Next is NULL */
     or eax, eax
-    jz 2f
+    jz _RtlpInterlockedFlushSListEnd
 
     /* Copy Depth and Sequence number to ecx */
     mov ecx, edx
@@ -143,10 +142,12 @@
     LOCK cmpxchg8b qword ptr [ebp]
  
     /* If not equal, retry with edx:eax, being the content of [ebp] now */
-    jnz 1b
+    jnz _RtlpInterlockedFlushSListResume
 
     /* Restore registers and return */
-2:
+_RtlpInterlockedFlushSListEnd:
     pop ebp
     pop ebx
     ret 4
+    
+END

Modified: branches/cmake-bringup/lib/rtl/i386/res_asm.s
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/i386/res_asm.s?rev=49399&r1=49398&r2=49399&view=diff
==============================================================================
--- branches/cmake-bringup/lib/rtl/i386/res_asm.s [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/i386/res_asm.s [iso-8859-1] Mon Nov  1 11:41:01 2010
@@ -1,11 +1,15 @@
+
+#include <reactos/asm.h>
 #include <ndk/asm.h>
-.intel_syntax noprefix
+
+EXTERN _LdrpAccessResource at 16:PROC
 
 /*
  * On x86, Shrinker, an executable compressor, depends on the
  * "call access_resource" instruction being there.
  */
-.globl _LdrAccessResource at 16
+.code
+PUBLIC _LdrAccessResource at 16
 _LdrAccessResource at 16:
     push ebp
     mov ebp, esp
@@ -18,3 +22,5 @@
     call _LdrpAccessResource at 16
     leave
     ret 16
+
+END

Modified: branches/cmake-bringup/lib/rtl/i386/rtlmem.s
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/i386/rtlmem.s?rev=49399&r1=49398&r2=49399&view=diff
==============================================================================
--- branches/cmake-bringup/lib/rtl/i386/rtlmem.s [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/i386/rtlmem.s [iso-8859-1] Mon Nov  1 11:41:01 2010
@@ -6,21 +6,21 @@
  * PROGRAMER:         Alex Ionescu (alex.ionescu at reactos.org)
  */
 
-.intel_syntax noprefix
+#include <reactos/asm.h>
 
 /* GLOBALS *******************************************************************/
 
-.globl _RtlCompareMemory at 12
-.globl _RtlCompareMemoryUlong at 12
-.globl _RtlFillMemory at 12
-.globl _RtlFillMemoryUlong at 12
-.globl _RtlMoveMemory at 12
-.globl _RtlZeroMemory at 8
-.globl @RtlPrefetchMemoryNonTemporal at 8
+PUBLIC _RtlCompareMemory at 12
+PUBLIC _RtlCompareMemoryUlong at 12
+PUBLIC _RtlFillMemory at 12
+PUBLIC _RtlFillMemoryUlong at 12
+PUBLIC _RtlMoveMemory at 12
+PUBLIC _RtlZeroMemory at 8
+PUBLIC @RtlPrefetchMemoryNonTemporal at 8
 
 /* FUNCTIONS *****************************************************************/
-
-.func RtlCompareMemory at 12
+.code
+
 _RtlCompareMemory at 12:
 
     /* Save volatiles */
@@ -74,9 +74,8 @@
     pop edi
     pop esi
     ret 12
-.endfunc
-
-.func RtlCompareMemoryUlong at 12
+
+
 _RtlCompareMemoryUlong at 12:
 
     /* Get pointers and size in ULONGs */
@@ -97,9 +96,8 @@
     mov eax, edi
     pop edi
     ret 12
-.endfunc
-
-.func RtlFillMemory at 12
+
+
 _RtlFillMemory at 12:
 
     /* Get pointers and size  */
@@ -134,9 +132,8 @@
     rep stosb
     pop edi
     ret 12
-.endfunc
-
-.func RtlFillMemoryUlong at 12
+
+
 _RtlFillMemoryUlong at 12:
 
     /* Get pointer, size and pattern */
@@ -150,9 +147,8 @@
     rep stosd
     pop edi
     ret 12
-.endfunc
-
-.func RtlFillMemoryUlonglong at 16
+
+
 _RtlFillMemoryUlonglong at 16:
 
     /* Save volatiles */
@@ -179,9 +175,8 @@
     pop esi
     pop edi
     ret 16
-.endfunc
-
-.func RtlZeroMemory at 8
+
+
 _RtlZeroMemory at 8:
 
     /* Get pointers and size  */
@@ -212,9 +207,8 @@
     rep stosb
     pop edi
     ret 8
-.endfunc
-
-.func RtlMoveMemory at 12
+
+
 _RtlMoveMemory at 12:
 
     /* Save volatiles */
@@ -280,9 +274,8 @@
     rep movsb
     cld
     jmp DoneMove
-.endfunc
-
-.func @RtlPrefetchMemoryNonTemporal at 8, @RtlPrefetchMemoryNonTemporal at 8
+
+
 @RtlPrefetchMemoryNonTemporal at 8:
 
     /*
@@ -306,8 +299,10 @@
     /* Keep looping for the next line, or return if done */
     ja FetchLine
     ret
-.endfunc
+
 
 /* FIXME: HACK */
 _Ke386CacheAlignment:
-    .long   0x40
+    .long   64
+
+END




More information about the Ros-diffs mailing list