From 687e82cd9a59b6a17e14bbe87c6f6ab299ff36ac Mon Sep 17 00:00:00 2001 From: Ulf Carlsson Date: Wed, 5 Apr 2000 00:43:25 +0000 Subject: o 32-bit ioctls (some at least) o some syscalls o check that the syscall is withing range --- arch/mips64/kernel/scall_64.S | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'arch/mips64/kernel/scall_64.S') diff --git a/arch/mips64/kernel/scall_64.S b/arch/mips64/kernel/scall_64.S index af3dd1d87..224f43378 100644 --- a/arch/mips64/kernel/scall_64.S +++ b/arch/mips64/kernel/scall_64.S @@ -22,9 +22,6 @@ /* This duplicates the definition from */ #define SIGILL 4 /* Illegal instruction (ANSI). */ -/* Highest syscall handled here. */ -#define MAX_SYSCALL_NO __NR_Linux + __NR_Linux_syscalls - #ifndef CONFIG_MIPS32_COMPAT #define handle_sys64 handle_sys #endif @@ -39,14 +36,14 @@ NESTED(handle_sys64, PT_SIZE, sp) #endif ld t1, PT_EPC(sp) # skip syscall on return - sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number + subu t0, v0, __NR_Linux # check syscall number + sltiu t0, t0, __NR_Linux_syscalls + 1 daddiu t1, 4 # skip to next instruction beqz t0, illegal_syscall sd t1, PT_EPC(sp) - dsll t0, v0, 3 + dsll t0, v0, 3 # offset into table ld t2, (sys_call_table - (__NR_Linux * 8))(t0) # syscall routine - beqz t2, illegal_syscall; sd a3, PT_R26(sp) # save a3 for syscall restarting -- cgit v1.2.3