2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00
criu/arch/x86/include/asm/memcpy_64.h
Alexander Kartashov 6f61488f21 x86: moved x86-specific files into the directory arch/x86.
* The following files goes into the directory arch/x86/include/asm unmodified:
  - include/atomic.h,
  - include/linkage.h,
  - include/memcpy_64.h,
  - include/types.h,
  - include/bitops.h,
  - pie/parasite-head-x86-64.S,
  - include/processor-flags.h,
  - include/syscall-x86-64.def.

* Changed include directives in the source files that include the headers
  listed above.

* Modified build scripts to reflect the source moves.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-09 17:02:47 +04:00

23 lines
524 B
C

#ifndef __CR_MEMCPY_64_H__
#define __CR_MEMCPY_64_H__
#include "compiler.h"
#include "asm/types.h"
static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n)
{
int d0, d1, d2;
asm volatile("rep ; movsl \n"
"movl %4,%%ecx \n"
"andl $3,%%ecx \n"
"jz 1f \n"
"rep ; movsb \n"
"1:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
: "0" (n / 4), "g" (n), "1" ((long)to), "2" ((long)from)
: "memory");
return to;
}
#endif /* __CR_MEMCPY_64_H__ */