Files
xen/tools/ocaml/libs/xc/Makefile
T
Edwin Török ff95dae53e tools/ocaml/xenctrl: Add binding for xc_evtchn_status
There is no API or ioctl to query event channel status, it is only
present in xenctrl.h

The C union is mapped to an OCaml variant exposing just the value from
the correct union tag.  This causes the xc bindings to now depend on
evtchn to get a useful API for EVTCHNSTAT_virq.

The information provided here is similar to 'lsevtchn', but rather than
parsing its output it queries the underlying API directly.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
2022-12-02 13:41:04 +00:00

42 lines
1007 B
Makefile

OCAML_TOPLEVEL=$(CURDIR)/../..
XEN_ROOT=$(OCAML_TOPLEVEL)/../..
include $(OCAML_TOPLEVEL)/common.make
CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
CFLAGS += $(APPEND_CFLAGS)
OCAMLINCLUDE += -I ../mmap -I ../eventchn
OBJS = xenctrl
INTF = xenctrl.cmi
LIBS = xenctrl.cma xenctrl.cmxa
LIBS_xenctrl = $(call xenlibs-ldflags-ldlibs,ctrl guest)
xenctrl_OBJS = $(OBJS)
xenctrl_C_OBJS = xenctrl_stubs
OCAML_LIBRARY = xenctrl
all: $(INTF) $(LIBS)
libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
xenctrl_stubs.o: xenctrl_abi_check.h
xenctrl_abi_check.h: abi-check xenctrl_stubs.c xenctrl.ml
$(PERL) -w $^ >$@.tmp && mv -f $@.tmp $@
GENERATED_FILES += xenctrl_abi_check.h
include $(OCAML_TOPLEVEL)/Makefile.rules