linux/include/xen/xen-ops.h
<<
>>
Prefs
   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 * xen_remap_domain_gfn_array() - map an array of foreign frames
  39 * @vma:     VMA to map the pages into
  40 * @addr:    Address at which to map the pages
  41 * @gfn:     Array of GFNs to map
  42 * @nr:      Number entries in the GFN array
  43 * @err_ptr: Returns per-GFN error status.
  44 * @prot:    page protection mask
  45 * @domid:   Domain owning the pages
  46 * @pages:   Array of pages if this domain has an auto-translated physmap
  47 *
  48 * @gfn and @err_ptr may point to the same buffer, the GFNs will be
  49 * overwritten by the error codes after they are mapped.
  50 *
  51 * Returns the number of successfully mapped frames, or a -ve error
  52 * code.
  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/* xen_remap_domain_gfn_range() - map a range of foreign frames
  62 * @vma:     VMA to map the pages into
  63 * @addr:    Address at which to map the pages
  64 * @gfn:     First GFN to map.
  65 * @nr:      Number frames to map
  66 * @prot:    page protection mask
  67 * @domid:   Domain owning the pages
  68 * @pages:   Array of pages if this domain has an auto-translated physmap
  69 *
  70 * Returns the number of successfully mapped frames, or a -ve error
  71 * code.
  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 /* CONFIG_PREEMPT */
 125
 126#endif /* INCLUDE_XEN_OPS_H */
 127