diff --git a/sys/arch/i386/i386/syscall.c b/sys/arch/i386/i386/syscall.c index 208144a85e48..572b887dd826 100644 --- a/sys/arch/i386/i386/syscall.c +++ b/sys/arch/i386/i386/syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.24 2003/10/08 00:28:41 thorpej Exp $ */ +/* $NetBSD: syscall.c,v 1.25 2003/10/26 10:48:08 yamt Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.24 2003/10/08 00:28:41 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.25 2003/10/26 10:48:08 yamt Exp $"); #include "opt_syscall_debug.h" #include "opt_vm86.h" @@ -152,9 +152,13 @@ syscall_plain(frame) rval[0] = 0; rval[1] = 0; - KERNEL_PROC_LOCK(l); - error = (*callp->sy_call)(l, args, rval); - KERNEL_PROC_UNLOCK(l); + if (callp->sy_flags & SYCALL_MPSAFE) { + error = (*callp->sy_call)(l, args, rval); + } else { + KERNEL_PROC_LOCK(l); + error = (*callp->sy_call)(l, args, rval); + KERNEL_PROC_UNLOCK(l); + } switch (error) { case 0: @@ -243,8 +247,13 @@ syscall_fancy(frame) rval[0] = 0; rval[1] = 0; - error = (*callp->sy_call)(l, args, rval); - KERNEL_PROC_UNLOCK(l); + if (callp->sy_flags & SYCALL_MPSAFE) { + KERNEL_PROC_UNLOCK(l); + error = (*callp->sy_call)(l, args, rval); + } else { + error = (*callp->sy_call)(l, args, rval); + KERNEL_PROC_UNLOCK(l); + } switch (error) { case 0: frame->tf_eax = rval[0];