170025d76Sjohnny /* 270025d76Sjohnny * CDDL HEADER START 370025d76Sjohnny * 470025d76Sjohnny * The contents of this file are subject to the terms of the 5337fc9e2Sanish * Common Development and Distribution License (the "License"). 6337fc9e2Sanish * You may not use this file except in compliance with the License. 770025d76Sjohnny * 870025d76Sjohnny * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 970025d76Sjohnny * or http://www.opensolaris.org/os/licensing. 1070025d76Sjohnny * See the License for the specific language governing permissions 1170025d76Sjohnny * and limitations under the License. 1270025d76Sjohnny * 1370025d76Sjohnny * When distributing Covered Code, include this CDDL HEADER in each 1470025d76Sjohnny * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1570025d76Sjohnny * If applicable, add the following below this CDDL HEADER, with the 1670025d76Sjohnny * fields enclosed by brackets "[]" replaced with your own identifying 1770025d76Sjohnny * information: Portions Copyright [yyyy] [name of copyright owner] 1870025d76Sjohnny * 1970025d76Sjohnny * CDDL HEADER END 2070025d76Sjohnny */ 2170025d76Sjohnny 2270025d76Sjohnny /* 237eea693dSMark Johnson * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2470025d76Sjohnny * Use is subject to license terms. 25*284ce987SPatrick Mooney * Copyright 2018 Joyent, Inc. 2670025d76Sjohnny */ 2770025d76Sjohnny 28843e1988Sjohnlev #ifndef _VM_SEG_MF_H 29843e1988Sjohnlev #define _VM_SEG_MF_H 3070025d76Sjohnny 3170025d76Sjohnny 32ae115bc7Smrj #include <sys/types.h> 33843e1988Sjohnlev #include <vm/seg.h> 34843e1988Sjohnlev #include <sys/hypervisor.h> 35ae115bc7Smrj 36ae115bc7Smrj #ifdef __cplusplus 3770025d76Sjohnny extern "C" { 3870025d76Sjohnny #endif 3970025d76Sjohnny 40843e1988Sjohnlev struct segmf_crargs { 41843e1988Sjohnlev dev_t dev; 42843e1988Sjohnlev uchar_t prot; 43843e1988Sjohnlev uchar_t maxprot; 44843e1988Sjohnlev }; 45843e1988Sjohnlev 46*284ce987SPatrick Mooney extern int segmf_create(struct seg **, void *); 477eea693dSMark Johnson 48843e1988Sjohnlev extern int segmf_add_mfns(struct seg *, caddr_t, mfn_t, pgcnt_t, domid_t); 4970025d76Sjohnny 507eea693dSMark Johnson /* max grefs which can be passed into segmf_add_grefs */ 517eea693dSMark Johnson #define SEGMF_MAX_GREFS 0x10 527eea693dSMark Johnson 537eea693dSMark Johnson /* segmf_add_grefs flags */ 547eea693dSMark Johnson #define SEGMF_GREF_WR 0x1 /* Map gref writable */ 557eea693dSMark Johnson 567eea693dSMark Johnson extern int segmf_add_grefs(struct seg *, caddr_t, uint_t, grant_ref_t *, 577eea693dSMark Johnson uint_t, domid_t); 587eea693dSMark Johnson extern int segmf_release_grefs(struct seg *, caddr_t, uint_t); 597eea693dSMark Johnson extern void segmf_add_gref_pte(struct seg *, caddr_t, uint64_t); 607eea693dSMark Johnson 61ae115bc7Smrj #ifdef __cplusplus 6270025d76Sjohnny } 6370025d76Sjohnny #endif 6470025d76Sjohnny 65843e1988Sjohnlev #endif /* _VM_SEG_MF_H */ 66