Module Name: src
Committed By: tsutsui
Date: Fri Oct 15 15:55:54 UTC 2010
Modified Files:
src/sys/arch/sun3/include: param.h param3.h param3x.h vmparam.h
vmparam3.h vmparam3x.h
src/sys/arch/sun3/sun3: genassym.cf locore.s locore2.c machdep.c mem.c
pmap.c
src/sys/arch/sun3/sun3x: genassym.cf locore.s machdep.c mem.c pmap.c
src/sys/rump/librump/rumpkern: emul.c
src/sys/uvm: uvm_readahead.c
Log Message:
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?
To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/sun3/include/param.h
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sun3/include/param3.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sun3/include/param3x.h
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sun3/include/vmparam.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sun3/include/vmparam3.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sun3/include/vmparam3x.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sun3/sun3/genassym.cf
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/sun3/sun3/locore2.c
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/sun3/sun3/machdep.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sun3/sun3/mem.c
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/sun3/sun3/pmap.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sun3/sun3x/genassym.cf
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/sun3/sun3x/machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sun3/sun3x/mem.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sun3/sun3x/pmap.c
cvs rdiff -u -r1.145 -r1.146 src/sys/rump/librump/rumpkern/emul.c
cvs rdiff -u -r1.6 -r1.7 src/sys/uvm/uvm_readahead.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sun3/include/param.h
diff -u src/sys/arch/sun3/include/param.h:1.57 src/sys/arch/sun3/include/param.h:1.58
--- src/sys/arch/sun3/include/param.h:1.57 Sun Dec 11 12:19:21 2005
+++ src/sys/arch/sun3/include/param.h Fri Oct 15 15:55:52 2010
@@ -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)
Index: src/sys/arch/sun3/include/param3.h
diff -u src/sys/arch/sun3/include/param3.h:1.52 src/sys/arch/sun3/include/param3.h:1.53
--- src/sys/arch/sun3/include/param3.h:1.52 Fri Dec 11 13:52:57 2009
+++ src/sys/arch/sun3/include/param3.h Fri Oct 15 15:55:52 2010
@@ -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 */
Index: src/sys/arch/sun3/include/param3x.h
diff -u src/sys/arch/sun3/include/param3x.h:1.15 src/sys/arch/sun3/include/param3x.h:1.16
--- src/sys/arch/sun3/include/param3x.h:1.15 Fri Dec 11 13:52:57 2009
+++ src/sys/arch/sun3/include/param3x.h Fri Oct 15 15:55:52 2010
@@ -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 */
Index: src/sys/arch/sun3/include/vmparam.h
diff -u src/sys/arch/sun3/include/vmparam.h:1.34 src/sys/arch/sun3/include/vmparam.h:1.35
--- src/sys/arch/sun3/include/vmparam.h:1.34 Fri Apr 30 13:48:55 2010
+++ src/sys/arch/sun3/include/vmparam.h Fri Oct 15 15:55:52 2010
@@ -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)
Index: src/sys/arch/sun3/include/vmparam3.h
diff -u src/sys/arch/sun3/include/vmparam3.h:1.36 src/sys/arch/sun3/include/vmparam3.h:1.37
--- src/sys/arch/sun3/include/vmparam3.h:1.36 Fri Apr 30 13:48:55 2010
+++ src/sys/arch/sun3/include/vmparam3.h Fri Oct 15 15:55:52 2010
@@ -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)
Index: src/sys/arch/sun3/include/vmparam3x.h
diff -u src/sys/arch/sun3/include/vmparam3x.h:1.20 src/sys/arch/sun3/include/vmparam3x.h:1.21
--- src/sys/arch/sun3/include/vmparam3x.h:1.20 Fri Apr 30 13:48:55 2010
+++ src/sys/arch/sun3/include/vmparam3x.h Fri Oct 15 15:55:52 2010
@@ -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
Index: src/sys/arch/sun3/sun3/genassym.cf
diff -u src/sys/arch/sun3/sun3/genassym.cf:1.13 src/sys/arch/sun3/sun3/genassym.cf:1.14
--- src/sys/arch/sun3/sun3/genassym.cf:1.13 Wed Jul 7 01:23:08 2010
+++ src/sys/arch/sun3/sun3/genassym.cf Fri Oct 15 15:55:53 2010
@@ -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
Index: src/sys/arch/sun3/sun3/locore.s
diff -u src/sys/arch/sun3/sun3/locore.s:1.92 src/sys/arch/sun3/sun3/locore.s:1.93
--- src/sys/arch/sun3/sun3/locore.s:1.92 Wed Mar 3 06:53:34 2010
+++ src/sys/arch/sun3/sun3/locore.s Fri Oct 15 15:55:53 2010
@@ -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
Index: src/sys/arch/sun3/sun3/locore2.c
diff -u src/sys/arch/sun3/sun3/locore2.c:1.98 src/sys/arch/sun3/sun3/locore2.c:1.99
--- src/sys/arch/sun3/sun3/locore2.c:1.98 Sun Nov 29 15:13:22 2009
+++ src/sys/arch/sun3/sun3/locore2.c Fri Oct 15 15:55:53 2010
@@ -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;
}
Index: src/sys/arch/sun3/sun3/machdep.c
diff -u src/sys/arch/sun3/sun3/machdep.c:1.197 src/sys/arch/sun3/sun3/machdep.c:1.198
--- src/sys/arch/sun3/sun3/machdep.c:1.197 Mon Feb 8 19:02:32 2010
+++ src/sys/arch/sun3/sun3/machdep.c Fri Oct 15 15:55:53 2010
@@ -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 @@
#include <sys/vnode.h>
#include <sys/syscallargs.h>
#include <sys/ksyms.h>
+#include <sys/module.h>
#ifdef KGDB
#include <sys/kgdb.h>
#endif
@@ -139,6 +140,10 @@
/* Defined by the linker */
extern char etext[];
+/* kernel_arch specific values required by module(9) */
+const vaddr_t kernbase = KERNBASE3;
+const vaddr_t kern_end = KERN_END3;
+
/* Our exported CPU info; we can have only one. */
struct cpu_info cpu_info_store;
@@ -226,7 +231,7 @@
* Its mapping was prepared in pmap_bootstrap().
* Also, offset some to avoid PROM scribbles.
*/
- v = (char *)KERNBASE;
+ v = (char *)KERNBASE3;
msgbufaddr = v + MSGBUFOFF;
initmsgbuf(msgbufaddr, MSGBUFSIZE);
@@ -625,7 +630,7 @@
/* Fill in cpu_kcore_hdr_t part. */
strncpy(chdr_p->name, kernel_arch, sizeof(chdr_p->name));
chdr_p->page_size = PAGE_SIZE;
- chdr_p->kernbase = KERNBASE;
+ chdr_p->kernbase = KERNBASE3;
/* Fill in the sun3_kcore_hdr part (MMU state). */
pmap_kcore_hdr(sh);
@@ -669,7 +674,7 @@
do {
if ((todo & 0xf) == 0)
printf_nolog("\r%4d", todo);
- vaddr = (char*)(paddr + KERNBASE);
+ vaddr = (char*)(paddr + KERNBASE3);
error = (*dsw->d_dump)(dumpdev, blkno, vaddr, PAGE_SIZE);
if (error)
goto fail;
@@ -731,3 +736,13 @@
{
return ENOEXEC;
}
+
+#ifdef MODULAR
+/*
+ * Push any modules loaded by the bootloader etc.
+ */
+void
+module_init_md(void)
+{
+}
+#endif
Index: src/sys/arch/sun3/sun3/mem.c
diff -u src/sys/arch/sun3/sun3/mem.c:1.51 src/sys/arch/sun3/sun3/mem.c:1.52
--- src/sys/arch/sun3/sun3/mem.c:1.51 Sun Mar 4 14:03:03 2007
+++ src/sys/arch/sun3/sun3/mem.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.51 2007/03/04 14:03:03 tsutsui Exp $ */
+/* $NetBSD: mem.c,v 1.52 2010/10/15 15:55:53 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.51 2007/03/04 14:03:03 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.52 2010/10/15 15:55:53 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -178,7 +178,7 @@
* Also note: unlock done at end of function.
*/
if (v < avail_start) {
- v += KERNBASE;
+ v += KERNBASE3;
goto use_kmem;
}
/* Temporarily map the memory at vmmap. */
Index: src/sys/arch/sun3/sun3/pmap.c
diff -u src/sys/arch/sun3/sun3/pmap.c:1.164 src/sys/arch/sun3/sun3/pmap.c:1.165
--- src/sys/arch/sun3/sun3/pmap.c:1.164 Fri Dec 11 13:52:57 2009
+++ src/sys/arch/sun3/sun3/pmap.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.164 2009/12/11 13:52:57 tsutsui Exp $ */
+/* $NetBSD: pmap.c,v 1.165 2010/10/15 15:55:53 tsutsui Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.164 2009/12/11 13:52:57 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.165 2010/10/15 15:55:53 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@@ -132,7 +132,7 @@
#define DVMA_MAP_END (DVMA_MAP_BASE + DVMA_MAP_AVAIL)
/* User segments from 0 to KERNBASE */
-#define NUSEG (KERNBASE / NBSG)
+#define NUSEG (KERNBASE3 / NBSG)
/* The remainder are kernel segments. */
#define NKSEG (NSEGMAP - NUSEG)
@@ -1523,7 +1523,7 @@
* Determine the range of physical memory available.
* Physical memory at zero was remapped to KERNBASE.
*/
- avail_start = nextva - KERNBASE;
+ avail_start = nextva - KERNBASE3;
if (rvec->romvecVersion < 1) {
mon_printf("Warning: ancient PROM version=%d\n",
rvec->romvecVersion);
@@ -1575,7 +1575,7 @@
* Unmap user virtual segments.
* VA range: [0 .. KERNBASE]
*/
- for (va = 0; va < KERNBASE; va += NBSG)
+ for (va = 0; va < KERNBASE3; va += NBSG)
set_segmap(va, SEGINV);
/*
@@ -1641,7 +1641,7 @@
* (physical address zero) so its contents will be
* preserved through a reboot.
*/
- va = KERNBASE;
+ va = KERNBASE3;
pte = get_pte(va);
pte |= (PG_SYSTEM | PG_WRITE | PG_NC);
set_pte(va, pte);
@@ -3654,7 +3654,7 @@
sh->pg_valid = PG_VALID;
/* Copy the kernel segmap (256 bytes). */
- va = KERNBASE;
+ va = KERNBASE3;
cp = sh->ksegmap;
ep = cp + sizeof(sh->ksegmap);
do {
Index: src/sys/arch/sun3/sun3x/genassym.cf
diff -u src/sys/arch/sun3/sun3x/genassym.cf:1.12 src/sys/arch/sun3/sun3x/genassym.cf:1.13
--- src/sys/arch/sun3/sun3x/genassym.cf:1.12 Wed Jul 7 01:23:08 2010
+++ src/sys/arch/sun3/sun3x/genassym.cf Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.12 2010/07/07 01:23:08 chs Exp $
+# $NetBSD: genassym.cf,v 1.13 2010/10/15 15:55:53 tsutsui Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -119,13 +119,13 @@
define CACHE_CLR CACHE_CLR
# sun3 memory map
-define USRSTACK USRSTACK
+define USRSTACK3X USRSTACK3X
define SUN3X_MONSTART SUN3X_MONSTART
define SUN3X_PROM_BASE SUN3X_PROM_BASE
define SUN3X_MONEND SUN3X_MONEND
# kernel-isms
-define KERNBASE KERNBASE
+define KERNBASE3X KERNBASE3X
define USPACE USPACE
define PAGE_SIZE PAGE_SIZE
Index: src/sys/arch/sun3/sun3x/locore.s
diff -u src/sys/arch/sun3/sun3x/locore.s:1.60 src/sys/arch/sun3/sun3x/locore.s:1.61
--- src/sys/arch/sun3/sun3x/locore.s:1.60 Thu Feb 25 07:21:20 2010
+++ src/sys/arch/sun3/sun3x/locore.s Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.60 2010/02/25 07:21:20 skrll Exp $ */
+/* $NetBSD: locore.s,v 1.61 2010/10/15 15:55:53 tsutsui Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -112,7 +112,7 @@
| boot loader has loaded us into low memory but all the symbols in this
| code have been linked high.
movw #PSL_HIGHIPL,%sr | no interrupts
- movl #KERNBASE,%a5 | for vtop conversion
+ movl #KERNBASE3X,%a5 | for vtop conversion
lea _C_LABEL(mon_crp),%a0 | where to store the CRP
subl %a5,%a0
| Note: borrowing mon_crp for tt0 setup...
@@ -169,7 +169,7 @@
lea _C_LABEL(lwp0),%a0 | get lwp0
movl %a0@(L_PCB),%a1 | XXXuvm_lwp_getuarea
lea %a1@(USPACE-4),%sp | set SSP to last word
- movl #USRSTACK-4,%a2
+ movl #USRSTACK3X-4,%a2
movl %a2,%usp | init user SP
| Note curpcb was already set in _bootstrap().
@@ -800,7 +800,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 _KERNBASE3X,KERNBASE3X
.set _MONSTART,SUN3X_MONSTART
.set _PROM_BASE,SUN3X_PROM_BASE
.set _MONEND,SUN3X_MONEND
Index: src/sys/arch/sun3/sun3x/machdep.c
diff -u src/sys/arch/sun3/sun3x/machdep.c:1.123 src/sys/arch/sun3/sun3x/machdep.c:1.124
--- src/sys/arch/sun3/sun3x/machdep.c:1.123 Mon Feb 8 19:02:32 2010
+++ src/sys/arch/sun3/sun3x/machdep.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.123 2010/02/08 19:02:32 joerg Exp $ */
+/* $NetBSD: machdep.c,v 1.124 2010/10/15 15:55:53 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.123 2010/02/08 19:02:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.124 2010/10/15 15:55:53 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -103,6 +103,7 @@
#include <sys/vnode.h>
#include <sys/syscallargs.h>
#include <sys/ksyms.h>
+#include <sys/module.h>
#ifdef KGDB
#include <sys/kgdb.h>
#endif
@@ -136,6 +137,10 @@
/* Defined by the linker */
extern char etext[];
+/* kernel_arch specific values required by module(9) */
+const vaddr_t kernbase = KERNBASE3X;
+const vaddr_t kern_end = KERN_END3X;
+
/* Our exported CPU info; we can have only one. */
struct cpu_info cpu_info_store;
@@ -227,7 +232,7 @@
* Its mapping was prepared in pmap_bootstrap().
* Also, offset some to avoid PROM scribbles.
*/
- v = (char *)KERNBASE;
+ v = (char *)KERNBASE3X;
msgbufaddr = v + MSGBUFOFF;
initmsgbuf(msgbufaddr, MSGBUFSIZE);
@@ -650,7 +655,7 @@
/* Fill in cpu_kcore_hdr_t part. */
strncpy(chdr_p->name, kernel_arch, sizeof(chdr_p->name));
chdr_p->page_size = PAGE_SIZE;
- chdr_p->kernbase = KERNBASE;
+ chdr_p->kernbase = KERNBASE3X;
/* Fill in the sun3x_kcore_hdr part. */
pmap_kcore_hdr(sh);
@@ -731,3 +736,13 @@
{
return ENOEXEC;
}
+
+#ifdef MODULAR
+/*
+ * Push any modules loaded by the bootloader etc.
+ */
+void
+module_init_md(void)
+{
+}
+#endif
Index: src/sys/arch/sun3/sun3x/mem.c
diff -u src/sys/arch/sun3/sun3x/mem.c:1.33 src/sys/arch/sun3/sun3x/mem.c:1.34
--- src/sys/arch/sun3/sun3x/mem.c:1.33 Sun Mar 4 14:03:03 2007
+++ src/sys/arch/sun3/sun3x/mem.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.33 2007/03/04 14:03:03 tsutsui Exp $ */
+/* $NetBSD: mem.c,v 1.34 2010/10/15 15:55:53 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.33 2007/03/04 14:03:03 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.34 2010/10/15 15:55:53 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,7 +171,7 @@
* alias mapping known to exist for this range.
*/
if (v < avail_start) {
- v += KERNBASE;
+ v += KERNBASE3X;
goto use_kmem;
}
/* Temporarily map the memory at vmmap. */
Index: src/sys/arch/sun3/sun3x/pmap.c
diff -u src/sys/arch/sun3/sun3x/pmap.c:1.110 src/sys/arch/sun3/sun3x/pmap.c:1.111
--- src/sys/arch/sun3/sun3x/pmap.c:1.110 Thu Nov 26 00:19:23 2009
+++ src/sys/arch/sun3/sun3x/pmap.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.110 2009/11/26 00:19:23 matt Exp $ */
+/* $NetBSD: pmap.c,v 1.111 2010/10/15 15:55:53 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2009/11/26 00:19:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.111 2010/10/15 15:55:53 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@@ -348,7 +348,7 @@
* for purposes of MMU table allocation is -KERNBASE
* (length from KERNBASE to 0xFFFFffff)
*/
-#define KVAS_SIZE (-KERNBASE)
+#define KVAS_SIZE (-KERNBASE3X)
/* Numbers of kernel MMU tables to support KVAS_SIZE. */
#define KERN_B_TABLES (KVAS_SIZE >> MMU_TIA_SHIFT)
@@ -388,9 +388,9 @@
{
vaddr_t va;
- va = (pa + KERNBASE);
+ va = (pa + KERNBASE3X);
#ifdef PMAP_DEBUG
- if ((va < KERNBASE) || (va >= virtual_contig_end))
+ if ((va < KERNBASE3X) || (va >= virtual_contig_end))
panic("mmu_ptov");
#endif
return (void *)va;
@@ -403,10 +403,10 @@
va = (vaddr_t)vva;
#ifdef PMAP_DEBUG
- if ((va < KERNBASE) || (va >= virtual_contig_end))
+ if ((va < KERNBASE3X) || (va >= virtual_contig_end))
panic("mmu_vtop");
#endif
- return va - KERNBASE;
+ return va - KERNBASE3X;
}
/*
@@ -638,7 +638,7 @@
* That is plenty for our bootstrap work.
*/
virtual_avail = m68k_round_page(nextva);
- virtual_contig_end = KERNBASE + 0x400000; /* +4MB */
+ virtual_contig_end = KERNBASE3X + 0x400000; /* +4MB */
virtual_end = VM_MAX_KERNEL_ADDRESS;
/* Don't need avail_start til later. */
@@ -760,7 +760,7 @@
* practice to explicitly show that we are interpreting
* it as a list of A table descriptors.
*/
- for (i = 0; i < MMU_TIA(KERNBASE); i++) {
+ for (i = 0; i < MMU_TIA(KERNBASE3X); i++) {
kernAbase[i].addr.raw = 0;
}
@@ -769,7 +769,7 @@
* correct spots in the contiguous table of PTEs allocated for the
* kernel's virtual memory space.
*/
- for (i = MMU_TIA(KERNBASE); i < MMU_A_TBL_SIZE; i++) {
+ for (i = MMU_TIA(KERNBASE3X); i < MMU_A_TBL_SIZE; i++) {
kernAbase[i].attr.raw =
MMU_LONG_DTE_LU | MMU_LONG_DTE_SUPV | MMU_DT_SHORT;
kernAbase[i].addr.raw = mmu_vtop(&kernBbase[b]);
@@ -802,7 +802,7 @@
* These variables will never change after this point.
*/
virtual_contig_end = virtual_avail;
- avail_start = virtual_avail - KERNBASE;
+ avail_start = virtual_avail - KERNBASE3X;
/*
* `avail_next' is a running pointer used by pmap_next_page() to
@@ -851,7 +851,7 @@
* Only the mappings created here exist in our tables, so
* remember to map anything we expect to use.
*/
- va = (vaddr_t)KERNBASE;
+ va = (vaddr_t)KERNBASE3X;
pa = 0;
/*
@@ -1001,7 +1001,7 @@
* Note: mon_ctbl[0] maps SUN3X_MON_KDB_BASE
*/
mon_ctbl = *romp->monptaddr;
- i = m68k_btop(SUN3X_MON_KDB_BASE - KERNBASE);
+ i = m68k_btop(SUN3X_MON_KDB_BASE - KERNBASE3X);
kpte = &kernCbase[i];
len = m68k_btop(SUN3X_MONEND - SUN3X_MON_KDB_BASE);
@@ -1020,7 +1020,7 @@
* not recorded in our PV lists...
*/
mon_ctbl = *romp->shadowpteaddr;
- i = m68k_btop(SUN3X_MON_DVMA_BASE - KERNBASE);
+ i = m68k_btop(SUN3X_MON_DVMA_BASE - KERNBASE3X);
kpte = &kernCbase[i];
len = m68k_btop(SUN3X_MON_DVMA_SIZE);
for (i = (len - 1); i < len; i++) {
@@ -1056,7 +1056,7 @@
int i;
mon_dte = (mmu_long_dte_t *)mon_crp.rp_addr;
- for (i = MMU_TIA(KERNBASE); i < MMU_TIA(KERN_END); i++) {
+ for (i = MMU_TIA(KERNBASE3X); i < MMU_TIA(KERN_END3X); i++) {
mon_dte[i].attr.raw = kernAbase[i].attr.raw;
mon_dte[i].addr.raw = kernAbase[i].addr.raw;
}
@@ -1395,7 +1395,7 @@
at_wired = a_tbl->at_wcnt;
if (a_tbl->at_ecnt) {
dte = a_tbl->at_dtbl;
- for (i = 0; i < MMU_TIA(KERNBASE); i++) {
+ for (i = 0; i < MMU_TIA(KERNBASE3X); i++) {
/*
* If a table entry points to a valid B table, free
* it and its children.
@@ -2093,7 +2093,7 @@
/*
* Calculate the index of the PTE being modified.
*/
- pte_idx = (u_long)m68k_btop(va - KERNBASE);
+ pte_idx = (u_long)m68k_btop(va - KERNBASE3X);
/* This array is traditionally named "Sysmap" */
pte = &kernCbase[pte_idx];
@@ -2153,7 +2153,7 @@
mmu_short_pte_t *pte;
/* This array is traditionally named "Sysmap" */
- pte = &kernCbase[(u_long)m68k_btop(va - KERNBASE)];
+ pte = &kernCbase[(u_long)m68k_btop(va - KERNBASE3X)];
KASSERT(!MMU_VALID_DT(*pte));
pte->attr.raw = MMU_DT_INVALID | MMU_DT_PAGE | (pa & MMU_PAGE_MASK);
@@ -2171,8 +2171,8 @@
panic("pmap_kremove: alignment");
#endif
- idx = m68k_btop(va - KERNBASE);
- eidx = m68k_btop(va + len - KERNBASE);
+ idx = m68k_btop(va - KERNBASE3X);
+ eidx = m68k_btop(va + len - KERNBASE3X);
while (idx < eidx) {
kernCbase[idx++].attr.raw = MMU_DT_INVALID;
@@ -2215,7 +2215,7 @@
vaddr_t va;
mmu_short_pte_t *pte;
- pte = &kernCbase[(unsigned long) m68k_btop(startva - KERNBASE)];
+ pte = &kernCbase[(unsigned long) m68k_btop(startva - KERNBASE3X)];
for (va = startva; va < endva; va += PAGE_SIZE, pte++) {
if (MMU_VALID_DT(*pte)) {
switch (prot) {
@@ -2823,7 +2823,7 @@
*pmap = pmap_kernel();
va = m68k_ptob(idx);
- va += KERNBASE;
+ va += KERNBASE3X;
}
return va;
@@ -2921,7 +2921,7 @@
{
mmu_short_pte_t *pte;
- pte = &kernCbase[(u_int)m68k_btop(va - KERNBASE)];
+ pte = &kernCbase[(u_int)m68k_btop(va - KERNBASE3X)];
if (!MMU_VALID_DT(*pte))
return false;
if (pap != NULL)
@@ -2976,8 +2976,8 @@
panic("pmap_remove_kernel: alignment");
#endif
- idx = m68k_btop(sva - KERNBASE);
- eidx = m68k_btop(eva - KERNBASE);
+ idx = m68k_btop(sva - KERNBASE3X);
+ eidx = m68k_btop(eva - KERNBASE3X);
while (idx < eidx) {
pmap_remove_pte(&kernCbase[idx++]);
@@ -3659,7 +3659,7 @@
a_tbl = pmap->pm_a_tmgr;
count = 0;
- for (a_idx = 0; a_idx < MMU_TIA(KERNBASE); a_idx++) {
+ for (a_idx = 0; a_idx < MMU_TIA(KERNBASE3X); a_idx++) {
if (MMU_VALID_DT(a_tbl->at_dtbl[a_idx])) {
b_tbl = mmuB2tmgr(mmu_ptov(a_tbl->at_dtbl[a_idx].addr.raw));
for (b_idx = 0; b_idx < MMU_B_TBL_SIZE; b_idx++) {
@@ -3705,7 +3705,7 @@
pte_pa = ptest_addr(va & ~PGOFSET);
/* Convert to a virtual address... */
- pte = (mmu_short_pte_t *) (KERNBASE + pte_pa);
+ pte = (mmu_short_pte_t *) (KERNBASE3X + pte_pa);
/* Make sure it is in our level-C tables... */
if ((pte < kernCbase) ||
@@ -3727,10 +3727,10 @@
{
u_long idx;
- if (va < KERNBASE)
+ if (va < KERNBASE3X)
return;
- idx = (unsigned long) m68k_btop(va - KERNBASE);
+ idx = (unsigned long) m68k_btop(va - KERNBASE3X);
kernCbase[idx].attr.raw = pte;
TBIS(va);
}
Index: src/sys/rump/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.145 src/sys/rump/librump/rumpkern/emul.c:1.146
--- src/sys/rump/librump/rumpkern/emul.c:1.145 Wed Sep 1 19:37:58 2010
+++ src/sys/rump/librump/rumpkern/emul.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: emul.c,v 1.145 2010/09/01 19:37:58 pooka Exp $ */
+/* $NetBSD: emul.c,v 1.146 2010/10/15 15:55:53 tsutsui Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.145 2010/09/01 19:37:58 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.146 2010/10/15 15:55:53 tsutsui Exp $");
#include <sys/param.h>
#include <sys/null.h>
@@ -103,9 +103,10 @@
int pgshift = 12;
#endif
-/* sun3 is sun3 with broken kernel modules */
+/* on sun3 VM_MAX_ADDRESS is a const variable */
+/* XXX: should be moved into rump.c and initialize for sun3 and sun3x? */
#ifdef sun3
-char KERNBASE[1]; /* this is completely random ... */
+const vaddr_t kernbase = KERNBASE3;
#endif
struct loadavg averunnable = {
Index: src/sys/uvm/uvm_readahead.c
diff -u src/sys/uvm/uvm_readahead.c:1.6 src/sys/uvm/uvm_readahead.c:1.7
--- src/sys/uvm/uvm_readahead.c:1.6 Wed Jun 10 01:54:08 2009
+++ src/sys/uvm/uvm_readahead.c Fri Oct 15 15:55:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_readahead.c,v 1.6 2009/06/10 01:54:08 yamt Exp $ */
+/* $NetBSD: uvm_readahead.c,v 1.7 2010/10/15 15:55:53 tsutsui Exp $ */
/*-
* Copyright (c)2003, 2005, 2009 YAMAMOTO Takashi,
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_readahead.c,v 1.6 2009/06/10 01:54:08 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_readahead.c,v 1.7 2010/10/15 15:55:53 tsutsui Exp $");
#include <sys/param.h>
#include <sys/pool.h>
@@ -66,8 +66,8 @@
off_t ra_next; /* next offset to read-ahead */
};
-#if defined(sun2) || (defined(sun3) && defined(_SUN3_))
-/* XXX: on sun2 and sun3 (but not sun3x) MAXPHYS is 0xe000 */
+#if defined(sun2) || defined(sun3)
+/* XXX: on sun2 and sun3 MAXPHYS is 0xe000 */
#undef MAXPHYS
#define MAXPHYS 0x8000 /* XXX */
#endif