1 #if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
2 #define __XEN_VMAP_H__
3 
4 #include <xen/mm.h>
5 #include <asm/page.h>
6 
7 enum vmap_region {
8     VMAP_DEFAULT,
9     VMAP_XEN,
10     VMAP_REGION_NR,
11 };
12 
13 void vm_init_type(enum vmap_region type, void *start, void *end);
14 
15 void *__vmap(const mfn_t *mfn, unsigned int granularity, unsigned int nr,
16              unsigned int align, unsigned int flags, enum vmap_region);
17 void *vmap(const mfn_t *mfn, unsigned int nr);
18 void vunmap(const void *);
19 
20 void *vmalloc(size_t size);
21 void *vmalloc_xen(size_t size);
22 
23 void *vzalloc(size_t size);
24 void vfree(void *va);
25 
26 void __iomem *ioremap(paddr_t, size_t);
27 
iounmap(void __iomem * va)28 static inline void iounmap(void __iomem *va)
29 {
30     unsigned long addr = (unsigned long)(void __force *)va;
31 
32     vunmap((void *)(addr & PAGE_MASK));
33 }
34 
35 void *arch_vmap_virt_end(void);
vm_init(void)36 static inline void vm_init(void)
37 {
38     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
39 }
40 
41 #endif /* __XEN_VMAP_H__ */
42