xref: /illumos-gate/usr/src/uts/intel/io/vmm/sys/vmm_reservoir.h (revision fdad6fbf87b201fdb96a704fc41fa8be1e4efbc8)
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 /* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
13 
14 /*
15  * Copyright 2023 Oxide Computer Company
16  */
17 
18 #ifndef _SYS_VMM_RESERVOIR_H
19 #define	_SYS_VMM_RESERVOIR_H
20 
21 #include <sys/types.h>
22 #include <sys/cred.h>
23 
24 struct vmmr_region;
25 typedef struct vmmr_region vmmr_region_t;
26 
27 int vmmr_init();
28 void vmmr_fini();
29 bool vmmr_is_empty();
30 
31 int vmmr_alloc(size_t, bool, vmmr_region_t **);
32 void *vmmr_region_mem_at(vmmr_region_t *, uintptr_t);
33 pfn_t vmmr_region_pfn_at(vmmr_region_t *, uintptr_t);
34 void vmmr_free(vmmr_region_t *);
35 
36 int vmmr_ioctl(int, intptr_t, int, cred_t *, int *);
37 
38 #endif /* _SYS_VMM_RESERVOIR_H */
39