From: John Hodge Date: Wed, 26 Oct 2011 08:48:48 +0000 (+0800) Subject: Usermode/ld-acess - Fixed ARMv7 syscalls to save LR because it's not saved by syscall... X-Git-Tag: rel0.14~195 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=21789de8826c1361656e755a5f6fa71ed0e0fada;p=tpg%2Facess2.git Usermode/ld-acess - Fixed ARMv7 syscalls to save LR because it's not saved by syscall handler --- diff --git a/Usermode/Libraries/ld-acess.so_src/arch/armv7.S.h b/Usermode/Libraries/ld-acess.so_src/arch/armv7.S.h index 97dad215..d8823d7b 100644 --- a/Usermode/Libraries/ld-acess.so_src/arch/armv7.S.h +++ b/Usermode/Libraries/ld-acess.so_src/arch/armv7.S.h @@ -60,32 +60,31 @@ _errno: .long 0 @ Placed in .text, to allow use of relative addressing .macro syscall0 _name, _num .globl \_name \_name: + push {lr} svc #\_num str r2, _errno - mov pc, lr + pop {pc} .endm .macro syscall5 _name, _num .globl \_name \_name: - push {r4} + push {r4, lr} ldr r4, [sp,#4] svc #\_num str r2, _errno - pop {r4} - mov pc, lr + pop {r4, pc} .endm .macro syscall6 _name, _num .globl \_name \_name: - push {r4,r5} + push {r4,r5,lr} ldr r4, [sp,#8] ldr r5, [sp,#12] svc #\_num str r2, _errno - pop {r4,r5} - mov pc, lr + pop {r4,r5,pc} .endm #define SYSCALL0(_name,_num) syscall0 _name, _num