diff options
| author | ad <ad@NetBSD.org> | 2007-06-15 20:17:07 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2007-06-15 20:17:07 +0000 |
| commit | 029f4f9cd7abeb156e6a135e80fcedccec060d8d (patch) | |
| tree | 7cfb6f1272c8121f6898f0d44e885ef6bb79aaa1 /sys | |
| parent | e6bf177ae19f42943bea19418f846efe3f46783d (diff) | |
splstatclock, spllock -> splhigh
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/lockstat.c | 8 | ||||
| -rw-r--r-- | sys/kern/kern_fork.c | 6 | ||||
| -rw-r--r-- | sys/kern/kern_lock.c | 41 | ||||
| -rw-r--r-- | sys/kern/kern_proc.c | 6 | ||||
| -rw-r--r-- | sys/kern/subr_lockdebug.c | 6 |
5 files changed, 28 insertions, 39 deletions
diff --git a/sys/dev/lockstat.c b/sys/dev/lockstat.c index b86d9939e2d..218f9d4787b 100644 --- a/sys/dev/lockstat.c +++ b/sys/dev/lockstat.c @@ -1,7 +1,7 @@ -/* $NetBSD: lockstat.c,v 1.8 2007/03/04 06:01:42 christos Exp $ */ +/* $NetBSD: lockstat.c,v 1.9 2007/06/15 20:17:07 ad Exp $ */ /*- - * Copyright (c) 2006 The NetBSD Foundation, Inc. + * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lockstat.c,v 1.8 2007/03/04 06:01:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lockstat.c,v 1.9 2007/06/15 20:17:07 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -381,7 +381,7 @@ lockstat_event(uintptr_t lock, uintptr_t callsite, u_int flags, u_int count, lc = curcpu()->ci_lockstat; ll = &lc->lc_hash[LOCKSTAT_HASH(lock ^ callsite)]; event = (flags & LB_EVENT_MASK) - 1; - s = spllock(); + s = splhigh(); LIST_FOREACH(lb, ll, lb_chain.list) { if (lb->lb_lock == lock && lb->lb_callsite == callsite) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 1ae421191d8..622dfff1785 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_fork.c,v 1.139 2007/05/17 14:51:39 yamt Exp $ */ +/* $NetBSD: kern_fork.c,v 1.140 2007/06/15 20:17:08 ad Exp $ */ /*- * Copyright (c) 1999, 2001, 2004 The NetBSD Foundation, Inc. @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.139 2007/05/17 14:51:39 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.140 2007/06/15 20:17:08 ad Exp $"); #include "opt_ktrace.h" #include "opt_systrace.h" @@ -319,7 +319,7 @@ fork1(struct lwp *l1, int flags, int exitsig, void *stack, size_t stacksize, /* XXX p_smutex can be IPL_VM except for audio drivers */ mutex_init(&p2->p_smutex, MUTEX_SPIN, IPL_SCHED); - mutex_init(&p2->p_stmutex, MUTEX_SPIN, IPL_STATCLOCK); + mutex_init(&p2->p_stmutex, MUTEX_SPIN, IPL_HIGH); mutex_init(&p2->p_rasmutex, MUTEX_SPIN, IPL_SCHED); mutex_init(&p2->p_mutex, MUTEX_DEFAULT, IPL_NONE); cv_init(&p2->p_refcv, "drainref"); diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 5243da4fbb7..f771676bc13 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,7 +1,7 @@ -/* $NetBSD: kern_lock.c,v 1.113 2007/05/17 14:51:39 yamt Exp $ */ +/* $NetBSD: kern_lock.c,v 1.114 2007/06/15 20:17:08 ad Exp $ */ /*- - * Copyright (c) 1999, 2000, 2006 The NetBSD Foundation, Inc. + * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.113 2007/05/17 14:51:39 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.114 2007/06/15 20:17:08 ad Exp $"); #include "opt_multiprocessor.h" #include "opt_ddb.h" @@ -160,7 +160,7 @@ do { \ #define INTERLOCK_ACQUIRE(lkp, flags, s) \ do { \ if ((flags) & LK_SPIN) \ - s = spllock(); \ + s = splhigh(); \ simple_lock(&(lkp)->lk_interlock); \ } while (/*CONSTCOND*/ 0) @@ -356,7 +356,7 @@ _TAILQ_HEAD(, struct lock, volatile) spinlock_list = #define HAVEIT(lkp) \ do { \ if ((lkp)->lk_flags & LK_SPIN) { \ - int sp = spllock(); \ + int sp = splhigh(); \ SPINLOCK_LIST_LOCK(); \ TAILQ_INSERT_TAIL(&spinlock_list, (lkp), lk_list); \ SPINLOCK_LIST_UNLOCK(); \ @@ -367,7 +367,7 @@ do { \ #define DONTHAVEIT(lkp) \ do { \ if ((lkp)->lk_flags & LK_SPIN) { \ - int sp = spllock(); \ + int sp = splhigh(); \ SPINLOCK_LIST_LOCK(); \ TAILQ_REMOVE(&spinlock_list, (lkp), lk_list); \ SPINLOCK_LIST_UNLOCK(); \ @@ -535,7 +535,7 @@ spinlock_switchcheck(void) u_long cnt; int s; - s = spllock(); + s = splhigh(); #if defined(MULTIPROCESSOR) cnt = curcpu()->ci_spin_locks; #else @@ -565,17 +565,6 @@ spinlock_switchcheck(void) * * A raw __cpu_simple_lock may be used from interrupts are long as it * is acquired and held at a single IPL. - * - * A simple_lock (which is a __cpu_simple_lock wrapped with some - * debugging hooks) may be used at or below spllock(), which is - * typically at or just below splhigh() (i.e. blocks everything - * but certain machine-dependent extremely high priority interrupts). - * - * spinlockmgr spinlocks should be used at or below splsched(). - * - * Some platforms may have interrupts of higher priority than splsched(), - * including hard serial interrupts, inter-processor interrupts, and - * kernel debugger traps. */ /* @@ -1189,7 +1178,7 @@ _simple_lock(volatile struct simplelock *alp, const char *id, int l) cpuid_t cpu_num = cpu_number(); int s; - s = spllock(); + s = splhigh(); /* * MULTIPROCESSOR case: This is `safe' since if it's not us, we @@ -1212,7 +1201,7 @@ _simple_lock(volatile struct simplelock *alp, const char *id, int l) /* Acquire the lock before modifying any fields. */ splx(s); __cpu_simple_lock(&alp->lock_data); - s = spllock(); + s = splhigh(); #else alp->lock_data = __SIMPLELOCK_LOCKED; #endif /* } */ @@ -1243,7 +1232,7 @@ _simple_lock_held(volatile struct simplelock *alp) #endif int s, locked = 0; - s = spllock(); + s = splhigh(); #if defined(MULTIPROCESSOR) if (__cpu_simple_lock_try(&alp->lock_data) == 0) @@ -1268,7 +1257,7 @@ _simple_lock_try(volatile struct simplelock *alp, const char *id, int l) cpuid_t cpu_num = cpu_number(); int s, rv = 0; - s = spllock(); + s = splhigh(); /* * MULTIPROCESSOR case: This is `safe' since if it's not us, we @@ -1315,7 +1304,7 @@ _simple_unlock(volatile struct simplelock *alp, const char *id, int l) { int s; - s = spllock(); + s = splhigh(); /* * MULTIPROCESSOR case: This is `safe' because we think we hold @@ -1359,7 +1348,7 @@ simple_lock_dump(void) volatile struct simplelock *alp; int s; - s = spllock(); + s = splhigh(); SLOCK_LIST_LOCK(); lock_printf("all simple locks:\n"); TAILQ_FOREACH(alp, &simplelock_list, list) { @@ -1376,7 +1365,7 @@ simple_lock_freecheck(void *start, void *end) volatile struct simplelock *alp; int s; - s = spllock(); + s = splhigh(); SLOCK_LIST_LOCK(); TAILQ_FOREACH(alp, &simplelock_list, list) { if ((volatile void *)alp >= start && @@ -1416,7 +1405,7 @@ simple_lock_only_held(volatile struct simplelock *lp, const char *where) if (lp) { LOCK_ASSERT(simple_lock_held(lp)); } - s = spllock(); + s = splhigh(); SLOCK_LIST_LOCK(); TAILQ_FOREACH(alp, &simplelock_list, list) { if (alp == lp) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 31ea020c9ed..ccf52b55958 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.111 2007/06/14 14:29:50 yamt Exp $ */ +/* $NetBSD: kern_proc.c,v 1.112 2007/06/15 20:17:08 ad Exp $ */ /*- * Copyright (c) 1999, 2006, 2007 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.111 2007/06/14 14:29:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.112 2007/06/15 20:17:08 ad Exp $"); #include "opt_kstack.h" #include "opt_maxuprc.h" @@ -312,7 +312,7 @@ proc0_init(void) * should operate "lock free". */ mutex_init(&p->p_smutex, MUTEX_SPIN, IPL_SCHED); - mutex_init(&p->p_stmutex, MUTEX_SPIN, IPL_STATCLOCK); + mutex_init(&p->p_stmutex, MUTEX_SPIN, IPL_HIGH); mutex_init(&p->p_rasmutex, MUTEX_SPIN, IPL_SCHED); mutex_init(&p->p_mutex, MUTEX_DEFAULT, IPL_NONE); diff --git a/sys/kern/subr_lockdebug.c b/sys/kern/subr_lockdebug.c index 8a05e04774f..c895033116d 100644 --- a/sys/kern/subr_lockdebug.c +++ b/sys/kern/subr_lockdebug.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_lockdebug.c,v 1.7 2007/05/21 11:56:35 skrll Exp $ */ +/* $NetBSD: subr_lockdebug.c,v 1.8 2007/06/15 20:17:08 ad Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ #include "opt_ddb.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.7 2007/05/21 11:56:35 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.8 2007/06/15 20:17:08 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -125,7 +125,7 @@ lockdebug_lock(lockdebuglk_t *lk) { int s; - s = spllock(); + s = splhigh(); __cpu_simple_lock(&lk->lk_lock); lk->lk_oldspl = s; } |
