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 /* 237eea693dSMark Johnson * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24843e1988Sjohnlev * Use is subject to license terms. 25*284ce987SPatrick Mooney * Copyright 2018 Joyent, Inc. 26843e1988Sjohnlev */ 27843e1988Sjohnlev 28843e1988Sjohnlev #ifndef _VM_SEG_MF_H 29843e1988Sjohnlev #define _VM_SEG_MF_H 30843e1988Sjohnlev 31843e1988Sjohnlev 32843e1988Sjohnlev #include <sys/types.h> 33843e1988Sjohnlev #include <vm/seg.h> 34843e1988Sjohnlev #include <sys/hypervisor.h> 35843e1988Sjohnlev 36843e1988Sjohnlev #ifdef __cplusplus 37843e1988Sjohnlev extern "C" { 38843e1988Sjohnlev #endif 39843e1988Sjohnlev 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); 49843e1988Sjohnlev 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 61843e1988Sjohnlev #ifdef __cplusplus 62843e1988Sjohnlev } 63843e1988Sjohnlev #endif 64843e1988Sjohnlev 65843e1988Sjohnlev #endif /* _VM_SEG_MF_H */ 66