1(*
2 * Copyright (C) 2006-2007 XenSource Ltd.
3 * Copyright (C) 2008      Citrix Ltd.
4 * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; version 2.1 only. with the special
9 * exception on linking described in file LICENSE.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Lesser General Public License for more details.
15 *)
16
17(** Event channel bindings: see tools/libxc/include/xenctrl.h *)
18
19type handle
20(** An initialised event channel interface. *)
21
22type t
23(** A local event channel. *)
24
25val to_int: t -> int
26
27val of_int: int -> t
28
29val init: unit -> handle
30(** Return an initialised event channel interface. On error it
31    will throw a Failure exception. *)
32
33val fd: handle -> Unix.file_descr
34(** Return a file descriptor suitable for Unix.select. When
35    the descriptor becomes readable, it is safe to call 'pending'.
36    On error it will throw a Failure exception. *)
37
38val notify : handle -> t -> unit
39(** Notify the given event channel. On error it will throw a
40    Failure exception. *)
41
42val bind_interdomain : handle -> int -> int -> t
43(** [bind_interdomain h domid remote_port] returns a local event
44    channel connected to domid:remote_port. On error it will
45    throw a Failure exception. *)
46
47val bind_dom_exc_virq : handle -> t
48(** Binds a local event channel to the VIRQ_DOM_EXC
49    (domain exception VIRQ). On error it will throw a Failure
50    exception. *)
51
52val unbind : handle -> t -> unit
53(** Unbinds the given event channel. On error it will throw a
54    Failure exception. *)
55
56val pending : handle -> t
57(** Returns the next event channel to become pending. On error it
58    will throw a Failure exception. *)
59
60val unmask : handle -> t -> unit
61(** Unmasks the given event channel. On error it will throw a
62    Failure exception. *)
63