2828#include <caml/alloc.h>
2929#include <caml/custom.h>
3030#include <caml/fail.h>
31- #include <caml/signals .h>
31+ #include <caml/threads .h>
3232#include <caml/callback.h>
3333#include <caml/unixsupport.h>
3434#include <caml/bigarray.h>
@@ -95,9 +95,9 @@ CAMLprim value stub_xenctrlext_interface_open(value unused)
9595 CAMLlocal1 (result );
9696 xc_interface * xch ;
9797
98- caml_enter_blocking_section ();
98+ caml_release_runtime_system ();
9999 xch = xc_interface_open (NULL , NULL , 0 );
100- caml_leave_blocking_section ();
100+ caml_acquire_runtime_system ();
101101
102102 if ( !xch )
103103 failwith_xc (xch );
@@ -226,9 +226,9 @@ CAMLprim value stub_xenctrlext_get_max_nr_cpus(value xch_val)
226226 xc_interface * xch = xch_of_val (xch_val );
227227 int r ;
228228
229- caml_enter_blocking_section ();
229+ caml_release_runtime_system ();
230230 r = xc_physinfo (xch , & c_physinfo );
231- caml_leave_blocking_section ();
231+ caml_acquire_runtime_system ();
232232
233233 if (r )
234234 failwith_xc (xch );
@@ -256,9 +256,9 @@ CAMLprim value stub_xenctrlext_physdev_map_pirq(value xch_val,
256256 CAMLparam3 (xch_val , domid , irq );
257257 xc_interface * xch = xch_of_val (xch_val );
258258 int pirq = Int_val (irq );
259- caml_enter_blocking_section ();
259+ caml_release_runtime_system ();
260260 int retval = xc_physdev_map_pirq (xch , Int_val (domid ), pirq , & pirq );
261- caml_leave_blocking_section ();
261+ caml_acquire_runtime_system ();
262262 if (retval )
263263 failwith_xc (xch );
264264 CAMLreturn (Val_int (pirq ));
@@ -269,9 +269,9 @@ CAMLprim value stub_xenctrlext_assign_device(value xch_val, value domid,
269269{
270270 CAMLparam4 (xch_val , domid , machine_sbdf , flag );
271271 xc_interface * xch = xch_of_val (xch_val );
272- caml_enter_blocking_section ();
272+ caml_release_runtime_system ();
273273 int retval = xc_assign_device (xch , Int_val (domid ), Int_val (machine_sbdf ), Int_val (flag ));
274- caml_leave_blocking_section ();
274+ caml_acquire_runtime_system ();
275275 if (retval )
276276 failwith_xc (xch );
277277 CAMLreturn (Val_unit );
@@ -281,9 +281,9 @@ CAMLprim value stub_xenctrlext_deassign_device(value xch_val, value domid, value
281281{
282282 CAMLparam3 (xch_val , domid , machine_sbdf );
283283 xc_interface * xc = xch_of_val (xch_val );
284- caml_enter_blocking_section ();
284+ caml_release_runtime_system ();
285285 int retval = xc_deassign_device (xc , Int_val (domid ), Int_val (machine_sbdf ));
286- caml_leave_blocking_section ();
286+ caml_acquire_runtime_system ();
287287 if (retval )
288288 failwith_xc (xc );
289289 CAMLreturn (Val_unit );
@@ -299,9 +299,9 @@ CAMLprim value stub_xenctrlext_domain_soft_reset(value xch_val, value domid)
299299{
300300 CAMLparam2 (xch_val , domid );
301301 xc_interface * xc = xch_of_val (xch_val );
302- caml_enter_blocking_section ();
302+ caml_release_runtime_system ();
303303 int retval = xc_domain_soft_reset (xc , Int_val (domid ));
304- caml_leave_blocking_section ();
304+ caml_acquire_runtime_system ();
305305 if (retval )
306306 failwith_xc (xc );
307307 CAMLreturn (Val_unit );
@@ -312,11 +312,11 @@ CAMLprim value stub_xenctrlext_domain_update_channels(value xch_val, value domid
312312{
313313 CAMLparam4 (xch_val , domid , store_port , console_port );
314314 xc_interface * xc = xch_of_val (xch_val );
315- caml_enter_blocking_section ();
315+ caml_release_runtime_system ();
316316 int retval = xc_set_hvm_param (xc , Int_val (domid ), HVM_PARAM_STORE_EVTCHN , Int_val (store_port ));
317317 if (!retval )
318318 retval = xc_set_hvm_param (xc , Int_val (domid ), HVM_PARAM_CONSOLE_EVTCHN , Int_val (console_port ));
319- caml_leave_blocking_section ();
319+ caml_acquire_runtime_system ();
320320 if (retval )
321321 failwith_xc (xc );
322322 CAMLreturn (Val_unit );
0 commit comments