access-helper.h 367 B

12345678910111213
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/uaccess.h>
  3. static inline int __get_inst(u32 *i, u32 *p, bool user)
  4. {
  5. return user ? get_user(*i, (u32 __user *)p) : get_kernel_nofault(*i, p);
  6. }
  7. static inline int __get_addr(unsigned long *a, unsigned long *p, bool user)
  8. {
  9. return user ? get_user(*a, (unsigned long __user *)p) : get_kernel_nofault(*a, p);
  10. }