64f10ee644
Implement getrusage. These fields of struct rusage are not supported and always set to zero at this time long ru_nswap; /* swaps */ long ru_inblock; /* block input operations */ long ru_oublock; /* block output operations */ long ru_msgsnd; /* messages sent */ long ru_msgrcv; /* messages received */ long ru_nvcsw; /* voluntary context switches */ long ru_nivcsw; /* involuntary context switches */ test75.c is the unit test for this new function Change-Id: I3f1eb69de1fce90d087d76773b09021fc6106539
33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
|
|
#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 {
|
|
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, 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);
|
|
} mem_type_t;
|
|
|
|
#endif
|
|
|