Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbsh3/evbsh3 adapt to new pmap.



details:   https://anonhg.NetBSD.org/src/rev/4f021ca4eef6
branches:  trunk
changeset: 526740:4f021ca4eef6
user:      uch <uch%NetBSD.org@localhost>
date:      Thu May 09 12:34:53 2002 +0000

description:
adapt to new pmap.

diffstat:

 sys/arch/evbsh3/evbsh3/machdep.c |  63 +++++++++++++++------------------------
 1 files changed, 24 insertions(+), 39 deletions(-)

diffs (127 lines):

diff -r c661604fa219 -r 4f021ca4eef6 sys/arch/evbsh3/evbsh3/machdep.c
--- a/sys/arch/evbsh3/evbsh3/machdep.c  Thu May 09 12:34:20 2002 +0000
+++ b/sys/arch/evbsh3/evbsh3/machdep.c  Thu May 09 12:34:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.40 2002/03/24 18:21:16 uch Exp $ */
+/*     $NetBSD: machdep.c,v 1.41 2002/05/09 12:34:53 uch Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -77,7 +77,6 @@
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
-#include "opt_syscall_debug.h"
 #include "opt_memsize.h"
 #include "opt_initbsc.h"
 
@@ -88,7 +87,6 @@
 #include <sys/mount.h>
 #include <sys/reboot.h>
 #include <sys/sysctl.h>
-#include <sys/msgbuf.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -112,12 +110,6 @@
 char machine[] = MACHINE;              /* evbsh3 */
 char machine_arch[] = MACHINE_ARCH;    /* sh3eb or sh3el */
 
-paddr_t msgbuf_paddr;
-extern paddr_t avail_start, avail_end;
-extern char start[], etext[], edata[], end[];
-
-#define IOM_RAM_END    ((paddr_t)IOM_RAM_BEGIN + IOM_RAM_SIZE - 1)
-
 void initSH3 __P((void *));
 void LoadAndReset __P((char *));
 void XLoadAndReset __P((char *));
@@ -228,8 +220,8 @@
 void
 initSH3(void *pc)      /* XXX return address */
 {
+       extern char edata[], end[];
        vaddr_t kernend;
-       vsize_t sz;
 
        /* Clear bss */
        memset(edata, 0, end - edata);
@@ -262,39 +254,35 @@
 #else
 #error "define SH3 or SH4"
 #endif
-
-       /* Initialize proc0 and enable MMU. */
-       kernend = sh3_round_page(end);
-       sz = sh_proc0_init(kernend, IOM_RAM_BEGIN, IOM_RAM_END);
+       /* Console */
+       consinit();
 
-       /* Number of pages of physmem addr space */
-       physmem = atop(IOM_RAM_END - IOM_RAM_BEGIN + 1);
+       /* Load memory to UVM */
+       kernend = atop(round_page(SH3_P1SEG_TO_PHYS(end)));
+       physmem = atop(IOM_RAM_SIZE);
+       uvm_page_physload(
+               kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
+               kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
+               VM_FREELIST_DEFAULT);
 
-       /* avail_start is first available physical memory address */
-       avail_start = kernend + sz;
-       avail_end = IOM_RAM_END + 1;
+       /* Initialize proc0 u-area */
+       sh_proc0_init();
 
-       consinit();
+       /* Initialize pmap and start to address translation */
+       pmap_bootstrap();
+
 #ifdef DDB
        ddb_init(0, NULL, NULL);
 #endif
 
-       /* Call pmap initialization to make new kernel address space */
-       pmap_bootstrap(VM_MIN_KERNEL_ADDRESS);
-
-       /*
-        * Initialize error message buffer (at end of core).
-        */
-       initmsgbuf((caddr_t)msgbuf_paddr, round_page(MSGBUFSIZE));
-
        /*
         * XXX We can't return here, because we change stack pointer.
         *     So jump to return address directly.
         */
-
        __asm __volatile (
                "jmp    @%0;"
-               "mov    %1, r15" :: "r"(pc), "r"(proc0.p_addr->u_pcb.pcb_sp));
+               "mov    %1, r15"
+               :: "r"(pc),"r"(proc0.p_md.md_pcb->pcb_sf.sf_r7_bank));
 }
 
 /*
@@ -479,16 +467,13 @@
 #undef MODE
 
        for (; pa < endpa; pa += NBPG, va += NBPG) {
-               pmap_enter(pmap_kernel(), va, pa,
-                   VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
+               pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
+               pte = __pmap_kpte_lookup(va);
+               KDASSERT(pte);
+               *pte |= m;  /* PTEA PCMCIA assistant bit */
+               sh_tlb_update(0, va, *pte);
+       }
 
-               pte = kvtopte(va);
-               *pte &= ~PG_N;
-               *pte |= m;
-               pmap_update_pg(va);
-       }
-       pmap_update(pmap_kernel());
- 
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index