Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh5/sh5 Simplify the test for KSEG0 addresses in pm...



details:   https://anonhg.NetBSD.org/src/rev/4a8f6886cb43
branches:  trunk
changeset: 537729:4a8f6886cb43
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Oct 05 08:23:32 2002 +0000

description:
Simplify the test for KSEG0 addresses in pmap_extract() so that it
works for _all_ KSEG0 addresses, not just managed VAs.

diffstat:

 sys/arch/sh5/sh5/pmap.c |  18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diffs (32 lines):

diff -r be0cc3fcf9f9 -r 4a8f6886cb43 sys/arch/sh5/sh5/pmap.c
--- a/sys/arch/sh5/sh5/pmap.c   Sat Oct 05 08:00:52 2002 +0000
+++ b/sys/arch/sh5/sh5/pmap.c   Sat Oct 05 08:23:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.14 2002/10/04 09:17:58 scw Exp $    */
+/*     $NetBSD: pmap.c,v 1.15 2002/10/05 08:23:32 scw Exp $    */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2056,19 +2056,9 @@
         */
        if (pm == pmap_kernel() &&
            va < SH5_KSEG1_BASE && va >= SH5_KSEG0_BASE) {
-               struct mem_region *mr;
-               for (mr = mem; mr->mr_size; mr++) {
-                       if (va >= mr->mr_kvastart &&
-                           va < (mr->mr_kvastart + mr->mr_size)) {
-                               *pap = mr->mr_start +
-                                   (paddr_t)(va - mr->mr_kvastart);
-                               PMPRINTF(("KSEG0. pa 0x%lx\n", *pap));
-                               return (TRUE);
-                       }
-               }
-
-               PMPRINTF(("KSEG0. Not found!\n"));
-               return (FALSE);         /* Should probably panic here ... */
+               *pap = (paddr_t)(va - SH5_KSEG0_BASE) + pmap_kseg0_pa;
+               PMPRINTF(("KSEG0. pa 0x%lx\n", *pap));
+               return (TRUE);
        }
 
        s = splhigh();



Home | Main Index | Thread Index | Old Index