diff options
author | 2022-05-31 18:04:11 +0800 | |
---|---|---|
committer | 2022-06-03 20:09:28 +0800 | |
commit | 0603839b18f4fb3bffa82515efcf5b02084505ef (patch) | |
tree | 592ec99a3a7b1cd8d2ed029b285974b1dc7fecf0 /arch/loongarch/kernel/access-helper.h | |
parent | LoongArch: Add boot and setup routines (diff) | |
download | linux-0603839b18f4fb3bffa82515efcf5b02084505ef.tar.gz linux-0603839b18f4fb3bffa82515efcf5b02084505ef.tar.bz2 linux-0603839b18f4fb3bffa82515efcf5b02084505ef.zip |
LoongArch: Add exception/interrupt handling
Add the exception and interrupt handling machanism for basic LoongArch
support.
Reviewed-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/access-helper.h')
-rw-r--r-- | arch/loongarch/kernel/access-helper.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/access-helper.h b/arch/loongarch/kernel/access-helper.h new file mode 100644 index 000000000000..4a35ca81bd08 --- /dev/null +++ b/arch/loongarch/kernel/access-helper.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <linux/uaccess.h> + +static inline int __get_inst(u32 *i, u32 *p, bool user) +{ + return user ? get_user(*i, (u32 __user *)p) : get_kernel_nofault(*i, p); +} + +static inline int __get_addr(unsigned long *a, unsigned long *p, bool user) +{ + return user ? get_user(*a, (unsigned long __user *)p) : get_kernel_nofault(*a, p); +} |