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 /* xen-machine.c */ 28 enum xen_mode { 29 XEN_DISABLED = 0, /* xen support disabled (default) */ 30 XEN_ATTACH, /* attach to xen domain created by libxl */ 31 XEN_EMULATE, /* emulate Xen within QEMU */ 32 }; 33 34 extern uint32_t xen_domid; 35 extern enum xen_mode xen_mode; 36 extern bool xen_domid_restrict; 37 extern bool xen_is_stubdomain; 38 39 int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num); 40 int xen_set_pci_link_route(uint8_t link, uint8_t irq); 41 void xen_intx_set_irq(void *opaque, int irq_num, int level); 42 void xen_hvm_inject_msi(uint64_t addr, uint32_t data); 43 int xen_is_pirq_msi(uint32_t msi_data); 44 45 qemu_irq *xen_interrupt_controller_init(void); 46 47 void xen_register_framebuffer(struct MemoryRegion *mr); 48 49 #endif /* QEMU_HW_XEN_H */ 50