xref: /qemu/include/hw/xen/xen.h (revision 50c88402ca599e577f025e78a4380431be2b3f6d)
1 /*
2  * public xen header
3  *   stuff needed outside xen-*.c, i.e. interfaces to qemu.
4  *   must not depend on any xen headers being present in
5  *   /usr/include/xen, so it can be included unconditionally.
6  */
7 #ifndef QEMU_HW_XEN_H
8 #define QEMU_HW_XEN_H
9 
10 /*
11  * As a temporary measure while the headers are being untangled, define
12  * __XEN_TOOLS__ here before any Xen headers are included. Otherwise, if
13  * the Xen toolstack library headers are later included, they will find
14  * some of the "internal" definitions missing and the build will fail. In
15  * later commits, we'll end up with a rule that the native libraries have
16  * to be included first, which will ensure that the libraries get the
17  * version of Xen libraries that they expect.
18  */
19 #define __XEN_TOOLS__ 1
20 
21 #include "exec/cpu-common.h"
22 
23 /* xen-machine.c */
24 enum xen_mode {
25     XEN_EMULATE = 0,  // xen emulation, using xenner (default)
26     XEN_ATTACH        // attach to xen domain created by libxl
27 };
28 
29 extern uint32_t xen_domid;
30 extern enum xen_mode xen_mode;
31 extern bool xen_domid_restrict;
32 
33 int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
34 int xen_set_pci_link_route(uint8_t link, uint8_t irq);
35 void xen_piix3_set_irq(void *opaque, int irq_num, int level);
36 void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
37 int xen_is_pirq_msi(uint32_t msi_data);
38 
39 qemu_irq *xen_interrupt_controller_init(void);
40 
41 void xenstore_store_pv_console_info(int i, Chardev *chr);
42 
43 void xen_register_framebuffer(struct MemoryRegion *mr);
44 
45 #endif /* QEMU_HW_XEN_H */
46