diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-04-01 14:56:35 +0200 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-04-06 14:36:56 +0200 |
commit | 08ee3a009f49ac160cf8df0b65aa7dc299c811b2 (patch) | |
tree | f6640588770e3ac79c448959e95342fb49394b84 /arch/mips/include | |
parent | MIPS: kernel: Remove not needed set_fs calls (diff) | |
download | linux-08ee3a009f49ac160cf8df0b65aa7dc299c811b2.tar.xz linux-08ee3a009f49ac160cf8df0b65aa7dc299c811b2.zip |
MIPS: uaccess: Added __get/__put_kernel_nofault
Added __get/__put_kernel_nofault as preparation for removing
get/set_fs.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/uaccess.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index d273a3857809..c5cab0b8f902 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h @@ -355,6 +355,18 @@ do { \ (val) = __gu_tmp.t; \ } +#define HAVE_GET_KERNEL_NOFAULT + +#define __get_kernel_nofault(dst, src, type, err_label) \ +do { \ + int __gu_err; \ + \ + __get_kernel_common(*((type *)(dst)), sizeof(type), \ + (__force type *)(src)); \ + if (unlikely(__gu_err)) \ + goto err_label; \ +} while (0) + #ifndef CONFIG_EVA #define __put_kernel_common(ptr, size) __put_user_common(ptr, size) #else @@ -483,6 +495,18 @@ do { \ extern void __put_user_unknown(void); +#define __put_kernel_nofault(dst, src, type, err_label) \ +do { \ + type __pu_val; \ + int __pu_err = 0; \ + \ + __pu_val = *(__force type *)(src); \ + __put_kernel_common(((type *)(dst)), sizeof(type)); \ + if (unlikely(__pu_err)) \ + goto err_label; \ +} while (0) + + /* * We're generating jump to subroutines which will be outside the range of * jump instructions |