xref: /titanic_41/usr/src/uts/i86xpv/vm/seg_mf.h (revision 7eea693d6b672899726e75993fddc4e95b52647f)
1843e1988Sjohnlev /*
2843e1988Sjohnlev  * CDDL HEADER START
3843e1988Sjohnlev  *
4843e1988Sjohnlev  * The contents of this file are subject to the terms of the
5843e1988Sjohnlev  * Common Development and Distribution License (the "License").
6843e1988Sjohnlev  * You may not use this file except in compliance with the License.
7843e1988Sjohnlev  *
8843e1988Sjohnlev  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9843e1988Sjohnlev  * or http://www.opensolaris.org/os/licensing.
10843e1988Sjohnlev  * See the License for the specific language governing permissions
11843e1988Sjohnlev  * and limitations under the License.
12843e1988Sjohnlev  *
13843e1988Sjohnlev  * When distributing Covered Code, include this CDDL HEADER in each
14843e1988Sjohnlev  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15843e1988Sjohnlev  * If applicable, add the following below this CDDL HEADER, with the
16843e1988Sjohnlev  * fields enclosed by brackets "[]" replaced with your own identifying
17843e1988Sjohnlev  * information: Portions Copyright [yyyy] [name of copyright owner]
18843e1988Sjohnlev  *
19843e1988Sjohnlev  * CDDL HEADER END
20843e1988Sjohnlev  */
21843e1988Sjohnlev 
22843e1988Sjohnlev /*
23*7eea693dSMark Johnson  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24843e1988Sjohnlev  * Use is subject to license terms.
25843e1988Sjohnlev  */
26843e1988Sjohnlev 
27843e1988Sjohnlev #ifndef	_VM_SEG_MF_H
28843e1988Sjohnlev #define	_VM_SEG_MF_H
29843e1988Sjohnlev 
30843e1988Sjohnlev 
31843e1988Sjohnlev #include <sys/types.h>
32843e1988Sjohnlev #include <vm/seg.h>
33843e1988Sjohnlev #include <sys/hypervisor.h>
34843e1988Sjohnlev 
35843e1988Sjohnlev #ifdef __cplusplus
36843e1988Sjohnlev extern "C" {
37843e1988Sjohnlev #endif
38843e1988Sjohnlev 
39843e1988Sjohnlev struct segmf_crargs {
40843e1988Sjohnlev 	dev_t		dev;
41843e1988Sjohnlev 	uchar_t		prot;
42843e1988Sjohnlev 	uchar_t		maxprot;
43843e1988Sjohnlev };
44843e1988Sjohnlev 
45843e1988Sjohnlev extern int segmf_create(struct seg *, void *);
46*7eea693dSMark Johnson 
47843e1988Sjohnlev extern int segmf_add_mfns(struct seg *, caddr_t, mfn_t, pgcnt_t, domid_t);
48843e1988Sjohnlev 
49*7eea693dSMark Johnson /* max grefs which can be passed into segmf_add_grefs */
50*7eea693dSMark Johnson #define	SEGMF_MAX_GREFS		0x10
51*7eea693dSMark Johnson 
52*7eea693dSMark Johnson /* segmf_add_grefs flags */
53*7eea693dSMark Johnson #define	SEGMF_GREF_WR		0x1	/* Map gref writable */
54*7eea693dSMark Johnson 
55*7eea693dSMark Johnson extern int segmf_add_grefs(struct seg *, caddr_t, uint_t, grant_ref_t *,
56*7eea693dSMark Johnson     uint_t, domid_t);
57*7eea693dSMark Johnson extern int segmf_release_grefs(struct seg *, caddr_t, uint_t);
58*7eea693dSMark Johnson extern void segmf_add_gref_pte(struct seg *, caddr_t, uint64_t);
59*7eea693dSMark Johnson 
60843e1988Sjohnlev #ifdef __cplusplus
61843e1988Sjohnlev }
62843e1988Sjohnlev #endif
63843e1988Sjohnlev 
64843e1988Sjohnlev #endif /* _VM_SEG_MF_H */
65