12#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
13#define __XEN_PUBLIC_GRANT_TABLE_H__
98typedef UINT32 grant_ref_t;
111#if __XEN_INTERFACE_VERSION__ < 0x0003020a
112#define grant_entry_v1 grant_entry
113#define grant_entry_v1_t grant_entry_t
133#define GNTTAB_NR_RESERVED_ENTRIES 8
134#define GNTTAB_RESERVED_CONSOLE 0
135#define GNTTAB_RESERVED_XENSTORE 1
146#define GTF_invalid (0U<<0)
147#define GTF_permit_access (1U<<0)
148#define GTF_accept_transfer (2U<<0)
149#define GTF_transitive (3U<<0)
150#define GTF_type_mask (3U<<0)
162#define _GTF_readonly (2)
163#define GTF_readonly (1U<<_GTF_readonly)
164#define _GTF_reading (3)
165#define GTF_reading (1U<<_GTF_reading)
166#define _GTF_writing (4)
167#define GTF_writing (1U<<_GTF_writing)
169#define GTF_PWT (1U<<_GTF_PWT)
171#define GTF_PCD (1U<<_GTF_PCD)
173#define GTF_PAT (1U<<_GTF_PAT)
174#define _GTF_sub_page (8)
175#define GTF_sub_page (1U<<_GTF_sub_page)
187#define _GTF_transfer_committed (2)
188#define GTF_transfer_committed (1U<<_GTF_transfer_committed)
189#define _GTF_transfer_completed (3)
190#define GTF_transfer_completed (1U<<_GTF_transfer_completed)
201#if __XEN_INTERFACE_VERSION__ >= 0x0003020a
269typedef UINT16 grant_status_t;
288#define GNTTABOP_map_grant_ref 0
289#define GNTTABOP_unmap_grant_ref 1
295typedef UINT32 grant_handle_t;
322 grant_handle_t handle;
344 grant_handle_t handle;
356#define _GNTMAP_device_map (0)
357#define GNTMAP_device_map (1<<_GNTMAP_device_map)
359#define _GNTMAP_host_map (1)
360#define GNTMAP_host_map (1<<_GNTMAP_host_map)
362#define _GNTMAP_readonly (2)
363#define GNTMAP_readonly (1<<_GNTMAP_readonly)
370#define _GNTMAP_application_map (3)
371#define GNTMAP_application_map (1<<_GNTMAP_application_map)
378#define _GNTMAP_contains_pte (4)
379#define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte)
381#define _GNTMAP_can_fail (5)
382#define GNTMAP_can_fail (1<<_GNTMAP_can_fail)
388#define _GNTMAP_guest_avail0 (16)
389#define GNTMAP_guest_avail_mask ((UINT32)~0 << _GNTMAP_guest_avail0)
395#define GNTST_okay (0)
396#define GNTST_general_error (-1)
397#define GNTST_bad_domain (-2)
398#define GNTST_bad_gntref (-3)
399#define GNTST_bad_handle (-4)
400#define GNTST_bad_virt_addr (-5)
401#define GNTST_bad_dev_addr (-6)
402#define GNTST_no_device_space (-7)
403#define GNTST_permission_denied (-8)
404#define GNTST_bad_page (-9)
405#define GNTST_bad_copy_arg (-10)
406#define GNTST_address_too_big (-11)
407#define GNTST_eagain (-12)
410#define GNTTABOP_error_msgs { \
413 "unrecognised domain id", \
414 "invalid grant reference", \
415 "invalid mapping handle", \
416 "invalid virtual address", \
417 "invalid device address", \
418 "no spare translation slot in the I/O MMU", \
419 "permission denied", \
421 "copy arguments cross page boundary", \
422 "page address size too large", \
423 "operation not done; try again" \