• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H
3 #define _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H
4 
5 DECLARE_STATIC_KEY_FALSE(uaccess_flush_key);
6 
7 /* Prototype for function defined in exceptions-64s.S */
8 void do_uaccess_flush(void);
9 
allow_user_access(void __user * to,const void __user * from,unsigned long size)10 static __always_inline void allow_user_access(void __user *to, const void __user *from,
11 					      unsigned long size)
12 {
13 }
14 
prevent_user_access(void __user * to,const void __user * from,unsigned long size)15 static inline void prevent_user_access(void __user *to, const void __user *from,
16 				       unsigned long size)
17 {
18 	if (static_branch_unlikely(&uaccess_flush_key))
19 		do_uaccess_flush();
20 }
21 
22 #endif /* _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H */
23