aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2010-10-25 10:10:40 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:19 -0400
commitbaa071588c3ffcc1a8721faf9337140e85d34bf6 (patch)
tree5aefe1db8edbc3dfb956669e657368673ad601ef /arch/s390
parent178514d7e3e8cfba087b3a208e22a54ce65e8f34 (diff)
[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: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/syscall.h4
-rw-r--r--arch/s390/kernel/entry.S6
-rw-r--r--arch/s390/kernel/entry64.S4
3 files changed, 5 insertions, 9 deletions
diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
index 8429686951f9..5c0246b955d8 100644
--- a/arch/s390/include/asm/syscall.h
+++ b/arch/s390/include/asm/syscall.h
@@ -65,8 +65,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
65 if (test_tsk_thread_flag(task, TIF_31BIT)) 65 if (test_tsk_thread_flag(task, TIF_31BIT))
66 mask = 0xffffffff; 66 mask = 0xffffffff;
67#endif 67#endif
68 if (i + n == 6)
69 args[--n] = regs->args[0] & mask;
70 while (n-- > 0) 68 while (n-- > 0)
71 if (i + n > 0) 69 if (i + n > 0)
72 args[n] = regs->gprs[2 + i + n] & mask; 70 args[n] = regs->gprs[2 + i + n] & mask;
@@ -80,8 +78,6 @@ static inline void syscall_set_arguments(struct task_struct *task,
80 const unsigned long *args) 78 const unsigned long *args)
81{ 79{
82 BUG_ON(i + n > 6); 80 BUG_ON(i + n > 6);
83 if (i + n == 6)
84 regs->args[0] = args[--n];
85 while (n-- > 0) 81 while (n-- > 0)
86 if (i + n > 0) 82 if (i + n > 0)
87 regs->gprs[2 + i + n] = args[n]; 83 regs->gprs[2 + i + n] = args[n];
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 736d7010629e..5efce7202984 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -254,12 +254,11 @@ sysc_do_svc:
254 bnl BASED(sysc_nr_ok) 254 bnl BASED(sysc_nr_ok)
255 lr %r7,%r1 # copy svc number to %r7 255 lr %r7,%r1 # copy svc number to %r7
256sysc_nr_ok: 256sysc_nr_ok:
257 mvc SP_ARGS(4,%r15),SP_R7(%r15)
258sysc_do_restart:
259 sth %r7,SP_SVCNR(%r15) 257 sth %r7,SP_SVCNR(%r15)
260 sll %r7,2 # svc number *4 258 sll %r7,2 # svc number *4
261 l %r8,BASED(.Lsysc_table) 259 l %r8,BASED(.Lsysc_table)
262 tm __TI_flags+2(%r9),_TIF_SYSCALL 260 tm __TI_flags+2(%r9),_TIF_SYSCALL
261 mvc SP_ARGS(4,%r15),SP_R7(%r15)
263 l %r8,0(%r7,%r8) # get system call addr. 262 l %r8,0(%r7,%r8) # get system call addr.
264 bnz BASED(sysc_tracesys) 263 bnz BASED(sysc_tracesys)
265 basr %r14,%r8 # call sys_xxxx 264 basr %r14,%r8 # call sys_xxxx
@@ -347,7 +346,7 @@ sysc_restart:
347 l %r7,SP_R2(%r15) # load new svc number 346 l %r7,SP_R2(%r15) # load new svc number
348 mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument 347 mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
349 lm %r2,%r6,SP_R2(%r15) # load svc arguments 348 lm %r2,%r6,SP_R2(%r15) # load svc arguments
350 b BASED(sysc_do_restart) # restart svc 349 b BASED(sysc_nr_ok) # restart svc
351 350
352# 351#
353# _TIF_SINGLE_STEP is set, call do_single_step 352# _TIF_SINGLE_STEP is set, call do_single_step
@@ -380,6 +379,7 @@ sysc_tracesys:
380 l %r8,0(%r7,%r8) 379 l %r8,0(%r7,%r8)
381sysc_tracego: 380sysc_tracego:
382 lm %r3,%r6,SP_R3(%r15) 381 lm %r3,%r6,SP_R3(%r15)
382 mvc SP_ARGS(4,%r15),SP_R7(%r15)
383 l %r2,SP_ORIG_R2(%r15) 383 l %r2,SP_ORIG_R2(%r15)
384 basr %r14,%r8 # call sys_xxx 384 basr %r14,%r8 # call sys_xxx
385 st %r2,SP_R2(%r15) # store return value 385 st %r2,SP_R2(%r15) # store return value
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index e4038ea4dc57..a2be23922f43 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -246,7 +246,6 @@ sysc_saveall:
246 CREATE_STACK_FRAME __LC_SAVE_AREA 246 CREATE_STACK_FRAME __LC_SAVE_AREA
247 mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW 247 mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW
248 mvc SP_ILC(4,%r15),__LC_SVC_ILC 248 mvc SP_ILC(4,%r15),__LC_SVC_ILC
249 stg %r7,SP_ARGS(%r15)
250 lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct 249 lg %r12,__LC_THREAD_INFO # load pointer to thread_info struct
251sysc_vtime: 250sysc_vtime:
252 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER 251 UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
@@ -274,6 +273,7 @@ sysc_nr_ok:
274sysc_noemu: 273sysc_noemu:
275#endif 274#endif
276 tm __TI_flags+6(%r12),_TIF_SYSCALL 275 tm __TI_flags+6(%r12),_TIF_SYSCALL
276 mvc SP_ARGS(8,%r15),SP_R7(%r15)
277 lgf %r8,0(%r7,%r10) # load address of system call routine 277 lgf %r8,0(%r7,%r10) # load address of system call routine
278 jnz sysc_tracesys 278 jnz sysc_tracesys
279 basr %r14,%r8 # call sys_xxxx 279 basr %r14,%r8 # call sys_xxxx
@@ -387,6 +387,7 @@ sysc_tracesys:
387 lgf %r8,0(%r7,%r10) 387 lgf %r8,0(%r7,%r10)
388sysc_tracego: 388sysc_tracego:
389 lmg %r3,%r6,SP_R3(%r15) 389 lmg %r3,%r6,SP_R3(%r15)
390 mvc SP_ARGS(8,%r15),SP_R7(%r15)
390 lg %r2,SP_ORIG_R2(%r15) 391 lg %r2,SP_ORIG_R2(%r15)
391 basr %r14,%r8 # call sys_xxx 392 basr %r14,%r8 # call sys_xxx
392 stg %r2,SP_R2(%r15) # store return value 393 stg %r2,SP_R2(%r15) # store return value
@@ -953,7 +954,6 @@ cleanup_system_call:
953 CREATE_STACK_FRAME __LC_SAVE_AREA 954 CREATE_STACK_FRAME __LC_SAVE_AREA
954 mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW 955 mvc SP_PSW(16,%r15),__LC_SVC_OLD_PSW
955 mvc SP_ILC(4,%r15),__LC_SVC_ILC 956 mvc SP_ILC(4,%r15),__LC_SVC_ILC
956 stg %r7,SP_ARGS(%r15)
957 mvc 8(8,%r12),__LC_THREAD_INFO 957 mvc 8(8,%r12),__LC_THREAD_INFO
958cleanup_vtime: 958cleanup_vtime:
959 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24) 959 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24)