summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-01-24 09:57:45 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-01-24 09:57:45 +0000
commit1885dbbd49414bf51885eb9eec436e66bb1171e6 (patch)
tree9fd195e4be0aefac1f11be44ef0103ba2c844c33 /sys/arch/mvme88k/include
parentfae7f597349d2dadcde2c1f26438ae8e98751a2b (diff)
Convert m88k pmap from physseg to VM_PAGE_MD.
This allows us to remove some ambiguities on how some functions are called, remove some diagnostic checks for conditions that can never happen and remove the ugly hack with "pmap_initialized". Then, rework internal function interfaces and some logic so as to stop fetching vm_page from a pa and the reverse every now and then - this makes some pmap operations run much faster. While there, various KNF and whitespace fixes, and rename some structure fields to be closer to the m68k pmap. per art@'s idea.
Diffstat (limited to 'sys/arch/mvme88k/include')
-rw-r--r--sys/arch/mvme88k/include/mmu.h4
-rw-r--r--sys/arch/mvme88k/include/pmap.h43
-rw-r--r--sys/arch/mvme88k/include/vmparam.h26
3 files changed, 40 insertions, 33 deletions
diff --git a/sys/arch/mvme88k/include/mmu.h b/sys/arch/mvme88k/include/mmu.h
index 5754b0d8641..a6820fde23c 100644
--- a/sys/arch/mvme88k/include/mmu.h
+++ b/sys/arch/mvme88k/include/mmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmu.h,v 1.17 2002/03/14 01:26:39 millert Exp $ */
+/* $OpenBSD: mmu.h,v 1.18 2003/01/24 09:57:41 miod Exp $ */
/*
* This file bears almost no resemblance to the original m68k file,
@@ -215,7 +215,7 @@ typedef u_int32_t pt_ind_entry_t;
#define PDTIDX(va) (((va) & PDT_MASK) >> PDT_SHIFT)
/* XXX uses knowledge of pmap structure */
-#define SDTENT(map, va) ((sdt_entry_t *)((map)->sdt_vaddr + SDTIDX(va)))
+#define SDTENT(map, va) ((sdt_entry_t *)((map)->pm_stab + SDTIDX(va)))
/*
* Size of a PDT table group.
diff --git a/sys/arch/mvme88k/include/pmap.h b/sys/arch/mvme88k/include/pmap.h
index e95c489bb95..116c14c1c91 100644
--- a/sys/arch/mvme88k/include/pmap.h
+++ b/sys/arch/mvme88k/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.28 2003/01/24 00:51:52 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.29 2003/01/24 09:57:41 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -17,34 +17,25 @@
#include <machine/mmu.h> /* batc_template_t, BATC_MAX, etc.*/
#include <machine/pcb.h> /* pcb_t, etc.*/
-#include <machine/psl.h> /* get standard goodies */
-
-typedef sdt_entry_t *sdt_ptr_t;
/*
* PMAP structure
*/
-typedef struct pmap *pmap_t;
/* #define PMAP_USE_BATC */
struct pmap {
- sdt_ptr_t sdt_paddr; /* physical pointer to sdt */
- sdt_ptr_t sdt_vaddr; /* virtual pointer to sdt */
- int ref_count; /* reference count */
- struct simplelock lock;
- struct pmap_statistics stats; /* pmap statistics */
+ sdt_entry_t *pm_stpa; /* physical pointer to sdt */
+ sdt_entry_t *pm_stab; /* virtual pointer to sdt */
+ int pm_count; /* reference count */
+ struct simplelock pm_lock;
+ struct pmap_statistics pm_stats; /* pmap statistics */
/* cpus using of this pmap; NCPU must be <= 32 */
- u_int32_t cpus_using;
+ u_int32_t pm_cpus;
#ifdef PMAP_USE_BATC
- batc_template_t i_batc[BATC_MAX]; /* instruction BATCs */
- batc_template_t d_batc[BATC_MAX]; /* data BATCs */
-#endif
-
-#ifdef DEBUG
- pmap_t next;
- pmap_t prev;
+ batc_template_t pm_ibatc[BATC_MAX]; /* instruction BATCs */
+ batc_template_t pm_dbatc[BATC_MAX]; /* data BATCs */
#endif
};
@@ -57,11 +48,10 @@ struct pmap {
* pv_head_table. This is used by things like pmap_remove, when we must
* find and remove all mappings for a particular physical page.
*/
-typedef struct pv_entry {
- struct pv_entry *next; /* next pv_entry */
- pmap_t pmap; /* pmap where mapping lies */
- vaddr_t va; /* virtual address for mapping */
-} *pv_entry_t;
+/* XXX - struct pv_entry moved to vmparam.h because of include ordering issues */
+
+typedef struct pmap *pmap_t;
+typedef struct pv_entry *pv_entry_t;
#ifdef _KERNEL
@@ -70,11 +60,12 @@ extern struct pmap kernel_pmap_store;
extern caddr_t vmmap;
#define pmap_kernel() (&kernel_pmap_store)
-#define pmap_resident_count(pmap) ((pmap)->stats.resident_count)
-#define pmap_wired_count(pmap) ((pmap)->stats.wired_count)
+#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
+#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
#define pmap_phys_address(frame) ((paddr_t)(ptoa(frame)))
-#define pmap_update(pmap) /* nothing (yet) */
+#define pmap_copy(dp,sp,d,l,s) do { /* nothing */ } while (0)
+#define pmap_update(pmap) do { /* nothing (yet) */ } while (0)
void pmap_bootstrap(vaddr_t, paddr_t *, paddr_t *, vaddr_t *, vaddr_t *);
void pmap_cache_ctrl(pmap_t, vaddr_t, vaddr_t, u_int);
diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h
index 99dbe816ac9..c1565f01437 100644
--- a/sys/arch/mvme88k/include/vmparam.h
+++ b/sys/arch/mvme88k/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.20 2002/02/17 22:59:53 maja Exp $ */
+/* $OpenBSD: vmparam.h,v 1.21 2003/01/24 09:57:41 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
@@ -107,11 +107,27 @@
/*
* pmap-specific data stored in the vm_physmem[] array.
*/
-#define __HAVE_PMAP_PHYSSEG
-struct pmap_physseg {
- struct pv_entry *pvent; /* pv table for this seg */
- char *attrs; /* page modify list for this seg */
+
+/* XXX - belongs in pmap.h, but put here because of ordering issues */
+struct pv_entry {
+ struct pv_entry *pv_next; /* next pv_entry */
+ struct pmap *pv_pmap; /* pmap where mapping lies */
+ vaddr_t pv_va; /* virtual address for mapping */
+ int pv_flags;
+};
+
+#define __HAVE_VM_PAGE_MD
+struct vm_page_md {
+ struct pv_entry pvent;
};
+
+#define VM_MDPAGE_INIT(pg) do { \
+ (pg)->mdpage.pvent.pv_next = NULL; \
+ (pg)->mdpage.pvent.pv_pmap = PMAP_NULL; \
+ (pg)->mdpage.pvent.pv_va = 0; \
+ (pg)->mdpage.pvent.pv_flags = 0; \
+} while (0)
+
#endif /* _LOCORE */
#endif /* _MACHINE_VM_PARAM_ */