summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2000-10-09 18:47:49 +0000
committergallatin <gallatin@FreeBSD.org>2000-10-09 18:47:49 +0000
commit8c25d0773da5520a5580e9fa1883814c79d540f8 (patch)
treecf706df9d7bcc41f1a739c23c535ed9a0d6d1cfd
parentf5ae415528e6481f9b749c27d4daf8bbd9b42982 (diff)
downloadFreeBSD-src-8c25d0773da5520a5580e9fa1883814c79d540f8.zip
FreeBSD-src-8c25d0773da5520a5580e9fa1883814c79d540f8.tar.gz
kernacc() only knows about mapped memory, not K0SEG addresses.
Before calling kernacc(), make sure that we're not calling it with a K0SEG address. This gets alphas booting with SMP_DEBUG & INVARIANTS options approved by: jhb
-rw-r--r--sys/alpha/alpha/synch_machdep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/alpha/alpha/synch_machdep.c b/sys/alpha/alpha/synch_machdep.c
index 80d5579..184da83 100644
--- a/sys/alpha/alpha/synch_machdep.c
+++ b/sys/alpha/alpha/synch_machdep.c
@@ -428,6 +428,9 @@ mtx_exit_hard(struct mtx *m, int type)
#ifdef SMP_DEBUG
+#define ISK0SEG(va) \
+ ((va >= ALPHA_K0SEG_BASE && va <= ALPHA_K0SEG_END))
+
int mtx_validate __P((struct mtx *, int));
int
@@ -441,10 +444,12 @@ mtx_validate(struct mtx *m, int when)
return 0;
mtx_enter(&all_mtx, MTX_DEF);
- ASS(kernacc((caddr_t)all_mtx.mtx_next, 4, 1) == 1);
+ ASS(ISK0SEG((vm_offset_t)all_mtx.mtx_next) ||
+ kernacc((caddr_t)all_mtx.mtx_next, 4, 1) == 1);
ASS(all_mtx.mtx_next->mtx_prev == &all_mtx);
for (i = 0, mp = all_mtx.mtx_next; mp != &all_mtx; mp = mp->mtx_next) {
- if (kernacc((caddr_t)mp->mtx_next, 4, 1) != 1) {
+ if (!ISK0SEG((vm_offset_t)all_mtx.mtx_next) &&
+ kernacc((caddr_t)mp->mtx_next, 4, 1) != 1) {
panic("mtx_validate: mp=%p mp->mtx_next=%p",
mp, mp->mtx_next);
}
OpenPOWER on IntegriCloud