]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Xen/arch-x86/xen.h
OvmfPkg/Include/...Xen: Convert __i386__/__x86_64__ to MDE_CPU_IA32/MDE_CPU_X64.
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / arch-x86 / xen.h
CommitLineData
6b621f95
AP
1/******************************************************************************\r
2 * arch-x86/xen.h\r
3 * \r
4 * Guest OS interface to x86 Xen.\r
5 * \r
6 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
7 * of this software and associated documentation files (the "Software"), to\r
8 * deal in the Software without restriction, including without limitation the\r
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\r
10 * sell copies of the Software, and to permit persons to whom the Software is\r
11 * furnished to do so, subject to the following conditions:\r
12 *\r
13 * The above copyright notice and this permission notice shall be included in\r
14 * all copies or substantial portions of the Software.\r
15 *\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
22 * DEALINGS IN THE SOFTWARE.\r
23 *\r
24 * Copyright (c) 2004-2006, K A Fraser\r
25 */\r
26\r
27#include "../xen.h"\r
28\r
29#ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__\r
30#define __XEN_PUBLIC_ARCH_X86_XEN_H__\r
31\r
32/* Structural guest handles introduced in 0x00030201. */\r
33#if __XEN_INTERFACE_VERSION__ >= 0x00030201\r
34#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \\r
35 typedef struct { type *p; } __guest_handle_ ## name\r
36#else\r
37#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \\r
38 typedef type * __guest_handle_ ## name\r
39#endif\r
40\r
41/*\r
42 * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field\r
43 * in a struct in memory.\r
44 * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an\r
45 * hypercall argument.\r
46 * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but\r
47 * they might not be on other architectures.\r
48 */\r
49#define __DEFINE_XEN_GUEST_HANDLE(name, type) \\r
50 ___DEFINE_XEN_GUEST_HANDLE(name, type); \\r
51 ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)\r
52#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)\r
53#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name\r
54#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)\r
55#define XEN_GUEST_HANDLE_PARAM(name) XEN_GUEST_HANDLE(name)\r
56#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0)\r
57#ifdef __XEN_TOOLS__\r
58#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)\r
59#endif\r
60#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)\r
61\r
8f148aee 62#if defined(MDE_CPU_IA32)\r
6b621f95 63#include "xen-x86_32.h"\r
8f148aee 64#elif defined(MDE_CPU_X64)\r
6b621f95
AP
65#include "xen-x86_64.h"\r
66#endif\r
67\r
68#ifndef __ASSEMBLY__\r
69typedef UINTN xen_pfn_t;\r
70#define PRI_xen_pfn "lx"\r
71#endif\r
72\r
73#define XEN_HAVE_PV_UPCALL_MASK 1\r
74\r
75/* Maximum number of virtual CPUs in legacy multi-processor guests. */\r
76#define XEN_LEGACY_MAX_VCPUS 32\r
77\r
78#ifndef __ASSEMBLY__\r
79\r
80typedef UINTN xen_ulong_t;\r
81#define PRI_xen_ulong "lx"\r
82\r
83typedef UINT64 tsc_timestamp_t; /* RDTSC timestamp */\r
84\r
8f148aee 85#ifdef MDE_CPU_IA32\r
6b621f95
AP
86#pragma pack(4)\r
87#endif\r
88struct arch_shared_info {\r
89 UINTN max_pfn; /* max pfn that appears in table */\r
90 /* Frame containing list of mfns containing list of mfns containing p2m. */\r
91 xen_pfn_t pfn_to_mfn_frame_list_list;\r
92 UINTN nmi_reason;\r
93 UINT64 pad[32];\r
94};\r
95typedef struct arch_shared_info arch_shared_info_t;\r
8f148aee 96#ifdef MDE_CPU_IA32\r
6b621f95
AP
97#pragma pack()\r
98#endif\r
99\r
100#endif /* !__ASSEMBLY__ */\r
101\r
102#endif /* __XEN_PUBLIC_ARCH_X86_XEN_H__ */\r
103\r
104/*\r
105 * Local variables:\r
106 * mode: C\r
107 * c-file-style: "BSD"\r
108 * c-basic-offset: 4\r
109 * tab-width: 4\r
110 * indent-tabs-mode: nil\r
111 * End:\r
112 */\r