|
14 | 14 | .section __bug_table,"aw" |
15 | 15 | 5001: .4byte \addr - . |
16 | 16 | .4byte 5002f - . |
| 17 | +#ifdef CONFIG_KUNIT_SUPPRESS_BACKTRACE |
| 18 | + .4byte 0 |
| 19 | +#endif |
17 | 20 | .short \line, \flags |
18 | 21 | .org 5001b+BUG_ENTRY_SIZE |
19 | 22 | .previous |
|
32 | 35 | #endif /* verbose */ |
33 | 36 |
|
34 | 37 | #else /* !__ASSEMBLY__ */ |
35 | | -/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and |
36 | | - sizeof(struct bug_entry), respectively */ |
| 38 | +/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3,%4 to be FILE, __func__, LINE, flags |
| 39 | + and sizeof(struct bug_entry), respectively */ |
37 | 40 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
| 41 | + |
| 42 | +#ifdef CONFIG_KUNIT_SUPPRESS_BACKTRACE |
| 43 | +# define HAVE_BUG_FUNCTION |
| 44 | +# define __BUG_FUNC_PTR " .4byte %1 - .\n" |
| 45 | +#else |
| 46 | +# define __BUG_FUNC_PTR |
| 47 | +#endif /* CONFIG_KUNIT_SUPPRESS_BACKTRACE */ |
| 48 | + |
38 | 49 | #define _EMIT_BUG_ENTRY \ |
39 | 50 | ".section __bug_table,\"aw\"\n" \ |
40 | 51 | "2: .4byte 1b - .\n" \ |
41 | 52 | " .4byte %0 - .\n" \ |
42 | | - " .short %1, %2\n" \ |
43 | | - ".org 2b+%3\n" \ |
| 53 | + __BUG_FUNC_PTR \ |
| 54 | + " .short %2, %3\n" \ |
| 55 | + ".org 2b+%4\n" \ |
44 | 56 | ".previous\n" |
45 | 57 | #else |
46 | 58 | #define _EMIT_BUG_ENTRY \ |
47 | 59 | ".section __bug_table,\"aw\"\n" \ |
48 | 60 | "2: .4byte 1b - .\n" \ |
49 | | - " .short %2\n" \ |
50 | | - ".org 2b+%3\n" \ |
| 61 | + " .short %3\n" \ |
| 62 | + ".org 2b+%4\n" \ |
51 | 63 | ".previous\n" |
52 | 64 | #endif |
53 | 65 |
|
| 66 | +#ifdef HAVE_BUG_FUNCTION |
| 67 | +# define __BUG_FUNC __func__ |
| 68 | +#else |
| 69 | +# define __BUG_FUNC NULL |
| 70 | +#endif |
| 71 | + |
54 | 72 | #define BUG_ENTRY(insn, flags, ...) \ |
55 | 73 | __asm__ __volatile__( \ |
56 | 74 | "1: " insn "\n" \ |
57 | 75 | _EMIT_BUG_ENTRY \ |
58 | | - : : "i" (__FILE__), "i" (__LINE__), \ |
| 76 | + : : "i" (__FILE__), "i" (__BUG_FUNC), \ |
| 77 | + "i" (__LINE__), \ |
59 | 78 | "i" (flags), \ |
60 | 79 | "i" (sizeof(struct bug_entry)), \ |
61 | 80 | ##__VA_ARGS__) |
|
80 | 99 | if (x) \ |
81 | 100 | BUG(); \ |
82 | 101 | } else { \ |
83 | | - BUG_ENTRY(PPC_TLNEI " %4, 0", 0, "r" ((__force long)(x))); \ |
| 102 | + BUG_ENTRY(PPC_TLNEI " %5, 0", 0, "r" ((__force long)(x))); \ |
84 | 103 | } \ |
85 | 104 | } while (0) |
86 | 105 |
|
|
90 | 109 | if (__ret_warn_on) \ |
91 | 110 | __WARN(); \ |
92 | 111 | } else { \ |
93 | | - BUG_ENTRY(PPC_TLNEI " %4, 0", \ |
| 112 | + BUG_ENTRY(PPC_TLNEI " %5, 0", \ |
94 | 113 | BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), \ |
95 | 114 | "r" (__ret_warn_on)); \ |
96 | 115 | } \ |
|
0 commit comments