From: Andrew Cooper <[email protected]> No users of this yet so no overall change.
Signed-off-by: Andrew Cooper <[email protected]> Signed-off-by: Ian Jackson <[email protected]> --- tools/ocaml/libs/xc/abi-check | 3 ++- tools/ocaml/libs/xc/xenctrl_stubs.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check index ccc35e79e9..a470c05e0b 100755 --- a/tools/ocaml/libs/xc/abi-check +++ b/tools/ocaml/libs/xc/abi-check @@ -22,6 +22,7 @@ our $ei; # Parse the C file looking for calls to: # c_bitmap_to_ocaml_list() +# ocaml_list_to_c_bitmap() # # followed by anotations of the following form: # /* ! OType OPrefix Mangle */ @@ -30,7 +31,7 @@ our $ei; # The function definitions use /* ! */ which simply skips that instance. while (<>) { if ($cline == -1) { - if (m/c_bitmap_to_ocaml_list/) { + if (m/c_bitmap_to_ocaml_list|ocaml_list_to_c_bitmap/) { $cline = 0; $ei = { }; } diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 352a6bd2d6..c74c2b43a0 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -153,6 +153,21 @@ static value c_bitmap_to_ocaml_list CAMLreturn(list); } +static unsigned int ocaml_list_to_c_bitmap(value l) + /* ! */ + /* + * All calls to this function must be in a form suitable + * for xenctrl_abi_check. The parsing there is ad-hoc. + */ +{ + unsigned int val; + + for ( ; l != Val_none; l = Field(l, 1) ) + val |= 1u << Int_val(Field(l, 0)); + + return val; +} + CAMLprim value stub_xc_domain_create(value xch, value config) { CAMLparam2(xch, config); -- 2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
