1#ifndef INCLUDE_XEN_OPS_H
2#define INCLUDE_XEN_OPS_H
3
4#include <linux/percpu.h>
5#include <linux/notifier.h>
6#include <linux/efi.h>
7#include <asm/xen/interface.h>
8#include <xen/interface/vcpu.h>
9
10DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
11
12void xen_arch_pre_suspend(void);
13void xen_arch_post_suspend(int suspend_cancelled);
14
15void xen_timer_resume(void);
16void xen_arch_resume(void);
17void xen_arch_suspend(void);
18
19void xen_resume_notifier_register(struct notifier_block *nb);
20void xen_resume_notifier_unregister(struct notifier_block *nb);
21
22bool xen_vcpu_stolen(int vcpu);
23void xen_setup_runstate_info(int cpu);
24void xen_get_runstate_snapshot(struct vcpu_runstate_info *res);
25
26int xen_setup_shutdown_event(void);
27
28extern unsigned long *xen_contiguous_bitmap;
29int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
30 unsigned int address_bits,
31 dma_addr_t *dma_handle);
32
33void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
34
35struct vm_area_struct;
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
55 unsigned long addr,
56 xen_pfn_t *gfn, int nr,
57 int *err_ptr, pgprot_t prot,
58 unsigned domid,
59 struct page **pages);
60
61
62
63
64
65
66
67
68
69
70
71
72
73int xen_remap_domain_gfn_range(struct vm_area_struct *vma,
74 unsigned long addr,
75 xen_pfn_t gfn, int nr,
76 pgprot_t prot, unsigned domid,
77 struct page **pages);
78int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
79 int numpgs, struct page **pages);
80int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
81 unsigned long addr,
82 xen_pfn_t *gfn, int nr,
83 int *err_ptr, pgprot_t prot,
84 unsigned domid,
85 struct page **pages);
86int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
87 int nr, struct page **pages);
88
89bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
90
91#ifdef CONFIG_XEN_EFI
92extern efi_system_table_t *xen_efi_probe(void);
93#else
94static inline efi_system_table_t __init *xen_efi_probe(void)
95{
96 return NULL;
97}
98#endif
99
100#ifdef CONFIG_PREEMPT
101
102static inline void xen_preemptible_hcall_begin(void)
103{
104}
105
106static inline void xen_preemptible_hcall_end(void)
107{
108}
109
110#else
111
112DECLARE_PER_CPU(bool, xen_in_preemptible_hcall);
113
114static inline void xen_preemptible_hcall_begin(void)
115{
116 __this_cpu_write(xen_in_preemptible_hcall, true);
117}
118
119static inline void xen_preemptible_hcall_end(void)
120{
121 __this_cpu_write(xen_in_preemptible_hcall, false);
122}
123
124#endif
125
126#endif
127