11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/errno.h>
24 static long probe_kernel_write_odd(
void *
dst,
const void *
src,
size_t size)
30 aligned = (
unsigned long) dst & ~3
UL;
31 offset = (
unsigned long) dst & 3;
32 count =
min_t(
unsigned long, 4 - offset, size);
33 mask = (0xf << (4 -
count)) & 0xf;
45 : "+
d" (rc), "+
a" (aligned)
46 : "
a" (mask), "
a" (src) : "
cc", "
memory", "0", "1");
55 copied = probe_kernel_write_odd(dst, src, size);
62 return copied < 0 ? -
EFAULT : 0;
65 static int __memcpy_real(
void *
dest,
void *src,
size_t count)
67 register unsigned long _dest
asm(
"2") = (
unsigned long)
dest;
68 register unsigned long _len1
asm(
"3") = (
unsigned long)
count;
69 register unsigned long _src
asm(
"4") = (
unsigned long)
src;
70 register unsigned long _len2
asm(
"5") = (
unsigned long)
count;
74 "0: mvcle %1,%2,0x0\n"
79 :
"+d" (rc),
"+d" (_dest),
"+d" (_src),
"+d" (_len1),
80 "+d" (_len2),
"=m" (*((
long *) dest))
81 :
"m" (*((
long *) src))
98 rc = __memcpy_real(dest, src, count);
113 prefix = store_prefix();
139 while (offs < count) {
165 while (offs < count) {
182 static int is_swapped(
unsigned long addr)
191 if (addr > lc +
sizeof(
struct _lowcore) - 1 || addr <
lc)
206 void *bounce = (
void *) addr;
211 if (is_swapped(addr)) {
227 if ((
void *) addr != buf)