ia64/xen-unstable

view linux-2.6-xen-sparse/include/xen/gnttab.h @ 9296:f85bb99187bf

Update interface documentation to include sched_op_new hypercall
and clean up the style a bit. Also clean up the sched_op_new
description in the sched.h public header.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 15 19:19:22 2006 +0100 (2006-03-15)
parents 3dde68484683
children a07e25890329
line source
1 /******************************************************************************
2 * gnttab.h
3 *
4 * Two sets of functionality:
5 * 1. Granting foreign access to our memory reservation.
6 * 2. Accessing others' memory reservations via grant references.
7 * (i.e., mechanisms for both sender and recipient of grant references)
8 *
9 * Copyright (c) 2004-2005, K A Fraser
10 * Copyright (c) 2005, Christopher Clark
11 *
12 * This file may be distributed separately from the Linux kernel, or
13 * incorporated into other software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
34 #ifndef __ASM_GNTTAB_H__
35 #define __ASM_GNTTAB_H__
37 #include <linux/config.h>
38 #include <asm/hypervisor.h>
39 #include <xen/interface/grant_table.h>
41 /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
42 #ifdef __ia64__
43 #define NR_GRANT_FRAMES 1
44 #else
45 #define NR_GRANT_FRAMES 4
46 #endif
48 struct gnttab_free_callback {
49 struct gnttab_free_callback *next;
50 void (*fn)(void *);
51 void *arg;
52 u16 count;
53 };
55 int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
56 int readonly);
58 /*
59 * End access through the given grant reference, iff the grant entry is no
60 * longer in use. Return 1 if the grant entry was freed, 0 if it is still in
61 * use.
62 */
63 int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly);
65 /*
66 * Eventually end access through the given grant reference, and once that
67 * access has been ended, free the given page too. Access will be ended
68 * immediately iff the grant entry is not in use, otherwise it will happen
69 * some time later. page may be 0, in which case no freeing will occur.
70 */
71 void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
72 unsigned long page);
74 int gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn);
76 unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref);
77 unsigned long gnttab_end_foreign_transfer(grant_ref_t ref);
79 int gnttab_query_foreign_access(grant_ref_t ref);
81 /*
82 * operations on reserved batches of grant references
83 */
84 int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
86 void gnttab_free_grant_reference(grant_ref_t ref);
88 void gnttab_free_grant_references(grant_ref_t head);
90 int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);
92 void gnttab_release_grant_reference(grant_ref_t *private_head,
93 grant_ref_t release);
95 void gnttab_request_free_callback(struct gnttab_free_callback *callback,
96 void (*fn)(void *), void *arg, u16 count);
98 void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
99 unsigned long frame, int readonly);
101 void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
102 unsigned long pfn);
104 #ifdef __ia64__
105 #define gnttab_map_vaddr(map) __va(map.dev_bus_addr)
106 #else
107 #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
108 #endif
110 #endif /* __ASM_GNTTAB_H__ */
112 /*
113 * Local variables:
114 * c-file-style: "linux"
115 * indent-tabs-mode: t
116 * c-indent-level: 8
117 * c-basic-offset: 8
118 * tab-width: 8
119 * End:
120 */