Go to the documentation of this file.
18 #include <linux/types.h>
24 #define ALIGN_DEST_TO8_UP(d,s,n) \
28 *(char *) d = *(char *) s; \
31 #define ALIGN_DEST_TO8_DN(d,s,n) \
36 *(char *) d = *(char *) s; \
43 #define DO_REST_UP(d,s,n) \
46 *(char *) d = *(char *) s; \
49 #define DO_REST_DN(d,s,n) \
53 *(char *) d = *(char *) s; \
60 #define DO_REST_ALIGNED_UP(d,s,n) DO_REST_UP(d,s,n)
61 #define DO_REST_ALIGNED_DN(d,s,n) DO_REST_DN(d,s,n)
70 static inline void __memcpy_unaligned_up (
unsigned long d,
unsigned long s,
76 unsigned long low_word, high_word;
77 __asm__(
"ldq_u %0,%1":
"=r" (low_word):
"m" (*(
unsigned long *) s));
80 __asm__(
"ldq_u %0,%1":
"=r" (high_word):
"m" (*(
unsigned long *)(s+8)));
84 :
"r" (low_word),
"r" (s));
87 :
"r" (high_word),
"r" (s));
89 *(
unsigned long *) d = low_word | tmp;
98 static inline void __memcpy_unaligned_dn (
unsigned long d,
unsigned long s,
105 * (
char *) --d = * (
char *) --
s;
116 static inline void __memcpy_aligned_up (
unsigned long d,
unsigned long s,
123 __asm__(
"ldq %0,%1":
"=r" (tmp):
"m" (*(
unsigned long *) s));
126 *(
unsigned long *) d = tmp;
132 static inline void __memcpy_aligned_dn (
unsigned long d,
unsigned long s,
142 __asm__(
"ldq %0,%1":
"=r" (tmp):
"m" (*(
unsigned long *) s));
145 *(
unsigned long *) d = tmp;
153 if (!(((
unsigned long) dest ^ (
unsigned long) src) & 7)) {
154 __memcpy_aligned_up ((
unsigned long) dest, (
unsigned long) src,
158 __memcpy_unaligned_up ((
unsigned long) dest, (
unsigned long) src, n);
163 asm(
"__memcpy = memcpy; .globl __memcpy");