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"
28 phys_bytes phys
; /* physical memory */
29 u8_t refcount
; /* Refcount of these pages */
31 /* what kind of memory is it? */
34 /* first in list of phys_regions that reference this block */
35 struct phys_region
*firstregion
;
38 typedef struct vir_region
{
39 vir_bytes vaddr
; /* virtual address, offset from pagetable */
40 vir_bytes length
; /* length in bytes */
41 physr_avl
*phys
; /* avl tree of physical memory blocks */
43 struct vmproc
*parent
; /* Process that owns this vir_region. */
44 mem_type_t
*memtype
; /* Default instantiated memory type. */
46 u32_t id
; /* unique id */
58 struct vir_region
*lower
, *higher
;
63 #define VR_WRITABLE 0x001 /* Process may write here. */
64 #define VR_PHYS64K 0x004 /* Physical memory must be 64k aligned. */
65 #define VR_LOWER16MB 0x008
66 #define VR_LOWER1MB 0x010
67 #define VR_CONTIG 0x020 /* Must be physically contiguous. */
68 #define VR_SHARED 0x040
69 #define VR_UNINITIALIZED 0x080 /* Do not clear after allocation */
72 #define VR_ANON 0x100 /* Memory to be cleared and allocated */
73 #define VR_DIRECT 0x200 /* Mapped, but not managed by VM */
75 /* map_page_region flags */
76 #define MF_PREALLOC 0x01