Skip to content

Commit 6edd1db

Browse files
Christoph Hellwigarndb
authored andcommitted
asm-generic: optimize generic uaccess for 8-byte loads and stores
On 64-bit architectures we can also use the direct load/store trick for 8-byte values. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent bd79f94 commit 6edd1db

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎include/asm-generic/uaccess.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ raw_copy_from_user(void *to, const void __user * from, unsigned long n)
2424
case 4:
2525
*(u32 *)to = *(u32 __force *)from;
2626
return 0;
27+
#ifdef CONFIG_64BIT
28+
case 8:
29+
*(u64 *)to = *(u64 __force *)from;
30+
return 0;
31+
#endif
2732
}
2833
}
2934

@@ -45,6 +50,11 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
4550
case 4:
4651
*(u32 __force *)to = *(u32 *)from;
4752
return 0;
53+
#ifdef CONFIG_64BIT
54+
case 8:
55+
*(u64 __force *)to = *(u64 *)from;
56+
return 0;
57+
#endif
4858
default:
4959
break;
5060
}

0 commit comments

Comments
 (0)