xref: /openbmc/qemu/include/hw/xen/xen.h (revision b8116f4c)
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  * C files using Xen toolstack libraries will have included those headers
12  * already via xen_native.h, and having __XEM_TOOLS__ defined will have
13  * automatically set __XEN_INTERFACE_VERSION__ to the latest supported
14  * by the *system* Xen headers which were transitively included.
15  *
16  * C files which are part of the internal emulation, and which did not
17  * include xen_native.h, may need this defined so that the Xen headers
18  * imported to include/hw/xen/interface/ will expose the appropriate API
19  * version.
20  *
21  * This is why there's a rule that xen_native.h must be included first.
22  */
23 #ifndef __XEN_INTERFACE_VERSION__
24 #define __XEN_INTERFACE_VERSION__ 0x00040e00
25 #endif
26 
27 #include "exec/cpu-common.h"
28 
29 /* xen-machine.c */
30 enum xen_mode {
31     XEN_DISABLED = 0, /* xen support disabled (default) */
32     XEN_ATTACH,       /* attach to xen domain created by libxl */
33     XEN_EMULATE,      /* emulate Xen within QEMU */
34 };
35 
36 extern uint32_t xen_domid;
37 extern enum xen_mode xen_mode;
38 extern bool xen_domid_restrict;
39 
40 int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
41 int xen_set_pci_link_route(uint8_t link, uint8_t irq);
42 void xen_intx_set_irq(void *opaque, int irq_num, int level);
43 void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
44 int xen_is_pirq_msi(uint32_t msi_data);
45 
46 qemu_irq *xen_interrupt_controller_init(void);
47 
48 void xen_register_framebuffer(struct MemoryRegion *mr);
49 
50 #endif /* QEMU_HW_XEN_H */
51