1 
2 /*
3  * This file and its contents are supplied under the terms of the
4  * Common Development and Distribution License ("CDDL"), version 1.0.
5  * You may only use this file in accordance with the terms of version
6  * 1.0 of the CDDL.
7  *
8  * A full copy of the text of the CDDL should have accompanied this
9  * source.  A copy of the CDDL is also available via the Internet at
10  * http://www.illumos.org/license/CDDL.
11  */
12 
13 /*
14  * Copyright 2023 Oxide Computer Company
15  */
16 
17 #ifndef _SYS_VMM_RESERVOIR_H
18 #define	_SYS_VMM_RESERVOIR_H
19 
20 #include <sys/types.h>
21 #include <sys/cred.h>
22 
23 struct vmmr_region;
24 typedef struct vmmr_region vmmr_region_t;
25 
26 int vmmr_init();
27 void vmmr_fini();
28 bool vmmr_is_empty();
29 
30 int vmmr_alloc(size_t, bool, vmmr_region_t **);
31 void *vmmr_region_mem_at(vmmr_region_t *, uintptr_t);
32 pfn_t vmmr_region_pfn_at(vmmr_region_t *, uintptr_t);
33 void vmmr_free(vmmr_region_t *);
34 
35 int vmmr_ioctl(int, intptr_t, int, cred_t *, int *);
36 
37 #endif /* _SYS_VMM_RESERVOIR_H */
38