xref: /qemu/include/system/xen.h (revision 6c1ae457a17a9462fb89ef1f30ad7da5266bfea6)
1 /*
2  * QEMU Xen support
3  *
4  * This work is licensed under the terms of the GNU GPL, version 2 or later.
5  * See the COPYING file in the top-level directory.
6  */
7 
8 /* header to be included in non-Xen-specific code */
9 
10 #ifndef SYSTEM_XEN_H
11 #define SYSTEM_XEN_H
12 
13 #ifdef CONFIG_USER_ONLY
14 #error Cannot include system/xen.h from user emulation
15 #endif
16 
17 #include "exec/cpu-common.h"
18 
19 #ifdef COMPILING_PER_TARGET
20 # ifdef CONFIG_XEN
21 #  define CONFIG_XEN_IS_POSSIBLE
22 # endif
23 #else
24 # define CONFIG_XEN_IS_POSSIBLE
25 #endif /* COMPILING_PER_TARGET */
26 
27 #ifdef CONFIG_XEN_IS_POSSIBLE
28 extern bool xen_allowed;
29 #define xen_enabled()           (xen_allowed)
30 #else /* !CONFIG_XEN_IS_POSSIBLE */
31 #define xen_enabled() 0
32 #endif /* CONFIG_XEN_IS_POSSIBLE */
33 
34 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
35 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
36                    struct MemoryRegion *mr, Error **errp);
37 bool xen_mr_is_memory(MemoryRegion *mr);
38 bool xen_mr_is_grants(MemoryRegion *mr);
39 #endif
40