1#ifndef INCLUDE_XEN_OPS_H
2#define INCLUDE_XEN_OPS_H
3
4#include <linux/percpu.h>
5#include <asm/xen/interface.h>
6
7DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
8
9DECLARE_PER_CPU(uint32_t, xen_vcpu_id);
10static inline uint32_t xen_vcpu_nr(int cpu)
11{
12 return per_cpu(xen_vcpu_id, cpu);
13}
14
15#define XEN_VCPU_ID_INVALID U32_MAX
16
17void xen_arch_pre_suspend(void);
18void xen_arch_post_suspend(int suspend_cancelled);
19void xen_arch_hvm_post_suspend(int suspend_cancelled);
20
21void xen_mm_pin_all(void);
22void xen_mm_unpin_all(void);
23
24void xen_timer_resume(void);
25void xen_arch_resume(void);
26
27int xen_setup_shutdown_event(void);
28
29extern unsigned long *xen_contiguous_bitmap;
30int xen_create_contiguous_region(unsigned long vstart, unsigned int order,
31 unsigned int address_bits);
32
33void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
34
35struct vm_area_struct;
36int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
37 unsigned long addr,
38 xen_pfn_t mfn, int nr,
39 pgprot_t prot, unsigned domid,
40 struct page **pages);
41int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
42 int numpgs, struct page **pages);
43
44bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
45#endif
46