From cf8988088c93f558376af9dce26c17d5aa766731 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 24 Jan 2001 13:10:17 +0000 Subject: Oops, when converting if (foo) panic() to a KASSERT(), you have to invert the test case. Spotted by: peter, jasone --- sys/alpha/alpha/pmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index a57bf3e..0a8fc4d 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -2843,8 +2843,8 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write) panic("pmap_emulate_reference: user ref to kernel"); pte = vtopte(v); } else { - KASSERT(p == NULL, ("pmap_emulate_reference: bad proc")); - KASSERT(p->p_vmspace == NULL, ("pmap_emulate_reference: bad p_vmspace")); + KASSERT(p != NULL, ("pmap_emulate_reference: bad proc")); + KASSERT(p->p_vmspace != NULL, ("pmap_emulate_reference: bad p_vmspace")); pte = pmap_lev3pte(p->p_vmspace->vm_map.pmap, v); } #ifdef DEBUG /* These checks are more expensive */ @@ -2872,7 +2872,8 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write) #endif pa = pmap_pte_pa(pte); - KASSERT((*pte & PG_MANAGED) == 0, ("pmap_emulate_reference(%p, 0x%lx, %d, %d): pa 0x%lx not managed", + KASSERT((*pte & PG_MANAGED) != 0, + ("pmap_emulate_reference(%p, 0x%lx, %d, %d): pa 0x%lx not managed", p, v, user, write, pa)); /* -- cgit v1.1