use the new priority boosting syscall to help out with consoled and telnetd
[newos.git] / lib / libc / arch / i386 / memcpy.S
blob0bd67b39d0f6f87217d90153ff84c817e8e94f3e
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #include <libc/arch/string.h>
7 .globl memcpy
9 .align 4
10 memcpy:
11         pushl   %esi
12         pushl   %edi
13         movl    12(%esp),%edi   /* dest */
14         movl    %edi,%eax       /* save dest ptr as return address */
15         movl    16(%esp),%esi   /* source */
16         movl    20(%esp),%ecx   /* count */
17         
18         /* move by words */
19         cld
20         shrl    $2,%ecx
21         rep
22         movsl
24         /* move any remaining data by bytes */
25         movl    20(%esp),%ecx
26         andl    $3,%ecx
27         rep
28         movsb
29         
30         popl    %edi
31         popl    %esi
32         ret