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_brk(endpoint_t ep
, char *newaddr
);
12 int vm_willexit(endpoint_t ep
);
13 int vm_adddma(endpoint_t proc_e
, phys_bytes start
, phys_bytes size
);
14 int vm_deldma(endpoint_t proc_e
, phys_bytes start
, phys_bytes size
);
15 int vm_getdma(endpoint_t
*procp
, phys_bytes
*basep
, phys_bytes
*sizep
);
16 void *vm_map_phys(endpoint_t who
, void *physaddr
, size_t len
);
17 int vm_unmap_phys(endpoint_t who
, void *vaddr
, size_t len
);
19 int vm_notify_sig(endpoint_t ep
, endpoint_t ipc_ep
);
20 int vm_set_priv(int procnr
, void *buf
);
21 int vm_update(endpoint_t src_e
, endpoint_t dst_e
);
22 int vm_memctl(endpoint_t ep
, int req
);
23 int vm_query_exit(endpoint_t
*endpt
);
24 int vm_watch_exit(endpoint_t ep
);
25 int vm_forgetblock(u64_t id
);
26 void vm_forgetblocks(void);
27 int vm_yield_block_get_block(u64_t yieldid
, u64_t getid
, void *mem
,
30 /* Invalid ID with special meaning for the vm_yield_block_get_block
33 #define VM_BLOCKID_NONE make64(ULONG_MAX, ULONG_MAX)
35 /* VM kernel request types. */
36 #define VMPTYPE_NONE 0
37 #define VMPTYPE_CHECK 1
39 struct vm_stats_info
{
40 unsigned int vsi_pagesize
; /* page size */
41 unsigned long vsi_total
; /* total number of memory pages */
42 unsigned long vsi_free
; /* number of free pages */
43 unsigned long vsi_largest
; /* largest number of consecutive free pages */
44 unsigned long vsi_cached
; /* number of pages cached for file systems */
47 struct vm_usage_info
{
48 vir_bytes vui_total
; /* total amount of process memory */
49 vir_bytes vui_common
; /* part of memory mapped in more than once */
50 vir_bytes vui_shared
; /* shared (non-COW) part of common memory */
53 struct vm_region_info
{
54 vir_bytes vri_addr
; /* base address of region */
55 vir_bytes vri_length
; /* length of region */
56 int vri_prot
; /* protection flags (PROT_) */
57 int vri_flags
; /* memory flags (subset of MAP_) */
60 #define MAX_VRI_COUNT 64 /* max. number of regions provided at once */
62 int vm_info_stats(struct vm_stats_info
*vfi
);
63 int vm_info_usage(endpoint_t who
, struct vm_usage_info
*vui
);
64 int vm_info_region(endpoint_t who
, struct vm_region_info
*vri
, int
65 count
, vir_bytes
*next
);
66 int vm_procctl(endpoint_t ep
, int param
);
68 #endif /* _MINIX_VM_H */