Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc srmmu_vcache_flush_page/range: cover th...



details:   https://anonhg.NetBSD.org/src/rev/51e45410aa2a
branches:  trunk
changeset: 565723:51e45410aa2a
user:      pk <pk%NetBSD.org@localhost>
date:      Sun Apr 18 21:49:09 2004 +0000

description:
srmmu_vcache_flush_page/range: cover the case where we're called during
bootstrap before the cache parameters are setup.

diffstat:

 sys/arch/sparc/sparc/cache.c |  20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diffs (49 lines):

diff -r 8e5acdcf7b80 -r 51e45410aa2a sys/arch/sparc/sparc/cache.c
--- a/sys/arch/sparc/sparc/cache.c      Sun Apr 18 21:48:15 2004 +0000
+++ b/sys/arch/sparc/sparc/cache.c      Sun Apr 18 21:49:09 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cache.c,v 1.87 2004/04/18 20:46:39 pk Exp $ */
+/*     $NetBSD: cache.c,v 1.88 2004/04/18 21:49:09 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.87 2004/04/18 20:46:39 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.88 2004/04/18 21:49:09 pk Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_sparc_arch.h"
@@ -671,7 +671,13 @@
 
        cachestats.cs_npgflush++;
        p = (char *)va;
-       ls = CACHEINFO.c_linesize;
+
+       /*
+        * XXX - if called early during bootstrap, we don't have the cache
+        *       info yet. Make up a cache line size (double-word aligned)
+        */
+       if ((ls = CACHEINFO.c_linesize) == 0)
+               ls = 8;
        i = PAGE_SIZE;
        octx = getcontext4m();
        trapoff();
@@ -709,8 +715,14 @@
        char *p;
        int octx;
 
+       /*
+        * XXX - if called early during bootstrap, we don't have the cache
+        *       info yet. Make up a cache line size (double-word aligned)
+        */
+       if ((ls = CACHEINFO.c_linesize) == 0)
+               ls = 8;
+
        /* Compute # of cache lines covered by this range */
-       ls = CACHEINFO.c_linesize;
        offset = va & (ls - 1);
        i = len + offset;
        p = (char *)(va & ~(ls - 1));



Home | Main Index | Thread Index | Old Index