+/*This is a structure of function pointers for grant table v1*/
static
+struct {
+ /*
+ * Mapping a list of frames for storing grant entry status,
this
+ * mechanism can allow better synchronization using barriers.
Input
+ * parameter is frame number, returning GNTST_okay means
success and
+ * negative value means failure.
+ */
+ int (*_gnttab_map_status)(unsigned int);
+ /*
+ * Release a list of frames which are mapped in
_gnttab_map_status for
+ * grant entry status.
+ */
+ void (*_gnttab_unmap_status)(void);
+ /*
+ * Introducing a valid entry into the grant table, granting
the frame
+ * of this grant entry to domain for accessing, or
transfering, or
+ * transitively accessing. First input parameter is reference
of this
+ * introduced grant entry, second one is domid of granted
domain, third
+ * one is the frame to be granted, and the last one is status
of the
+ * grant entry to be updated.
+ */
+ void (*_update_grant_entry)(grant_ref_t, domid_t,
+ unsigned long, unsigned);
+ /*
+ * Stop granting a grant entry to domain for accessing. First
input
+ * parameter is reference of a grant entry whose grant access
will be
+ * stopped, second one is not in use now. If the grant entry
is
+ * currently mapped for reading or writing, just return
failure(==0)
+ * directly and don't tear down the grant access. Otherwise,
stop grant
+ * access for this entry and return success(==1).
+ */
+ int (*_gnttab_end_foreign_access_ref)(grant_ref_t, int);
+ /*
+ * Stop granting a grant entry to domain for transfer. If
tranfer has
+ * not started, just reclaim the grant entry and return
failure(==0).
+ * Otherwise, wait for the transfer to complete and then
return the
+ * frame.
+ */
+ unsigned long
(*_gnttab_end_foreign_transfer_ref)(grant_ref_t);
+ /*
+ * Query the status of a grant entry. Input parameter is
reference of
+ * queried grant entry, return value is the status of queried
entry.
+ * Detailed status(writing/reading) can be gotten from the
return value
+ * by bit operations.
+ */
+ int (*_gnttab_query_foreign_access)(grant_ref_t);
+} gnttab_interface;
+