Skip to content

Commit

Permalink
csky: Fixup abiv2 syscall_trace break a4 & a5
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
guoren83 committed May 28, 2020
1 parent 9008975 commit e0bbb53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/csky/abiv2/inc/abi/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define LSAVE_A1 28
#define LSAVE_A2 32
#define LSAVE_A3 36
#define LSAVE_A4 40
#define LSAVE_A5 44

#define KSPTOUSP
#define USPTOKSP
Expand Down
6 changes: 4 additions & 2 deletions arch/csky/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ csky_syscall_trace:
ldw a3, (sp, LSAVE_A3)
#if defined(__CSKYABIV2__)
subi sp, 8
stw r5, (sp, 0x4)
stw r4, (sp, 0x0)
ldw r9, (sp, LSAVE_A4)
stw r9, (sp, 0x0)
ldw r9, (sp, LSAVE_A5)
stw r9, (sp, 0x4)
#else
ldw r6, (sp, LSAVE_A4)
ldw r7, (sp, LSAVE_A5)
Expand Down

0 comments on commit e0bbb53

Please sign in to comment.