xref: /minix/minix/servers/vm/memtype.h (revision 83133719)
1 
2 #ifndef _MEMTYPE_H
3 #define _MEMTYPE_H 1
4 
5 struct vmproc;
6 struct vir_region;
7 struct phys_region;
8 
9 typedef void (*vfs_callback_t)(struct vmproc *vmp, message *m,
10         void *, void *);
11 
12 typedef struct mem_type {
13 	const char *name;	/* human-readable name */
14 	int (*ev_new)(struct vir_region *region);
15 	void (*ev_delete)(struct vir_region *region);
16 	int (*ev_reference)(struct phys_region *pr, struct phys_region *newpr);
17 	int (*ev_unreference)(struct phys_region *pr);
18 	int (*ev_pagefault)(struct vmproc *vmp, struct vir_region *region,
19 	 struct phys_region *ph, int write, vfs_callback_t cb, void *state,
20 	 int len, int *io);
21 	int (*ev_resize)(struct vmproc *vmp, struct vir_region *vr, vir_bytes len);
22 	void (*ev_split)(struct vmproc *vmp, struct vir_region *vr,
23 		struct vir_region *r1, struct vir_region *r2);
24 	int (*writable)(struct phys_region *pr);
25 	int (*ev_sanitycheck)(struct phys_region *pr, const char *file, int line);
26         int (*ev_copy)(struct vir_region *vr, struct vir_region *newvr);
27         int (*ev_lowshrink)(struct vir_region *vr, vir_bytes len);
28 	u32_t (*regionid)(struct vir_region *vr);
29         int (*refcount)(struct vir_region *vr);
30         int (*pt_flags)(struct vir_region *vr); /* page table flags */
31 } mem_type_t;
32 
33 #endif
34 
35