xref: /onnv-gate/usr/src/uts/i86xpv/vm/seg_mf.h (revision 7756:d653ef0c7180)
15084Sjohnlev /*
25084Sjohnlev  * CDDL HEADER START
35084Sjohnlev  *
45084Sjohnlev  * The contents of this file are subject to the terms of the
55084Sjohnlev  * Common Development and Distribution License (the "License").
65084Sjohnlev  * You may not use this file except in compliance with the License.
75084Sjohnlev  *
85084Sjohnlev  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95084Sjohnlev  * or http://www.opensolaris.org/os/licensing.
105084Sjohnlev  * See the License for the specific language governing permissions
115084Sjohnlev  * and limitations under the License.
125084Sjohnlev  *
135084Sjohnlev  * When distributing Covered Code, include this CDDL HEADER in each
145084Sjohnlev  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155084Sjohnlev  * If applicable, add the following below this CDDL HEADER, with the
165084Sjohnlev  * fields enclosed by brackets "[]" replaced with your own identifying
175084Sjohnlev  * information: Portions Copyright [yyyy] [name of copyright owner]
185084Sjohnlev  *
195084Sjohnlev  * CDDL HEADER END
205084Sjohnlev  */
215084Sjohnlev 
225084Sjohnlev /*
23*7756SMark.Johnson@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
245084Sjohnlev  * Use is subject to license terms.
255084Sjohnlev  */
265084Sjohnlev 
275084Sjohnlev #ifndef	_VM_SEG_MF_H
285084Sjohnlev #define	_VM_SEG_MF_H
295084Sjohnlev 
305084Sjohnlev 
315084Sjohnlev #include <sys/types.h>
325084Sjohnlev #include <vm/seg.h>
335084Sjohnlev #include <sys/hypervisor.h>
345084Sjohnlev 
355084Sjohnlev #ifdef __cplusplus
365084Sjohnlev extern "C" {
375084Sjohnlev #endif
385084Sjohnlev 
395084Sjohnlev struct segmf_crargs {
405084Sjohnlev 	dev_t		dev;
415084Sjohnlev 	uchar_t		prot;
425084Sjohnlev 	uchar_t		maxprot;
435084Sjohnlev };
445084Sjohnlev 
455084Sjohnlev extern int segmf_create(struct seg *, void *);
46*7756SMark.Johnson@Sun.COM 
475084Sjohnlev extern int segmf_add_mfns(struct seg *, caddr_t, mfn_t, pgcnt_t, domid_t);
485084Sjohnlev 
49*7756SMark.Johnson@Sun.COM /* max grefs which can be passed into segmf_add_grefs */
50*7756SMark.Johnson@Sun.COM #define	SEGMF_MAX_GREFS		0x10
51*7756SMark.Johnson@Sun.COM 
52*7756SMark.Johnson@Sun.COM /* segmf_add_grefs flags */
53*7756SMark.Johnson@Sun.COM #define	SEGMF_GREF_WR		0x1	/* Map gref writable */
54*7756SMark.Johnson@Sun.COM 
55*7756SMark.Johnson@Sun.COM extern int segmf_add_grefs(struct seg *, caddr_t, uint_t, grant_ref_t *,
56*7756SMark.Johnson@Sun.COM     uint_t, domid_t);
57*7756SMark.Johnson@Sun.COM extern int segmf_release_grefs(struct seg *, caddr_t, uint_t);
58*7756SMark.Johnson@Sun.COM extern void segmf_add_gref_pte(struct seg *, caddr_t, uint64_t);
59*7756SMark.Johnson@Sun.COM 
605084Sjohnlev #ifdef __cplusplus
615084Sjohnlev }
625084Sjohnlev #endif
635084Sjohnlev 
645084Sjohnlev #endif /* _VM_SEG_MF_H */
65