aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml
Commit message (Collapse)AuthorAgeFilesLines
...
* tools/ocaml: unify build processChristoph Egger2011-11-011-3/+1
| | | | | | | | Unify ocaml build process for different platforms. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add a flags argument to libxl_ctx_alloc.Ian Campbell2011-10-181-1/+1
| | | | | | | | | Currently unused but gives us scope for expansion in an ABI compatible manner in the future. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: convert PCI device handling to device APIIan Campbell2011-10-182-20/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: convert VFB handling to device APIIan Campbell2011-10-182-8/+11
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: convert VKB handling to device APIIan Campbell2011-10-182-8/+11
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: remove libxl_device_console_add.Ian Campbell2011-10-182-19/+0
| | | | | | | | | | | | It has no callers, the only code which adds consoles in internal to libxl and uses libxl__device_console_add directly. Rather than worrying about what the public API should look like in this case simply remove it, adding new APIs is much easier than fixing broken ones... Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: convert NIC handling to device APIIan Campbell2011-10-182-4/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: convert disk handling to device APIIan Campbell2011-10-182-4/+7
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* ocaml: align build outputIan Campbell2011-10-171-3/+3
| | | | | | | | | | | | | Fix: MLI op.mli MLI op.cmi MLI partial.mli MLI partial.cmi MLI packet.mli Signed-off-by: Ian Cmpabell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/ocaml: Small improvement to the ocaml xenctrl libraryJon Ludlam2011-10-103-1/+5
| | | | | | | | Add a new field 'max_nr_cpus' to the physinfo type in the ocaml xc bindings Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-oneJon Ludlam2011-10-101-3/+3
| | | | | | | | | | The bit bugs are in ocaml vcpu affinity calls, and the off-by-one error is in the ocaml console ring code Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
* tools/ocaml: Remove log library from tools/ocaml/libsJon Ludlam2011-10-1023-944/+236
| | | | | | | | | | The only user was oxenstored, which has had the relevant bits merged in. Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
* tools/ocaml: Remove the uuid libraryJon Ludlam2011-10-1010-213/+16
| | | | | | | | | The library was only minimally used, and was really rather redundant. Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
* tools/ocaml: Add a missing dependency to the xenctrl ocaml packageJon Ludlam2011-10-101-1/+1
| | | | | | Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools/ocaml: Rename the ocaml librariesJon Ludlam2011-10-1043-277/+319
| | | | | | | | | | | | | | | | | | | | ocamlfind does not support namespaces, so to avoid name clashes the module names have become longer. Additionally, the xenstore and xenbus subdirs, which contain several modules each, have been packed into toplevel Xenstore and Xenbus modules. xb becomes xenbus, xc becomes xenctrl, xl becomes xenlight, xs becomes xenstore, eventchn becomes xeneventchn and mmap becomes xenmmap. [ Patch modified from that submitted, to update the .hgignore, and to cope with intervening changes to mmap_stubs.c -iwj ] Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: Change GET_C_STRUCT to Intf_val to follow common naming schemeZheng Li2011-10-061-17/+17
| | | | | | | | Change GET_C_STRUCT to Intf_val to follow the common naming scheme of OCaml macros, and for better readability. Signed-off-by: Zheng Li <dev@zheng.li> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: Fix invalid memory access in OCaml mmap libraryZheng Li2011-10-061-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix invalid memory access in OCaml mmap library (to play nicely with the GC) This was a bug reported by Roberto Di Cosmo. When he tried to reuse the mmap library for his own project, Mmap.read occasionally got different result when reading from the same map. This turned out to be a bug in the binding, where a C pointer was created pointing to a OCaml value, and the OCaml value was subsequently moved around by the GC after memory allocation and hence invalidated the C pointer. This patch removes the indirection of C pointer and uses OCaml macro to access values directly. Only Mmap.read function had this problem. The other functions, despite having the same code style, didn't have memory allocation involved hence wouldn't intrigue such an error. I've changed all of them to the safer style for future proof. Directly casting OCaml value's *data block* (rather than the value itself) as a C pointer is not a common practice either, but I'll leave it as it is. The bug hadn't occured on XenServer because XenServer didn't make use of the Mmap.read function (except in one place for debugging). In XenServer, most mmap operations were going through another pair of separately implemented functions (Xs_ring.read/write). Signed-off-by: Zheng Li <dev@zheng.li> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Rename libxl.idl to libxl_types.idl.Anthony PERARD2011-09-291-2/+2
| | | | | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> --HG-- rename : tools/libxl/libxl.idl => tools/libxl/libxl_types.idl
* tools/ocaml: ask compiler for correct libraryMike McClurg2011-06-211-1/+1
| | | | | | | | | | | | | OCaml libraries will live in /usr/local/ if the user compiles OCaml from source. This patch asks the OCaml compiler where we should look for libraries. NB: it may be that we should do the same thing for the NetBSD case, but I don't have a BSD box to test this out. Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: remove non-posix-ism from sed script.Ian Campbell2011-05-241-5/+9
| | | | | | | | | | | | | | | | | | | | Christoph Egger reported than on NetBSD the build fails with Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl sed: 1: "1i(*\ * AUTO-GENERATED ...": command i expects \ followed by test gmake[7]: Leaving directory `tools/ocaml/libs/xl' The following was tested by Christoph on NetBSD and also with GNU-sed with and without the --posix flag. In addition when sed fails will still create the output file, which confuses subsequent make invocations. Generate to a temporary file and move into place only on success. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: autogenerate xl datatype definitions and ocaml<->C conversionIan Campbell2011-04-205-412/+336
| | | | | | | | | | | | | | | | | | | | The method by which ocaml converts between ocaml types and C datastructures is based around explicit matching of field indexes within the ocaml data type to C structure members which is error prone to write and fragile to maintain (as evidenced by the difference between the existing hand coded support and the autogenerated code which shows how out of date the ocaml bindings have become). Autogenerating these types should reduce these problems. There is a short list of types which are blacklisted and not autogenerated because I expect them to change significantly in the future due to changes to the IDL type (fixing up the TaggedUnion class) so I didn't want to spend the time to implement the necessary autogenerator features just yet.. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: lay ground work for auto generating xl datatypes.Ian Campbell2011-04-205-1/+77
| | | | | | | | | | | | | Doesn't actually generate anything yet but puts all the moving parts into place. In particular sets up the xl.ml.in+_libxl_types.ml.in->xl.ml transformation using sed. This appears to be the only/best way to do this for ocaml due to the lack of a preprocessor and/or an include mechanism which has an inmpact on namespacing. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: tweak whitespace in preparation for autogenerating xl bindingsIan Campbell2011-04-203-53/+44
| | | | | | | | Reduces the diff of existing vs auto-generated code. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: remove create_info and build_info data types from xl bindingsIan Campbell2011-04-203-167/+0
| | | | | | | | | | | | There are currently no stub functions which use these datatypes. The existing definitions are out of date wrt the C API (and the conversion routines are commented out anyway) and are complex from the IDL point of view (and so will be skipped in the first round of autogeneration). Remove them to keep things simple for now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: reorder xl bindings type and function definitions to match IDLIan Campbell2011-04-202-212/+212
| | | | | | | | | | | Reduces the churn when comparing the before and after auto-generation versions of the patch. (in practice the ocaml pre-autogeneration bindings are so out of date that there isn't all that much benefit to this though...) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: remove libxl_domain_build_state from the IDLIan Campbell2011-04-203-39/+4
| | | | | | | | | | | | | | This datastructure is internal to the library. Remove the reference from libxl_device_console. This could never have been used from outside libxl and is only used internally to add the primary PV console to a guest. Make an internal variant of libxl_device_console_add which takes the build state as a parameter instead. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the topology types and functionsIan Campbell2011-04-202-19/+18
| | | | | | | | | | | 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: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Cc: David Scott <dave.scott@eu.citrix.com>
* tools: ocaml: rename the sched_credit types and functionsDavid Scott2011-03-302-16/+19
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the physinfo types and functionsDavid Scott2011-03-302-30/+36
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the domain_build_state types and functionsDavid Scott2011-03-302-16/+20
| | | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> [ijc: s/Device_build_state/Domain_build_state/g]
* tools: ocaml: rename the build_info types and functionsDavid Scott2011-03-302-66/+74
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the create_info types and functionsDavid Scott2011-03-302-26/+30
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: remove the domain_make and domain_build functions since they ↵David Scott2011-03-302-6/+0
| | | | | | | | | | | don't work The actual stubs are missing so these are currently a trap for the unwary. Signed-off-by: David Scott <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the pci types and functionsDavid Scott2011-03-303-31/+34
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the vkb types and functionsDavid Scott2011-03-303-62/+69
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the console types and functionsDavid Scott2011-03-303-17/+21
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the disk_info types and functionsDavid Scott2011-03-303-29/+33
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: ocaml: rename the device_nic types and functionsDavid Scott2011-03-303-36/+38
| | | | | | | | | | | 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 <dave.scott@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: namespace enum values within their type.Ian Campbell2011-04-201-2/+2
| | | | | | | | | In other words the values for an enum type libxl_foo always take the form LIBXL_FOO_VALUE. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: move all enum values into the libxl namespaceIan Campbell2011-04-201-2/+2
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: drop domid field from libxl_device_*Ian Campbell2011-04-081-9/+2
| | | | | | | | | | | | | | | | | | All functions which add a device to a domain already take a domid argument and the callers typically write the same value to the structure right before making the call. Functions which delete a device typically do not but adding this field makes the interface more consistent anyway and all callers have the domid to hand. All functions which return a libxl device structure are given a domid as a paramter and the caller therefore already knows which domain it is dealing with. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: do not expose libxenctrl/libxenstore headers via libxl.hIan Campbell2011-04-061-25/+25
| | | | | | | | | | | | This completely removes libxenstore from libxl users' view. xl still needs libxenctrl directly due to the direct use of the xentoollog functionality but it is not exposed to the indirect linkage anymore. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Remove $(CFLAGS) from links lines.Ian Campbell2011-03-311-1/+1
| | | | | | | | The relevant variable in these circumstances is called $(LDFLAGS). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: drop redefinition of xen_mbIan Campbell2011-03-311-4/+0
| | | | | | | This is always available to the in-tree build. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: drop some commented out build rules.Ian Campbell2011-03-311-8/+0
| | | | | | | These are covered by tools/ocaml/Makefile.rules now Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: push CFLAGS usage down into the specific bindingsIan Campbell2011-03-314-1/+6
| | | | | | | So each binding only builds against what it requires. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: do not try to link dynamic objects into .a librariesIan Campbell2011-03-311-2/+2
| | | | | | | | | | | lib<foo>_stubs.a was linking against $(LIBS_<foo>) which only includes dynamic linkage information which is not useful for a static library. $(LIBS_<foo>) is still used when linking <foo>.cmxa Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: Add an ocaml binding for libxl_get_topologyinfoDavid Scott2011-03-313-0/+63
| | | | | | | | | | Add an ocaml binding for libxl_get_topologyinfo in the style of libxl_get_physinfo. The function returns an array of optional records, one per possible pCPU. Signed-off-by: David Scott <dave.scott@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings.Ian Campbell2011-03-313-23/+13
| | | | | | | | | 22166:251694a87f1d changed the libxl interface to remove the need for users to understand BDF encoding but did not propagate the change to the ocaml bindings. Do that now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: remove "reg" and "enable" fields from PCI device.Ian Campbell2011-03-311-2/+0
| | | | | | | | | | | | The structure of the BDF argument used with PCI passthrough related hypercalls was taken from the structure of the PCI config_address register (I/O port 0xCF8) which allows I/O mapped access to PCI configuration space but these fields have no meaning in the context of PCI passthrough configuration and hence do not need to be exposed via libxl. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>