Page
Library
Module
Module type
Parameter
Class
Class type
Source
Gnt.Gntshr
SourceA connection to the gntshr device, needed for sharing/unmapping
Open a connection to the gntshr device. This must be done before any calls to share or unmap.
Close 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)
This is is only available in kernelspace and is deprecated. For low-level access, use mirage-xen's OS.Xen API instead.
Raised when the low-level grant table interface is not available
get_nonblock ()
is Some idx
is the grant table is not full, or None
otherwise.
get_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
.
end_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.t