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>
19 #include "phys_region.h"
26 phys_bytes phys
; /* physical memory */
27 u8_t refcount
; /* Refcount of these pages */
30 u8_t share_flag
; /* PBSH_COW or PBSH_SMAP */
32 /* first in list of phys_regions that reference this block */
33 struct phys_region
*firstregion
;
36 typedef struct vir_region
{
37 vir_bytes vaddr
; /* virtual address, offset from pagetable */
38 vir_bytes length
; /* length in bytes */
39 physr_avl
*phys
; /* avl tree of physical memory blocks */
41 u32_t tag
; /* Opaque to mapping code. */
42 struct vmproc
*parent
; /* Process that owns this vir_region. */
45 struct vir_region
*lower
, *higher
;
50 #define VR_WRITABLE 0x001 /* Process may write here. */
51 #define VR_NOPF 0x002 /* May not generate page faults. */
52 #define VR_PHYS64K 0x004 /* Physical memory must be 64k aligned. */
53 #define VR_LOWER16MB 0x008
54 #define VR_LOWER1MB 0x010
55 #define VR_CONTIG 0x020 /* Must be physically contiguous. */
56 #define VR_SHARED 0x040
57 #define VR_UNINITIALIZED 0x080 /* Do not clear after allocation */
60 #define VR_ANON 0x100 /* Memory to be cleared and allocated */
61 #define VR_DIRECT 0x200 /* Mapped, but not managed by VM */
64 #define VRT_NONE 0xBEEF0000
65 #define VRT_HEAP 0xBEEF0001
66 #define VRT_TEXT 0xBEEF0002
67 #define VRT_STACK 0xBEEF0003
69 /* map_page_region flags */
70 #define MF_PREALLOC 0x01