Skip to contentSkip to conversation

s390 (2/5): syscall numbers > 255.

PATCH New Martin Schwidefsky 1 participant 1 message Mar 3, 2003 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390 (2/5): syscall numbers > 255.

Add support for system calls with numbers > 255.

arch/s390/kernel/entry.S +27 -9
diff -urN linux-2.5.63/arch/s390/kernel/entry.S linux-2.5.63-s390/arch/s390/kernel/entry.S
@@ -18,6 +18,7 @@
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
 #include <asm/offsets.h>
+#include <asm/unistd.h>
 
 /*
  * Stack layout for the system_call stack entry.
@@ -97,8 +98,7 @@
         stam    %a0,%a15,SP_AREGS(%r15)   # store access registers to kst.
         mvc     SP_AREGS+8(12,%r15),__LC_SAVE_AREA+12 # store ac. regs
         mvc     SP_PSW(8,%r15),\psworg    # move user PSW to stack
-        la      %r0,\psworg               # store trap indication
-        st      %r0,SP_TRAP(%r15)
+	mvc	SP_TRAP(4,%r15),BASED(.L\psworg) # store trap indication
         xc      0(4,%r15),0(%r15)         # clear back chain
         .endm
 
@@ -179,12 +179,18 @@
 	SAVE_ALL_BASE
         SAVE_ALL __LC_SVC_OLD_PSW,1
 	lh	%r7,0x8a	  # get svc number from lowcore
-        GET_THREAD_INFO           # load pointer to task_struct to R9
-	sll	%r7,2
         stosm   24(%r15),0x03     # reenable interrupts
+        GET_THREAD_INFO           # load pointer to task_struct to R9
+	sla	%r7,2             # *4 and test for svc 0
+	bnz	BASED(sysc_do_restart)  # svc number > 0
+	# svc 0: system call number in %r1
+	cl	%r1,BASED(.Lnr_syscalls)
+	bnl	BASED(sysc_do_restart)
+	lr	%r7,%r1           # copy svc number to %r7
+	sla	%r7,2             # *4
 sysc_do_restart:
-        l       %r8,sys_call_table-entry_base(%r7,%r13) # get system call addr.
 	tm	__TI_flags+3(%r9),_TIF_SYSCALL_TRACE
+        l       %r8,sys_call_table-entry_base(%r7,%r13) # get system call addr.
         bo      BASED(sysc_tracesys)
         basr    %r14,%r8          # call sys_xxxx
         st      %r2,SP_R2(%r15)   # store return value (change R2 on stack)
@@ -247,7 +253,7 @@
 	ni	__TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
 	stosm	24(%r15),0x03          # reenable interrupts
 	l	%r7,SP_R2(%r15)        # load new svc number
-	sll	%r7,2
+	sla	%r2,2
 	mvc	SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
 	lm	%r2,%r6,SP_R2(%r15)    # load svc arguments
 	b	BASED(sysc_do_restart) # restart svc
@@ -617,9 +623,15 @@
 	.long  sys_epoll_wait
 	.long  sys_set_tid_address
 	.long  sys_fadvise64
-	.rept  255-253
-	.long  sys_ni_syscall
-	.endr
+	.long  sys_timer_create
+	.long  sys_timer_settime	 /* 255 */
+	.long  sys_timer_gettime
+	.long  sys_timer_getoverrun
+	.long  sys_timer_delete
+	.long  sys_clock_settime
+	.long  sys_clock_gettime
+	.long  sys_clock_getres
+	.long  sys_clock_nanosleep
 
 /*
  * Program check handler routine
@@ -925,6 +937,12 @@
 .Lc_pactive:   .long  PREEMPT_ACTIVE
 .Lc0xff:       .long  0xff
 .Lc256:        .long  256
+.Lnr_syscalls: .long  NR_syscalls
+.L0x018:       .long  0x018
+.L0x020:       .long  0x020
+.L0x028:       .long  0x028
+.L0x030:       .long  0x030
+.L0x038:       .long  0x038
 
 /*
  * Symbol constants
arch/s390x/kernel/entry.S +32 -13

101 lines not on this page · raw message

include/asm-s390/unistd.h +146 -106

276 lines not on this page · raw message

include/asm-s390x/unistd.h +146 -106

276 lines not on this page · raw message