score: fix off-by-one index into syscall table
[linux-2.6.git] / arch / score / kernel / entry.S
index 2f16917..83bb960 100644 (file)
@@ -395,20 +395,20 @@ ENTRY(resume)
 
 ENTRY(handle_sys)
        SAVE_ALL
+       sw      r8, [r0, 16]            # argument 5 from user r8
+       sw      r9, [r0, 20]            # argument 6 from user r9
        enable_irq
 
        sw      r4, [r0, PT_ORIG_R4]    #for restart syscall
        sw      r7, [r0, PT_ORIG_R7]    #for restart syscall
        sw      r27, [r0, PT_IS_SYSCALL] # it from syscall
-       sw      r8, [r0, 16]            # argument 5 from user r8
-       sw      r9, [r0, 20]            # argument 6 from user r9
 
        lw      r9, [r0, PT_EPC]        # skip syscall on return
        addi    r9, 4
        sw      r9, [r0, PT_EPC]
 
        cmpi.c  r27, __NR_syscalls      # check syscall number
-       bgtu    illegal_syscall
+       bgeu    illegal_syscall
 
        slli    r8, r27, 2              # get syscall routine
        la      r11, sys_call_table
@@ -499,3 +499,16 @@ ENTRY(sys_sigaltstack)
        mv      r4, r0
        la      r8, score_sigaltstack
        br      r8
+
+#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
+ENTRY(sys_fork)
+       mv      r4, r0
+       la      r8, score_fork
+       br      r8
+
+ENTRY(sys_vfork)
+       mv      r4, r0
+       la      r8, score_vfork
+       br      r8
+#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
+