summaryrefslogtreecommitdiff
path: root/minix/servers/vm/memtype.h
blob: a7edaa3a50baae62d810dba1f7862a9745ce1202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

#ifndef _MEMTYPE_H
#define _MEMTYPE_H 1

struct vmproc;
struct vir_region;
struct phys_region;

typedef void (*vfs_callback_t)(struct vmproc *vmp, message *m,
        void *, void *);

typedef struct mem_type {
	const char *name;	/* human-readable name */
	int (*ev_new)(struct vir_region *region);
	void (*ev_delete)(struct vir_region *region);
	int (*ev_reference)(struct phys_region *pr, struct phys_region *newpr);
	int (*ev_unreference)(struct phys_region *pr);
	int (*ev_pagefault)(struct vmproc *vmp, struct vir_region *region,
	 struct phys_region *ph, int write, vfs_callback_t cb, void *state,
	 int len, int *io);
	int (*ev_resize)(struct vmproc *vmp, struct vir_region *vr, vir_bytes len);
	void (*ev_split)(struct vmproc *vmp, struct vir_region *vr,
		struct vir_region *r1, struct vir_region *r2);
	int (*writable)(struct phys_region *pr);
	int (*ev_sanitycheck)(struct phys_region *pr, const char *file, int line);
        int (*ev_copy)(struct vir_region *vr, struct vir_region *newvr);
        int (*ev_lowshrink)(struct vir_region *vr, vir_bytes len);
	u32_t (*regionid)(struct vir_region *vr);
        int (*refcount)(struct vir_region *vr);
        int (*pt_flags)(struct vir_region *vr); /* page table flags */
} mem_type_t;

#endif