1 /******************************************************************************
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)
9 * Copyright (c) 2004, K A Fraser
10 * Copyright (c) 2005, Christopher Clark
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
22 #define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * PAGE_SIZE / sizeof(grant_entry_t))
25 gnttab_grant_foreign_access(
26 domid_t domid, unsigned long frame, int readonly);
29 gnttab_end_foreign_access(
30 grant_ref_t ref, int readonly);
33 gnttab_grant_foreign_transfer(
34 domid_t domid, unsigned long pfn);
37 gnttab_end_foreign_transfer(
41 gnttab_query_foreign_access(
45 * operations on reserved batches of grant references
48 gnttab_alloc_grant_references(
49 u16 count, grant_ref_t *pprivate_head, grant_ref_t *private_terminal );
52 gnttab_free_grant_references(
53 u16 count, grant_ref_t private_head );
56 gnttab_claim_grant_reference( grant_ref_t *pprivate_head, grant_ref_t terminal
60 gnttab_release_grant_reference(
61 grant_ref_t *private_head, grant_ref_t release );
64 gnttab_grant_foreign_access_ref(
65 grant_ref_t ref, domid_t domid, unsigned long frame, int readonly);
68 gnttab_grant_foreign_transfer_ref(
69 grant_ref_t, domid_t domid, unsigned long pfn);
72 #endif /* __ASM_GNTTAB_H__ */