Backport of fix from asynchvfs branch for PM-LOG-VFS-PM deadlock that resulted in...
[minix3-old.git] / lib / i86 / string / memcpy.s
bloba4a9b536aa691f68753d6bd83d1b91a24266e18b
1 ! memcpy() Author: Kees J. Bot
2 ! 27 Jan 1994
3 .sect .text; .sect .rom; .sect .data; .sect .bss
5 ! void *memcpy(void *s1, const void *s2, size_t n)
6 ! Copy a chunk of memory.
7 ! This routine need not handle overlap, so it does not handle overlap.
8 ! One could simply call __memmove, the cost of the overlap check is
9 ! negligible, but you are dealing with a programmer who believes that
10 ! if anything can go wrong, it should go wrong.
12 .sect .text
13 .define _memcpy
14 _memcpy:
15 push bp
16 mov bp, sp
17 push si
18 push di
19 mov di, 4(bp) ! String s1
20 mov si, 6(bp) ! String s2
21 mov cx, 8(bp) ! Length
22 ! No overlap check here
23 jmp __memcpy ! Call the part of __memmove that copies up