Skip to content

Commit e0bbb53

Browse files
committed
csky: Fixup abiv2 syscall_trace break a4 & a5
Current implementation could destory a4 & a5 when strace, so we need to get them from pt_regs by SAVE_ALL. Signed-off-by: Guo Ren <[email protected]>
1 parent 9008975 commit e0bbb53

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/csky/abiv2/inc/abi/entry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#define LSAVE_A1 28
1414
#define LSAVE_A2 32
1515
#define LSAVE_A3 36
16+
#define LSAVE_A4 40
17+
#define LSAVE_A5 44
1618

1719
#define KSPTOUSP
1820
#define USPTOKSP

arch/csky/kernel/entry.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ csky_syscall_trace:
173173
ldw a3, (sp, LSAVE_A3)
174174
#if defined(__CSKYABIV2__)
175175
subi sp, 8
176-
stw r5, (sp, 0x4)
177-
stw r4, (sp, 0x0)
176+
ldw r9, (sp, LSAVE_A4)
177+
stw r9, (sp, 0x0)
178+
ldw r9, (sp, LSAVE_A5)
179+
stw r9, (sp, 0x4)
178180
#else
179181
ldw r6, (sp, LSAVE_A4)
180182
ldw r7, (sp, LSAVE_A5)

0 commit comments

Comments
 (0)