xref: /qemu/include/system/xen.h (revision 8916c373a3fd56938f1b7d57010491a0b9662b1e)
1da278d58SPhilippe Mathieu-Daudé /*
2da278d58SPhilippe Mathieu-Daudé  * QEMU Xen support
3da278d58SPhilippe Mathieu-Daudé  *
4da278d58SPhilippe Mathieu-Daudé  * This work is licensed under the terms of the GNU GPL, version 2 or later.
5da278d58SPhilippe Mathieu-Daudé  * See the COPYING file in the top-level directory.
6da278d58SPhilippe Mathieu-Daudé  */
7da278d58SPhilippe Mathieu-Daudé 
869700301SPhilippe Mathieu-Daudé /* header to be included in non-Xen-specific code */
969700301SPhilippe Mathieu-Daudé 
1032cad1ffSPhilippe Mathieu-Daudé #ifndef SYSTEM_XEN_H
1132cad1ffSPhilippe Mathieu-Daudé #define SYSTEM_XEN_H
12da278d58SPhilippe Mathieu-Daudé 
13ce6936bcSPhilippe Mathieu-Daudé #include "exec/cpu-common.h"
14ce6936bcSPhilippe Mathieu-Daudé 
157d7a21baSPhilippe Mathieu-Daudé #ifdef COMPILING_PER_TARGET
16da278d58SPhilippe Mathieu-Daudé # ifdef CONFIG_XEN
178e0ef068SPhilippe Mathieu-Daudé #  define CONFIG_XEN_IS_POSSIBLE
188e0ef068SPhilippe Mathieu-Daudé # endif
198e0ef068SPhilippe Mathieu-Daudé #else
208e0ef068SPhilippe Mathieu-Daudé # define CONFIG_XEN_IS_POSSIBLE
217d7a21baSPhilippe Mathieu-Daudé #endif /* COMPILING_PER_TARGET */
22da278d58SPhilippe Mathieu-Daudé 
238e0ef068SPhilippe Mathieu-Daudé #ifdef CONFIG_XEN_IS_POSSIBLE
248e0ef068SPhilippe Mathieu-Daudé extern bool xen_allowed;
258e0ef068SPhilippe Mathieu-Daudé #define xen_enabled()           (xen_allowed)
26*d3ab5b56SPierrick Bouvier #else /* !CONFIG_XEN_IS_POSSIBLE */
27*d3ab5b56SPierrick Bouvier #define xen_enabled() 0
28*d3ab5b56SPierrick Bouvier #endif /* CONFIG_XEN_IS_POSSIBLE */
29da278d58SPhilippe Mathieu-Daudé 
30da278d58SPhilippe Mathieu-Daudé void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
31da278d58SPhilippe Mathieu-Daudé void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
32da278d58SPhilippe Mathieu-Daudé                    struct MemoryRegion *mr, Error **errp);
331be974bcSEdgar E. Iglesias bool xen_mr_is_memory(MemoryRegion *mr);
349ecdd4bfSEdgar E. Iglesias bool xen_mr_is_grants(MemoryRegion *mr);
35da278d58SPhilippe Mathieu-Daudé #endif
36