2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file COPYING in the main directory of this archive
7 #include <linux/module.h>
8 #include <linux/uaccess.h>
10 unsigned long __generic_copy_from_user(void *to
, const void __user
*from
,
13 unsigned long tmp
, res
;
18 "1: "MOVES
".l (%1)+,%3\n"
24 "3: "MOVES
".w (%1)+,%3\n"
28 "5: "MOVES
".b (%1)+,%3\n"
31 " .section .fixup,\"ax\"\n"
43 " .section __ex_table,\"a\"\n"
49 : "=d" (res
), "+a" (from
), "+a" (to
), "=&d" (tmp
)
50 : "0" (n
/ 4), "d" (n
& 3));
54 EXPORT_SYMBOL(__generic_copy_from_user
);
56 unsigned long __generic_copy_to_user(void __user
*to
, const void *from
,
59 unsigned long tmp
, res
;
64 "1: move.l (%1)+,%3\n"
65 "2: "MOVES
".l %3,(%2)+\n"
71 "5: "MOVES
".w %3,(%2)+\n"
75 "7: "MOVES
".b %3,(%2)+\n"
77 " .section .fixup,\"ax\"\n"
84 " .section __ex_table,\"a\"\n"
93 : "=d" (res
), "+a" (from
), "+a" (to
), "=&d" (tmp
)
94 : "0" (n
/ 4), "d" (n
& 3));
98 EXPORT_SYMBOL(__generic_copy_to_user
);
104 unsigned long __clear_user(void __user
*to
, unsigned long n
)
111 "1: "MOVES
".l %2,(%1)+\n"
116 "4: "MOVES
".w %2,(%1)+\n"
119 "6: "MOVES
".b %2,(%1)\n"
121 " .section .fixup,\"ax\"\n"
128 " .section __ex_table,\"a\"\n"
137 : "=d" (res
), "+a" (to
)
138 : "d" (0), "0" (n
/ 4), "d" (n
& 3));
142 EXPORT_SYMBOL(__clear_user
);