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... ============================================================================== --- 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@relsoft.net) */
-.intel_syntax noprefix +#include <reactos/asm.h>
/* GLOBALS ****************************************************************/
-.globl _DbgBreakPoint@0 -.globl _DbgBreakPointWithStatus@4 -.globl _DbgUserBreakPoint@0 -.globl _DebugService@20 -.globl _DebugService2@12 -.globl _DbgBreakPointNoBugCheck@0 -.globl _RtlpBreakWithStatusInstruction@0 +PUBLIC _DbgBreakPoint@0 +PUBLIC _DbgBreakPointWithStatus@4 +PUBLIC _DbgUserBreakPoint@0 +PUBLIC _DebugService@20 +PUBLIC _DebugService2@12 +PUBLIC _DbgBreakPointNoBugCheck@0 +PUBLIC _RtlpBreakWithStatusInstruction@0
/* FUNCTIONS ***************************************************************/
-.func DbgBreakPointNoBugCheck@0 +.code + _DbgBreakPointNoBugCheck@0: int 3 ret -.endfunc
-.func DbgBreakPoint@0 _DbgBreakPoint@0: _DbgUserBreakPoint@0: int 3 ret -.endfunc
-.func DbgBreakPointWithStatus@4 _DbgBreakPointWithStatus@4: mov eax, [esp+4]
_RtlpBreakWithStatusInstruction@0: int 3 ret 4 -.endfunc
-.func DebugService2@12 + _DebugService2@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@20 + _DebugService@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/excep... ============================================================================== --- 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@0:PROC +EXTERN _RtlDispatchException@8:PROC +EXTERN _ZwContinue@8:PROC +EXTERN _ZwRaiseException@12:PROC
#define ExceptionContinueSearch 1 #define ExceptionNestedException 2 @@ -18,17 +23,17 @@
/* FUNCTIONS *****************************************************************/
-.func RtlpGetExceptionList@0 -.globl _RtlpGetExceptionList@0 +.code + +PUBLIC _RtlpGetExceptionList@0 _RtlpGetExceptionList@0:
/* Return the exception list */ mov eax, fs:[TEB_EXCEPTION_LIST] ret -.endfunc - -.func RtlpSetExceptionList@4 -.globl _RtlpSetExceptionList@4 + + +PUBLIC _RtlpSetExceptionList@4 _RtlpSetExceptionList@4:
/* Get the new list */ @@ -40,10 +45,9 @@
/* Return */ ret 4 -.endfunc - -.func RtlCaptureContext@4 -.globl _RtlCaptureContext@4 + + +PUBLIC _RtlCaptureContext@4 _RtlCaptureContext@4:
/* Preserve EBX and put the context in it */ @@ -61,10 +65,9 @@
/* Capture the other regs */ jmp CaptureRest -.endfunc - -.func RtlpCaptureContext@4 -.globl _RtlpCaptureContext@4 + + +PUBLIC _RtlpCaptureContext@4 _RtlpCaptureContext@4:
/* Preserve EBX and put the context in it */ @@ -107,10 +110,9 @@ /* Return to the caller */ pop ebx ret 4 -.endfunc - -.func RtlpExecuteHandlerForException@20 -.globl _RtlpExecuteHandlerForException@20 + + +PUBLIC _RtlpExecuteHandlerForException@20 _RtlpExecuteHandlerForException@20:
/* Copy the routine in EDX */ @@ -118,16 +120,14 @@
/* Jump to common routine */ jmp _RtlpExecuteHandler@20 -.endfunc - -.func RtlpExecuteHandlerForUnwind@20 -.globl _RtlpExecuteHandlerForUnwind@20 + + +PUBLIC _RtlpExecuteHandlerForUnwind@20 _RtlpExecuteHandlerForUnwind@20: /* Copy the routine in EDX */ mov edx, offset _RtlpUnwindProtector -.endfunc - -.func RtlpExecuteHandler@20 + + _RtlpExecuteHandler@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@20
/* Restore non-volatile */ pop edi pop esi pop ebx - ret 0x14 -.endfunc - -.func RtlpExecuteHandler2@20 -.globl _RtlpExecuteHandler2@20 + ret 20 + + +PUBLIC _RtlpExecuteHandler2@20 _RtlpExecuteHandler2@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@4 -.globl _RtlRaiseException@4 + + +PUBLIC _RtlRaiseException@4 _RtlRaiseException@4:
/* Set up stack frame */ @@ -325,10 +321,9 @@ /* If we returned, raise a status */ push eax call _RtlRaiseStatus@4 -.endfunc - -.func RtlRaiseStatus@4 -.globl _RtlRaiseStatus@4 + + +PUBLIC _RtlRaiseStatus@4 _RtlRaiseStatus@4:
/* Set up stack frame */ @@ -398,4 +393,5 @@ /* If we returned, raise a status */ push eax call _RtlRaiseStatus@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/inter... ============================================================================== --- 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@0 -.global _ExpInterlockedPopEntrySListEnd@0 -.global _ExpInterlockedPopEntrySListFault@0 -.global _RtlInterlockedPopEntrySList@4 +PUBLIC _ExpInterlockedPopEntrySListResume@0 +PUBLIC _ExpInterlockedPopEntrySListEnd@0 +PUBLIC _ExpInterlockedPopEntrySListFault@0 +PUBLIC _RtlInterlockedPopEntrySList@4 _RtlInterlockedPopEntrySList@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@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@8 +PUBLIC _RtlInterlockedPushEntrySList@8 _RtlInterlockedPushEntrySList@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@4 +PUBLIC _RtlInterlockedFlushSList@4 _RtlInterlockedFlushSList@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_a... ============================================================================== --- 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@16:PROC
/* * On x86, Shrinker, an executable compressor, depends on the * "call access_resource" instruction being there. */ -.globl _LdrAccessResource@16 +.code +PUBLIC _LdrAccessResource@16 _LdrAccessResource@16: push ebp mov ebp, esp @@ -18,3 +22,5 @@ call _LdrpAccessResource@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/rtlme... ============================================================================== --- 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@reactos.org) */
-.intel_syntax noprefix +#include <reactos/asm.h>
/* GLOBALS *******************************************************************/
-.globl _RtlCompareMemory@12 -.globl _RtlCompareMemoryUlong@12 -.globl _RtlFillMemory@12 -.globl _RtlFillMemoryUlong@12 -.globl _RtlMoveMemory@12 -.globl _RtlZeroMemory@8 -.globl @RtlPrefetchMemoryNonTemporal@8 +PUBLIC _RtlCompareMemory@12 +PUBLIC _RtlCompareMemoryUlong@12 +PUBLIC _RtlFillMemory@12 +PUBLIC _RtlFillMemoryUlong@12 +PUBLIC _RtlMoveMemory@12 +PUBLIC _RtlZeroMemory@8 +PUBLIC @RtlPrefetchMemoryNonTemporal@8
/* FUNCTIONS *****************************************************************/ - -.func RtlCompareMemory@12 +.code + _RtlCompareMemory@12:
/* Save volatiles */ @@ -74,9 +74,8 @@ pop edi pop esi ret 12 -.endfunc - -.func RtlCompareMemoryUlong@12 + + _RtlCompareMemoryUlong@12:
/* Get pointers and size in ULONGs */ @@ -97,9 +96,8 @@ mov eax, edi pop edi ret 12 -.endfunc - -.func RtlFillMemory@12 + + _RtlFillMemory@12:
/* Get pointers and size */ @@ -134,9 +132,8 @@ rep stosb pop edi ret 12 -.endfunc - -.func RtlFillMemoryUlong@12 + + _RtlFillMemoryUlong@12:
/* Get pointer, size and pattern */ @@ -150,9 +147,8 @@ rep stosd pop edi ret 12 -.endfunc - -.func RtlFillMemoryUlonglong@16 + + _RtlFillMemoryUlonglong@16:
/* Save volatiles */ @@ -179,9 +175,8 @@ pop esi pop edi ret 16 -.endfunc - -.func RtlZeroMemory@8 + + _RtlZeroMemory@8:
/* Get pointers and size */ @@ -212,9 +207,8 @@ rep stosb pop edi ret 8 -.endfunc - -.func RtlMoveMemory@12 + + _RtlMoveMemory@12:
/* Save volatiles */ @@ -280,9 +274,8 @@ rep movsb cld jmp DoneMove -.endfunc - -.func @RtlPrefetchMemoryNonTemporal@8, @RtlPrefetchMemoryNonTemporal@8 + + @RtlPrefetchMemoryNonTemporal@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