5 #include <minix/callnr.h>
7 #include <minix/config.h>
8 #include <minix/const.h>
10 #include <minix/endpoint.h>
11 #include <minix/minlib.h>
12 #include <minix/type.h>
13 #include <minix/ipc.h>
14 #include <minix/sysutil.h>
15 #include <minix/syslib.h>
16 #include <minix/const.h>
18 #include "phys_region.h"
27 phys_bytes phys
; /* physical memory */
29 /* first in list of phys_regions that reference this block */
30 struct phys_region
*firstregion
;
31 u8_t refcount
; /* Refcount of these pages */
35 #define PBF_INCACHE 0x01
37 typedef struct vir_region
{
38 vir_bytes vaddr
; /* virtual address, offset from pagetable */
39 vir_bytes length
; /* length in bytes */
40 struct phys_region
**physblocks
;
42 struct vmproc
*parent
; /* Process that owns this vir_region. */
43 mem_type_t
*def_memtype
; /* Default instantiated memory type. */
45 int id
; /* unique id */
48 phys_bytes phys
; /* VR_DIRECT */
54 struct phys_block
*pb_cache
;
64 struct vir_region
*lower
, *higher
;
69 #define VR_WRITABLE 0x001 /* Process may write here. */
70 #define VR_PHYS64K 0x004 /* Physical memory must be 64k aligned. */
71 #define VR_LOWER16MB 0x008
72 #define VR_LOWER1MB 0x010
73 #define VR_SHARED 0x040
74 #define VR_UNINITIALIZED 0x080 /* Do not clear after allocation */
77 #define VR_ANON 0x100 /* Memory to be cleared and allocated */
78 #define VR_DIRECT 0x200 /* Mapped, but not managed by VM */
80 /* map_page_region flags */
81 #define MF_PREALLOC 0x01