tar: use utime() to restore timestamps
[minix.git] / servers / vm / region.h
blob6899339d9074202d3addc5c2d4aa65c89c4b69e3
2 #ifndef _REGION_H
3 #define _REGION_H 1
5 #include <minix/callnr.h>
6 #include <minix/com.h>
7 #include <minix/config.h>
8 #include <minix/const.h>
9 #include <minix/ds.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"
20 #include "memtype.h"
21 #include "vm.h"
23 struct phys_block {
24 #if SANITYCHECKS
25 u32_t seencount;
26 #endif
27 phys_bytes phys; /* physical memory */
28 u8_t refcount; /* Refcount of these pages */
30 /* what kind of memory is it? */
31 mem_type_t *memtype;
33 /* first in list of phys_regions that reference this block */
34 struct phys_region *firstregion;
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;
41 u16_t flags;
42 struct vmproc *parent; /* Process that owns this vir_region. */
43 mem_type_t *memtype; /* Default instantiated memory type. */
44 int remaps;
45 u32_t id; /* unique id */
47 union {
48 phys_bytes phys;
49 struct {
50 endpoint_t ep;
51 vir_bytes vaddr;
52 int id;
53 } shared;
54 } param;
56 /* AVL fields */
57 struct vir_region *lower, *higher;
58 int factor;
59 } region_t;
61 /* Mapping flags: */
62 #define VR_WRITABLE 0x001 /* Process may write here. */
63 #define VR_PHYS64K 0x004 /* Physical memory must be 64k aligned. */
64 #define VR_LOWER16MB 0x008
65 #define VR_LOWER1MB 0x010
66 #define VR_CONTIG 0x020 /* Must be physically contiguous. */
67 #define VR_SHARED 0x040
68 #define VR_UNINITIALIZED 0x080 /* Do not clear after allocation */
70 /* Mapping type: */
71 #define VR_ANON 0x100 /* Memory to be cleared and allocated */
72 #define VR_DIRECT 0x200 /* Mapped, but not managed by VM */
74 /* map_page_region flags */
75 #define MF_PREALLOC 0x01
77 #endif