minix/servers/vm/arch/earm/pagetable.h
Lionel Sambuc b1c4ba4ab6 ARM updates
Due to the ABI we are using we have to use the earm architecture
moniker for the build system to behave correctly. This involves
then some headers to move around.

There is also a few related Makefile updates as well as minor
source code corrections.
2013-01-17 10:03:58 +01:00

49 lines
1.4 KiB
C

#ifndef _PAGETABLE_H
#define _PAGETABLE_H 1
#include <stdint.h>
#include <machine/vm.h>
#include "vm.h"
/* Mapping flags. */
#define PTF_WRITE ARM_VM_PTE_RW
#define PTF_READ ARM_VM_PTE_RO
#define PTF_PRESENT ARM_VM_PTE_PRESENT
#define PTF_SUPER ARM_VM_PTE_SUPER
#define PTF_USER ARM_VM_PTE_USER
#define PTF_NOCACHE ARM_VM_PTE_DEVICE
#define PTF_CACHEWB ARM_VM_PTE_WB
#define PTF_CACHEWT ARM_VM_PTE_WT
#define PTF_SHARE ARM_VM_PTE_SHAREABLE
#define ARCH_VM_DIR_ENTRIES ARM_VM_DIR_ENTRIES
#define ARCH_BIG_PAGE_SIZE ARM_BIG_PAGE_SIZE
#define ARCH_VM_ADDR_MASK ARM_VM_ADDR_MASK
#define ARCH_VM_PDE_MASK ARM_VM_PDE_MASK
#define ARCH_VM_PDE_PRESENT ARM_VM_PDE_PRESENT
#define ARCH_VM_PTE_PRESENT ARM_VM_PTE_PRESENT
#define ARCH_VM_PTE_USER ARM_VM_PTE_USER
#define ARCH_PAGEDIR_SIZE ARM_PAGEDIR_SIZE
#define ARCH_VM_PTE_RW ARM_VM_PTE_RW
#define ARCH_VM_BIGPAGE ARM_VM_BIGPAGE
#define ARCH_VM_PT_ENTRIES ARM_VM_PT_ENTRIES
#define ARCH_VM_PTE_RO ARM_VM_PTE_RO
/* For arch-specific PT routines to check if no bits outside
* the regular flags are set.
*/
#define PTF_ALLFLAGS (PTF_READ|PTF_WRITE|PTF_PRESENT|PTF_SUPER|PTF_USER|PTF_NOCACHE|PTF_CACHEWB|PTF_CACHEWT|PTF_SHARE)
#define PFERR_PROT(e) ((ARM_VM_PFE_FS(e) == ARM_VM_PFE_L1PERM) \
|| (ARM_VM_PFE_FS(e) == ARM_VM_PFE_L2PERM))
#define PFERR_NOPAGE(e) (!PFERR_PROT(e))
#define PFERR_WRITE(e) ((e) & ARM_VM_PFE_W)
#define PFERR_READ(e) (!((e) & ARM_VM_PFE_W))
#define VM_PAGE_SIZE ARM_PAGE_SIZE
#endif