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

[PATCH v1 9/9] tools/ocaml/libs/mmap: Clean up unused read/write


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Edwin Török <edvin.torok@xxxxxxxxxx>
  • Date: Thu, 27 Aug 2020 18:36:00 +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" <ian.jackson@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 27 Aug 2020 17:36:39 +0000
  • Ironport-sdr: HljBeO9zi6Qm0Aq4dmatkf5eNa46RdzbNCy+42n5s7NI1n3O/Sx928IHmDzf9CH1LN2tTjjCmf lWz92HIwkvp4J4eAuwdDAxUTzfVtq6pMZE2ViCpZzWGt6hmjo43tRmlmIa/ji2a1BbqXAbkPWa /7Sl/6mT1cOrFm3CUmOftNiZKy2wt8qQ/BdzRni/uJseA8fbzfyKIuDQB2rzrSx2mllEI39jbm 36nPA9fFnMN/6CFUbLFP11HcbsWVx1k6gTBdkqSPr7DvUNu5LlqONe3sSlla74vYRRGl5apL1b 4oM=
  • 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 21feceea0e..ec0431efb5 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®.