in include/asm/uaccess.h [201:289]
asm volatile ("\n" \
"1: "MOVES"."#s1" (%2)+,%3\n" \
" move."#s1" %3,(%1)+\n" \
" .ifnc \""#s2"\",\"\"\n" \
"2: "MOVES"."#s2" (%2)+,%3\n" \
" move."#s2" %3,(%1)+\n" \
" .ifnc \""#s3"\",\"\"\n" \
"3: "MOVES"."#s3" (%2)+,%3\n" \
" move."#s3" %3,(%1)+\n" \
" .endif\n" \
" .endif\n" \
"4:\n" \
" .section __ex_table,\"a\"\n" \
" .align 4\n" \
" .long 1b,10f\n" \
" .ifnc \""#s2"\",\"\"\n" \
" .long 2b,20f\n" \
" .ifnc \""#s3"\",\"\"\n" \
" .long 3b,30f\n" \
" .endif\n" \
" .endif\n" \
" .previous\n" \
"\n" \
" .section .fixup,\"ax\"\n" \
" .even\n" \
"10: addq.l #"#n1",%0\n" \
" .ifnc \""#s2"\",\"\"\n" \
"20: addq.l #"#n2",%0\n" \
" .ifnc \""#s3"\",\"\"\n" \
"30: addq.l #"#n3",%0\n" \
" .endif\n" \
" .endif\n" \
" jra 4b\n" \
" .previous\n" \
: "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \
: : "memory")
#define ___constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, s1, s2, s3)\
____constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, s1, s2, s3)
#define __constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3) \
___constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, \
__suffix##n1, __suffix##n2, __suffix##n3)
static __always_inline unsigned long
__constant_copy_from_user(void *to, const void __user *from, unsigned long n)
{
unsigned long res = 0, tmp;
switch (n) {
case 1:
__constant_copy_from_user_asm(res, to, from, tmp, 1, 0, 0);
break;
case 2:
__constant_copy_from_user_asm(res, to, from, tmp, 2, 0, 0);
break;
case 3:
__constant_copy_from_user_asm(res, to, from, tmp, 2, 1, 0);
break;
case 4:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 0, 0);
break;
case 5:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 1, 0);
break;
case 6:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 2, 0);
break;
case 7:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 2, 1);
break;
case 8:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 0);
break;
case 9:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 1);
break;
case 10:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 2);
break;
case 12:
__constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 4);
break;
default:
/* we limit the inlined version to 3 moves */
return __generic_copy_from_user(to, from, n);
}
return res;
}