summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2011-07-06 21:41:38 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2011-07-06 21:41:38 +0000
commit1f8bec9fc5270feedd8a624a9d95c12ca9f84541 (patch)
tree00106427be1dff3557a53963b35c56d2cbf075a2 /sys/arch/amd64
parentf303274e6cc4f87cb47de6f68f997d8a37c76e0f (diff)
Clean up after P_BIGLOCK removal.
KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/fpu.c6
-rw-r--r--sys/arch/amd64/amd64/syscall.c32
-rw-r--r--sys/arch/amd64/amd64/trap.c47
3 files changed, 41 insertions, 44 deletions
diff --git a/sys/arch/amd64/amd64/fpu.c b/sys/arch/amd64/amd64/fpu.c
index 047468a8fd8..1c36e6e7443 100644
--- a/sys/arch/amd64/amd64/fpu.c
+++ b/sys/arch/amd64/amd64/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.22 2011/03/20 21:44:08 guenther Exp $ */
+/* $OpenBSD: fpu.c,v 1.23 2011/07/06 21:41:37 art Exp $ */
/* $NetBSD: fpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -166,9 +166,9 @@ fputrap(struct trapframe *frame)
sfp->fp_ex_sw = sfp->fp_fxsave.fx_fsw;
code = x86fpflags_to_siginfo (statbits);
sv.sival_ptr = (void *)frame->tf_rip; /* XXX - ? */
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGFPE, frame->tf_err, code, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
static int
diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c
index cabe03827e4..e43c2f61227 100644
--- a/sys/arch/amd64/amd64/syscall.c
+++ b/sys/arch/amd64/amd64/syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.c,v 1.16 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: syscall.c,v 1.17 2011/07/06 21:41:37 art Exp $ */
/* $NetBSD: syscall.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
@@ -127,32 +127,32 @@ syscall(struct trapframe *frame)
lock = !(callp->sy_flags & SY_NOLOCK);
#ifdef SYSCALL_DEBUG
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
scdebug_call(p, code, argp);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
#endif
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSCALL)) {
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
ktrsyscall(p, code, callp->sy_argsize, argp);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
#endif
rval[0] = 0;
rval[1] = frame->tf_rdx;
#if NSYSTRACE > 0
if (ISSET(p->p_flag, P_SYSTRACE)) {
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
error = systrace_redirect(code, p, argp, rval);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
} else
#endif
{
if (lock)
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
error = (*callp->sy_call)(p, argp, rval);
if (lock)
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
switch (error) {
case 0:
@@ -179,16 +179,16 @@ syscall(struct trapframe *frame)
}
#ifdef SYSCALL_DEBUG
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
scdebug_ret(p, code, error, rval);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
#endif
userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET)) {
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
ktrsysret(p, code, error, rval[0]);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
#endif
}
@@ -203,17 +203,17 @@ child_return(void *arg)
tf->tf_rdx = 1;
tf->tf_rflags &= ~PSL_C;
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET)) {
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
ktrsysret(p,
(p->p_flag & P_THREAD) ? SYS_rfork :
(p->p_p->ps_flags & PS_PPWAIT) ? SYS_vfork : SYS_fork,
0, 0);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
#endif
}
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 2a506003d65..10d1cc5ce2b 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.22 2010/11/01 15:41:01 phessler Exp $ */
+/* $OpenBSD: trap.c,v 1.23 2011/07/06 21:41:37 art Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -250,22 +250,22 @@ copyfault:
frame_dump(frame);
#endif
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGBUS, type & ~T_USER, BUS_OBJERR, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_ALIGNFLT|T_USER:
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGBUS, type & ~T_USER, BUS_ADRALN, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_PRIVINFLT|T_USER: /* privileged instruction fault */
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGILL, type & ~T_USER, ILL_PRVOPC, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_FPOPFLT|T_USER: /* coprocessor operand fault */
#ifdef TRAP_SIGDEBUG
@@ -274,17 +274,17 @@ copyfault:
frame_dump(frame);
#endif
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGILL, type & ~T_USER, ILL_COPROC, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_ASTFLT|T_USER: /* Allow process switch */
uvmexp.softs++;
if (p->p_flag & P_OWEUPC) {
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
ADDUPROF(p);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
}
/* Allow a forced task switch. */
if (curcpu()->ci_want_resched)
@@ -293,21 +293,21 @@ copyfault:
case T_BOUND|T_USER:
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGFPE, type &~ T_USER, FPE_FLTSUB, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_OFLOW|T_USER:
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGFPE, type &~ T_USER, FPE_INTOVF, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_DIVIDE|T_USER:
sv.sival_ptr = (void *)frame->tf_rip;
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGFPE, type &~ T_USER, FPE_INTDIV, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
case T_ARITHTRAP|T_USER:
@@ -330,7 +330,7 @@ copyfault:
extern struct vm_map *kernel_map;
cr2 = rcr2();
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
faultcommon:
vm = p->p_vmspace;
if (vm == NULL)
@@ -377,7 +377,7 @@ faultcommon:
KERNEL_UNLOCK();
return;
}
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
goto out;
}
if (error == EACCES) {
@@ -409,10 +409,7 @@ faultcommon:
sv.sival_ptr = (void *)fa;
trapsignal(p, SIGSEGV, T_PAGEFLT, SEGV_MAPERR, sv);
}
- if (type == T_PAGEFLT)
- KERNEL_UNLOCK();
- else
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
break;
}
@@ -424,9 +421,9 @@ faultcommon:
#ifdef MATH_EMULATE
trace:
#endif
- KERNEL_PROC_LOCK(p);
+ KERNEL_LOCK();
trapsignal(p, SIGTRAP, type &~ T_USER, TRAP_BRKPT, sv);
- KERNEL_PROC_UNLOCK(p);
+ KERNEL_UNLOCK();
break;
#if NISA > 0