Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/c9de00b718fd
branches:  trunk
changeset: 526738:c9de00b718fd
user:      uch <uch%NetBSD.org@localhost>
date:      Thu May 09 12:33:18 2002 +0000

description:
adapt to new pmap.

diffstat:

 sys/arch/dreamcast/dreamcast/machdep.c |  55 ++++++++++++++-------------------
 1 files changed, 23 insertions(+), 32 deletions(-)

diffs (110 lines):

diff -r b61ab0e0e0a5 -r c9de00b718fd sys/arch/dreamcast/dreamcast/machdep.c
--- a/sys/arch/dreamcast/dreamcast/machdep.c    Thu May 09 12:32:55 2002 +0000
+++ b/sys/arch/dreamcast/dreamcast/machdep.c    Thu May 09 12:33:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.19 2002/03/24 18:21:10 uch Exp $ */
+/*     $NetBSD: machdep.c,v 1.20 2002/05/09 12:33:18 uch Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@@ -87,7 +87,6 @@
 #include <sys/mount.h>
 #include <sys/reboot.h>
 #include <sys/sysctl.h>
-#include <sys/msgbuf.h>
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -108,21 +107,14 @@
 char machine[] = MACHINE;              /* dreamcast */
 char machine_arch[] = MACHINE_ARCH;    /* 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 main(void) __attribute__((__noreturn__));
 void dreamcast_startup(void) __attribute__((__noreturn__));
 
 void
 dreamcast_startup()
 {
-       vaddr_t kernend;
-       vsize_t sz;
+       extern char edata[], end[];
+       paddr_t kernend;
 
        /* Clear bss */
        memset(edata, 0, end - edata);
@@ -130,40 +122,39 @@
        /* Initialize CPU ops. */
        sh_cpu_init(CPU_ARCH_SH4, CPU_PRODUCT_7750);
 
-       /* 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 */
+       physmem = atop(IOM_RAM_SIZE);
+       kernend = atop(round_page(SH3_P1SEG_TO_PHYS(end)));
+       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();
+
+       /* Debugger. */
 #ifdef DDB
        ddb_init(0, NULL, NULL);
 #endif
-#if defined(KGDB) && NSCIF > 0
+#if defined(KGDB) && (NSCIF > 0)
        if (scif_kgdb_init() == 0) {
                kgdb_debug_init = 1;
                kgdb_connect(1);
        }
 #endif /* KGDB && NSCIF > 0 */
 
-       /* 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));
-
-       /* jump to main */
+       /* Jump to main */
        __asm__ __volatile__(
                "jmp    @%0;"
-               "mov    %1, sp" :: "r"(main), "r"(proc0.p_addr->u_pcb.pcb_sp));
+               "mov    %1, sp"
+               :: "r"(main),"r"(proc0.p_md.md_pcb->pcb_sf.sf_r7_bank));
        /* NOTREACHED */
        while (1)
                ;
@@ -264,7 +255,7 @@
 
        ih = EVTCODE_IH(evtcode);
        KDASSERT(ih->ih_func);
-       /* 
+       /*
         * On entry, all interrrupts are disabled, and exception is enabled.
         * Enable higher level interrupt here.
         */



Home | Main Index | Thread Index | Old Index