xen-ops.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef INCLUDE_XEN_OPS_H
  2. #define INCLUDE_XEN_OPS_H
  3. #include <linux/percpu.h>
  4. #include <linux/notifier.h>
  5. #include <linux/efi.h>
  6. #include <asm/xen/interface.h>
  7. DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
  8. void xen_arch_pre_suspend(void);
  9. void xen_arch_post_suspend(int suspend_cancelled);
  10. void xen_timer_resume(void);
  11. void xen_arch_resume(void);
  12. void xen_resume_notifier_register(struct notifier_block *nb);
  13. void xen_resume_notifier_unregister(struct notifier_block *nb);
  14. int xen_setup_shutdown_event(void);
  15. extern unsigned long *xen_contiguous_bitmap;
  16. int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
  17. unsigned int address_bits,
  18. dma_addr_t *dma_handle);
  19. void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
  20. struct vm_area_struct;
  21. int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
  22. unsigned long addr,
  23. xen_pfn_t mfn, int nr,
  24. pgprot_t prot, unsigned domid,
  25. struct page **pages);
  26. int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
  27. int numpgs, struct page **pages);
  28. bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
  29. #ifdef CONFIG_XEN_EFI
  30. extern efi_system_table_t *xen_efi_probe(void);
  31. #else
  32. static inline efi_system_table_t __init *xen_efi_probe(void)
  33. {
  34. return NULL;
  35. }
  36. #endif
  37. #ifdef CONFIG_PREEMPT
  38. static inline void xen_preemptible_hcall_begin(void)
  39. {
  40. }
  41. static inline void xen_preemptible_hcall_end(void)
  42. {
  43. }
  44. #else
  45. DECLARE_PER_CPU(bool, xen_in_preemptible_hcall);
  46. static inline void xen_preemptible_hcall_begin(void)
  47. {
  48. __this_cpu_write(xen_in_preemptible_hcall, true);
  49. }
  50. static inline void xen_preemptible_hcall_end(void)
  51. {
  52. __this_cpu_write(xen_in_preemptible_hcall, false);
  53. }
  54. #endif /* CONFIG_PREEMPT */
  55. #endif /* INCLUDE_XEN_OPS_H */