Source-Changes-HG archive

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

[src/trunk]: src/sys Make common kernel module binaries work on both sun3 and...



details:   https://anonhg.NetBSD.org/src/rev/1d8f7ee4d5e4
branches:  trunk
changeset: 758046:1d8f7ee4d5e4
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Oct 15 15:55:52 2010 +0000

description:
Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?

diffstat:

 sys/arch/sun3/include/param.h     |  19 +++++++++---
 sys/arch/sun3/include/param3.h    |  10 ++----
 sys/arch/sun3/include/param3x.h   |  10 ++----
 sys/arch/sun3/include/vmparam.h   |  25 ++++++++++------
 sys/arch/sun3/include/vmparam3.h  |  12 +-------
 sys/arch/sun3/include/vmparam3x.h |  12 +-------
 sys/arch/sun3/sun3/genassym.cf    |   6 ++--
 sys/arch/sun3/sun3/locore.s       |   8 ++--
 sys/arch/sun3/sun3/locore2.c      |   6 ++--
 sys/arch/sun3/sun3/machdep.c      |  25 +++++++++++++---
 sys/arch/sun3/sun3/mem.c          |   6 ++--
 sys/arch/sun3/sun3/pmap.c         |  14 ++++----
 sys/arch/sun3/sun3x/genassym.cf   |   6 ++--
 sys/arch/sun3/sun3x/locore.s      |   8 ++--
 sys/arch/sun3/sun3x/machdep.c     |  23 ++++++++++++--
 sys/arch/sun3/sun3x/mem.c         |   6 ++--
 sys/arch/sun3/sun3x/pmap.c        |  58 +++++++++++++++++++-------------------
 sys/rump/librump/rumpkern/emul.c  |   9 +++--
 sys/uvm/uvm_readahead.c           |   8 ++--
 19 files changed, 145 insertions(+), 126 deletions(-)

diffs (truncated from 897 to 300 lines):

diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/param.h
--- a/sys/arch/sun3/include/param.h     Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/param.h     Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.h,v 1.57 2005/12/11 12:19:21 christos Exp $      */
+/*     $NetBSD: param.h,v 1.58 2010/10/15 15:55:52 tsutsui Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -86,6 +86,9 @@
 
 #define        PGSHIFT         13              /* LOG2(NBPG) */
 
+#define        MAXBSIZE        0x8000          /* max FS block size */
+#define        MAXPHYS         0xe000          /* XXX: sun3 DMA can't handle 64KB? */
+
 #ifdef MSGBUFSIZE
 #error "MSGBUFSIZE is not user-adjustable for this arch"
 #endif
@@ -95,14 +98,17 @@
 /* This is needed by ps (actually USPACE). */
 #define        UPAGES          2               /* pages of u-area */
 
-#if defined(_KERNEL) || defined(_STANDALONE)
 #ifdef _SUN3_
-#include <arch/sun3/include/param3.h>
+#include <machine/param3.h>
 #endif /* SUN3 */
 #ifdef _SUN3X_
-#include <arch/sun3/include/param3x.h>
+#include <machine/param3x.h>
 #endif /* SUN3X */
-#endif /* _KERNEL */
+
+/* default for rump etc. */
+#if !defined(_SUN3_) && !defined(_SUN3X_)
+#include <machine/param3.h>
+#endif
 
 #include <m68k/param.h>
 
@@ -117,6 +123,9 @@
 
 #include <machine/intr.h>
 
+extern const vaddr_t kernbase;
+extern const vaddr_t kern_end;
+
 extern void _delay(unsigned);
 #define delay(us)      _delay((us)<<8)
 #define        DELAY(n)        delay(n)
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/param3.h
--- a/sys/arch/sun3/include/param3.h    Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/param3.h    Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param3.h,v 1.52 2009/12/11 13:52:57 tsutsui Exp $      */
+/*     $NetBSD: param3.h,v 1.53 2010/10/15 15:55:52 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,9 +78,5 @@
  * Machine dependent constants for the Sun3 series.
  */
 
-#define        KERNBASE        0x0E000000      /* start of kernel virtual */
-#define        KERNTEXTOFF     0x0E004000      /* start of kernel text */
-#define        KERN_END        0x0FE00000      /* end of kernel virtual */
-
-#define        MAXBSIZE        0x8000          /* max FS block size */
-#define        MAXPHYS         0xe000
+#define        KERNBASE3       0x0E000000      /* start of kernel virtual */
+#define        KERN_END3       0x0FE00000      /* end of kernel virtual */
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/param3x.h
--- a/sys/arch/sun3/include/param3x.h   Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/param3x.h   Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param3x.h,v 1.15 2009/12/11 13:52:57 tsutsui Exp $     */
+/*     $NetBSD: param3x.h,v 1.16 2010/10/15 15:55:52 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,9 +78,5 @@
  * Machine dependent constants for the Sun3X series.
  */
 
-#define        KERNBASE        0xF8000000      /* start of kernel virtual */
-#define        KERNTEXTOFF     0xF8004000      /* start of kernel text */
-#define        KERN_END        0xFE000000      /* end of kernel virtual */
-
-#define        MAXBSIZE        0x8000          /* max FS block size */
-
+#define        KERNBASE3X      0xF8000000      /* start of kernel virtual */
+#define        KERN_END3X      0xFE000000      /* end of kernel virtual */
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/vmparam.h
--- a/sys/arch/sun3/include/vmparam.h   Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/vmparam.h   Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.34 2010/04/30 13:48:55 pooka Exp $       */
+/*     $NetBSD: vmparam.h,v 1.35 2010/10/15 15:55:52 tsutsui Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,9 @@
 #define        PAGE_SIZE       (1 << PAGE_SHIFT)
 #define        PAGE_MASK       (PAGE_SIZE - 1)
 
-#define        USRSTACK        KERNBASE
+#define        USRSTACK        kernbase        /* for modules */
+#define        USRSTACK3       KERNBASE3       /* for asm not in modules */
+#define        USRSTACK3X      KERNBASE3X
 
 #ifdef _SUN3_
 #include <machine/vmparam3.h>
@@ -51,9 +53,14 @@
 #include <machine/vmparam3.h>
 #endif
 
-/* XXX: this makes modules *compile* */
-#ifdef _MODULE
-extern char KERNBASE[];
+/*
+ * PTEs for mapping user space into the kernel for phyio operations.
+ * The actual limitation for physio requests will be the DVMA space,
+ * and that is fixed by hardware design at 1MB.  We could make the
+ * physio map larger than that, but it would not buy us much.
+ */
+#ifndef USRIOSIZE
+#define USRIOSIZE      128             /* 1 MB */
 #endif
 
 /* This is needed by some LKMs. */
@@ -65,10 +72,10 @@
 
 /* user/kernel map constants */
 #define VM_MIN_ADDRESS         ((vaddr_t)0)
-#define VM_MAX_ADDRESS         ((vaddr_t)KERNBASE)
-#define VM_MAXUSER_ADDRESS     ((vaddr_t)KERNBASE)
-#define VM_MIN_KERNEL_ADDRESS  ((vaddr_t)KERNBASE)
-#define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)KERN_END)
+#define VM_MAX_ADDRESS         kernbase
+#define VM_MAXUSER_ADDRESS     kernbase
+#define VM_MIN_KERNEL_ADDRESS  kernbase
+#define VM_MAX_KERNEL_ADDRESS  kern_end
 
 /* virtual sizes (bytes) for various kernel submaps */
 #define VM_PHYS_SIZE           (USRIOSIZE*PAGE_SIZE)
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/vmparam3.h
--- a/sys/arch/sun3/include/vmparam3.h  Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/vmparam3.h  Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam3.h,v 1.36 2010/04/30 13:48:55 pooka Exp $      */
+/*     $NetBSD: vmparam3.h,v 1.37 2010/10/15 15:55:52 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -112,14 +112,4 @@
 #define        MAXSSIZ         MAXDSIZ                 /* max stack size */
 #endif
 
-/*
- * PTEs for mapping user space into the kernel for phyio operations.
- * The actual limitation for physio requests will be the DVMA space,
- * and that is fixed by hardware design at 1MB.  We could make the
- * physio map larger than that, but it would not buy us much.
- */
-#ifndef USRIOSIZE
-#define USRIOSIZE      128             /* 1 MB */
-#endif
-
 #define        PAGER_MAP_DEFAULT_SIZE (4 * 1024 * 1024)
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/include/vmparam3x.h
--- a/sys/arch/sun3/include/vmparam3x.h Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/include/vmparam3x.h Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam3x.h,v 1.20 2010/04/30 13:48:55 pooka Exp $     */
+/*     $NetBSD: vmparam3x.h,v 1.21 2010/10/15 15:55:52 tsutsui Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -98,13 +98,3 @@
 #ifndef        MAXSSIZ
 #define        MAXSSIZ         (32*1024*1024)          /* max stack size */
 #endif
-
-/*
- * PTEs for mapping user space into the kernel for phyio operations.
- * The actual limitation for physio requests will be the DVMA space,
- * and that is fixed by hardware design at 1MB.  We could make the
- * physio map larger than that, but it would not buy us much.
- */
-#ifndef USRIOSIZE
-#define USRIOSIZE      128     /* 1 MB */
-#endif
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/sun3/genassym.cf
--- a/sys/arch/sun3/sun3/genassym.cf    Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/sun3/genassym.cf    Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.13 2010/07/07 01:23:08 chs Exp $
+#      $NetBSD: genassym.cf,v 1.14 2010/10/15 15:55:53 tsutsui Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -126,13 +126,13 @@
 define SEGMAP_BASE                     SEGMAP_BASE
 
 # sun3 memory map
-define USRSTACK                        USRSTACK
+define USRSTACK3                       USRSTACK3
 define SUN3_MONSTART                   SUN3_MONSTART
 define SUN3_PROM_BASE                  SUN3_PROM_BASE
 define SUN3_MONEND                     SUN3_MONEND
 
 # kernel-isms
-define KERNBASE                        KERNBASE
+define KERNBASE3                       KERNBASE3
 define USPACE                          USPACE
 define PAGE_SIZE                       PAGE_SIZE
 define NBSG                            NBSG
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/sun3/locore.s
--- a/sys/arch/sun3/sun3/locore.s       Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/sun3/locore.s       Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.92 2010/03/03 06:53:34 skrll Exp $        */
+/*     $NetBSD: locore.s,v 1.93 2010/10/15 15:55:53 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -117,7 +117,7 @@
 | We will unscramble which PMEGs we actually need later.
 
        movl    #(SEGMAP_BASE+0),%a0            | src
-       movl    #(SEGMAP_BASE+KERNBASE),%a1     | dst
+       movl    #(SEGMAP_BASE+KERNBASE3),%a1    | dst
        movl    #(0x400000/NBSG),%d0            | count
 
 L_per_pmeg:
@@ -155,7 +155,7 @@
        lea     _C_LABEL(lwp0),%a0      | lwp0
        movl    %a0@(L_PCB),%a1         | XXXuvm_lwp_getuarea
        lea     %a1@(USPACE-4),%sp      | set SSP to last word
-       movl    #USRSTACK-4,%a2
+       movl    #USRSTACK3-4,%a2
        movl    %a2,%usp                | init user SP
 
 | Note curpcb was already set in _bootstrap().
@@ -789,7 +789,7 @@
 | Not using _C_LABEL() here because these symbols are never
 | referenced by any C code, and if the leading underscore
 | ever goes away, these lines turn into syntax errors...
-       .set    _KERNBASE,KERNBASE
+       .set    _KERNBASE3,KERNBASE3
        .set    _MONSTART,SUN3_MONSTART
        .set    _PROM_BASE,SUN3_PROM_BASE
        .set    _MONEND,SUN3_MONEND
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/sun3/locore2.c
--- a/sys/arch/sun3/sun3/locore2.c      Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/sun3/locore2.c      Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore2.c,v 1.98 2009/11/29 15:13:22 pooka Exp $       */
+/*     $NetBSD: locore2.c,v 1.99 2010/10/15 15:55:53 tsutsui Exp $     */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.98 2009/11/29 15:13:22 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.99 2010/10/15 15:55:53 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -153,7 +153,7 @@
         */
 
        if ((cpu_machine_id == ID_SUN3_50) &&
-           ((vaddr_t)maxsym > (KERNBASE + OBMEM_BW50_ADDR - USPACE))) {
+           ((vaddr_t)maxsym > (KERNBASE3 + OBMEM_BW50_ADDR - USPACE))) {
                mon_printf("_save_symtab: too large for 3/50");
                return;
        }
diff -r f96a1fbe4e1a -r 1d8f7ee4d5e4 sys/arch/sun3/sun3/machdep.c
--- a/sys/arch/sun3/sun3/machdep.c      Fri Oct 15 15:08:05 2010 +0000
+++ b/sys/arch/sun3/sun3/machdep.c      Fri Oct 15 15:55:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.197 2010/02/08 19:02:32 joerg Exp $      */
+/*     $NetBSD: machdep.c,v 1.198 2010/10/15 15:55:53 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.197 2010/02/08 19:02:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.198 2010/10/15 15:55:53 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -106,6 +106,7 @@



Home | Main Index | Thread Index | Old Index