xen.h 1.6 KB

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