:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / ntoskrnl / rtl / i386 / memcpy.c
1 /* $Id$
2  *
3  * COPYRIGHT:       See COPYING in the top level directory
4  * PROJECT:         ReactOS kernel
5  * FILE:            ntoskrnl/rtl/i386/memcpy.c
6  * PROGRAMMER:      Hartmut Birr
7  * UPDATE HISTORY:
8  */
9
10 /* INCLUDES *****************************************************************/
11
12 #include <ddk/ntddk.h>
13 #include <string.h>
14
15 #define NDEBUG
16 #include <internal/debug.h>
17
18 /* FUNCTIONS *****************************************************************/
19
20 #undef memcpy
21 void *memcpy (void *to, const void *from, size_t count)
22 {
23   __asm__( \
24         "or     %%ecx,%%ecx\n\t"\
25         "jz     .L1\n\t"        \
26         "cld\n\t"               \
27         "rep\n\t"               \
28         "movsb\n\t"             \
29         ".L1:\n\t"
30           :
31           : "D" (to), "S" (from), "c" (count));
32   return to;
33 }
34