Make VM fix up memory for kernel that crosses region boundaries
[minix.git] / servers / vm / i386 / pagetable.h
blob42fb7d7e62efa0178e231415dbc7b6e82fdd422d
2 #ifndef _PAGETABLE_H
3 #define _PAGETABLE_H 1
5 #include <stdint.h>
6 #include <sys/vm_i386.h>
8 #include "../vm.h"
10 /* An i386 pagetable. */
11 typedef struct {
12 /* Directory entries in VM addr space - root of page table. */
13 u32_t *pt_dir; /* page aligned (I386_VM_DIR_ENTRIES) */
14 u32_t pt_dir_phys; /* physical address of pt_dir */
16 /* Pointers to page tables in VM address space. */
17 u32_t *pt_pt[I386_VM_DIR_ENTRIES];
19 /* When looking for a hole in virtual address space, start
20 * looking here. This is in linear addresses, i.e.,
21 * not as the process sees it but the position in the page
22 * page table. This is just a hint.
24 u32_t pt_virtop;
25 } pt_t;
27 /* Mapping flags. */
28 #define PTF_WRITE I386_VM_WRITE
29 #define PTF_PRESENT I386_VM_PRESENT
30 #define PTF_USER I386_VM_USER
31 #define PTF_GLOBAL I386_VM_GLOBAL
32 #define PTF_MAPALLOC I386_VM_PTAVAIL1 /* Page allocated by pt code. */
34 /* For arch-specific PT routines to check if no bits outside
35 * the regular flags are set.
37 #define PTF_ALLFLAGS (PTF_WRITE|PTF_PRESENT|PTF_USER|PTF_GLOBAL)
39 #if SANITYCHECKS
40 #define PT_SANE(p) { pt_sanitycheck((p), __FILE__, __LINE__); }
41 #else
42 #define PT_SANE(p)
43 #endif
45 #endif