From: David Scott Date: Wed, 30 Mar 2011 17:54:28 +0000 (+0100) Subject: tools: ocaml: rename the physinfo types and functions X-Git-Tag: 4.2.0-rc1~2311 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=56e0b06e36cedd178d7c3d9a94e1d24d269ce869;p=xen.git tools: ocaml: rename the physinfo types and functions The aims are: 1. make the records instantiable if they have field names in common; and 2. to make it easier to derive the names programatically from the IDL Signed-off-by: David Scott Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/ocaml/libs/xl/xl.ml b/tools/ocaml/libs/xl/xl.ml index a2a39e0144..3e2244d1d2 100644 --- a/tools/ocaml/libs/xl/xl.ml +++ b/tools/ocaml/libs/xl/xl.ml @@ -192,20 +192,24 @@ module Device_pci = struct external shutdown : domid -> unit = "stub_xl_device_pci_shutdown" end -type physinfo = -{ - threads_per_core: int; - cores_per_socket: int; - max_cpu_id: int; - nr_cpus: int; - cpu_khz: int; - total_pages: int64; - free_pages: int64; - scrub_pages: int64; - nr_nodes: int; - hwcap: int32 array; - physcap: int32; -} +module Physinfo = struct + type t = + { + threads_per_core: int; + cores_per_socket: int; + max_cpu_id: int; + nr_cpus: int; + cpu_khz: int; + total_pages: int64; + free_pages: int64; + scrub_pages: int64; + nr_nodes: int; + hwcap: int32 array; + physcap: int32; + } + external get : unit -> t = "stub_xl_physinfo" + +end type topology = { @@ -227,7 +231,6 @@ type button = | Button_Sleep external button_press : domid -> button -> unit = "stub_xl_button_press" -external physinfo : unit -> physinfo = "stub_xl_physinfo" external topologyinfo: unit -> topologyinfo = "stub_xl_topologyinfo" diff --git a/tools/ocaml/libs/xl/xl.mli b/tools/ocaml/libs/xl/xl.mli index d023289404..c1332c9d73 100644 --- a/tools/ocaml/libs/xl/xl.mli +++ b/tools/ocaml/libs/xl/xl.mli @@ -192,20 +192,24 @@ module Device_pci : sig external shutdown : domid -> unit = "stub_xl_device_pci_shutdown" end -type physinfo = -{ - threads_per_core: int; - cores_per_socket: int; - max_cpu_id: int; - nr_cpus: int; - cpu_khz: int; - total_pages: int64; - free_pages: int64; - scrub_pages: int64; - nr_nodes: int; - hwcap: int32 array; - physcap: int32; -} +module Physinfo : sig + type t = + { + threads_per_core: int; + cores_per_socket: int; + max_cpu_id: int; + nr_cpus: int; + cpu_khz: int; + total_pages: int64; + free_pages: int64; + scrub_pages: int64; + nr_nodes: int; + hwcap: int32 array; + physcap: int32; + } + external get : unit -> t = "stub_xl_physinfo" + +end type topology = { @@ -227,7 +231,6 @@ type button = | Button_Sleep external button_press : domid -> button -> unit = "stub_xl_button_press" -external physinfo : unit -> physinfo = "stub_xl_physinfo" external topologyinfo: unit -> topologyinfo = "stub_xl_topologyinfo"