granttables.h revision 1.6
11.6Scegger/* $NetBSD: granttables.h,v 1.6 2008/10/30 09:24:37 cegger 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.6Scegger#include <xen/xen3-public/xen.h>
341.4Sbouyer#include <xen/xen3-public/grant_table.h>
351.1Sbouyer
361.1Sbouyervoid xengnt_init(void);
371.1Sbouyer
381.1Sbouyer/*
391.1Sbouyer * grant access to a remote domain. Returns a handle on the allocated grant
401.1Sbouyer * entry in table in grant_ref_t *.
411.1Sbouyer */
421.1Sbouyerint xengnt_grant_access(domid_t, paddr_t, int, grant_ref_t *);
431.1Sbouyer
441.1Sbouyer/*
451.1Sbouyer * Revoke access. Caller is responsible to ensure that the grant entry is
461.1Sbouyer * not referenced any more.
471.1Sbouyer */
481.1Sbouyervoid xengnt_revoke_access(grant_ref_t);
491.1Sbouyer
501.1Sbouyer/* allow a page transfer from a remote domain */
511.1Sbouyerint xengnt_grant_transfer(domid_t, grant_ref_t *);
521.1Sbouyer
531.1Sbouyer/* end transfer, return the new page address or 0 */
541.1Sbouyerpaddr_t xengnt_revoke_transfer(grant_ref_t);
551.1Sbouyer
561.1Sbouyer/*
571.1Sbouyer * Query grant status (i.e. if remote has a valid mapping to this grant).
581.5Sjym * Returns GTF_reading | GTF_writing (0 if remote does not use it anymore).
591.1Sbouyer */
601.1Sbouyerint xengnt_status(grant_ref_t);
61