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

[PATCH v2 17/17] tools/ocaml/libs/mmap: Clean up unused read/write


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Edwin Török <edvin.torok@xxxxxxxxxx>
  • Date: Tue, 11 May 2021 19:05:30 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Edwin Török <edvin.torok@xxxxxxxxxx>, "Christian Lindig" <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 11 May 2021 18:19:49 +0000
  • Ironport-hdrordr: A9a23:msXP7qz674nE3o0i9+mmKrPw6L1zdoMgy1knxilNoHxuH/Bw9v re+cjzsCWftN9/Yh4dcLy7VpVoIkmsl6Kdg7NwAV7KZmCP1FdARLsI0WKI+UyCJ8SRzI9gPa cLSdkFNDXzZ2IK8PoTNmODYqodKNrsytHWuQ/HpU0dKT2D88tbnn9E4gDwKDwQeCB2QaAXOb C7/cR9qz+paR0sH7+G7ilsZZmkmzXT/qiWGCI7Ow==
  • Ironport-sdr: iyilpD8SzCuioWNXOA9zFQdv0QcR3XhXht5LopOS6cVHbkq7tv7tK6I/yHXjb/ouc6mgLZvkvm Vp0V5STd83/IReHf6355A4PJeDdXxclLhlEbM6eX/TORACxQJbqoPVWC9GLOntlt4cYetwS/LX 5hgPDAVyhtIlp+jxOznnPz2jNGB13Ux4NtM+q2MYYtdTri0/mpbF1m4h2uEIqq/PFsmjTFsSRq yHomvODWg6ssASAGw9fxtJDw9HE5ZP70w5jMVtJtozSajL4Wzge+1rvn4zwV8d8Tju8Pem+hTU 70s=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Xenmmap is only modified by the ring functions,
these functions are unused.

Signed-off-by: Edwin Török <edvin.torok@xxxxxxxxxx>
---
 tools/ocaml/libs/mmap/xenmmap.ml      |  5 ----
 tools/ocaml/libs/mmap/xenmmap.mli     |  4 ---
 tools/ocaml/libs/mmap/xenmmap_stubs.c | 41 ---------------------------
 3 files changed, 50 deletions(-)

diff --git a/tools/ocaml/libs/mmap/xenmmap.ml b/tools/ocaml/libs/mmap/xenmmap.ml
index af258942a0..e17a62e607 100644
--- a/tools/ocaml/libs/mmap/xenmmap.ml
+++ b/tools/ocaml/libs/mmap/xenmmap.ml
@@ -24,11 +24,6 @@ type mmap_map_flag = SHARED | PRIVATE
 (* mmap: fd -> prot_flag -> map_flag -> length -> offset -> interface *)
 external mmap': Unix.file_descr -> mmap_prot_flag -> mmap_map_flag
                -> int -> int -> mmap_interface = "stub_mmap_init"
-(* read: interface -> start -> length -> data *)
-external read: mmap_interface -> int -> int -> string = "stub_mmap_read"
-(* write: interface -> data -> start -> length -> unit *)
-external write: mmap_interface -> string -> int -> int -> unit = 
"stub_mmap_write"
-(* getpagesize: unit -> size of page *)
 external unmap': mmap_interface -> unit = "stub_mmap_final"
 (* getpagesize: unit -> size of page *)
 let make ?(unmap=unmap') interface = interface, unmap
diff --git a/tools/ocaml/libs/mmap/xenmmap.mli 
b/tools/ocaml/libs/mmap/xenmmap.mli
index 075b24eab4..abf2a50131 100644
--- a/tools/ocaml/libs/mmap/xenmmap.mli
+++ b/tools/ocaml/libs/mmap/xenmmap.mli
@@ -19,10 +19,6 @@ type mmap_interface
 type mmap_prot_flag = RDONLY | WRONLY | RDWR
 type mmap_map_flag = SHARED | PRIVATE
 
-external read : mmap_interface -> int -> int -> string = "stub_mmap_read"
-external write : mmap_interface -> string -> int -> int -> unit
-               = "stub_mmap_write"
-
 val mmap : Unix.file_descr -> mmap_prot_flag -> mmap_map_flag -> int -> int -> 
t
 val unmap : t -> unit
 
diff --git a/tools/ocaml/libs/mmap/xenmmap_stubs.c 
b/tools/ocaml/libs/mmap/xenmmap_stubs.c
index e8d2d6add5..633e1fa916 100644
--- a/tools/ocaml/libs/mmap/xenmmap_stubs.c
+++ b/tools/ocaml/libs/mmap/xenmmap_stubs.c
@@ -96,47 +96,6 @@ CAMLprim value stub_mmap_final(value intf)
        CAMLreturn(Val_unit);
 }
 
-CAMLprim value stub_mmap_read(value intf, value start, value len)
-{
-       CAMLparam3(intf, start, len);
-       CAMLlocal1(data);
-       int c_start;
-       int c_len;
-
-       c_start = Int_val(start);
-       c_len = Int_val(len);
-
-       if (c_start > Intf_val(intf)->len)
-               caml_invalid_argument("start invalid");
-       if (c_start + c_len > Intf_val(intf)->len)
-               caml_invalid_argument("len invalid");
-
-       data = caml_alloc_string(c_len);
-       memcpy((char *) data, Intf_val(intf)->addr + c_start, c_len);
-
-       CAMLreturn(data);
-}
-
-CAMLprim value stub_mmap_write(value intf, value data,
-                               value start, value len)
-{
-       CAMLparam4(intf, data, start, len);
-       int c_start;
-       int c_len;
-
-       c_start = Int_val(start);
-       c_len = Int_val(len);
-
-       if (c_start > Intf_val(intf)->len)
-               caml_invalid_argument("start invalid");
-       if (c_start + c_len > Intf_val(intf)->len)
-               caml_invalid_argument("len invalid");
-
-       memcpy(Intf_val(intf)->addr + c_start, (char *) data, c_len);
-
-       CAMLreturn(Val_unit);
-}
-
 CAMLprim value stub_mmap_getpagesize(value unit)
 {
        CAMLparam1(unit);
-- 
2.25.1




 


Rackspace

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