xref: /openbmc/linux/arch/x86/include/asm/uaccess_32.h (revision b9bd9f60)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
21965aae3SH. Peter Anvin #ifndef _ASM_X86_UACCESS_32_H
31965aae3SH. Peter Anvin #define _ASM_X86_UACCESS_32_H
4bb898558SAl Viro 
5bb898558SAl Viro /*
6bb898558SAl Viro  * User space memory access functions
7bb898558SAl Viro  */
8bb898558SAl Viro #include <linux/string.h>
9bb898558SAl Viro #include <asm/asm.h>
10bb898558SAl Viro #include <asm/page.h>
11bb898558SAl Viro 
12beba3a20SAl Viro unsigned long __must_check __copy_user_ll
13beba3a20SAl Viro 		(void *to, const void *from, unsigned long n);
14bb898558SAl Viro unsigned long __must_check __copy_from_user_ll_nocache_nozero
15bb898558SAl Viro 		(void *to, const void __user *from, unsigned long n);
16bb898558SAl Viro 
17bb898558SAl Viro static __always_inline unsigned long __must_check
raw_copy_to_user(void __user * to,const void * from,unsigned long n)18beba3a20SAl Viro raw_copy_to_user(void __user *to, const void *from, unsigned long n)
19bb898558SAl Viro {
20beba3a20SAl Viro 	return __copy_user_ll((__force void *)to, from, n);
21bb898558SAl Viro }
22bb898558SAl Viro 
23bb898558SAl Viro static __always_inline unsigned long
raw_copy_from_user(void * to,const void __user * from,unsigned long n)24beba3a20SAl Viro raw_copy_from_user(void *to, const void __user *from, unsigned long n)
25bb898558SAl Viro {
26beba3a20SAl Viro 	return __copy_user_ll(to, (__force const void *)from, n);
27bb898558SAl Viro }
28bb898558SAl Viro 
29bb898558SAl Viro static __always_inline unsigned long
__copy_from_user_inatomic_nocache(void * to,const void __user * from,unsigned long n)30bb898558SAl Viro __copy_from_user_inatomic_nocache(void *to, const void __user *from,
31bb898558SAl Viro 				  unsigned long n)
32bb898558SAl Viro {
33bb898558SAl Viro        return __copy_from_user_ll_nocache_nozero(to, from, n);
34bb898558SAl Viro }
35bb898558SAl Viro 
36*b9bd9f60SLinus Torvalds unsigned long __must_check clear_user(void __user *mem, unsigned long len);
37*b9bd9f60SLinus Torvalds unsigned long __must_check __clear_user(void __user *mem, unsigned long len);
38*b9bd9f60SLinus Torvalds 
391965aae3SH. Peter Anvin #endif /* _ASM_X86_UACCESS_32_H */
40