granttables.h revision 1.5
11.5Sjym/* $NetBSD: granttables.h,v 1.5 2008/10/24 18:02:58 jym Exp $ */ 21.1Sbouyer/* 31.1Sbouyer * Copyright (c) 2006 Manuel Bouyer. 41.1Sbouyer * 51.1Sbouyer * Redistribution and use in source and binary forms, with or without 61.1Sbouyer * modification, are permitted provided that the following conditions 71.1Sbouyer * are met: 81.1Sbouyer * 1. Redistributions of source code must retain the above copyright 91.1Sbouyer * notice, this list of conditions and the following disclaimer. 101.1Sbouyer * 2. Redistributions in binary form must reproduce the above copyright 111.1Sbouyer * notice, this list of conditions and the following disclaimer in the 121.1Sbouyer * documentation and/or other materials provided with the distribution. 131.1Sbouyer * 3. All advertising materials mentioning features or use of this software 141.1Sbouyer * must display the following acknowledgement: 151.1Sbouyer * This product includes software developed by Manuel Bouyer. 161.1Sbouyer * 4. The name of the author may not be used to endorse or promote products 171.1Sbouyer * derived from this software without specific prior written permission. 181.1Sbouyer * 191.1Sbouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 201.1Sbouyer * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 211.1Sbouyer * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 221.1Sbouyer * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 231.1Sbouyer * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 241.1Sbouyer * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 251.1Sbouyer * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 261.1Sbouyer * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 271.1Sbouyer * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 281.1Sbouyer * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 291.1Sbouyer * 301.1Sbouyer */ 311.1Sbouyer 321.1Sbouyer/* Interface to the Xen Grant tables */ 331.4Sbouyer#include <xen/xen3-public/grant_table.h> 341.1Sbouyer 351.1Sbouyervoid xengnt_init(void); 361.1Sbouyer 371.1Sbouyer/* 381.1Sbouyer * grant access to a remote domain. Returns a handle on the allocated grant 391.1Sbouyer * entry in table in grant_ref_t *. 401.1Sbouyer */ 411.1Sbouyerint xengnt_grant_access(domid_t, paddr_t, int, grant_ref_t *); 421.1Sbouyer 431.1Sbouyer/* 441.1Sbouyer * Revoke access. Caller is responsible to ensure that the grant entry is 451.1Sbouyer * not referenced any more. 461.1Sbouyer */ 471.1Sbouyervoid xengnt_revoke_access(grant_ref_t); 481.1Sbouyer 491.1Sbouyer/* allow a page transfer from a remote domain */ 501.1Sbouyerint xengnt_grant_transfer(domid_t, grant_ref_t *); 511.1Sbouyer 521.1Sbouyer/* end transfer, return the new page address or 0 */ 531.1Sbouyerpaddr_t xengnt_revoke_transfer(grant_ref_t); 541.1Sbouyer 551.1Sbouyer/* 561.1Sbouyer * Query grant status (i.e. if remote has a valid mapping to this grant). 571.5Sjym * Returns GTF_reading | GTF_writing (0 if remote does not use it anymore). 581.1Sbouyer */ 591.1Sbouyerint xengnt_status(grant_ref_t); 60