summaryrefslogtreecommitdiff
path: root/sys/arch/m88k/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-12-31 21:38:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-12-31 21:38:09 +0000
commitac70415760e796ddc49d0a3f42cef4d80e3cd79c (patch)
tree320bd94ef834f8806974e699f17f9347fc1ed7e8 /sys/arch/m88k/include
parent0b6d62f095cb4dece152a6de03a65095436aed03 (diff)
Massive overhauling of the m88k pmap, though I can't pretend it's a new pmap
since a large part of the structures and logic remains. Since m88k has separate supervisor/user spaces, we can map physical memory 1:1 in supervisor space, and have the kernel virtual address space start from the end of physical memory. This allows us to switch to __HAVE_PMAP_DIRECT. And to get rid of the double mapped sdt, since now their virtual and physical addresses will always match. The upper bound of the kernel virtual memory space is now platform dependent, until the code which relies upon some hardware devices being mapped 1:1 in supervisor mode is updated to no longer require this (this is mainly a PITA on luna88k, where onboard devices start at 0x40000000, leaving only 1GB of KVA at the moment - still much better than the previous 512MB). Tested on mvme88k only (187, 188, 197LE, 197DP). Other platforms ought to work, aviion will be checked shortly and fixed if necessary. No known OpenBSD/luna88k system in working condition at the moment.
Diffstat (limited to 'sys/arch/m88k/include')
-rw-r--r--sys/arch/m88k/include/pmap.h22
-rw-r--r--sys/arch/m88k/include/pmap_table.h15
-rw-r--r--sys/arch/m88k/include/vmparam.h10
3 files changed, 24 insertions, 23 deletions
diff --git a/sys/arch/m88k/include/pmap.h b/sys/arch/m88k/include/pmap.h
index c8059ad8f24..8bbfb0914f8 100644
--- a/sys/arch/m88k/include/pmap.h
+++ b/sys/arch/m88k/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.17 2010/12/26 15:40:59 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.18 2010/12/31 21:38:08 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -27,9 +27,6 @@ struct pmap {
sdt_entry_t *pm_stab; /* virtual pointer to sdt */
apr_t pm_apr;
int pm_count; /* reference count */
-#ifdef MULTIPROCESSOR
- __cpu_simple_lock_t pm_lock;
-#endif
struct pmap_statistics pm_stats; /* pmap statistics */
};
@@ -62,14 +59,27 @@ extern apr_t default_apr;
#define pmap_clear_modify(pg) pmap_unsetbit(pg, PG_M)
#define pmap_clear_reference(pg) pmap_unsetbit(pg, PG_U)
-void pmap_bootstrap(vaddr_t);
+void pmap_bootstrap(void);
void pmap_bootstrap_cpu(cpuid_t);
-void pmap_cache_ctrl(pmap_t, vaddr_t, vaddr_t, u_int);
+void pmap_cache_ctrl(vaddr_t, vaddr_t, u_int);
#define pmap_unuse_final(p) /* nothing */
#define pmap_remove_holes(map) do { /* nothing */ } while (0)
int pmap_set_modify(pmap_t, vaddr_t);
boolean_t pmap_unsetbit(struct vm_page *, int);
+int pmap_translation_info(pmap_t, vaddr_t, paddr_t *, uint32_t *);
+/*
+ * pmap_translation_info() return values
+ */
+#define PTI_INVALID 0
+#define PTI_PTE 1
+#define PTI_BATC 2
+
+#define pmap_map_direct(pg) ((vaddr_t)VM_PAGE_TO_PHYS(pg))
+#define pmap_unmap_direct(va) PHYS_TO_VM_PAGE((paddr_t)va)
+#define __HAVE_PMAP_DIRECT
+#define PMAP_STEAL_MEMORY
+
#endif /* _KERNEL */
#endif /* _M88K_PMAP_H_ */
diff --git a/sys/arch/m88k/include/pmap_table.h b/sys/arch/m88k/include/pmap_table.h
index 9d90e393949..8de566e4ef8 100644
--- a/sys/arch/m88k/include/pmap_table.h
+++ b/sys/arch/m88k/include/pmap_table.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_table.h,v 1.1 2004/07/25 11:06:42 miod Exp $ */
+/* $OpenBSD: pmap_table.h,v 1.2 2010/12/31 21:38:08 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
@@ -30,15 +30,14 @@
/*
* Built-in mappings list.
- * An entry is considered invalid if pm_size = 0, and
- * end of list is indicated by pm_size 0xffffffff
+ * An entry is considered invalid if size = 0, and
+ * end of list is indicated by size 0xffffffff
*/
typedef struct {
- vaddr_t phys_start; /* in bytes */
- vaddr_t virt_start; /* in bytes */
- vsize_t size; /* in bytes */
- unsigned int prot; /* vm_prot_read, vm_prot_write */
- unsigned int cacheability; /* none, writeback, normal */
+ paddr_t start;
+ psize_t size;
+ vm_prot_t prot;
+ unsigned int cacheability;
} pmap_table_entry;
typedef const pmap_table_entry *pmap_table_t;
diff --git a/sys/arch/m88k/include/vmparam.h b/sys/arch/m88k/include/vmparam.h
index e1391884f02..e971b6dd0ab 100644
--- a/sys/arch/m88k/include/vmparam.h
+++ b/sys/arch/m88k/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.9 2010/12/15 05:30:19 tedu Exp $ */
+/* $OpenBSD: vmparam.h,v 1.10 2010/12/31 21:38:08 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
@@ -75,14 +75,6 @@
#define VM_MAX_ADDRESS ((vaddr_t)0xfffff000)
#define VM_MAXUSER_ADDRESS VM_MAX_ADDRESS
-/*
- * Although user and supervisor address spaces are separate, we limit
- * ourselves to 512KB KVM because the kernel page table is statically
- * allocated.
- */
-#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0)
-#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x20000000)
-
/* virtual sizes (bytes) for various kernel submaps */
#define VM_PHYS_SIZE (1 * NPTEPG * PAGE_SIZE)