diff options
author | 2004-09-07 10:12:35 +0000 | |
---|---|---|
committer | 2004-09-07 10:12:35 +0000 | |
commit | 75cce0074c56f9b93dfac409dccc44c46cde5930 (patch) | |
tree | e0891cf6b7725fe8f341358cf5432111a58a0a65 | |
parent | Do not incorrectly sign-extend a mode_t value. (diff) | |
download | wireguard-openbsd-75cce0074c56f9b93dfac409dccc44c46cde5930.tar.xz wireguard-openbsd-75cce0074c56f9b93dfac409dccc44c46cde5930.zip |
Properly put ktrsyscall (and scdebug_foo) into biglock, inspired from NetBSD
-rw-r--r-- | sys/arch/i386/i386/trap.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index ca0713f6da1..a69e15501f7 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.65 2004/08/14 00:14:11 niklas Exp $ */ +/* $OpenBSD: trap.c,v 1.66 2004/09/07 10:12:35 niklas Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -775,6 +775,7 @@ syscall(frame) else error = 0; orig_error = error; + KERNEL_PROC_LOCK(p); #ifdef SYSCALL_DEBUG scdebug_call(p, code, args); #endif @@ -782,11 +783,12 @@ syscall(frame) if (KTRPOINT(p, KTR_SYSCALL)) ktrsyscall(p, code, argsize, args); #endif - if (error) + if (error) { + KERNEL_PROC_UNLOCK(p); goto bad; + } rval[0] = 0; rval[1] = frame.tf_edx; - KERNEL_PROC_LOCK(p); #if NSYSTRACE > 0 if (ISSET(p->p_flag, P_SYSTRACE)) orig_error = error = systrace_redirect(code, p, args, rval); @@ -826,7 +828,9 @@ syscall(frame) } #ifdef SYSCALL_DEBUG + KERNEL_PROC_LOCK(p); scdebug_ret(p, code, orig_error, rval); + KERNEL_PROC_UNLOCK(p); #endif userret(p, frame.tf_eip, sticks); #ifdef KTRACE |