Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hppa/hppa Use pmap_extract instead of kvtop.



details:   https://anonhg.NetBSD.org/src/rev/01b7a3d46b14
branches:  trunk
changeset: 750861:01b7a3d46b14
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jan 17 08:50:04 2010 +0000

description:
Use pmap_extract instead of kvtop.

diffstat:

 sys/arch/hppa/hppa/trap.c       |  13 +++++++++----
 sys/arch/hppa/hppa/vm_machdep.c |   9 ++++++---
 2 files changed, 15 insertions(+), 7 deletions(-)

diffs (73 lines):

diff -r 60fbba604227 -r 01b7a3d46b14 sys/arch/hppa/hppa/trap.c
--- a/sys/arch/hppa/hppa/trap.c Sun Jan 17 08:48:50 2010 +0000
+++ b/sys/arch/hppa/hppa/trap.c Sun Jan 17 08:50:04 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $  */
+/*     $NetBSD: trap.c,v 1.71 2010/01/17 08:50:04 skrll Exp $  */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.71 2010/01/17 08:50:04 skrll Exp $");
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -462,10 +462,15 @@
 
                SANITY(l != NULL || (tf->tf_sp >= minsp && tf->tf_sp < maxsp));
        } else {
+               bool ok;
+               paddr_t pa;
+
+               ok = pmap_extract(pmap_kernel(), uvm_lwp_getuarea(l), &pa);
+               KASSERT(ok);
+
                SANITY(USERMODE(tf->tf_iioq_head));
                SANITY(USERMODE(tf->tf_iioq_tail));
-               SANITY(l != NULL &&
-                   tf->tf_cr30 == kvtop((void *)uvm_lwp_getuarea(l)));
+               SANITY(l != NULL && tf->tf_cr30 == pa);
        }
 #undef SANITY
 out:
diff -r 60fbba604227 -r 01b7a3d46b14 sys/arch/hppa/hppa/vm_machdep.c
--- a/sys/arch/hppa/hppa/vm_machdep.c   Sun Jan 17 08:48:50 2010 +0000
+++ b/sys/arch/hppa/hppa/vm_machdep.c   Sun Jan 17 08:50:04 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.39 2009/11/29 04:15:42 rmind Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.40 2010/01/17 08:50:04 skrll Exp $    */
 
 /*     $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $    */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.39 2009/11/29 04:15:42 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.40 2010/01/17 08:50:04 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,6 +54,7 @@
 cpu_activate_pcb(struct lwp *l)
 {
        struct trapframe *tf = l->l_md.md_regs;
+       bool ok;
        struct pcb *pcb = lwp_getpcb(l);
        vaddr_t uarea = (vaddr_t)pcb;
 #ifdef DIAGNOSTIC
@@ -64,7 +65,9 @@
         * Stash the physical for the pcb of U for later perusal
         */
        pcb->pcb_uva = uarea;
-       tf->tf_cr30 = kvtop((void *)uarea);
+       ok = pmap_extract(pmap_kernel(), uarea, (paddr_t *)&tf->tf_cr30);
+       KASSERT(ok);
+
        fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb, sizeof(struct pcb));
 
 #ifdef DIAGNOSTIC



Home | Main Index | Thread Index | Old Index