ia64/xen-unstable

view linux-2.6-xen-sparse/include/asm-xen/gnttab.h @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
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, K A Fraser
10 * Copyright (c) 2005, Christopher Clark
11 */
13 #ifndef __ASM_GNTTAB_H__
14 #define __ASM_GNTTAB_H__
16 #include <linux/config.h>
17 #include <asm-xen/hypervisor.h>
18 #include <asm-xen/xen-public/grant_table.h>
20 /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
21 #define NR_GRANT_FRAMES 4
23 struct gnttab_free_callback {
24 struct gnttab_free_callback *next;
25 void (*fn)(void *);
26 void *arg;
27 u16 count;
28 };
30 int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
31 int readonly);
33 void gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly);
34 void gnttab_end_foreign_access(grant_ref_t ref, int readonly);
36 int gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn);
38 unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref);
39 unsigned long gnttab_end_foreign_transfer(grant_ref_t ref);
41 int gnttab_query_foreign_access(grant_ref_t ref);
43 /*
44 * operations on reserved batches of grant references
45 */
46 int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
48 void gnttab_free_grant_reference(grant_ref_t ref);
50 void gnttab_free_grant_references(grant_ref_t head);
52 int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);
54 void gnttab_release_grant_reference(grant_ref_t *private_head,
55 grant_ref_t release);
57 void gnttab_request_free_callback(struct gnttab_free_callback *callback,
58 void (*fn)(void *), void *arg, u16 count);
60 void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
61 unsigned long frame, int readonly);
63 void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
64 unsigned long pfn);
66 #endif /* __ASM_GNTTAB_H__ */