|
17 | 17 | #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff"
|
18 | 18 | #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */
|
19 | 19 |
|
20 |
| -#if defined(CONFIG_64BIT) |
21 |
| -#define ASM_WORD_INSN ".dword\t" |
| 20 | +#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS |
| 21 | +# define __BUG_REL(val) ".word " __stringify(val) " - ." |
22 | 22 | #else
|
23 |
| -#define ASM_WORD_INSN ".word\t" |
| 23 | +# define __BUG_REL(val) ".word " __stringify(val) |
24 | 24 | #endif
|
25 | 25 |
|
| 26 | + |
26 | 27 | #ifdef CONFIG_DEBUG_BUGVERBOSE
|
27 | 28 | #define BUG() \
|
28 | 29 | do { \
|
29 | 30 | asm volatile("\n" \
|
30 | 31 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
31 | 32 | "\t.pushsection __bug_table,\"a\"\n" \
|
32 |
| - "\t.align %4\n" \ |
33 |
| - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
| 33 | + "\t.align 4\n" \ |
| 34 | + "2:\t" __BUG_REL(1b) "\n" \ |
| 35 | + "\t" __BUG_REL(%c0) "\n" \ |
34 | 36 | "\t.short %1, %2\n" \
|
35 |
| - "\t.blockz %3-2*%4-2*2\n" \ |
| 37 | + "\t.blockz %3-2*4-2*2\n" \ |
36 | 38 | "\t.popsection" \
|
37 | 39 | : : "i" (__FILE__), "i" (__LINE__), \
|
38 |
| - "i" (0), "i" (sizeof(struct bug_entry)), \ |
39 |
| - "i" (sizeof(long)) ); \ |
| 40 | + "i" (0), "i" (sizeof(struct bug_entry)) ); \ |
40 | 41 | unreachable(); \
|
41 | 42 | } while(0)
|
42 | 43 |
|
|
54 | 55 | asm volatile("\n" \
|
55 | 56 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
56 | 57 | "\t.pushsection __bug_table,\"a\"\n" \
|
57 |
| - "\t.align %4\n" \ |
58 |
| - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
| 58 | + "\t.align 4\n" \ |
| 59 | + "2:\t" __BUG_REL(1b) "\n" \ |
| 60 | + "\t" __BUG_REL(%c0) "\n" \ |
59 | 61 | "\t.short %1, %2\n" \
|
60 |
| - "\t.blockz %3-2*%4-2*2\n" \ |
| 62 | + "\t.blockz %3-2*4-2*2\n" \ |
61 | 63 | "\t.popsection" \
|
62 | 64 | : : "i" (__FILE__), "i" (__LINE__), \
|
63 | 65 | "i" (BUGFLAG_WARNING|(flags)), \
|
64 |
| - "i" (sizeof(struct bug_entry)), \ |
65 |
| - "i" (sizeof(long)) ); \ |
| 66 | + "i" (sizeof(struct bug_entry)) ); \ |
66 | 67 | } while(0)
|
67 | 68 | #else
|
68 | 69 | #define __WARN_FLAGS(flags) \
|
|
71 | 72 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
72 | 73 | "\t.pushsection __bug_table,\"a\"\n" \
|
73 | 74 | "\t.align %2\n" \
|
74 |
| - "2:\t" ASM_WORD_INSN "1b\n" \ |
| 75 | + "2:\t" __BUG_REL(1b) "\n" \ |
75 | 76 | "\t.short %0\n" \
|
76 |
| - "\t.blockz %1-%2-2\n" \ |
| 77 | + "\t.blockz %1-4-2\n" \ |
77 | 78 | "\t.popsection" \
|
78 | 79 | : : "i" (BUGFLAG_WARNING|(flags)), \
|
79 |
| - "i" (sizeof(struct bug_entry)), \ |
80 |
| - "i" (sizeof(long)) ); \ |
| 80 | + "i" (sizeof(struct bug_entry)) ); \ |
81 | 81 | } while(0)
|
82 | 82 | #endif
|
83 | 83 |
|
|
0 commit comments