:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / ntoskrnl / rtl / i386 / memset.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 <string.h>
13
14 #define NDEBUG
15 #include <internal/debug.h>
16
17 /* FUNCTIONS *****************************************************************/
18
19 void * memset(void *src, int val, size_t count)
20 {
21         __asm__( \
22                 "or     %%ecx,%%ecx\n\t"\
23                 "jz     .L1\n\t"        \
24                 "cld\t\n"               \
25                 "rep\t\n"               \
26                 "stosb\t\n"             \
27                 ".L1:\n\t"
28                 : 
29                 : "D" (src), "c" (count), "a" (val));
30         return src;
31 }