diff options
author | 2014-01-30 18:16:41 +0000 | |
---|---|---|
committer | 2014-01-30 18:16:41 +0000 | |
commit | 62fe2d4b3bff9db166916908a163621eefc781a0 (patch) | |
tree | d5481ab491926c22d4a9628a6af22ea7d4aed9db /sys/arch/sparc | |
parent | reorganise this file into something a bit saner, killing wacky macros (diff) | |
download | wireguard-openbsd-62fe2d4b3bff9db166916908a163621eefc781a0.tar.xz wireguard-openbsd-62fe2d4b3bff9db166916908a163621eefc781a0.zip |
Move declaration of struct vm_page_md from <machine/vmparam.h> to
<machine/pmap.h> where it belongs, and compensate in <uvm/uvm_extern.h>
by including <uvm/uvm_pmap.h> before <uvm/uvm_page.h>. Tested on all
MACHINE_ARCH but amd64 and i386 (and hppa64).
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/include/pmap.h | 85 | ||||
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 26 |
2 files changed, 53 insertions, 58 deletions
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h index 022aadb3b34..bed3dfd7f9a 100644 --- a/sys/arch/sparc/include/pmap.h +++ b/sys/arch/sparc/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.53 2013/06/11 16:42:11 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.54 2014/01/30 18:16:41 miod Exp $ */ /* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */ /* @@ -175,38 +175,6 @@ struct pmap { typedef struct pmap *pmap_t; -/* - * For each managed physical page, there is a list of all currently - * valid virtual mappings of that page. Since there is usually one - * (or zero) mapping per page, the table begins with an initial entry, - * rather than a pointer; this head entry is empty iff its pv_pmap - * field is NULL. - * - * Note that these are per machine independent page (so there may be - * only one for every two hardware pages, e.g.). Since the virtual - * address is aligned on a page boundary, the low order bits are free - * for storing flags. Only the head of each list has flags. - * - * THIS SHOULD BE PART OF THE CORE MAP - */ -/* XXX - struct pvlist moved to vmparam.h because of include ordering issues */ - -/* - * Flags in pv_flags. Note that PV_MOD must be 1 and PV_REF must be 2 - * since they must line up with the bits in the hardware PTEs (see pte.h). - * SUN4M bits are at a slightly different location in the PTE. - * Note: the REF, MOD and ANC flag bits occur only in the head of a pvlist. - * The cacheable bit (either PV_NC or PV_C4M) is meaningful in each - * individual pv entry. - */ -#define PV_MOD 1 /* page modified */ -#define PV_REF 2 /* page referenced */ -#define PV_NC 4 /* page cannot be cached */ -#define PV_REF4M 1 /* page referenced (SRMMU) */ -#define PV_MOD4M 2 /* page modified (SRMMU) */ -#define PV_C4M 4 /* page _can_ be cached (SRMMU) */ -#define PV_ANC 0x10 /* page has incongruent aliases */ - #if 0 struct kvm_cpustate { int kvm_npmemarr; @@ -407,4 +375,55 @@ extern void (*pmap_changeprot_p)(pmap_t, vaddr_t, #endif /* _KERNEL */ +/* + * For each managed physical page, there is a list of all currently + * valid virtual mappings of that page. Since there is usually one + * (or zero) mapping per page, the table begins with an initial entry, + * rather than a pointer; this head entry is empty iff its pv_pmap + * field is NULL. + * + * Note that these are per machine independent page (so there may be + * only one for every two hardware pages, e.g.). Since the virtual + * address is aligned on a page boundary, the low order bits are free + * for storing flags. Only the head of each list has flags. + */ + +struct pvlist { + struct pvlist *pv_next; /* next pvlist, if any */ + struct pmap *pv_pmap; /* pmap of this va */ + vaddr_t pv_va; /* virtual address */ + int pv_flags; /* flags (below) */ +}; + +struct vm_page_md { + struct pvlist pv_head; +}; + +#ifdef _KERNEL + +/* + * Flags in pv_flags. Note that PV_MOD must be 1 and PV_REF must be 2 + * since they must line up with the bits in the hardware PTEs (see pte.h). + * SUN4M bits are at a slightly different location in the PTE. + * Note: the REF, MOD and ANC flag bits occur only in the head of a pvlist. + * The cacheable bit (either PV_NC or PV_C4M) is meaningful in each + * individual pv entry. + */ +#define PV_MOD 1 /* page modified */ +#define PV_REF 2 /* page referenced */ +#define PV_NC 4 /* page cannot be cached */ +#define PV_REF4M 1 /* page referenced (SRMMU) */ +#define PV_MOD4M 2 /* page modified (SRMMU) */ +#define PV_C4M 4 /* page _can_ be cached (SRMMU) */ +#define PV_ANC 0x10 /* page has incongruent aliases */ + +#define VM_MDPAGE_INIT(pg) do { \ + (pg)->mdpage.pv_head.pv_next = NULL; \ + (pg)->mdpage.pv_head.pv_pmap = NULL; \ + (pg)->mdpage.pv_head.pv_va = 0; \ + (pg)->mdpage.pv_head.pv_flags = 0; \ +} while (0) + +#endif /* _KERNEL */ + #endif /* _MACHINE_PMAP_H_ */ diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index 0d51ddf7362..827a355a537 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.40 2014/01/23 22:06:29 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.41 2014/01/30 18:16:41 miod Exp $ */ /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ /* @@ -105,30 +105,6 @@ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ -/* - * pmap specific data stored in the vm_physmem[] array - */ - - -/* XXX - belongs in pmap.h, but put here because of ordering issues */ -struct pvlist { - struct pvlist *pv_next; /* next pvlist, if any */ - struct pmap *pv_pmap; /* pmap of this va */ - vaddr_t pv_va; /* virtual address */ - int pv_flags; /* flags (below) */ -}; - -struct vm_page_md { - struct pvlist pv_head; -}; - -#define VM_MDPAGE_INIT(pg) do { \ - (pg)->mdpage.pv_head.pv_next = NULL; \ - (pg)->mdpage.pv_head.pv_pmap = NULL; \ - (pg)->mdpage.pv_head.pv_va = 0; \ - (pg)->mdpage.pv_head.pv_flags = 0; \ -} while (0) - #if defined (_KERNEL) && !defined(_LOCORE) struct vm_map; #define dvma_mapin(map,va,len,canwait) dvma_mapin_space(map,va,len,canwait,0) |