Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Add the brutal hack that allows us to lim...



details:   https://anonhg.NetBSD.org/src/rev/498efe574f00
branches:  trunk
changeset: 535259:498efe574f00
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Aug 13 03:36:30 2002 +0000

description:
Add the brutal hack that allows us to limp along using the read/write
cache line allocation policy on XScale CPUs: in pmap_enter(), if the
pmap is the kernel pmap, clear the X-bit in the PTE, thus disabling
read/write-allocate for managed kernel mappings.

Yes, this is ugly.  But it makes userland code run with r/w-allocate,
which is a huge improvement on systems with low core memory performance.

diffstat:

 sys/arch/arm/arm32/pmap.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r e2034781f3ad -r 498efe574f00 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Tue Aug 13 02:46:36 2002 +0000
+++ b/sys/arch/arm/arm32/pmap.c Tue Aug 13 03:36:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.108 2002/08/10 00:48:35 thorpej Exp $       */
+/*     $NetBSD: pmap.c,v 1.109 2002/08/13 03:36:30 thorpej Exp $       */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -143,7 +143,7 @@
 #include <machine/param.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.108 2002/08/10 00:48:35 thorpej Exp $");        
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2002/08/13 03:36:30 thorpej Exp $");        
 #ifdef PMAP_DEBUG
 #define        PDEBUG(_lev_,_stat_) \
        if (pmap_debug_level >= (_lev_)) \
@@ -2730,6 +2730,17 @@
                        npte |= L2_TYPE_INV;
        }
 
+#if ARM_MMU_XSCALE == 1 && defined(XSCALE_CACHE_READ_WRITE_ALLOCATE)
+#if ARM_NMMUS > 1
+# error "XXX Unable to use read/write-allocate and configure non-XScale"
+#endif
+       /*
+        * XXX BRUTAL HACK!  This allows us to limp along with
+        * XXX the read/write-allocate cache mode.
+        */
+       if (pmap == pmap_kernel())
+               npte &= ~L2_XSCALE_T_TEX(TEX_XSCALE_X);
+#endif
        ptes[arm_btop(va)] = npte;
 
        if (pg != NULL) {



Home | Main Index | Thread Index | Old Index