xen.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef QEMU_HW_XEN_H
  2. #define QEMU_HW_XEN_H 1
  3. /*
  4. * public xen header
  5. * stuff needed outside xen-*.c, i.e. interfaces to qemu.
  6. * must not depend on any xen headers being present in
  7. * /usr/include/xen, so it can be included unconditionally.
  8. */
  9. #include <inttypes.h>
  10. #include "qemu-common.h"
  11. /* xen-machine.c */
  12. enum xen_mode {
  13. XEN_EMULATE = 0, // xen emulation, using xenner (default)
  14. XEN_CREATE, // create xen domain
  15. XEN_ATTACH // attach to xen domain created by xend
  16. };
  17. extern uint32_t xen_domid;
  18. extern enum xen_mode xen_mode;
  19. extern int xen_allowed;
  20. static inline int xen_enabled(void)
  21. {
  22. #if defined(CONFIG_XEN_BACKEND) && !defined(CONFIG_NO_XEN)
  23. return xen_allowed;
  24. #else
  25. return 0;
  26. #endif
  27. }
  28. int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
  29. void xen_piix3_set_irq(void *opaque, int irq_num, int level);
  30. void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
  31. void xen_cmos_set_s3_resume(void *opaque, int irq, int level);
  32. qemu_irq *xen_interrupt_controller_init(void);
  33. int xen_init(void);
  34. int xen_hvm_init(void);
  35. void xen_vcpu_init(void);
  36. void xenstore_store_pv_console_info(int i, struct CharDriverState *chr);
  37. #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY)
  38. void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size);
  39. #endif
  40. #if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400
  41. # define HVM_MAX_VCPUS 32
  42. #endif
  43. #endif /* QEMU_HW_XEN_H */