xref: /minix3/minix/servers/vm/arch/i386/pagetable.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc 
2*433d6423SLionel Sambuc #ifndef _PAGETABLE_H
3*433d6423SLionel Sambuc #define _PAGETABLE_H 1
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #include <stdint.h>
6*433d6423SLionel Sambuc #include <machine/vm.h>
7*433d6423SLionel Sambuc 
8*433d6423SLionel Sambuc #include "vm.h"
9*433d6423SLionel Sambuc 
10*433d6423SLionel Sambuc /* Mapping flags. */
11*433d6423SLionel Sambuc #define PTF_WRITE	I386_VM_WRITE
12*433d6423SLionel Sambuc #define PTF_READ	I386_VM_READ
13*433d6423SLionel Sambuc #define PTF_PRESENT	I386_VM_PRESENT
14*433d6423SLionel Sambuc #define PTF_USER	I386_VM_USER
15*433d6423SLionel Sambuc #define PTF_GLOBAL	I386_VM_GLOBAL
16*433d6423SLionel Sambuc #define PTF_NOCACHE	(I386_VM_PWT | I386_VM_PCD)
17*433d6423SLionel Sambuc 
18*433d6423SLionel Sambuc #define ARCH_VM_DIR_ENTRIES	I386_VM_DIR_ENTRIES
19*433d6423SLionel Sambuc #define ARCH_BIG_PAGE_SIZE	I386_BIG_PAGE_SIZE
20*433d6423SLionel Sambuc #define ARCH_VM_ADDR_MASK	I386_VM_ADDR_MASK
21*433d6423SLionel Sambuc #define ARCH_VM_PAGE_PRESENT    I386_VM_PRESENT
22*433d6423SLionel Sambuc #define ARCH_VM_PDE_MASK        I386_VM_PDE_MASK
23*433d6423SLionel Sambuc #define ARCH_VM_PDE_PRESENT     I386_VM_PRESENT
24*433d6423SLionel Sambuc #define ARCH_VM_PTE_PRESENT	I386_VM_PRESENT
25*433d6423SLionel Sambuc #define ARCH_VM_PTE_USER	I386_VM_USER
26*433d6423SLionel Sambuc #define ARCH_VM_PTE_RW		I386_VM_WRITE
27*433d6423SLionel Sambuc #define ARCH_PAGEDIR_SIZE	I386_PAGE_SIZE
28*433d6423SLionel Sambuc #define ARCH_VM_BIGPAGE		I386_VM_BIGPAGE
29*433d6423SLionel Sambuc #define ARCH_VM_PT_ENTRIES      I386_VM_PT_ENTRIES
30*433d6423SLionel Sambuc 
31*433d6423SLionel Sambuc /* For arch-specific PT routines to check if no bits outside
32*433d6423SLionel Sambuc  * the regular flags are set.
33*433d6423SLionel Sambuc  */
34*433d6423SLionel Sambuc #define PTF_ALLFLAGS   (PTF_READ|PTF_WRITE|PTF_PRESENT|PTF_USER|PTF_GLOBAL|PTF_NOCACHE)
35*433d6423SLionel Sambuc 
36*433d6423SLionel Sambuc #define PFERR_NOPAGE(e)	(!((e) & I386_VM_PFE_P))
37*433d6423SLionel Sambuc #define PFERR_PROT(e)	(((e) & I386_VM_PFE_P))
38*433d6423SLionel Sambuc #define PFERR_WRITE(e)	((e) & I386_VM_PFE_W)
39*433d6423SLionel Sambuc #define PFERR_READ(e)	(!((e) & I386_VM_PFE_W))
40*433d6423SLionel Sambuc 
41*433d6423SLionel Sambuc #define VM_PAGE_SIZE	I386_PAGE_SIZE
42*433d6423SLionel Sambuc 
43*433d6423SLionel Sambuc /* virtual address -> pde, pte macros */
44*433d6423SLionel Sambuc #define ARCH_VM_PTE(v) I386_VM_PTE(v)
45*433d6423SLionel Sambuc #define ARCH_VM_PDE(v) I386_VM_PDE(v)
46*433d6423SLionel Sambuc 
47*433d6423SLionel Sambuc #endif
48