2012-10-11 15:15:49 +02:00
|
|
|
|
|
|
|
#ifndef _MEMTYPE_H
|
|
|
|
#define _MEMTYPE_H 1
|
|
|
|
|
|
|
|
struct vmproc;
|
|
|
|
struct vir_region;
|
|
|
|
struct phys_region;
|
|
|
|
|
2013-03-20 20:18:52 +01:00
|
|
|
typedef void (*vfs_callback_t)(struct vmproc *vmp, message *m,
|
|
|
|
void *, void *);
|
|
|
|
|
2012-10-11 15:15:49 +02:00
|
|
|
typedef struct mem_type {
|
2013-08-20 14:02:33 +02:00
|
|
|
const char *name; /* human-readable name */
|
2012-10-11 15:15:49 +02:00
|
|
|
int (*ev_new)(struct vir_region *region);
|
|
|
|
void (*ev_delete)(struct vir_region *region);
|
2013-03-20 20:18:52 +01:00
|
|
|
int (*ev_reference)(struct phys_region *pr, struct phys_region *newpr);
|
2012-10-11 15:15:49 +02:00
|
|
|
int (*ev_unreference)(struct phys_region *pr);
|
|
|
|
int (*ev_pagefault)(struct vmproc *vmp, struct vir_region *region,
|
2013-06-25 14:41:01 +02:00
|
|
|
struct phys_region *ph, int write, vfs_callback_t cb, void *state,
|
|
|
|
int len, int *io);
|
2012-10-11 15:15:49 +02:00
|
|
|
int (*ev_resize)(struct vmproc *vmp, struct vir_region *vr, vir_bytes len);
|
2013-03-20 20:18:52 +01:00
|
|
|
void (*ev_split)(struct vmproc *vmp, struct vir_region *vr,
|
|
|
|
struct vir_region *r1, struct vir_region *r2);
|
2012-10-11 15:15:49 +02:00
|
|
|
int (*writable)(struct phys_region *pr);
|
|
|
|
int (*ev_sanitycheck)(struct phys_region *pr, char *file, int line);
|
|
|
|
int (*ev_copy)(struct vir_region *vr, struct vir_region *newvr);
|
2013-03-20 20:18:52 +01:00
|
|
|
int (*ev_lowshrink)(struct vir_region *vr, vir_bytes len);
|
2012-10-11 15:15:49 +02:00
|
|
|
u32_t (*regionid)(struct vir_region *vr);
|
|
|
|
int (*refcount)(struct vir_region *vr);
|
2013-09-25 10:41:26 +02:00
|
|
|
int (*pt_flags)(struct vir_region *vr); /* page table flags */
|
2012-10-11 15:15:49 +02:00
|
|
|
} mem_type_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|