#include "mmap_stubs.h"
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
#define _H(__h) ((xc_interface *)(__h))
#define _D(__d) ((uint32_t)Int_val(__d))
+#ifndef Val_none
#define Val_none (Val_int(0))
+#endif
#define string_of_option_array(array, index) \
((Field(array, index) == Val_none) ? NULL : String_val(Field(Field(array, index), 0)))
CAMLparam3(xch, domid, mem_kb);
int retval;
- unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (PAGE_SHIFT - 10);
+ unsigned long nr_extents = ((unsigned long)(Int64_val(mem_kb))) >> (XC_PAGE_SHIFT - 10);
uint32_t c_domid = _D(domid);
caml_enter_blocking_section();
{
CAMLparam1(pages);
- CAMLreturn(caml_copy_int64(Int64_val(pages) << (PAGE_SHIFT - 10)));
+ CAMLreturn(caml_copy_int64(Int64_val(pages) << (XC_PAGE_SHIFT - 10)));
}
#include "_xtl_levels.inc"
/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
#define Val_none Val_int(0)
+#endif
+#ifndef Some_val
#define Some_val(v) Field(v,0)
+#endif
static value Val_some(value v)
{
}
/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
#define Val_none Val_int(0)
+#endif
+#ifndef Some_val
#define Some_val(v) Field(v,0)
+#endif
static value Val_some(value v)
{