Skip to content

Commit 88aa893

Browse files
iii-ihcahca
authored andcommitted
s390/kernel: unify EX_TABLE* implementations
Replace three implementations with one using using __stringify_in_c macro conveniently "borrowed" from powerpc and microblaze. Signed-off-by: Ilya Leoshkevich <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 771cf19 commit 88aa893

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

arch/s390/include/asm/asm-const.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_S390_ASM_CONST_H
3+
#define _ASM_S390_ASM_CONST_H
4+
5+
#ifdef __ASSEMBLY__
6+
# define stringify_in_c(...) __VA_ARGS__
7+
#else
8+
/* This version of stringify will deal with commas... */
9+
# define __stringify_in_c(...) #__VA_ARGS__
10+
# define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
11+
#endif
12+
#endif /* _ASM_S390_ASM_CONST_H */

arch/s390/include/asm/linkage.h

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,26 @@
22
#ifndef __ASM_LINKAGE_H
33
#define __ASM_LINKAGE_H
44

5+
#include <asm/asm-const.h>
56
#include <linux/stringify.h>
67

78
#define __ALIGN .align 4, 0x07
89
#define __ALIGN_STR __stringify(__ALIGN)
910

10-
#ifndef __ASSEMBLY__
11-
1211
/*
1312
* Helper macro for exception table entries
1413
*/
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__ */
2314

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)
3021

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)
3726

38-
#endif /* __ASSEMBLY__ */
3927
#endif

0 commit comments

Comments
 (0)