1 /* Prototypes and definitions for VM interface. */
6 #include <minix/types.h>
7 #include <minix/endpoint.h>
9 _PROTOTYPE( int vm_exit
, (endpoint_t ep
));
10 _PROTOTYPE( int vm_fork
, (endpoint_t ep
, int slotno
, endpoint_t
*child_ep
));
11 _PROTOTYPE( int vm_brk
, (endpoint_t ep
, char *newaddr
));
12 _PROTOTYPE( int vm_exec_newmem
, (endpoint_t ep
, struct exec_newmem
*args
,
13 int args_bytes
, char **ret_stack_top
, int *ret_flags
));
14 _PROTOTYPE( int vm_push_sig
, (endpoint_t ep
, vir_bytes
*old_sp
));
15 _PROTOTYPE( int vm_willexit
, (endpoint_t ep
));
16 _PROTOTYPE( int vm_adddma
, (endpoint_t req_e
, endpoint_t proc_e
,
17 phys_bytes start
, phys_bytes size
) );
18 _PROTOTYPE( int vm_deldma
, (endpoint_t req_e
, endpoint_t proc_e
,
19 phys_bytes start
, phys_bytes size
) );
20 _PROTOTYPE( int vm_getdma
, (endpoint_t req_e
, endpoint_t
*procp
,
21 phys_bytes
*basep
, phys_bytes
*sizep
) );
22 _PROTOTYPE( void *vm_map_phys
, (endpoint_t who
, void *physaddr
, size_t len
));
23 _PROTOTYPE( int vm_unmap_phys
, (endpoint_t who
, void *vaddr
, size_t len
));
25 _PROTOTYPE( int vm_notify_sig
, (endpoint_t ep
, endpoint_t ipc_ep
));
26 _PROTOTYPE( int vm_ctl
, (int what
, int param
));
27 _PROTOTYPE( int vm_set_priv
, (int procnr
, void *buf
));
28 _PROTOTYPE( int vm_update
, (endpoint_t src_e
, endpoint_t dst_e
));
29 _PROTOTYPE( int vm_query_exit
, (int *endpt
));
31 /* VM kernel request types. */
32 #define VMPTYPE_NONE 0
33 #define VMPTYPE_CHECK 1
34 #define VMPTYPE_COWMAP 2
35 #define VMPTYPE_SMAP 3
36 #define VMPTYPE_SUNMAP 4
38 struct vm_stats_info
{
39 int vsi_pagesize
; /* page size */
40 int vsi_total
; /* total number of memory pages */
41 int vsi_free
; /* number of free pages */
42 int vsi_largest
; /* largest number of consecutive free pages */
45 struct vm_usage_info
{
46 vir_bytes vui_total
; /* total amount of process memory */
47 vir_bytes vui_common
; /* part of memory mapped in more than once */
48 vir_bytes vui_shared
; /* shared (non-COW) part of common memory */
51 struct vm_region_info
{
52 int vri_seg
; /* segment of virtual region (T or D) */
53 vir_bytes vri_addr
; /* base address of region */
54 vir_bytes vri_length
; /* length of region */
55 int vri_prot
; /* protection flags (PROT_) */
56 int vri_flags
; /* memory flags (subset of MAP_) */
59 #define MAX_VRI_COUNT 64 /* max. number of regions provided at once */
61 _PROTOTYPE( int vm_info_stats
, (struct vm_stats_info
*vfi
) );
62 _PROTOTYPE( int vm_info_usage
, (endpoint_t who
,
63 struct vm_usage_info
*vui
) );
64 _PROTOTYPE( int vm_info_region
, (endpoint_t who
,
65 struct vm_region_info
*vri
, int count
, vir_bytes
*next
) );
67 #endif /* _MINIX_VM_H */