summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amiga/amiga/pmap_bootstrap.c36
-rw-r--r--sys/arch/hp300/hp300/pmap_bootstrap.c22
-rw-r--r--sys/arch/m68k/m68k/pmap_motorola.c16
-rw-r--r--sys/arch/mac68k/mac68k/pmap_bootstrap.c22
-rw-r--r--sys/arch/mvme68k/mvme68k/pmap_bootstrap.c41
5 files changed, 12 insertions, 125 deletions
diff --git a/sys/arch/amiga/amiga/pmap_bootstrap.c b/sys/arch/amiga/amiga/pmap_bootstrap.c
index a2df814dc8e..03636122ba0 100644
--- a/sys/arch/amiga/amiga/pmap_bootstrap.c
+++ b/sys/arch/amiga/amiga/pmap_bootstrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.1 2001/11/30 23:14:28 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.2 2001/12/14 21:44:02 miod Exp $ */
/* $NetBSD: pmap.c,v 1.68 1999/06/19 19:44:09 is Exp $ */
/*-
@@ -103,10 +103,8 @@ extern st_entry_t *Sysseg;
#if defined(M68040) || defined(M68060)
extern int protostfree;
#endif
-extern int protection_codes[];
extern vaddr_t reserve_dumppages __P((vaddr_t));
-void amiga_protection_init __P((void));
/*
* Bootstrap the system enough to run with virtual memory.
@@ -198,11 +196,6 @@ pmap_bootstrap(firstaddr, loadaddr)
virtual_end = VM_MAX_KERNEL_ADDRESS;
/*
- * Initialize protection array.
- */
- amiga_protection_init();
-
- /*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/
@@ -253,30 +246,3 @@ pmap_init_md()
UVM_FLAG_FIXED)))
panic("pmap_init: bogons in the VM system!\n");
}
-
-void
-amiga_protection_init()
-{
- int *kp, prot;
-
- kp = protection_codes;
- for (prot = 0; prot < 8; prot++) {
- switch (prot) {
- case VM_PROT_NONE | VM_PROT_NONE | VM_PROT_NONE:
- *kp++ = 0;
- break;
- case VM_PROT_READ | VM_PROT_NONE | VM_PROT_NONE:
- case VM_PROT_READ | VM_PROT_NONE | VM_PROT_EXECUTE:
- case VM_PROT_NONE | VM_PROT_NONE | VM_PROT_EXECUTE:
- *kp++ = PG_RO;
- break;
- case VM_PROT_NONE | VM_PROT_WRITE | VM_PROT_NONE:
- case VM_PROT_NONE | VM_PROT_WRITE | VM_PROT_EXECUTE:
- case VM_PROT_READ | VM_PROT_WRITE | VM_PROT_NONE:
- case VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE:
- *kp++ = PG_RW;
- break;
- }
- }
-}
-
diff --git a/sys/arch/hp300/hp300/pmap_bootstrap.c b/sys/arch/hp300/hp300/pmap_bootstrap.c
index 52c2d9583f6..9108859dcc3 100644
--- a/sys/arch/hp300/hp300/pmap_bootstrap.c
+++ b/sys/arch/hp300/hp300/pmap_bootstrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.12 2001/11/30 20:58:18 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.13 2001/12/14 21:44:04 miod Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.13 1997/06/10 18:56:50 veego Exp $ */
/*
@@ -68,7 +68,6 @@ extern int maxmem, physmem;
extern paddr_t avail_start, avail_end;
extern vaddr_t virtual_avail, virtual_end;
extern vsize_t mem_size;
-extern int protection_codes[];
#ifdef M68K_MMU_HP
extern int pmap_aliasmask;
#endif
@@ -448,25 +447,6 @@ pmap_bootstrap(nextpa, firstpa)
#endif
/*
- * Initialize protection array.
- * XXX don't use a switch statement, it might produce an
- * absolute "jmp" table.
- */
- {
- int *kp;
-
- kp = &RELOC(protection_codes, int);
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_NONE] = PG_RO;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- }
-
- /*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/
diff --git a/sys/arch/m68k/m68k/pmap_motorola.c b/sys/arch/m68k/m68k/pmap_motorola.c
index 76aa87ee6a2..fce5e1b30e4 100644
--- a/sys/arch/m68k/m68k/pmap_motorola.c
+++ b/sys/arch/m68k/m68k/pmap_motorola.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_motorola.c,v 1.9 2001/12/12 18:36:21 millert Exp $ */
+/* $OpenBSD: pmap_motorola.c,v 1.10 2001/12/14 21:44:04 miod Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -171,6 +171,7 @@
#include <machine/pte.h>
+/* #define UVM_PAGE_INLINE */
#include <uvm/uvm.h>
#include <machine/cpu.h>
@@ -249,8 +250,7 @@ int dokwriteback = 1; /* 68040: enable writeback caching of kernel AS */
* Given a map and a machine independent protection code,
* convert to an m68k protection code.
*/
-#define pte_prot(m, p) (protection_codes[p])
-int protection_codes[8];
+#define pte_prot(p) ((p) & VM_PROT_WRITE ? PG_RW : PG_RO)
/*
* Kernel page table page management.
@@ -338,8 +338,8 @@ void pmap_check_wiring __P((char *, vaddr_t));
#define PRM_CFLUSH 2
#define PRM_KEEPPTPAGE 4
-#define PAGE_IS_MANAGED(pa) (pmap_initialized && \
- vm_physseg_find(atop((pa)), NULL) != -1)
+#define PAGE_IS_MANAGED(pa) \
+ (pmap_initialized && IS_VM_PHYSADDR(pa))
#define pa_to_pvh(pa) \
({ \
@@ -1087,7 +1087,7 @@ pmap_protect(pmap, sva, eva, prot)
return;
}
- isro = pte_prot(pmap, prot);
+ isro = pte_prot(prot);
needtflush = active_pmap(pmap);
firstpage = TRUE;
while (sva < eva) {
@@ -1382,7 +1382,7 @@ validate:
/*
* Build the new PTE.
*/
- npte = pa | pte_prot(pmap, prot) | (*pte & (PG_M|PG_U)) | PG_V;
+ npte = pa | pte_prot(prot) | (*pte & (PG_M|PG_U)) | PG_V;
if (wired)
npte |= PG_W;
@@ -1486,7 +1486,7 @@ pmap_kenter_pa(va, pa, prot)
* Build the new PTE.
*/
- npte = pa | pte_prot(pmap, prot) | PG_V | PG_W;
+ npte = pa | pte_prot(prot) | PG_V | PG_W;
#if defined(M68040) || defined(M68060)
if (mmutype <= MMU_68040 && (npte & (PG_PROT)) == PG_RW)
npte |= PG_CCB;
diff --git a/sys/arch/mac68k/mac68k/pmap_bootstrap.c b/sys/arch/mac68k/mac68k/pmap_bootstrap.c
index c1e60b0e6a8..f3a45f84fca 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.16 2001/11/30 20:58:18 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.17 2001/12/14 21:44:05 miod Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.50 1999/04/07 06:14:33 scottr Exp $ */
/*
@@ -71,7 +71,6 @@ extern paddr_t avail_start;
extern paddr_t avail_end;
extern vaddr_t virtual_avail, virtual_end;
extern vsize_t mem_size;
-extern int protection_codes[];
/*
* These are used to map the RAM:
@@ -485,25 +484,6 @@ pmap_bootstrap(nextpa, firstpa)
virtual_end = VM_MAX_KERNEL_ADDRESS;
/*
- * Initialize protection array.
- * XXX don't use a switch statement, it might produce an
- * absolute "jmp" table.
- */
- {
- int *kp;
-
- kp = (int *) &protection_codes;
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_NONE] = PG_RO;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- }
-
- /*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/
diff --git a/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c b/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
index 0747c1f6e58..1bdeb80b05c 100644
--- a/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
+++ b/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_bootstrap.c,v 1.10 2001/11/30 20:58:18 miod Exp $ */
+/* $OpenBSD: pmap_bootstrap.c,v 1.11 2001/12/14 21:44:05 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -91,7 +91,6 @@ extern pt_entry_t *Sysptmap, *Sysmap;
extern int maxmem, physmem;
extern vm_offset_t avail_start, avail_end, virtual_avail, virtual_end;
extern vm_size_t mem_size;
-extern int protection_codes[];
/*
* Special purpose kernel virtual addresses, used for mapping
@@ -400,25 +399,6 @@ register vm_offset_t firstpa;
RELOC(virtual_end, vm_offset_t) = VM_MAX_KERNEL_ADDRESS;
/*
- * Initialize protection array.
- * XXX don't use a switch statement, it might produce an
- * absolute "jmp" table.
- */
- {
- register int *kp;
-
- kp = &RELOC(protection_codes, int);
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_NONE] = PG_RO;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- }
-
- /*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/
@@ -823,25 +803,6 @@ register vm_offset_t firstpa;
RELOC(virtual_end, vm_offset_t) = VM_MAX_KERNEL_ADDRESS;
/*
- * Initialize protection array.
- * XXX don't use a switch statement, it might produce an
- * absolute "jmp" table.
- */
- {
- register int *kp;
-
- kp = &RELOC(protection_codes, int);
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_NONE] = PG_RO;
- kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
- kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
- }
-
- /*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/