|
@@ -193,10 +193,10 @@ syscall_trace_entry:
|
|
|
! Reload R0-R4 from kernel stack, where the
|
|
|
! parent may have modified them using
|
|
|
! ptrace(POKEUSR). (Note that R0-R2 are
|
|
|
- ! used by the system call handler directly
|
|
|
- ! from the kernel stack anyway, so don't need
|
|
|
- ! to be reloaded here.) This allows the parent
|
|
|
- ! to rewrite system calls and args on the fly.
|
|
|
+ ! reloaded from the kernel stack by syscall_call
|
|
|
+ ! below, so don't need to be reloaded here.)
|
|
|
+ ! This allows the parent to rewrite system calls
|
|
|
+ ! and args on the fly.
|
|
|
mov.l @(OFF_R4,r15), r4 ! arg0
|
|
|
mov.l @(OFF_R5,r15), r5
|
|
|
mov.l @(OFF_R6,r15), r6
|
|
@@ -357,8 +357,15 @@ syscall_call:
|
|
|
mov.l 3f, r8 ! Load the address of sys_call_table
|
|
|
add r8, r3
|
|
|
mov.l @r3, r8
|
|
|
+ mov.l @(OFF_R2,r15), r2
|
|
|
+ mov.l @(OFF_R1,r15), r1
|
|
|
+ mov.l @(OFF_R0,r15), r0
|
|
|
+ mov.l r2, @-r15
|
|
|
+ mov.l r1, @-r15
|
|
|
+ mov.l r0, @-r15
|
|
|
jsr @r8 ! jump to specific syscall handler
|
|
|
nop
|
|
|
+ add #12, r15
|
|
|
mov.l @(OFF_R0,r15), r12 ! save r0
|
|
|
mov.l r0, @(OFF_R0,r15) ! save the return value
|
|
|
!
|