]>
Commit | Line | Data |
---|---|---|
e04d0d07 IY |
1 | #ifndef INCLUDE_XEN_OPS_H |
2 | #define INCLUDE_XEN_OPS_H | |
3 | ||
4 | #include <linux/percpu.h> | |
cd979883 | 5 | #include <linux/notifier.h> |
be81c8a1 | 6 | #include <linux/efi.h> |
7892f692 | 7 | #include <asm/xen/interface.h> |
e04d0d07 IY |
8 | |
9 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); | |
10 | ||
03c8142b IC |
11 | void xen_arch_pre_suspend(void); |
12 | void xen_arch_post_suspend(int suspend_cancelled); | |
0e91398f | 13 | |
ad55db9f IY |
14 | void xen_timer_resume(void); |
15 | void xen_arch_resume(void); | |
16 | ||
cd979883 SG |
17 | void xen_resume_notifier_register(struct notifier_block *nb); |
18 | void xen_resume_notifier_unregister(struct notifier_block *nb); | |
19 | ||
016b6f5f SS |
20 | int xen_setup_shutdown_event(void); |
21 | ||
08bbc9da | 22 | extern unsigned long *xen_contiguous_bitmap; |
1b65c4e5 | 23 | int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, |
69908907 SS |
24 | unsigned int address_bits, |
25 | dma_addr_t *dma_handle); | |
08bbc9da | 26 | |
1b65c4e5 | 27 | void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order); |
08bbc9da | 28 | |
c140d879 | 29 | struct vm_area_struct; |
4e8c0c8c DV |
30 | |
31 | /* | |
32 | * xen_remap_domain_mfn_array() - map an array of foreign frames | |
33 | * @vma: VMA to map the pages into | |
34 | * @addr: Address at which to map the pages | |
35 | * @gfn: Array of GFNs to map | |
36 | * @nr: Number entries in the GFN array | |
37 | * @err_ptr: Returns per-GFN error status. | |
38 | * @prot: page protection mask | |
39 | * @domid: Domain owning the pages | |
40 | * @pages: Array of pages if this domain has an auto-translated physmap | |
41 | * | |
42 | * @gfn and @err_ptr may point to the same buffer, the GFNs will be | |
43 | * overwritten by the error codes after they are mapped. | |
44 | * | |
45 | * Returns the number of successfully mapped frames, or a -ve error | |
46 | * code. | |
47 | */ | |
48 | int xen_remap_domain_mfn_array(struct vm_area_struct *vma, | |
49 | unsigned long addr, | |
50 | xen_pfn_t *gfn, int nr, | |
51 | int *err_ptr, pgprot_t prot, | |
52 | unsigned domid, | |
53 | struct page **pages); | |
54 | ||
55 | /* xen_remap_domain_mfn_range() - map a range of foreign frames | |
56 | * @vma: VMA to map the pages into | |
57 | * @addr: Address at which to map the pages | |
58 | * @gfn: First GFN to map. | |
59 | * @nr: Number frames to map | |
60 | * @prot: page protection mask | |
61 | * @domid: Domain owning the pages | |
62 | * @pages: Array of pages if this domain has an auto-translated physmap | |
63 | * | |
64 | * Returns the number of successfully mapped frames, or a -ve error | |
65 | * code. | |
66 | */ | |
de1ef206 IC |
67 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
68 | unsigned long addr, | |
4e8c0c8c | 69 | xen_pfn_t gfn, int nr, |
9a032e39 IC |
70 | pgprot_t prot, unsigned domid, |
71 | struct page **pages); | |
72 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | |
73 | int numpgs, struct page **pages); | |
4e8c0c8c | 74 | int xen_xlate_remap_gfn_array(struct vm_area_struct *vma, |
628c28ee | 75 | unsigned long addr, |
4e8c0c8c DV |
76 | xen_pfn_t *gfn, int nr, |
77 | int *err_ptr, pgprot_t prot, | |
628c28ee DV |
78 | unsigned domid, |
79 | struct page **pages); | |
80 | int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma, | |
81 | int nr, struct page **pages); | |
de1ef206 | 82 | |
394b40f6 | 83 | bool xen_running_on_version_or_later(unsigned int major, unsigned int minor); |
be81c8a1 DK |
84 | |
85 | #ifdef CONFIG_XEN_EFI | |
86 | extern efi_system_table_t *xen_efi_probe(void); | |
87 | #else | |
57f7138d | 88 | static inline efi_system_table_t __init *xen_efi_probe(void) |
be81c8a1 DK |
89 | { |
90 | return NULL; | |
91 | } | |
92 | #endif | |
93 | ||
fdfd811d DV |
94 | #ifdef CONFIG_PREEMPT |
95 | ||
96 | static inline void xen_preemptible_hcall_begin(void) | |
97 | { | |
98 | } | |
99 | ||
100 | static inline void xen_preemptible_hcall_end(void) | |
101 | { | |
102 | } | |
103 | ||
104 | #else | |
105 | ||
106 | DECLARE_PER_CPU(bool, xen_in_preemptible_hcall); | |
107 | ||
108 | static inline void xen_preemptible_hcall_begin(void) | |
109 | { | |
110 | __this_cpu_write(xen_in_preemptible_hcall, true); | |
111 | } | |
112 | ||
113 | static inline void xen_preemptible_hcall_end(void) | |
114 | { | |
115 | __this_cpu_write(xen_in_preemptible_hcall, false); | |
116 | } | |
117 | ||
118 | #endif /* CONFIG_PREEMPT */ | |
119 | ||
e04d0d07 | 120 | #endif /* INCLUDE_XEN_OPS_H */ |