Author: ion Date: Tue Sep 26 09:29:46 2006 New Revision: 24276
URL: http://svn.reactos.org/svn/reactos?rev=24276&view=rev Log: - In some far, far away galaxy, a long, long time ago, Greatlord will learn to fix 1-line bugs and/or talk to the developers responsible instead of reverting their code...until then....
Removed: trunk/reactos/lib/rtl/RtlMoveMemory.c Modified: trunk/reactos/lib/rtl/i386/rtlmem.s trunk/reactos/lib/rtl/rtl.rbuild
Removed: trunk/reactos/lib/rtl/RtlMoveMemory.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/RtlMoveMemory.c?rev... ============================================================================== --- trunk/reactos/lib/rtl/RtlMoveMemory.c (original) +++ trunk/reactos/lib/rtl/RtlMoveMemory.c (removed) @@ -1,23 +1,0 @@ -#include <rtl.h> - -#define NDEBUG -#include <debug.h> - -#undef RtlMoveMemory -/* - * @implemented - */ -VOID -NTAPI -RtlMoveMemory ( - PVOID Destination, - CONST VOID * Source, - ULONG Length -) -{ - memmove ( - Destination, - Source, - Length - ); -}
Modified: trunk/reactos/lib/rtl/i386/rtlmem.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlmem.s?rev=2... ============================================================================== --- trunk/reactos/lib/rtl/i386/rtlmem.s (original) +++ trunk/reactos/lib/rtl/i386/rtlmem.s Tue Sep 26 09:29:46 2006 @@ -214,6 +214,73 @@ ret 8 .endfunc
+.func RtlMoveMemory@12 +_RtlMoveMemory@12: + + /* Save volatiles */ + push esi + push edi + + /* Get pointers and size */ + mov esi, [esp+16] + mov edi, [esp+12] + mov ecx, [esp+20] + cld + + /* Check if the destination is higher (or equal) */ + cmp esi, edi + jbe Overlap + + /* Set ULONG size and UCHAR remainder */ +DoMove: + mov edx, ecx + and edx, 3 + shr ecx, 2 + + /* Do the move */ + rep movsd + or ecx, edx + jnz ByteMove + + /* Return */ + pop edi + pop esi + ret 12 + +ByteMove: + /* Move what's left */ + rep movsb + +DoneMove: + /* Restore volatiles */ + pop edi + pop esi + ret 12 + +Overlap: + /* Don't copy if they're equal */ + jz DoneMove + + /* Compare pointer distance with given length and check for overlap */ + mov eax, edi + sub eax, esi + cmp ecx, eax + jbe DoMove + + /* Set direction flag for backward move */ + std + + /* Copy byte-by-byte the non-overlapping distance */ + add esi, ecx + add edi, ecx + dec esi + dec edi + + /* Do the move, reset flag and return */ + rep movsb + cld + jmp DoneMove +.endfunc
.func @RtlPrefetchMemoryNonTemporal@8, @RtlPrefetchMemoryNonTemporal@8 @RtlPrefetchMemoryNonTemporal@8:
Modified: trunk/reactos/lib/rtl/rtl.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=2427... ============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild (original) +++ trunk/reactos/lib/rtl/rtl.rbuild Tue Sep 26 09:29:46 2006 @@ -39,7 +39,6 @@ <file>sqrt_asm.s</file> <file>tan_asm.s</file> </directory> - <file>RtlMoveMemory.c</file> </if>
<ifnot property="ARCH" value="i386">