1 /* Prototypes and definitions for VM interface. */
7 #include <minix/endpoint.h>
9 int vm_exit(endpoint_t ep
);
10 int vm_fork(endpoint_t ep
, int slotno
, endpoint_t
*child_ep
);
11 int vm_willexit(endpoint_t ep
);
12 int vm_adddma(endpoint_t proc_e
, phys_bytes start
, phys_bytes size
);
13 int vm_deldma(endpoint_t proc_e
, phys_bytes start
, phys_bytes size
);
14 int vm_getdma(endpoint_t
*procp
, phys_bytes
*basep
, phys_bytes
*sizep
);
15 void *vm_map_phys(endpoint_t who
, void *physaddr
, size_t len
);
16 int vm_unmap_phys(endpoint_t who
, void *vaddr
, size_t len
);
18 int vm_notify_sig(endpoint_t ep
, endpoint_t ipc_ep
);
19 int vm_set_priv(endpoint_t ep
, void *buf
, int sys_proc
);
20 int vm_update(endpoint_t src_e
, endpoint_t dst_e
);
21 int vm_memctl(endpoint_t ep
, int req
);
22 int vm_query_exit(endpoint_t
*endpt
);
23 int vm_watch_exit(endpoint_t ep
);
24 int vm_forgetblock(u64_t id
);
25 void vm_forgetblocks(void);
26 int minix_vfs_mmap(endpoint_t who
, off_t offset
, size_t len
,
27 dev_t dev
, ino_t ino
, int fd
, u32_t vaddr
, u16_t clearend
, u16_t
30 void *minix_mmap_for(endpoint_t forwhom
,
31 void *addr
, size_t len
, int prot
, int flags
, int fd
, off_t offset
);
32 int minix_vfs_mmap(endpoint_t who
, off_t offset
, size_t len
,
33 dev_t dev
, ino_t ino
, int fd
, u32_t vaddr
, u16_t clearend
,
36 /* minix vfs mmap flags */
37 #define MVM_WRITABLE 0x8000
39 /* VM kernel request types. */
40 #define VMPTYPE_NONE 0
41 #define VMPTYPE_CHECK 1
43 struct vm_stats_info
{
44 unsigned int vsi_pagesize
; /* page size */
45 unsigned long vsi_total
; /* total number of memory pages */
46 unsigned long vsi_free
; /* number of free pages */
47 unsigned long vsi_largest
; /* largest number of consecutive free pages */
48 unsigned long vsi_cached
; /* number of pages cached for file systems */
51 struct vm_usage_info
{
52 vir_bytes vui_total
; /* total amount of process memory */
53 vir_bytes vui_common
; /* part of memory mapped in more than once */
54 vir_bytes vui_shared
; /* shared (non-COW) part of common memory */
57 struct vm_region_info
{
58 vir_bytes vri_addr
; /* base address of region */
59 vir_bytes vri_length
; /* length of region */
60 int vri_prot
; /* protection flags (PROT_) */
61 int vri_flags
; /* memory flags (subset of MAP_) */
64 #define MAX_VRI_COUNT 64 /* max. number of regions provided at once */
66 int vm_info_stats(struct vm_stats_info
*vfi
);
67 int vm_info_usage(endpoint_t who
, struct vm_usage_info
*vui
);
68 int vm_info_region(endpoint_t who
, struct vm_region_info
*vri
, int
69 count
, vir_bytes
*next
);
70 int vm_procctl_clear(endpoint_t ep
);
71 int vm_procctl_handlemem(endpoint_t ep
, vir_bytes m1
, vir_bytes m2
, int wr
);
73 int vm_set_cacheblock(void *block
, dev_t dev
, off_t dev_offset
,
74 ino_t ino
, off_t ino_offset
, u32_t
*flags
, int blocksize
);
76 void *vm_map_cacheblock(dev_t dev
, off_t dev_offset
,
77 ino_t ino
, off_t ino_offset
, u32_t
*flags
, int blocksize
);
79 int vm_clear_cache(dev_t dev
);
81 /* flags for vm cache functions */
82 #define VMMC_FLAGS_LOCKED 0x01 /* someone is updating the flags; don't read/write */
83 #define VMMC_DIRTY 0x02 /* dirty buffer and it may not be evicted */
84 #define VMMC_EVICTED 0x04 /* VM has evicted the buffer and it's invalid */
85 #define VMMC_BLOCK_LOCKED 0x08 /* client is using it and it may not be evicted */
87 /* special inode number for vm cache functions */
88 #define VMC_NO_INODE 0 /* to reference a disk block, no associated file */
90 #endif /* _MINIX_VM_H */