Commit baa07158 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Martin Schwidefsky

[S390] cleanup system call parameter setup

Do the setup of the stack overflow argument for the sixth system
call parameter right before the branch to the system call function.
That simplifies the system call parameter access code.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 178514d7
...@@ -65,8 +65,6 @@ static inline void syscall_get_arguments(struct task_struct *task, ...@@ -65,8 +65,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
if (test_tsk_thread_flag(task, TIF_31BIT)) if (test_tsk_thread_flag(task, TIF_31BIT))
mask = 0xffffffff; mask = 0xffffffff;
#endif #endif
if (i + n == 6)
args[--n] = regs->args[0] & mask;
while (n-- > 0) while (n-- > 0)
if (i + n > 0) if (i + n > 0)
args[n] = regs->gprs[2 + i + n] & mask; args[n] = regs->gprs[2 + i + n] & mask;
...@@ -80,8 +78,6 @@ static inline void syscall_set_arguments(struct task_struct *task, ...@@ -80,8 +78,6 @@ static inline void syscall_set_arguments(struct task_struct *task,
const unsigned long *args) const unsigned long *args)
{ {
BUG_ON(i + n > 6); BUG_ON(i + n > 6);
if (i + n == 6)
regs->args[0] = args[--n];
while (n-- > 0) while (n-- > 0)
if (i + n > 0) if (i + n > 0)
regs->gprs[2 + i + n] = args[n]; regs->gprs[2 + i + n] = args[n];
......
...@@ -254,12 +254,11 @@ sysc_do_svc: ...@@ -254,12 +254,11 @@ sysc_do_svc:
bnl BASED(sysc_nr_ok) bnl BASED(sysc_nr_ok)
lr %r7,%r1 # copy svc number to %r7 lr %r7,%r1 # copy svc number to %r7
sysc_nr_ok: sysc_nr_ok:
mvc SP_ARGS(4,%r15),SP_R7(%r15)
sysc_do_restart:
sth %r7,SP_SVCNR(%r15) sth %r7,SP_SVCNR(%r15)
sll %r7,2 # svc number *4 sll %r7,2 # svc number *4
l %r8,BASED(.Lsysc_table) l %r8,BASED(.Lsysc_table)
tm __TI_flags+2(%r9),_TIF_SYSCALL tm __TI_flags+2(%r9),_TIF_SYSCALL
mvc SP_ARGS(4,%r15),SP_R7(%r15)
l %r8,0(%r7,%r8) # get system call addr. l %r8,0(%r7,%r8) # get system call addr.
bnz BASED(sysc_tracesys) bnz BASED(sysc_tracesys)
basr %r14,%r8 # call sys_xxxx basr %r14,%r8 # call sys_xxxx
...@@ -347,7 +346,7 @@ sysc_restart: ...@@ -347,7 +346,7 @@ sysc_restart:
l %r7,SP_R2(%r15) # load new svc number l %r7,SP_R2(%r15) # load new svc number
mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
lm %r2,%r6,SP_R2(%r15) # load svc arguments lm %r2,%r6,SP_R2(%r15) # load svc arguments
b BASED(sysc_do_restart) # restart svc b BASED(sysc_nr_ok) # restart svc
# #
# _TIF_SINGLE_STEP is set, call do_single_step # _TIF_SINGLE_STEP is set, call do_single_step
...@@ -380,6 +379,7 @@ sysc_tracesys: ...@@ -380,6 +379,7 @@ sysc_tracesys:
l %r8,0(%r7,%r8) l %r8,0(%r7,%r8)
sysc_tracego: sysc_tracego:
lm %r3,%r6,SP_R3(%r15) lm %r3,%r6,SP_R3(%r15)
mvc SP_ARGS(4,%r15),SP_R7(%r15)
l %r2,SP_ORIG_R2(%r15) l %r2,SP_ORIG_R2(%r15)
basr %r14,%r8 # call sys_xxx basr %r14,%r8 # call sys_xxx
st %r2,SP_R2(%r15) # store return value st %r2,SP_R2(%r15) # store return value
......
...@@ -246,7 +246,6 @@ sysc_saveall: ...@@ -246,7 +246,6 @@ sysc_saveall:
CREATE_STACK_FRAME __LC_SAVE_AREA CREATE_STACK_FRAME __LC_SAVE_AREA
mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW
mvc SP_ILC(4,%r15),__LC_SVC_ILC mvc SP_ILC(4,%r15),__LC_SVC_ILC
stg %r7,SP_ARGS(%r15)
lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct
sysc_vtime: sysc_vtime:
UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
...@@ -274,6 +273,7 @@ sysc_nr_ok: ...@@ -274,6 +273,7 @@ sysc_nr_ok:
sysc_noemu: sysc_noemu:
#endif #endif
tm __TI_flags+6(%r12),_TIF_SYSCALL tm __TI_flags+6(%r12),_TIF_SYSCALL
mvc SP_ARGS(8,%r15),SP_R7(%r15)
lgf %r8,0(%r7,%r10) # load address of system call routine lgf %r8,0(%r7,%r10) # load address of system call routine
jnz sysc_tracesys jnz sysc_tracesys
basr %r14,%r8 # call sys_xxxx basr %r14,%r8 # call sys_xxxx
...@@ -387,6 +387,7 @@ sysc_tracesys: ...@@ -387,6 +387,7 @@ sysc_tracesys:
lgf %r8,0(%r7,%r10) lgf %r8,0(%r7,%r10)
sysc_tracego: sysc_tracego:
lmg %r3,%r6,SP_R3(%r15) lmg %r3,%r6,SP_R3(%r15)
mvc SP_ARGS(8,%r15),SP_R7(%r15)
lg %r2,SP_ORIG_R2(%r15) lg %r2,SP_ORIG_R2(%r15)
basr %r14,%r8 # call sys_xxx basr %r14,%r8 # call sys_xxx
stg %r2,SP_R2(%r15) # store return value stg %r2,SP_R2(%r15) # store return value
...@@ -953,7 +954,6 @@ cleanup_system_call: ...@@ -953,7 +954,6 @@ cleanup_system_call:
CREATE_STACK_FRAME __LC_SAVE_AREA CREATE_STACK_FRAME __LC_SAVE_AREA
mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW
mvc SP_ILC(4,%r15),__LC_SVC_ILC mvc SP_ILC(4,%r15),__LC_SVC_ILC
stg %r7,SP_ARGS(%r15)
mvc 8(8,%r12),__LC_THREAD_INFO mvc 8(8,%r12),__LC_THREAD_INFO
cleanup_vtime: cleanup_vtime:
clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24) clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment