Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/m68k Add a common pmap_bootstrap_finalize() functio...



details:   https://anonhg.NetBSD.org/src/rev/8c23637ada0c
branches:  trunk
changeset: 749566:8c23637ada0c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Dec 02 15:47:45 2009 +0000

description:
Add a common pmap_bootstrap_finalize() function which initializes
lwp0 uarea, curlwp, and curpcb after MMU is turned on, using
lwp0uarea variable saved during pmap_bootstrap() (or equivalent functions)
for pmap_motorola based ports.  Discussed with rmind@.

diffstat:

 sys/arch/m68k/include/pcb.h           |   5 ++++-
 sys/arch/m68k/include/pmap_motorola.h |   6 +++++-
 sys/arch/m68k/m68k/pmap_motorola.c    |  22 ++++++++++++++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)

diffs (87 lines):

diff -r 8f1c082fa412 -r 8c23637ada0c sys/arch/m68k/include/pcb.h
--- a/sys/arch/m68k/include/pcb.h       Wed Dec 02 15:21:37 2009 +0000
+++ b/sys/arch/m68k/include/pcb.h       Wed Dec 02 15:47:45 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcb.h,v 1.7 2007/03/04 06:00:04 christos Exp $ */
+/*     $NetBSD: pcb.h,v 1.8 2009/12/02 15:47:45 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -105,4 +105,7 @@
 struct md_coredump {
        int     md_exec[16];    /* exec structure for HP-UX core dumps */
 };
+
+extern struct pcb *curpcb;
+
 #endif /* _M68K_PCB_H_ */
diff -r 8f1c082fa412 -r 8c23637ada0c sys/arch/m68k/include/pmap_motorola.h
--- a/sys/arch/m68k/include/pmap_motorola.h     Wed Dec 02 15:21:37 2009 +0000
+++ b/sys/arch/m68k/include/pmap_motorola.h     Wed Dec 02 15:47:45 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_motorola.h,v 1.21 2009/08/26 00:30:02 thorpej Exp $       */
+/*     $NetBSD: pmap_motorola.h,v 1.22 2009/12/02 15:47:45 tsutsui Exp $       */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -191,6 +191,10 @@
 extern void            *CADDR1, *CADDR2;
 extern void            *msgbufaddr;
 
+/* for lwp0 uarea initialization after MMU enabled */
+extern vaddr_t         lwp0uarea;
+void   pmap_bootstrap_finalize(void);
+
 vaddr_t        pmap_map(vaddr_t, paddr_t, paddr_t, int);
 void   pmap_procwr(struct proc *, vaddr_t, size_t);
 #define        PMAP_NEED_PROCWR
diff -r 8f1c082fa412 -r 8c23637ada0c sys/arch/m68k/m68k/pmap_motorola.c
--- a/sys/arch/m68k/m68k/pmap_motorola.c        Wed Dec 02 15:21:37 2009 +0000
+++ b/sys/arch/m68k/m68k/pmap_motorola.c        Wed Dec 02 15:47:45 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_motorola.c,v 1.51 2009/11/23 00:11:44 rmind Exp $        */
+/*     $NetBSD: pmap_motorola.c,v 1.52 2009/12/02 15:47:45 tsutsui Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.51 2009/11/23 00:11:44 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.52 2009/12/02 15:47:45 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -240,6 +240,8 @@
 struct vm_map  *st_map, *pt_map;
 struct vm_map_kernel st_map_store, pt_map_store;
 
+vaddr_t                lwp0uarea;      /* lwp0 u-area VA, initialized in bootstrap */
+
 paddr_t                avail_start;    /* PA of first available physical page */
 paddr_t                avail_end;      /* PA of last available physical page */
 vsize_t                mem_size;       /* memory size in bytes */
@@ -314,6 +316,22 @@
 #define        PRM_KEEPPTPAGE  0x04
 
 /*
+ * pmap_bootstrap_finalize:    [ INTERFACE ]
+ *
+ *     Initialize lwp0 uarea, curlwp, and curpcb after MMU is turned on,
+ *     using lwp0uarea variable saved during pmap_bootstrap().
+ */
+void
+pmap_bootstrap_finalize(void)
+{
+
+       memset((void *)lwp0uarea, 0, USPACE);
+       uvm_lwp_setuarea(&lwp0, lwp0uarea);
+       curlwp = &lwp0;
+       curpcb = lwp_getpcb(&lwp0);
+}
+
+/*
  * pmap_virtual_space:         [ INTERFACE ]
  *
  *     Report the range of available kernel virtual address



Home | Main Index | Thread Index | Old Index