diff options
Diffstat (limited to 'tools/ocaml/libs')
-rw-r--r-- | tools/ocaml/libs/eventchn/xeneventchn.ml | 6 | ||||
-rw-r--r-- | tools/ocaml/libs/eventchn/xeneventchn.mli | 17 |
2 files changed, 17 insertions, 6 deletions
diff --git a/tools/ocaml/libs/eventchn/xeneventchn.ml b/tools/ocaml/libs/eventchn/xeneventchn.ml index 79ad9b1e95..acebe10c6f 100644 --- a/tools/ocaml/libs/eventchn/xeneventchn.ml +++ b/tools/ocaml/libs/eventchn/xeneventchn.ml @@ -20,6 +20,9 @@ type handle external init: unit -> handle = "stub_eventchn_init" external fd: handle -> Unix.file_descr = "stub_eventchn_fd" + +type t = int + external notify: handle -> int -> unit = "stub_eventchn_notify" external bind_interdomain: handle -> int -> int -> int = "stub_eventchn_bind_interdomain" external bind_dom_exc_virq: handle -> int = "stub_eventchn_bind_dom_exc_virq" @@ -27,4 +30,7 @@ external unbind: handle -> int -> unit = "stub_eventchn_unbind" external pending: handle -> int = "stub_eventchn_pending" external unmask: handle -> int -> unit = "stub_eventchn_unmask" +let to_int x = x +let of_int x = x + let _ = Callback.register_exception "eventchn.error" (Error "register_callback") diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli index 394acc2821..2b582cdaaf 100644 --- a/tools/ocaml/libs/eventchn/xeneventchn.mli +++ b/tools/ocaml/libs/eventchn/xeneventchn.mli @@ -18,14 +18,19 @@ exception Error of string type handle +type t + +val to_int: t -> int +val of_int: int -> t + external init : unit -> handle = "stub_eventchn_init" external fd: handle -> Unix.file_descr = "stub_eventchn_fd" -external notify : handle -> int -> unit = "stub_eventchn_notify" -external bind_interdomain : handle -> int -> int -> int +external notify : handle -> t -> unit = "stub_eventchn_notify" +external bind_interdomain : handle -> int -> int -> t = "stub_eventchn_bind_interdomain" -external bind_dom_exc_virq : handle -> int = "stub_eventchn_bind_dom_exc_virq" -external unbind : handle -> int -> unit = "stub_eventchn_unbind" -external pending : handle -> int = "stub_eventchn_pending" -external unmask : handle -> int -> unit +external bind_dom_exc_virq : handle -> t = "stub_eventchn_bind_dom_exc_virq" +external unbind : handle -> t -> unit = "stub_eventchn_unbind" +external pending : handle -> t = "stub_eventchn_pending" +external unmask : handle -> t -> unit = "stub_eventchn_unmask" |