5 #include <minix/callnr.h>
7 #include <minix/config.h>
8 #include <minix/const.h>
10 #include <minix/endpoint.h>
11 #include <minix/keymap.h>
12 #include <minix/minlib.h>
13 #include <minix/type.h>
14 #include <minix/ipc.h>
15 #include <minix/sysutil.h>
16 #include <minix/syslib.h>
17 #include <minix/const.h>
23 vir_bytes length
; /* no. of contiguous bytes */
24 phys_bytes phys
; /* physical memory */
25 u8_t refcount
; /* Refcount of these pages */
27 /* first in list of phys_regions that reference this block */
28 struct phys_region
*firstregion
;
31 typedef struct phys_region
{
32 struct phys_block
*ph
;
33 struct vir_region
*parent
; /* parent vir_region. */
34 vir_bytes offset
; /* offset from start of vir region */
36 int written
; /* written to pagetable */
39 /* list of phys_regions that reference the same phys_block */
40 struct phys_region
*next_ph_list
;
43 struct phys_region
*less
, *greater
;
50 struct vir_region
*next
; /* next virtual region in this process */
51 vir_bytes vaddr
; /* virtual address, offset from pagetable */
52 vir_bytes length
; /* length in bytes */
53 physr_avl
*phys
; /* avl tree of physical memory blocks */
55 u32_t tag
; /* Opaque to mapping code. */
56 struct vmproc
*parent
; /* Process that owns this vir_region. */
60 #define VR_WRITABLE 0x001 /* Process may write here. */
61 #define VR_NOPF 0x002 /* May not generate page faults. */
62 #define VR_PHYS64K 0x004 /* Physical memory must be 64k aligned. */
63 #define VR_LOWER16MB 0x008
64 #define VR_LOWER1MB 0x010
67 #define VR_ANON 0x100 /* Memory to be cleared and allocated */
68 #define VR_DIRECT 0x200 /* Mapped, but not managed by VM */
69 #define VR_SHARED 0x40
72 #define VRT_NONE 0xBEEF0000
73 #define VRT_HEAP 0xBEEF0001
74 #define VRT_CODE 0xBEEF0002
76 /* map_page_region flags */
77 #define MF_PREALLOC 0x01
78 #define MF_CONTIG 0x02