xref: /qemu/include/system/xen.h (revision 8916c373a3fd56938f1b7d57010491a0b9662b1e)
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 #include "exec/cpu-common.h"
14 
15 #ifdef COMPILING_PER_TARGET
16 # ifdef CONFIG_XEN
17 #  define CONFIG_XEN_IS_POSSIBLE
18 # endif
19 #else
20 # define CONFIG_XEN_IS_POSSIBLE
21 #endif /* COMPILING_PER_TARGET */
22 
23 #ifdef CONFIG_XEN_IS_POSSIBLE
24 extern bool xen_allowed;
25 #define xen_enabled()           (xen_allowed)
26 #else /* !CONFIG_XEN_IS_POSSIBLE */
27 #define xen_enabled() 0
28 #endif /* CONFIG_XEN_IS_POSSIBLE */
29 
30 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
31 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
32                    struct MemoryRegion *mr, Error **errp);
33 bool xen_mr_is_memory(MemoryRegion *mr);
34 bool xen_mr_is_grants(MemoryRegion *mr);
35 #endif
36