Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / sysemu / xen.h
blobd70eacfbe280976bf7374090285963e4a51cc03d
1 /*
2 * QEMU Xen support
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 */
8 /* header to be included in non-Xen-specific code */
10 #ifndef SYSEMU_XEN_H
11 #define SYSEMU_XEN_H
13 #ifdef CONFIG_USER_ONLY
14 #error Cannot include sysemu/xen.h from user emulation
15 #endif
17 #include "exec/cpu-common.h"
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 */
27 #ifdef CONFIG_XEN_IS_POSSIBLE
29 extern bool xen_allowed;
31 #define xen_enabled() (xen_allowed)
33 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
34 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
35 struct MemoryRegion *mr, Error **errp);
37 #else /* !CONFIG_XEN_IS_POSSIBLE */
39 #define xen_enabled() 0
40 static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
42 /* nothing */
44 static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
45 MemoryRegion *mr, Error **errp)
47 g_assert_not_reached();
50 #endif /* CONFIG_XEN_IS_POSSIBLE */
52 bool xen_mr_is_memory(MemoryRegion *mr);
53 bool xen_mr_is_grants(MemoryRegion *mr);
54 #endif