]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/Xen/arch-x86/xen.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / arch-x86 / xen.h
1 /******************************************************************************
2 * arch-x86/xen.h
3 *
4 * Guest OS interface to x86 Xen.
5 *
6 * SPDX-License-Identifier: MIT
7 *
8 * Copyright (c) 2004-2006, K A Fraser
9 */
10
11 #include "../xen.h"
12
13 #ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__
14 #define __XEN_PUBLIC_ARCH_X86_XEN_H__
15
16 /* Structural guest handles introduced in 0x00030201. */
17 #if __XEN_INTERFACE_VERSION__ >= 0x00030201
18 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
19 typedef struct { type *p; } __guest_handle_ ## name
20 #else
21 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
22 typedef type * __guest_handle_ ## name
23 #endif
24
25 /*
26 * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
27 * in a struct in memory.
28 * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
29 * hypercall argument.
30 * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but
31 * they might not be on other architectures.
32 */
33 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
34 ___DEFINE_XEN_GUEST_HANDLE(name, type); \
35 ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
36 #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
37 #define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name
38 #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
39 #define XEN_GUEST_HANDLE_PARAM(name) XEN_GUEST_HANDLE(name)
40 #define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0)
41 #ifdef __XEN_TOOLS__
42 #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
43 #endif
44 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
45
46 #if defined (MDE_CPU_IA32)
47 #include "xen-x86_32.h"
48 #elif defined (MDE_CPU_X64)
49 #include "xen-x86_64.h"
50 #endif
51
52 #ifndef __ASSEMBLY__
53 typedef UINTN xen_pfn_t;
54 #define PRI_xen_pfn "lx"
55 #endif
56
57 #define XEN_HAVE_PV_UPCALL_MASK 1
58
59 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
60 #define XEN_LEGACY_MAX_VCPUS 32
61
62 #ifndef __ASSEMBLY__
63
64 typedef UINTN xen_ulong_t;
65 #define PRI_xen_ulong "lx"
66
67 typedef UINT64 tsc_timestamp_t; /* RDTSC timestamp */
68
69 #ifdef MDE_CPU_IA32
70 #pragma pack(4)
71 #endif
72 struct arch_shared_info {
73 UINTN max_pfn; /* max pfn that appears in table */
74 /* Frame containing list of mfns containing list of mfns containing p2m. */
75 xen_pfn_t pfn_to_mfn_frame_list_list;
76 UINTN nmi_reason;
77 UINT64 pad[32];
78 };
79
80 typedef struct arch_shared_info arch_shared_info_t;
81 #ifdef MDE_CPU_IA32
82 #pragma pack()
83 #endif
84
85 #endif /* !__ASSEMBLY__ */
86
87 #endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */
88
89 /*
90 * Local variables:
91 * mode: C
92 * c-file-style: "BSD"
93 * c-basic-offset: 4
94 * tab-width: 4
95 * indent-tabs-mode: nil
96 * End:
97 */