From ddfe2b83ca11c65c0268600085aa140279d27d92 Mon Sep 17 00:00:00 2001 From: pumnflqv2 Date: Sun, 26 Jun 2022 21:43:07 +0800 Subject: [PATCH] ADD file via upload --- include/asm/memory.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/asm/memory.h diff --git a/include/asm/memory.h b/include/asm/memory.h new file mode 100644 index 0000000..51b69e7 --- /dev/null +++ b/include/asm/memory.h @@ -0,0 +1,15 @@ +/* + * NOTE!!! memcpy(dest,src,n) assumes ds=es=normal data segment. This + * goes for all kernel functions (ds=es=kernel space, fs=local data, + * gs=null), as well as for all well-behaving user programs (ds=es= + * user data space). This is NOT a bug, as any user program that changes + * es deserves to die if it isn't careful. + */ +#define memcpy(dest,src,n) ({ \ +void * _res = dest; \ +__asm__ ("cld;rep;movsb" \ + ::"D" ((long)(_res)),"S" ((long)(src)),"c" ((long) (n)) \ + ); \ +_res; \ +}) +