Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm32/riscpc Changed the way in which virtual addre...



details:   https://anonhg.NetBSD.org/src/rev/5fb6e56393f8
branches:  trunk
changeset: 471627:5fb6e56393f8
user:      mark <mark%NetBSD.org@localhost>
date:      Tue Apr 06 06:57:00 1999 +0000

description:
Changed the way in which virtual address space is reserved for the SA110
fast cache clean area as the recent pmap changes mean that the existing
approach no longer works. Fixes PR7272.

diffstat:

 sys/arch/arm32/riscpc/rpc_machdep.c |  36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diffs (77 lines):

diff -r b33d535af1d4 -r 5fb6e56393f8 sys/arch/arm32/riscpc/rpc_machdep.c
--- a/sys/arch/arm32/riscpc/rpc_machdep.c       Tue Apr 06 06:35:03 1999 +0000
+++ b/sys/arch/arm32/riscpc/rpc_machdep.c       Tue Apr 06 06:57:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc_machdep.c,v 1.26 1999/03/29 10:02:20 mycroft Exp $ */
+/*     $NetBSD: rpc_machdep.c,v 1.27 1999/04/06 06:57:00 mark Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -63,6 +63,7 @@
 #include <ddb/db_extern.h>
 
 #include <vm/vm_kern.h>
+#include <uvm/uvm.h>
 
 #include <machine/signal.h>
 #include <machine/frame.h>
@@ -153,6 +154,11 @@
 
 extern int cold;
 
+#ifdef CPU_SA110
+#define CPU_SA110_CACHE_CLEAN_SIZE (0x4000 * 2)
+static vaddr_t sa110_cc_base;
+#endif /* CPU_SA110 */
+
 /* Prototypes */
 
 void physcon_display_base      __P((u_int addr));
@@ -812,6 +818,17 @@
 
        alloc_pages(msgbufphys, round_page(MSGBUFSIZE) / NBPG);
 
+#ifdef CPU_SA110
+       /*
+        * XXX totally stuffed hack to work round problems introduced
+        * in recent versions of the pmap code. Due to the calls used there
+        * we cannot allocate virtual memory during bootstrap.
+        */
+       sa110_cc_base = (KERNEL_BASE + (physical_freestart - physical_start)
+           + (CPU_SA110_CACHE_CLEAN_SIZE - 1))
+           & ~(CPU_SA110_CACHE_CLEAN_SIZE - 1);
+#endif /* CPU_SA110 */
+
        /*
         * Ok we have allocated physical pages for the primary kernel
         * page tables
@@ -1332,24 +1349,17 @@
 void
 rpc_sa110_cc_setup(void)
 {
-       vm_offset_t addr;
-       int cleanarea;
        int loop;
        vm_offset_t kaddr;
        pt_entry_t *pte;
-       extern vm_offset_t virtual_start;
 
-       cleanarea = 0x4000 * 2;
-       addr = (virtual_start + (cleanarea - 1)) & ~(cleanarea - 1);
-       virtual_start = addr + cleanarea;
-
-       kaddr = pmap_extract(kernel_pmap, 0xf0000000);
-       for (loop = 0; loop < cleanarea; loop += NBPG) {
-               pte = pmap_pte(kernel_pmap, (addr + loop));
+       kaddr = pmap_extract(kernel_pmap, KERNEL_TEXT_BASE);
+       for (loop = 0; loop < CPU_SA110_CACHE_CLEAN_SIZE; loop += NBPG) {
+               pte = pmap_pte(kernel_pmap, (sa110_cc_base + loop));
                *pte = L2_PTE(kaddr, AP_KR);
        }
-       sa110_cache_clean_addr = addr;
-       sa110_cache_clean_size = cleanarea / 2;
+       sa110_cache_clean_addr = sa110_cc_base;
+       sa110_cache_clean_size = CPU_SA110_CACHE_CLEAN_SIZE / 2;
 }
 #endif /* CPU_SA110 */
 



Home | Main Index | Thread Index | Old Index