diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 3531c744432f..260d4722b64a 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.226 2000/11/24 02:21:56 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.227 2000/11/24 03:59:07 chs Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.226 2000/11/24 02:21:56 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.227 2000/11/24 03:59:07 chs Exp $"); #include #include @@ -1932,10 +1932,7 @@ microtime(tvp) register struct timeval *tvp; { static struct timeval lasttime; -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) - static struct simplelock microtime_slock = - SIMPLELOCK_INITIALIZER; -#endif + static struct simplelock microtime_slock = SIMPLELOCK_INITIALIZER; int s; s = splclock(); diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index 81423e9774e7..9fa81d6216ad 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.110 2000/11/14 22:55:06 thorpej Exp $ */ +/* $NetBSD: pmap.c,v 1.111 2000/11/24 03:59:08 chs Exp $ */ /* * @@ -61,8 +61,6 @@ #include "opt_cputype.h" #include "opt_user_ldt.h" -#include "opt_lockdebug.h" -#include "opt_multiprocessor.h" #include "opt_largepages.h" #include @@ -253,33 +251,22 @@ * locking data structures */ -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) -struct lock pmap_main_lock; -simple_lock_data_t pvalloc_lock; -simple_lock_data_t pmaps_lock; -simple_lock_data_t pmap_copy_page_lock; -simple_lock_data_t pmap_zero_page_lock; -simple_lock_data_t pmap_tmpptp_lock; +static struct lock pmap_main_lock; +static simple_lock_data_t pvalloc_lock; +static simple_lock_data_t pmaps_lock; +static simple_lock_data_t pmap_copy_page_lock; +static simple_lock_data_t pmap_zero_page_lock; +static simple_lock_data_t pmap_tmpptp_lock; #define PMAP_MAP_TO_HEAD_LOCK() \ - spinlockmgr(&pmap_main_lock, LK_SHARED, (void *) 0) + (void) spinlockmgr(&pmap_main_lock, LK_SHARED, NULL) #define PMAP_MAP_TO_HEAD_UNLOCK() \ - spinlockmgr(&pmap_main_lock, LK_RELEASE, (void *) 0) + (void) spinlockmgr(&pmap_main_lock, LK_RELEASE, NULL) #define PMAP_HEAD_TO_MAP_LOCK() \ - spinlockmgr(&pmap_main_lock, LK_EXCLUSIVE, (void *) 0) + (void) spinlockmgr(&pmap_main_lock, LK_EXCLUSIVE, NULL) #define PMAP_HEAD_TO_MAP_UNLOCK() \ - spinlockmgr(&pmap_main_lock, LK_RELEASE, (void *) 0) - -#else - -#define PMAP_MAP_TO_HEAD_LOCK() /* null */ -#define PMAP_MAP_TO_HEAD_UNLOCK() /* null */ - -#define PMAP_HEAD_TO_MAP_LOCK() /* null */ -#define PMAP_HEAD_TO_MAP_UNLOCK() /* null */ - -#endif + (void) spinlockmgr(&pmap_main_lock, LK_RELEASE, NULL) /* * global data structures @@ -914,14 +901,12 @@ pmap_bootstrap(kva_start) * init the static-global locks and global lists. */ -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) spinlockinit(&pmap_main_lock, "pmaplk", 0); simple_lock_init(&pvalloc_lock); simple_lock_init(&pmaps_lock); simple_lock_init(&pmap_copy_page_lock); simple_lock_init(&pmap_zero_page_lock); simple_lock_init(&pmap_tmpptp_lock); -#endif LIST_INIT(&pmaps); TAILQ_INIT(&pv_freepages); TAILQ_INIT(&pv_unusedpgs); @@ -2616,6 +2601,9 @@ pmap_page_remove(pg) ptes = pmap_map_ptes(pve->pv_pmap); /* locks pmap */ #ifdef DIAGNOSTIC + if (pve->pv_va >= uvm.pager_sva && pve->pv_va < uvm.pager_eva) { + printf("pmap_page_remove: found pager VA on pv_list\n"); + } if (pve->pv_ptp && (pve->pv_pmap->pm_pdir[pdei(pve->pv_va)] & PG_FRAME) != VM_PAGE_TO_PHYS(pve->pv_ptp)) { @@ -2989,7 +2977,7 @@ pmap_unwire(pmap, va) #ifdef DIAGNOSTIC if (!pmap_valid_entry(ptes[i386_btop(va)])) - panic("pmap_unwire: invalid (unmapped) va"); + panic("pmap_unwire: invalid (unmapped) va 0x%lx", va); #endif if ((ptes[i386_btop(va)] & PG_W) != 0) { ptes[i386_btop(va)] &= ~PG_W; diff --git a/sys/dev/pci/cy82c693.c b/sys/dev/pci/cy82c693.c index 153939bbbcc7..45c3f31bfe24 100644 --- a/sys/dev/pci/cy82c693.c +++ b/sys/dev/pci/cy82c693.c @@ -1,4 +1,4 @@ -/* $NetBSD: cy82c693.c,v 1.1 2000/06/06 03:07:39 thorpej Exp $ */ +/* $NetBSD: cy82c693.c,v 1.2 2000/11/24 03:59:08 chs Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: cy82c693.c,v 1.1 2000/06/06 03:07:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cy82c693.c,v 1.2 2000/11/24 03:59:08 chs Exp $"); #include "opt_multiprocessor.h" #include "opt_lockdebug.h" @@ -64,9 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: cy82c693.c,v 1.1 2000/06/06 03:07:39 thorpej Exp $") static struct cy82c693_handle cyhc_handle; static int cyhc_initialized; -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) static struct simplelock cyhc_slock = SIMPLELOCK_INITIALIZER; -#endif #define CYHC_LOCK(s) \ do { \ diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 7e9aae0515d2..f9767b9bf11c 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty_pty.c,v 1.54 2000/11/21 03:53:27 enami Exp $ */ +/* $NetBSD: tty_pty.c,v 1.55 2000/11/24 03:59:08 chs Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -82,10 +82,7 @@ struct pt_softc { static struct pt_softc **pt_softc = NULL; /* pty array */ static int npty = 0; /* for pstat -t */ static int maxptys = DEFAULT_MAXPTYS; /* maximum number of ptys (sysctable) */ - -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) static struct simplelock pt_softc_mutex = SIMPLELOCK_INITIALIZER; -#endif #define PF_PKT 0x08 /* packet mode */ #define PF_STOPPED 0x10 /* user told stopped */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a95bb96edfab..b4b878da85e0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.140 2000/09/19 22:00:58 fvdl Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.141 2000/11/24 03:59:09 chs Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -148,9 +148,7 @@ struct vfs_list_head vfs_list = /* vfs list */ struct nfs_public nfs_pub; /* publicly exported FS */ struct simplelock mountlist_slock = SIMPLELOCK_INITIALIZER; -#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) static struct simplelock mntid_slock = SIMPLELOCK_INITIALIZER; -#endif struct simplelock mntvnode_slock = SIMPLELOCK_INITIALIZER; struct simplelock vnode_free_list_slock = SIMPLELOCK_INITIALIZER; struct simplelock spechash_slock = SIMPLELOCK_INITIALIZER; diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 0c7795e7c480..753819677f5f 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.40 2000/11/22 06:31:22 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.41 2000/11/24 03:59:09 chs Exp $ */ /*- * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -296,11 +296,15 @@ void lockmgr_printinfo(__volatile struct lock *); void spinlock_switchcheck(void); #endif +#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) #define spinlockinit(lkp, name, flags) \ lockinit((lkp), 0, (name), 0, (flags) | LK_SPIN) - #define spinlockmgr(lkp, flags, intrlk) \ lockmgr((lkp), (flags) | LK_SPIN, (intrlk)) +#else +#define spinlockinit(lkp, name, flags) (void)(lkp) +#define spinlockmgr(lkp, flags, intrlk) (0) +#endif #if defined(LOCKDEBUG) int _spinlock_release_all(__volatile struct lock *, const char *, int); @@ -340,10 +344,10 @@ void simple_lock_switchcheck(void); #define LOCK_ASSERT(x) /* nothing */ #else #define simple_lock_init(alp) (alp)->lock_data = __SIMPLELOCK_UNLOCKED -#define simple_lock(alp) /* nothing */ -#define simple_lock_try(alp) (1) /* always succeeds */ -#define simple_unlock(alp) /* nothing */ -#define LOCK_ASSERT(x) /* nothing */ +#define simple_lock(alp) (void)(alp) +#define simple_lock_try(alp) (1) +#define simple_unlock(alp) (void)(alp) +#define LOCK_ASSERT(x) /* nothing */ #endif #endif /* _KERNEL */