|
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 |
| - "\t.pushsection __bug_table,\"aw\"\n" \ |
32 |
| - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
33 |
| - "\t.short %c1, %c2\n" \ |
34 |
| - "\t.org 2b+%c3\n" \ |
| 32 | + "\t.pushsection __bug_table,\"a\"\n" \ |
| 33 | + "\t.align 4\n" \ |
| 34 | + "2:\t" __BUG_REL(1b) "\n" \ |
| 35 | + "\t" __BUG_REL(%c0) "\n" \ |
| 36 | + "\t.short %1, %2\n" \ |
| 37 | + "\t.blockz %3-2*4-2*2\n" \ |
35 | 38 | "\t.popsection" \
|
36 | 39 | : : "i" (__FILE__), "i" (__LINE__), \
|
37 |
| - "i" (0), "i" (sizeof(struct bug_entry)) ); \ |
| 40 | + "i" (0), "i" (sizeof(struct bug_entry)) ); \ |
38 | 41 | unreachable(); \
|
39 | 42 | } while(0)
|
40 | 43 |
|
|
51 | 54 | do { \
|
52 | 55 | asm volatile("\n" \
|
53 | 56 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
54 |
| - "\t.pushsection __bug_table,\"aw\"\n" \ |
55 |
| - "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
56 |
| - "\t.short %c1, %c2\n" \ |
57 |
| - "\t.org 2b+%c3\n" \ |
| 57 | + "\t.pushsection __bug_table,\"a\"\n" \ |
| 58 | + "\t.align 4\n" \ |
| 59 | + "2:\t" __BUG_REL(1b) "\n" \ |
| 60 | + "\t" __BUG_REL(%c0) "\n" \ |
| 61 | + "\t.short %1, %2\n" \ |
| 62 | + "\t.blockz %3-2*4-2*2\n" \ |
58 | 63 | "\t.popsection" \
|
59 | 64 | : : "i" (__FILE__), "i" (__LINE__), \
|
60 | 65 | "i" (BUGFLAG_WARNING|(flags)), \
|
|
65 | 70 | do { \
|
66 | 71 | asm volatile("\n" \
|
67 | 72 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \
|
68 |
| - "\t.pushsection __bug_table,\"aw\"\n" \ |
69 |
| - "2:\t" ASM_WORD_INSN "1b\n" \ |
70 |
| - "\t.short %c0\n" \ |
71 |
| - "\t.org 2b+%c1\n" \ |
| 73 | + "\t.pushsection __bug_table,\"a\"\n" \ |
| 74 | + "\t.align %2\n" \ |
| 75 | + "2:\t" __BUG_REL(1b) "\n" \ |
| 76 | + "\t.short %0\n" \ |
| 77 | + "\t.blockz %1-4-2\n" \ |
72 | 78 | "\t.popsection" \
|
73 | 79 | : : "i" (BUGFLAG_WARNING|(flags)), \
|
74 | 80 | "i" (sizeof(struct bug_entry)) ); \
|
|
0 commit comments