1 2 #ifndef _PAGETABLE_H 3 #define _PAGETABLE_H 1 4 5 #include <stdint.h> 6 #include <machine/vm.h> 7 8 #include "vm.h" 9 10 /* Mapping flags. */ 11 #define PTF_WRITE ARM_VM_PTE_RW 12 #define PTF_READ ARM_VM_PTE_RO 13 #define PTF_PRESENT ARM_VM_PTE_PRESENT 14 #define PTF_SUPER ARM_VM_PTE_SUPER 15 #define PTF_USER ARM_VM_PTE_USER 16 #define PTF_NOCACHE ARM_VM_PTE_DEVICE 17 #define PTF_CACHEWB ARM_VM_PTE_WB 18 #define PTF_CACHEWT ARM_VM_PTE_WT 19 #define PTF_SHARE ARM_VM_PTE_S 20 21 #define ARCH_VM_DIR_ENTRIES ARM_VM_DIR_ENTRIES 22 #define ARCH_BIG_PAGE_SIZE ARM_SECTION_SIZE 23 #define ARCH_VM_ADDR_MASK ARM_VM_ADDR_MASK 24 #define ARCH_VM_PDE_MASK ARM_VM_PDE_MASK 25 #define ARCH_VM_PDE_PRESENT ARM_VM_PDE_PRESENT 26 #define ARCH_VM_PTE_PRESENT ARM_VM_PTE_PRESENT 27 #define ARCH_VM_PTE_USER ARM_VM_PTE_USER 28 #define ARCH_PAGEDIR_SIZE ARM_PAGEDIR_SIZE 29 #define ARCH_VM_PTE_RW ARM_VM_PTE_RW 30 #define ARCH_VM_BIGPAGE ARM_VM_SECTION 31 #define ARCH_VM_PT_ENTRIES ARM_VM_PT_ENTRIES 32 #define ARCH_VM_PTE_RO ARM_VM_PTE_RO 33 34 /* For arch-specific PT routines to check if no bits outside 35 * the regular flags are set. 36 */ 37 #define PTF_ALLFLAGS (PTF_READ|PTF_WRITE|PTF_PRESENT|PTF_SUPER|PTF_USER|PTF_NOCACHE|PTF_CACHEWB|PTF_CACHEWT|PTF_SHARE) 38 39 #define PFERR_PROT(e) ((ARM_VM_PFE_FS(e) == ARM_VM_PFE_L1PERM) \ 40 || (ARM_VM_PFE_FS(e) == ARM_VM_PFE_L2PERM)) 41 #define PFERR_NOPAGE(e) (!PFERR_PROT(e)) 42 #define PFERR_WRITE(e) ((e) & ARM_VM_PFE_W) 43 #define PFERR_READ(e) (!((e) & ARM_VM_PFE_W)) 44 45 #define VM_PAGE_SIZE ARM_PAGE_SIZE 46 47 /* virtual address -> pde, pte macros */ 48 #define ARCH_VM_PTE(v) ARM_VM_PTE(v) 49 #define ARCH_VM_PDE(v) ARM_VM_PDE(v) 50 51 #endif 52 53