|
2 | 2 | #ifndef __ASM_LINKAGE_H
|
3 | 3 | #define __ASM_LINKAGE_H
|
4 | 4 |
|
| 5 | +#include <asm/asm-const.h> |
5 | 6 | #include <linux/stringify.h>
|
6 | 7 |
|
7 | 8 | #define __ALIGN .align 4, 0x07
|
8 | 9 | #define __ALIGN_STR __stringify(__ALIGN)
|
9 | 10 |
|
10 |
| -#ifndef __ASSEMBLY__ |
11 |
| - |
12 | 11 | /*
|
13 | 12 | * Helper macro for exception table entries
|
14 | 13 | */
|
15 |
| -#define EX_TABLE(_fault, _target) \ |
16 |
| - ".section __ex_table,\"a\"\n" \ |
17 |
| - ".align 4\n" \ |
18 |
| - ".long (" #_fault ") - .\n" \ |
19 |
| - ".long (" #_target ") - .\n" \ |
20 |
| - ".previous\n" |
21 |
| - |
22 |
| -#else /* __ASSEMBLY__ */ |
23 | 14 |
|
24 |
| -#define EX_TABLE(_fault, _target) \ |
25 |
| - .section __ex_table,"a" ; \ |
26 |
| - .align 4 ; \ |
27 |
| - .long (_fault) - . ; \ |
28 |
| - .long (_target) - . ; \ |
29 |
| - .previous |
| 15 | +#define __EX_TABLE(_section, _fault, _target) \ |
| 16 | + stringify_in_c(.section _section,"a";) \ |
| 17 | + stringify_in_c(.align 4;) \ |
| 18 | + stringify_in_c(.long (_fault) - .;) \ |
| 19 | + stringify_in_c(.long (_target) - .;) \ |
| 20 | + stringify_in_c(.previous) |
30 | 21 |
|
31 |
| -#define EX_TABLE_DMA(_fault, _target) \ |
32 |
| - .section .dma.ex_table, "a" ; \ |
33 |
| - .align 4 ; \ |
34 |
| - .long (_fault) - . ; \ |
35 |
| - .long (_target) - . ; \ |
36 |
| - .previous |
| 22 | +#define EX_TABLE(_fault, _target) \ |
| 23 | + __EX_TABLE(__ex_table, _fault, _target) |
| 24 | +#define EX_TABLE_DMA(_fault, _target) \ |
| 25 | + __EX_TABLE(.dma.ex_table, _fault, _target) |
37 | 26 |
|
38 |
| -#endif /* __ASSEMBLY__ */ |
39 | 27 | #endif
|
0 commit comments