aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-10-17 13:37:29 -0400
committerPaul Walmsley <paul.walmsley@sifive.com>2019-10-23 17:53:46 -0400
commita6d9e2672609653146cd9f4063f3d30619828787 (patch)
treecfa4e668bcac4da433e357d2895183ac25c31efe /arch/riscv
parent9fe57d8c575d7dc012bbfcf5698048304206a99d (diff)
riscv: cleanup <asm/bug.h>
Remove various not required ifdefs and externs. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/include/asm/bug.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index 07ceee8b1747..75604fec1b1b 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -12,7 +12,6 @@
12 12
13#include <asm/asm.h> 13#include <asm/asm.h>
14 14
15#ifdef CONFIG_GENERIC_BUG
16#define __INSN_LENGTH_MASK _UL(0x3) 15#define __INSN_LENGTH_MASK _UL(0x3)
17#define __INSN_LENGTH_32 _UL(0x3) 16#define __INSN_LENGTH_32 _UL(0x3)
18#define __COMPRESSED_INSN_MASK _UL(0xffff) 17#define __COMPRESSED_INSN_MASK _UL(0xffff)
@@ -20,7 +19,6 @@
20#define __BUG_INSN_32 _UL(0x00100073) /* ebreak */ 19#define __BUG_INSN_32 _UL(0x00100073) /* ebreak */
21#define __BUG_INSN_16 _UL(0x9002) /* c.ebreak */ 20#define __BUG_INSN_16 _UL(0x9002) /* c.ebreak */
22 21
23#ifndef __ASSEMBLY__
24typedef u32 bug_insn_t; 22typedef u32 bug_insn_t;
25 23
26#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS 24#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
@@ -43,6 +41,7 @@ typedef u32 bug_insn_t;
43 RISCV_SHORT " %2" 41 RISCV_SHORT " %2"
44#endif 42#endif
45 43
44#ifdef CONFIG_GENERIC_BUG
46#define __BUG_FLAGS(flags) \ 45#define __BUG_FLAGS(flags) \
47do { \ 46do { \
48 __asm__ __volatile__ ( \ 47 __asm__ __volatile__ ( \
@@ -58,14 +57,10 @@ do { \
58 "i" (flags), \ 57 "i" (flags), \
59 "i" (sizeof(struct bug_entry))); \ 58 "i" (sizeof(struct bug_entry))); \
60} while (0) 59} while (0)
61
62#endif /* !__ASSEMBLY__ */
63#else /* CONFIG_GENERIC_BUG */ 60#else /* CONFIG_GENERIC_BUG */
64#ifndef __ASSEMBLY__
65#define __BUG_FLAGS(flags) do { \ 61#define __BUG_FLAGS(flags) do { \
66 __asm__ __volatile__ ("ebreak\n"); \ 62 __asm__ __volatile__ ("ebreak\n"); \
67} while (0) 63} while (0)
68#endif /* !__ASSEMBLY__ */
69#endif /* CONFIG_GENERIC_BUG */ 64#endif /* CONFIG_GENERIC_BUG */
70 65
71#define BUG() do { \ 66#define BUG() do { \
@@ -79,15 +74,10 @@ do { \
79 74
80#include <asm-generic/bug.h> 75#include <asm-generic/bug.h>
81 76
82#ifndef __ASSEMBLY__
83
84struct pt_regs; 77struct pt_regs;
85struct task_struct; 78struct task_struct;
86 79
87extern void die(struct pt_regs *regs, const char *str); 80void die(struct pt_regs *regs, const char *str);
88extern void do_trap(struct pt_regs *regs, int signo, int code, 81void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr);
89 unsigned long addr);
90
91#endif /* !__ASSEMBLY__ */
92 82
93#endif /* _ASM_RISCV_BUG_H */ 83#endif /* _ASM_RISCV_BUG_H */