diff options
author | 2008-05-03 17:27:04 +0000 | |
---|---|---|
committer | 2008-05-03 17:27:04 +0000 | |
commit | 778944d4d91855231d8d588b016b4948bf090d5d (patch) | |
tree | e30e4a655dcccfadb6487bd1a3e3c762b6215a6d | |
parent | mpcpcibr(4) bits. OK drahn@. (diff) | |
download | wireguard-openbsd-778944d4d91855231d8d588b016b4948bf090d5d.tar.xz wireguard-openbsd-778944d4d91855231d8d588b016b4948bf090d5d.zip |
Do not acquire the kernel lock for SY_NOLOCK system calls; ok drahn@ kettenis@
-rw-r--r-- | sys/arch/powerpc/powerpc/trap.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index 6ceff97cb4b..17a10d044f7 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.81 2008/04/27 16:01:47 drahn Exp $ */ +/* $OpenBSD: trap.c,v 1.82 2008/05/03 17:27:04 miod Exp $ */ /* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */ /* @@ -414,7 +414,7 @@ printf("isi iar %x lr %x\n", frame->srr0, frame->lr); size_t argsize; register_t code, error; register_t *params, rval[2]; - int nsys, n; + int nsys, n, nolock; register_t args[10]; uvmexp.syscalls++; @@ -470,27 +470,39 @@ printf("isi iar %x lr %x\n", frame->srr0, frame->lr); params = args; } - KERNEL_PROC_LOCK(p); #ifdef KTRACE - if (KTRPOINT(p, KTR_SYSCALL)) + if (KTRPOINT(p, KTR_SYSCALL)) { + KERNEL_PROC_LOCK(p); ktrsyscall(p, code, argsize, params); + KERNEL_PROC_UNLOCK(p); + } #endif rval[0] = 0; rval[1] = frame->fixreg[FIRSTARG + 1]; #ifdef SYSCALL_DEBUG + KERNEL_PROC_LOCK(p); scdebug_call(p, code, params); + KERNEL_PROC_UNLOCK(p); #endif #if NSYSTRACE > 0 - if (ISSET(p->p_flag, P_SYSTRACE)) + if (ISSET(p->p_flag, P_SYSTRACE)) { + KERNEL_PROC_LOCK(p); error = systrace_redirect(code, p, params, rval); - else + KERNEL_PROC_UNLOCK(p); + } else #endif + { + nolock = (callp->sy_flags & SY_NOLOCK); + if (!nolock) + KERNEL_PROC_LOCK(p); error = (*callp->sy_call)(p, params, rval); - KERNEL_PROC_UNLOCK(p); + if (!nolock) + KERNEL_PROC_UNLOCK(p); + } switch (error) { case 0: frame->fixreg[0] = error; |