Skip to content

Commit 24da024

Browse files
heiherchenhuacai
authored andcommitted
LoongArch: extable: Also recognize ABI names of registers
When the kernel is compiled with LLVM, the register names being handled during exception fixup building are ABI names instead of bare $rNN style. Add mapping for the ABI names for LLVM compatibility. Signed-off-by: WANG Rui <[email protected]> Signed-off-by: WANG Xuerui <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 414cefc commit 24da024

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

arch/loongarch/include/asm/gpr-num.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,43 @@
99
.equ .L__gpr_num_$r\num, \num
1010
.endr
1111

12+
/* ABI names of registers */
13+
.equ .L__gpr_num_$ra, 1
14+
.equ .L__gpr_num_$tp, 2
15+
.equ .L__gpr_num_$sp, 3
16+
.irp num,0,1,2,3,4,5,6,7
17+
.equ .L__gpr_num_$a\num, 4 + \num
18+
.endr
19+
.irp num,0,1,2,3,4,5,6,7,8
20+
.equ .L__gpr_num_$t\num, 12 + \num
21+
.endr
22+
.equ .L__gpr_num_$s9, 22
23+
.equ .L__gpr_num_$fp, 22
24+
.irp num,0,1,2,3,4,5,6,7,8
25+
.equ .L__gpr_num_$s\num, 23 + \num
26+
.endr
27+
1228
#else /* __ASSEMBLY__ */
1329

1430
#define __DEFINE_ASM_GPR_NUMS \
1531
" .equ .L__gpr_num_zero, 0\n" \
1632
" .irp num,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\n" \
1733
" .equ .L__gpr_num_$r\\num, \\num\n" \
1834
" .endr\n" \
35+
" .equ .L__gpr_num_$ra, 1\n" \
36+
" .equ .L__gpr_num_$tp, 2\n" \
37+
" .equ .L__gpr_num_$sp, 3\n" \
38+
" .irp num,0,1,2,3,4,5,6,7\n" \
39+
" .equ .L__gpr_num_$a\\num, 4 + \\num\n" \
40+
" .endr\n" \
41+
" .irp num,0,1,2,3,4,5,6,7,8\n" \
42+
" .equ .L__gpr_num_$t\\num, 12 + \\num\n" \
43+
" .endr\n" \
44+
" .equ .L__gpr_num_$s9, 22\n" \
45+
" .equ .L__gpr_num_$fp, 22\n" \
46+
" .irp num,0,1,2,3,4,5,6,7,8\n" \
47+
" .equ .L__gpr_num_$s\\num, 23 + \\num\n" \
48+
" .endr\n" \
1949

2050
#endif /* __ASSEMBLY__ */
2151

0 commit comments

Comments
 (0)