12
12
13
13
#include <asm/asm.h>
14
14
15
- #ifdef CONFIG_GENERIC_BUG
16
15
#define __INSN_LENGTH_MASK _UL(0x3)
17
16
#define __INSN_LENGTH_32 _UL(0x3)
18
17
#define __COMPRESSED_INSN_MASK _UL(0xffff)
19
18
20
19
#define __BUG_INSN_32 _UL(0x00100073) /* ebreak */
21
20
#define __BUG_INSN_16 _UL(0x9002) /* c.ebreak */
22
21
23
- #ifndef __ASSEMBLY__
24
22
typedef u32 bug_insn_t ;
25
23
26
24
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
@@ -43,6 +41,7 @@ typedef u32 bug_insn_t;
43
41
RISCV_SHORT " %2"
44
42
#endif
45
43
44
+ #ifdef CONFIG_GENERIC_BUG
46
45
#define __BUG_FLAGS (flags ) \
47
46
do { \
48
47
__asm__ __volatile__ ( \
@@ -58,14 +57,10 @@ do { \
58
57
"i" (flags), \
59
58
"i" (sizeof(struct bug_entry))); \
60
59
} while (0)
61
-
62
- #endif /* !__ASSEMBLY__ */
63
60
#else /* CONFIG_GENERIC_BUG */
64
- #ifndef __ASSEMBLY__
65
61
#define __BUG_FLAGS (flags ) do { \
66
62
__asm__ __volatile__ ("ebreak\n"); \
67
63
} while (0)
68
- #endif /* !__ASSEMBLY__ */
69
64
#endif /* CONFIG_GENERIC_BUG */
70
65
71
66
#define BUG () do { \
@@ -79,15 +74,10 @@ do { \
79
74
80
75
#include <asm-generic/bug.h>
81
76
82
- #ifndef __ASSEMBLY__
83
-
84
77
struct pt_regs ;
85
78
struct task_struct ;
86
79
87
- extern void die (struct pt_regs * regs , const char * str );
88
- extern void do_trap (struct pt_regs * regs , int signo , int code ,
89
- unsigned long addr );
90
-
91
- #endif /* !__ASSEMBLY__ */
80
+ void die (struct pt_regs * regs , const char * str );
81
+ void do_trap (struct pt_regs * regs , int signo , int code , unsigned long addr );
92
82
93
83
#endif /* _ASM_RISCV_BUG_H */
0 commit comments