val interface_open : unit -> interfaceOpen a connection to the gntshr device. This must be done before any calls to share or unmap.
val interface_close : interface -> unitClose a connection to the gntshr device. Any future calls to share or unmap will fail.
When sharing a number of pages with another domain, we receive back both the list of grant references shared and actually mapped page(s). The foreign domain can map the same shared memory, after being notified (e.g. via xenstore) of our domid and list of references.
share_pages_exn if domid count writable shares count pages with foreign domain domid. writable determines whether or not the foreign domain can write to the shared memory.
share_pages if domid count writable shares count pages with foreign domain domid. writable determines whether or not the foreign domain can write to the shared memory. On error this function returns None. Diagnostic details will be logged.
Unmap a single mapping (which may involve multiple grants)
Low-level interface
Raised when the low-level grant table interface is not available
val put : gntref -> unitDeallocate a grant table index
val get_nonblock : unit -> gntref optionget_nonblock () is Some idx is the grant table is not full, or None otherwise.
val get_n_nonblock : int -> gntref listget_n_nonblock count is a list of grant table indices of length count, or [] if there if the table is too full to accomodate count new grant references.
num_free_grants () returns the number of instantaneously free grant table indices
grant_access ~domid ~writable gntref page adds a grant table entry at index gntref to the grant table, granting access to domid to read page, and write to is as well if writable is true.
val end_access : gntref -> unitend_access gntref removes entry index gntref from the grant table.
val with_grant : domid:int -> writable:bool -> gntref -> Io_page.t -> (unit -> 'a Lwt.t) -> 'a Lwt.tval with_grants : domid:int -> writable:bool -> gntref list -> Io_page.t list -> (unit -> 'a Lwt.t) -> 'a Lwt.tval with_gntshr : (interface -> 'a) -> 'awith_gntshr f opens an interface to gntshr, passes it to f, then returns the result of f (or re-raises any exceptions) ensuring that the gntshr interface is closed before returning.