summaryrefslogtreecommitdiff
path: root/src/arch/x86/lib/memcpy.c
blob: de210928a38c85e6edc476cd25a7e52e483dc202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <string.h>

void *memcpy(void *__restrict __dest,
	     __const void *__restrict __src, size_t __n)
{
	asm("cld\n"
	    "rep\n"
	    "movsb"
	    :	/* no input (?) */
	    :"S"(__src), "D"(__dest), "c"(__n)
	);
	return __dest;
}