summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-11-27 14:26:33 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-11-27 14:26:33 +0000
commitffaaa05b0a39cb5292abb8e72796ae8d11649cad (patch)
tree20d401430c7d452048d0da7f6aa02b8eada26952 /sys/arch
parent0290d1a059c8f3bddcc05459e4cc70c0968e620b (diff)
In pmap_bootstrap(), replace PMAP_MD_RWZERO, which would leave the lowest
page writeable, with PMAP_MD_RWLOW, which tells how many pages have to be left writeable on low addresses, since the mac rom needs more than one. This lets non-DDB mac68k kernels run. No change on non-mac68k platforms.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/m68k/m68k/pmap_bootstrap.c23
-rw-r--r--sys/arch/mac68k/mac68k/locore.s3
-rw-r--r--sys/arch/mac68k/mac68k/pmap_bootstrap.c5
3 files changed, 17 insertions, 14 deletions
diff --git a/sys/arch/m68k/m68k/pmap_bootstrap.c b/sys/arch/m68k/m68k/pmap_bootstrap.c
index 809aaebcfcd..5b5ce76369e 100644
--- a/sys/arch/m68k/m68k/pmap_bootstrap.c
+++ b/sys/arch/m68k/m68k/pmap_bootstrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.7 2004/07/22 19:37:39 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.8 2004/11/27 14:26:30 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -74,7 +74,7 @@
* PMAP_MD_RELOC3() general purpose kernel virtual addresses relocation
* PMAP_MD_MAPIOSPACE() setup machine-specific internal iospace components
* PMAP_MD_MEMSIZE() compute avail_end
- * PMAP_MD_RWZERO define to NOT make virtual address 0 read only
+ * PMAP_MD_RWLOW number of pages to keep writeable, starting at address 0
*/
extern char *etext;
@@ -348,23 +348,24 @@ pmap_bootstrap(nextpa, firstpa)
*/
pte = &(PA2VA(kptpa, u_int *))[m68k_btop(KERNBASE)];
epte = &pte[m68k_btop(trunc_page((vaddr_t)&etext))];
-#ifndef PMAP_MD_RWZERO
- *pte++ = firstpa | PG_NV; /* make *NULL fail in the kernel */
-#if defined(KGDB) || defined(DDB)
- protopte = (firstpa + NBPG) | PG_RW | PG_V | PG_U; /* XXX RW for now */
-#else
- protopte = (firstpa + NBPG) | PG_RO | PG_V | PG_U;
-#endif
-#else
+
#if defined(KGDB) || defined(DDB)
protopte = firstpa | PG_RW | PG_V | PG_U; /* XXX RW for now */
#else
protopte = firstpa | PG_RO | PG_V | PG_U;
#endif
+#ifdef PMAP_MD_RWLOW
+ for (num = PMAP_MD_RWLOW; num != 0; num--) {
+ *pte++ = (protopte & ~PG_RO) | PG_RW;
+ protopte += PAGE_SIZE;
+ }
+#else
+ *pte++ = PG_NV; /* make *NULL fail in the kernel */
+ protopte += PAGE_SIZE;
#endif
while (pte < epte) {
*pte++ = protopte;
- protopte += NBPG;
+ protopte += PAGE_SIZE;
}
/*
* Validate PTEs for kernel data/bss, dynamic data allocated
diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s
index dc33ea70d93..b49530ff836 100644
--- a/sys/arch/mac68k/mac68k/locore.s
+++ b/sys/arch/mac68k/mac68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.37 2004/11/26 21:21:28 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.38 2004/11/27 14:26:32 miod Exp $ */
/* $NetBSD: locore.s,v 1.103 1998/07/09 06:02:50 scottr Exp $ */
/*
@@ -122,6 +122,7 @@ ASLOCAL(tmpstk)
BSS(esym,4)
ASENTRY_NOPROFILE(start)
+GLOBAL(kernel_start)
movw #PSL_HIGHIPL,sr | no interrupts. ever.
lea _ASM_LABEL(tmpstk),sp | give ourselves a temporary stack
diff --git a/sys/arch/mac68k/mac68k/pmap_bootstrap.c b/sys/arch/mac68k/mac68k/pmap_bootstrap.c
index 9e024a0336e..a5956f25e1b 100644
--- a/sys/arch/mac68k/mac68k/pmap_bootstrap.c
+++ b/sys/arch/mac68k/mac68k/pmap_bootstrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.26 2004/11/25 18:32:11 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.27 2004/11/27 14:26:32 miod Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.50 1999/04/07 06:14:33 scottr Exp $ */
/*
@@ -93,7 +93,8 @@ void bootstrap_mac68k(int);
#define RELOC(v, t) *((t*)((u_int)&(v)))
#define PA2VA(v, t) *((t*)((u_int)&(v) - firstpa))
-#define PMAP_MD_RWZERO
+extern caddr_t kernel_start;
+#define PMAP_MD_RWLOW m68k_btop(m68k_round_page((vaddr_t)&kernel_start))
/*
* Present a totally tricky view of the world here...