Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips/rmixl Fix few problems in evbmips/rmixl:



details:   https://anonhg.NetBSD.org/src/rev/0210f4150fe1
branches:  trunk
changeset: 750200:0210f4150fe1
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Dec 20 04:11:37 2009 +0000

description:
Fix few problems in evbmips/rmixl:
- mach_init: use mips_init_lwp0_uarea(), do not hardcode it.  Do not call
  ksyms_init(), it's called in MI.  Also, avoid struct user in few places.
- findroot: use deviter interface.

diffstat:

 sys/arch/evbmips/rmixl/autoconf.c |  26 +++++++++++++-------------
 sys/arch/evbmips/rmixl/machdep.c  |  35 +++++++----------------------------
 2 files changed, 20 insertions(+), 41 deletions(-)

diffs (143 lines):

diff -r 22ac3846ff7d -r 0210f4150fe1 sys/arch/evbmips/rmixl/autoconf.c
--- a/sys/arch/evbmips/rmixl/autoconf.c Sun Dec 20 03:53:46 2009 +0000
+++ b/sys/arch/evbmips/rmixl/autoconf.c Sun Dec 20 04:11:37 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.2 2009/12/14 00:46:02 matt Exp $        */
+/*     $NetBSD: autoconf.c,v 1.3 2009/12/20 04:11:37 rmind Exp $       */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2009/12/14 00:46:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2009/12/20 04:11:37 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -83,31 +83,31 @@
 static void
 findroot(void)
 {
-       struct device *dv;
+       device_t dv;
+       deviter_t di;
 
        if (booted_device)
                return;
 
-       if ((booted_device == NULL) && netboot == 0)
-               for (dv = TAILQ_FIRST(&alldevs); dv != NULL;
-                    dv = TAILQ_NEXT(dv, dv_list))
+       if ((booted_device == NULL) && netboot == 0) {
+               for (dv = deviter_first(&di, DEVITER_F_ROOT_FIRST); dv != NULL;
+                   dv = deviter_next(&di)) {
                        if (device_class(dv) == DV_DISK &&
                            device_is_a(dv, "wd"))
-                                   booted_device = dv;
-
+                               booted_device = dv;
+               }
+               deviter_release(&di);
+       }
        /*
         * XXX Match up MBR boot specification with BSD disklabel for root?
         */
        booted_partition = 0;
-
-       return;
 }
 
 void
-device_register(dev, aux)
-       struct device *dev;
-       void *aux;
+device_register(struct device *dev, void *aux)
 {
+
        if ((booted_device == NULL) && (netboot == 1))
                if (device_class(dev) == DV_IFNET)
                        booted_device = dev;
diff -r 22ac3846ff7d -r 0210f4150fe1 sys/arch/evbmips/rmixl/machdep.c
--- a/sys/arch/evbmips/rmixl/machdep.c  Sun Dec 20 03:53:46 2009 +0000
+++ b/sys/arch/evbmips/rmixl/machdep.c  Sun Dec 20 04:11:37 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.2 2009/12/14 00:46:03 matt Exp $ */
+/*     $NetBSD: machdep.c,v 1.3 2009/12/20 04:11:37 rmind Exp $        */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2009/12/14 00:46:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.3 2009/12/20 04:11:37 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_com.h"
@@ -124,7 +124,6 @@
 #include <sys/kernel.h>
 #include <sys/buf.h>
 #include <sys/reboot.h>
-#include <sys/user.h>
 #include <sys/mount.h>
 #include <sys/kcore.h>
 #include <sys/boot_flag.h>
@@ -268,7 +267,7 @@
 mach_init(int argc, int32_t *argv, void *envp, int64_t infop)
 {
        struct rmixl_config *rcp = &rmixl_configuration;
-       void *kernend, *v;
+       void *kernend;
        u_long memsize;
        u_int vm_cluster_cnt;
        uint32_t r;
@@ -402,27 +401,9 @@
        pmap_bootstrap();
 
        /*
-        * Allocate space for proc0's USPACE.
+        * Allocate uarea page for lwp0 and set it.
         */
-       v = (void *)uvm_pageboot_alloc(USPACE); 
-       lwp0.l_addr = proc0paddr = (struct user *)v;
-       lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
-#ifdef _LP64
-        lwp0.l_md.md_regs->f_regs[_R_SR] = MIPS_SR_KX;
-#endif
-        proc0paddr->u_pcb.pcb_context.val[_L_SR] =
-#ifdef _LP64
-            MIPS_SR_KX |
-#endif  
-            MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
-
-
-       /*
-        * Initialize debuggers, and break into them, if appropriate.
-        */
-#if NKSYMS || defined(DDB) || defined(LKM)
-       ksyms_init(0, 0, 0);
-#endif
+       mips_init_lwp0_uarea();
 
 #if defined(DDB)
        if (boothowto & RB_KDB)
@@ -844,14 +825,12 @@
 int    waittime = -1;
 
 void
-cpu_reboot(howto, bootstr)
-       int howto;
-       char *bootstr;
+cpu_reboot(int howto, char *bootstr)
 {
 
        /* Take a snapshot before clobbering any registers. */
        if (curproc)
-               savectx((struct user *)curpcb);
+               savectx(curpcb);
 
        if (cold) {
                howto |= RB_HALT;



Home | Main Index | Thread Index | Old Index