2008-11-19 13:26:10 +01:00
|
|
|
|
|
|
|
#ifndef _PAGETABLE_H
|
|
|
|
#define _PAGETABLE_H 1
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2010-03-08 12:04:59 +01:00
|
|
|
#include <machine/vm.h>
|
2008-11-19 13:26:10 +01:00
|
|
|
|
2010-03-22 22:25:22 +01:00
|
|
|
#include "vm.h"
|
2009-09-21 16:49:49 +02:00
|
|
|
|
2008-11-19 13:26:10 +01:00
|
|
|
/* Mapping flags. */
|
|
|
|
#define PTF_WRITE I386_VM_WRITE
|
2012-08-16 23:34:15 +02:00
|
|
|
#define PTF_READ I386_VM_READ
|
2008-11-19 13:26:10 +01:00
|
|
|
#define PTF_PRESENT I386_VM_PRESENT
|
|
|
|
#define PTF_USER I386_VM_USER
|
2009-04-23 17:11:16 +02:00
|
|
|
#define PTF_GLOBAL I386_VM_GLOBAL
|
2010-04-13 13:08:08 +02:00
|
|
|
#define PTF_NOCACHE (I386_VM_PWT | I386_VM_PCD)
|
2008-11-19 13:26:10 +01:00
|
|
|
|
2012-10-31 19:24:14 +01:00
|
|
|
#define ARCH_VM_DIR_ENTRIES I386_VM_DIR_ENTRIES
|
|
|
|
#define ARCH_BIG_PAGE_SIZE I386_BIG_PAGE_SIZE
|
|
|
|
#define ARCH_VM_ADDR_MASK I386_VM_ADDR_MASK
|
|
|
|
#define ARCH_VM_PAGE_PRESENT I386_VM_PRESENT
|
|
|
|
#define ARCH_VM_PDE_MASK I386_VM_PDE_MASK
|
|
|
|
#define ARCH_VM_PDE_PRESENT I386_VM_PRESENT
|
|
|
|
#define ARCH_VM_PTE_PRESENT I386_VM_PRESENT
|
|
|
|
#define ARCH_VM_PTE_USER I386_VM_USER
|
|
|
|
#define ARCH_VM_PTE_RW I386_VM_WRITE
|
2012-11-09 19:00:46 +01:00
|
|
|
#define ARCH_PAGEDIR_SIZE I386_PAGE_SIZE
|
2012-10-31 19:24:14 +01:00
|
|
|
#define ARCH_VM_BIGPAGE I386_VM_BIGPAGE
|
|
|
|
#define ARCH_VM_PT_ENTRIES I386_VM_PT_ENTRIES
|
|
|
|
|
2008-11-19 13:26:10 +01:00
|
|
|
/* For arch-specific PT routines to check if no bits outside
|
|
|
|
* the regular flags are set.
|
|
|
|
*/
|
2012-08-16 23:34:15 +02:00
|
|
|
#define PTF_ALLFLAGS (PTF_READ|PTF_WRITE|PTF_PRESENT|PTF_USER|PTF_GLOBAL|PTF_NOCACHE)
|
2008-11-19 13:26:10 +01:00
|
|
|
|
2012-10-31 19:24:14 +01:00
|
|
|
#define PFERR_NOPAGE(e) (!((e) & I386_VM_PFE_P))
|
|
|
|
#define PFERR_PROT(e) (((e) & I386_VM_PFE_P))
|
|
|
|
#define PFERR_WRITE(e) ((e) & I386_VM_PFE_W)
|
|
|
|
#define PFERR_READ(e) (!((e) & I386_VM_PFE_W))
|
2008-11-19 13:26:10 +01:00
|
|
|
|
2012-10-31 19:24:14 +01:00
|
|
|
#define VM_PAGE_SIZE I386_PAGE_SIZE
|
2009-09-21 16:49:49 +02:00
|
|
|
|
2013-03-06 13:17:07 +01:00
|
|
|
/* virtual address -> pde, pte macros */
|
|
|
|
#define ARCH_VM_PTE(v) I386_VM_PTE(v)
|
|
|
|
#define ARCH_VM_PDE(v) I386_VM_PDE(v)
|
|
|
|
|
2012-10-31 19:24:14 +01:00
|
|
|
#endif
|