#include <caml/custom.h>
#include <caml/callback.h>
#include <caml/fail.h>
+#include <caml/signals.h>
#define _H(__h) ((xenevtchn_handle *)(__h))
{
CAMLparam0();
CAMLlocal1(result);
+ xenevtchn_handle *xce;
+
+ caml_enter_blocking_section();
+ xce = xenevtchn_open(NULL, 0);
+ caml_leave_blocking_section();
- xenevtchn_handle *xce = xenevtchn_open(NULL, 0);
if (xce == NULL)
caml_failwith("open failed");
CAMLparam2(xce, port);
int rc;
+ caml_enter_blocking_section();
rc = xenevtchn_notify(_H(xce), Int_val(port));
+ caml_leave_blocking_section();
+
if (rc == -1)
caml_failwith("evtchn notify failed");
CAMLlocal1(port);
xenevtchn_port_or_error_t rc;
+ caml_enter_blocking_section();
rc = xenevtchn_bind_interdomain(_H(xce), Int_val(domid), Int_val(remote_port));
+ caml_leave_blocking_section();
+
if (rc == -1)
caml_failwith("evtchn bind_interdomain failed");
port = Val_int(rc);
CAMLlocal1(port);
xenevtchn_port_or_error_t rc;
+ caml_enter_blocking_section();
rc = xenevtchn_bind_virq(_H(xce), Int_val(virq_type));
+ caml_leave_blocking_section();
+
if (rc == -1)
caml_failwith("evtchn bind_virq failed");
port = Val_int(rc);
CAMLparam2(xce, port);
int rc;
+ caml_enter_blocking_section();
rc = xenevtchn_unbind(_H(xce), Int_val(port));
+ caml_leave_blocking_section();
+
if (rc == -1)
caml_failwith("evtchn unbind failed");
CAMLlocal1(result);
xenevtchn_port_or_error_t port;
+ caml_enter_blocking_section();
port = xenevtchn_pending(_H(xce));
+ caml_leave_blocking_section();
+
if (port == -1)
caml_failwith("evtchn pending failed");
result = Val_int(port);
{
CAMLparam2(xce, _port);
evtchn_port_t port;
+ int rc;
port = Int_val(_port);
- if (xenevtchn_unmask(_H(xce), port))
+
+ caml_enter_blocking_section();
+ rc = xenevtchn_unmask(_H(xce), port);
+ caml_leave_blocking_section();
+
+ if (rc)
caml_failwith("evtchn unmask failed");
CAMLreturn(Val_unit);
}