2 * Xen HVM emulation support in KVM
4 * Copyright © 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
11 #ifndef QEMU_I386_KVM_XEN_COMPAT_H
12 #define QEMU_I386_KVM_XEN_COMPAT_H
14 #include "hw/xen/interface/memory.h"
16 typedef uint32_t compat_pfn_t
;
17 typedef uint32_t compat_ulong_t
;
18 typedef uint32_t compat_ptr_t
;
20 #define __DEFINE_COMPAT_HANDLE(name, type) \
23 type *_[0] __attribute__((packed)); \
24 } __compat_handle_ ## name; \
26 #define DEFINE_COMPAT_HANDLE(name) __DEFINE_COMPAT_HANDLE(name, name)
27 #define COMPAT_HANDLE(name) __compat_handle_ ## name
29 DEFINE_COMPAT_HANDLE(compat_pfn_t
);
30 DEFINE_COMPAT_HANDLE(compat_ulong_t
);
31 DEFINE_COMPAT_HANDLE(int);
33 struct compat_xen_add_to_physmap
{
41 struct compat_xen_add_to_physmap_batch
{
46 COMPAT_HANDLE(compat_ulong_t
) idxs
;
47 COMPAT_HANDLE(compat_pfn_t
) gpfns
;
48 COMPAT_HANDLE(int) errs
;
51 struct compat_physdev_map_pirq
{
56 /* IN (ignored for ..._MULTI_MSI) */
60 /* IN - high 16 bits hold segment for ..._MSI_SEG and ..._MULTI_MSI */
64 /* IN (also OUT for ..._MULTI_MSI) */
68 } __attribute__((packed
));
70 #endif /* QEMU_I386_XEN_COMPAT_H */