summaryrefslogtreecommitdiff
path: root/sys/arch/m68k
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/m68k
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/m68k')
-rw-r--r--sys/arch/m68k/m68k/pmap_bootstrap.c23
1 files changed, 12 insertions, 11 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