diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2022-05-31 13:04:11 +0300 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-06-03 15:09:28 +0300 |
commit | 0603839b18f4fb3bffa82515efcf5b02084505ef (patch) | |
tree | 592ec99a3a7b1cd8d2ed029b285974b1dc7fecf0 /arch/loongarch/include/asm/entry-common.h | |
parent | 628c3bb40e9a8cefc0a6fde28b7b66bfe46d1dc2 (diff) | |
download | linux-0603839b18f4fb3bffa82515efcf5b02084505ef.tar.xz |
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/include/asm/entry-common.h')
-rw-r--r-- | arch/loongarch/include/asm/entry-common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/entry-common.h b/arch/loongarch/include/asm/entry-common.h new file mode 100644 index 000000000000..0fe2a098ded9 --- /dev/null +++ b/arch/loongarch/include/asm/entry-common.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef ARCH_LOONGARCH_ENTRY_COMMON_H +#define ARCH_LOONGARCH_ENTRY_COMMON_H + +#include <linux/sched.h> +#include <linux/processor.h> + +static inline bool on_thread_stack(void) +{ + return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1)); +} + +#endif |