[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] tools/ocaml: abi handling: Provide ocaml->C conversion/check



commit 133821e5959ec4605978f6d10964c3166aaad636
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Sep 10 12:18:45 2019 +0100
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Tue Sep 10 14:44:33 2019 +0100

    tools/ocaml: abi handling: Provide ocaml->C conversion/check
    
    No users of this yet so no overall change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>
---
 tools/ocaml/libs/xc/abi-check       |  3 ++-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 17 +++++++++++++++++
 2 files changed, 19 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..522c2c59dd 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -153,6 +153,23 @@ static value c_bitmap_to_ocaml_list
        CAMLreturn(list);
 }
 
+#if 0 /* unused, will be used in a moment */
+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;
+}
+#endif
+
 CAMLprim value stub_xc_domain_create(value xch, value config)
 {
        CAMLparam2(xch, config);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.