xref: /openbmc/qemu/include/sysemu/xen.h (revision b53d555f)
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 #ifndef SYSEMU_XEN_H
9 #define SYSEMU_XEN_H
10 
11 #ifdef NEED_CPU_H
12 # ifdef CONFIG_XEN
13 #  define CONFIG_XEN_IS_POSSIBLE
14 # endif
15 #else
16 # define CONFIG_XEN_IS_POSSIBLE
17 #endif
18 
19 #ifdef CONFIG_XEN_IS_POSSIBLE
20 
21 extern bool xen_allowed;
22 
23 #define xen_enabled()           (xen_allowed)
24 
25 #ifndef CONFIG_USER_ONLY
26 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
27 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
28                    struct MemoryRegion *mr, Error **errp);
29 #endif
30 
31 #else /* !CONFIG_XEN_IS_POSSIBLE */
32 
33 #define xen_enabled() 0
34 #ifndef CONFIG_USER_ONLY
35 static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
36 {
37     /* nothing */
38 }
39 static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
40                                  MemoryRegion *mr, Error **errp)
41 {
42     g_assert_not_reached();
43 }
44 #endif
45 
46 #endif /* CONFIG_XEN_IS_POSSIBLE */
47 
48 #endif
49