123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133(*
* Copyright (c) 2013,2014 Citrix Systems Inc
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduletypeCONFIGURATION=sigtypet={ring_ref:string;event_channel:string;}[@@derivingsexp]valwrite:client_domid:int->port:Port.t->t->unitLwt.tvalread:server_domid:int->port:Port.t->tLwt.tvaldelete:client_domid:int->port:Port.t->unitLwt.tendmoduletypeMEMORY=sigtypegrant[@@derivingsexp]valgrant_of_int32:int32->grantvalint32_of_grant:grant->int32typeshare[@@derivingsexp_of]valgrants_of_share:share->grantlistvalbuf_of_share:share->Io_page.tvalshare:domid:int->npages:int->rw:bool->sharevalunshare:share->unitLwt.ttypemapping[@@derivingsexp_of]valbuf_of_mapping:mapping->Io_page.tvalmap:domid:int->grant:grant->rw:bool->mappingvalmapv:grants:(int*grant)list->rw:bool->mappingvalunmap:mapping->unitendmoduletypeEVENTS=sigtypeport[@@derivingsexp_of](** an identifier for a source of events. Ports are allocated by calls to
[listen], then exchanged out-of-band (typically by xenstore) and
finally calls to [connect] creates a channel between the two domains.
Events are send and received over these channels. *)valport_of_string:string->(port,[>`Msgofstring])resultvalstring_of_port:port->stringtypechannel[@@derivingsexp_of](** a channel is the connection between two domains and is used to send
and receive events. *)typeevent[@@derivingsexp_of](** an event notification received from a remote domain. Events contain no
data and may be coalesced. Domains which are blocked will be woken up
by an event. *)valinitial:event(** represents an event which 'fired' when the program started *)valrecv:channel->event->eventLwt.t(** [recv channel event] blocks until the system receives an event
newer than [event] on channel [channel]. If an event is received
while we aren't looking then this will be remembered and the
next call to [after] will immediately unblock. If the system
is suspended and then resumed, all event channel bindings are invalidated
and this function will fail with Generation.Invalid *)valsend:channel->unit(** [send channel] sends an event along [channel], to another domain
which will be woken up *)vallisten:int->port*channel(** [listen domid] allocates a fresh port and event channel. The port
may be supplied to [connect] *)valconnect:int->port->channel(** [connect domid port] connects an event channel to [port] on [domid] *)valclose:channel->unit(** [close channel] closes this side of an event channel *)endmoduletypeENDPOINT=sigtypet[@@derivingsexp_of](** Type of a vchan endpoint. *)typeport[@@derivingsexp_of](** Type of a vchan port name. *)valserver:domid:int->port:port->?read_size:int->?write_size:int->unit->tLwt.tvalclient:domid:int->port:port->unit->tLwt.tincludeMirage_flow.Swithtypeflow=tend