[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/7] tools/ocaml/libs: Don't declare stubs as taking void
- To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 31 Jan 2023 21:29:07 +0000
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: Edwin Török <edwin.torok@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
- Delivery-date: Tue, 31 Jan 2023 21:29:40 +0000
- Ironport-data: A9a23:DRPIu6rBBa1a1sQTvyEoYRPaRKNeBmIZZRIvgKrLsJaIsI4StFCzt garIBmGOayJYmr3L4onPYrg9k1XucfSz4BjHQZtrC9kQy0WoJuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpAFc+E0/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WxwUmAWP6gR5weHzCBNV/rzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXABkVS0ixwMCo+auyR+VI3ZgKHvv6BapK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVxrl6PqLVxyG/U1AFri5DmMcbPe8zMTsJQ9qqdj jObozWoW05EXDCZ4XmM3SylpNbppgPcQLIbD6y90aJ7gULGkwT/DzVJDADm8JFVkHWWS99Zb kAZ5Ccqhawz71CwCMnwWQWip3yJ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5/ 7cOqAtj71WSNQKBJgNcNvpbPHHeFAleyi8RV66MBDiDuUKKnjNo5n47PE84/yrYoUByN83lI 7aWF1VuGYucwa2YPf+qqFj41TIWiGwTD7twsZR69xwvaD9XqPiNWmGREo1m8Wtrv0DConQWu q1OphRH/j/RFGebrphzkn7Qd1fOHMeWMoatpIyXE+PuNvCLsnwuunSYJ/oVcnQ+PYfKxPC61 c4LUnOzZ97nz+Ws1fD8WbsZ08=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
From: Edwin Török <edwin.torok@xxxxxxxxx>
There is no such thing as an Ocaml function (C stub or otherwise) taking no
parameters. In the absence of any other parameters, unit is still passed.
This doesn't explode with any ABI we care about, but would malfunction for an
ABI environment such as stdcall.
Fixes: c3afd398ba7f ("ocaml: Add XS bindings.")
Fixes: 8b7ce06a2d34 ("ocaml: Add XC bindings.")
Signed-off-by: Edwin Török <edwin.torok@xxxxxxxxx>
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
CC: David Scott <dave@xxxxxxxxxx>
CC: Edwin Török <edwin.torok@xxxxxxxxx>
CC: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
---
tools/ocaml/libs/xb/xenbus_stubs.c | 5 ++---
tools/ocaml/libs/xc/xenctrl_stubs.c | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/ocaml/libs/xb/xenbus_stubs.c
b/tools/ocaml/libs/xb/xenbus_stubs.c
index 3065181a55e6..97116b07826a 100644
--- a/tools/ocaml/libs/xb/xenbus_stubs.c
+++ b/tools/ocaml/libs/xb/xenbus_stubs.c
@@ -30,10 +30,9 @@
#include <xenctrl.h>
#include <xen/io/xs_wire.h>
-CAMLprim value stub_header_size(void)
+CAMLprim value stub_header_size(value unit)
{
- CAMLparam0();
- CAMLreturn(Val_int(sizeof(struct xsd_sockmsg)));
+ return Val_int(sizeof(struct xsd_sockmsg));
}
CAMLprim value stub_header_of_string(value s)
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c
b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 2fba9c5e94d6..728818445975 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -86,9 +86,9 @@ static void Noreturn failwith_xc(xc_interface *xch)
caml_raise_with_string(*caml_named_value("xc.error"), error_str);
}
-CAMLprim value stub_xc_interface_open(void)
+CAMLprim value stub_xc_interface_open(value unit)
{
- CAMLparam0();
+ CAMLparam1(unit);
CAMLlocal1(result);
xc_interface *xch;
--
2.11.0
|