]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Xen/arch-x86/hvm/start_info.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / arch-x86 / hvm / start_info.h
CommitLineData
60d26545
AP
1/*\r
2 * SPDX-License-Identifier: MIT\r
3 *\r
4 * Copyright (c) 2016, Citrix Systems, Inc.\r
5 */\r
6\r
7#ifndef __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__\r
8#define __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__\r
9\r
10/*\r
11 * Start of day structure passed to PVH guests and to HVM guests in %ebx.\r
12 *\r
13 * NOTE: nothing will be loaded at physical address 0, so a 0 value in any\r
14 * of the address fields should be treated as not present.\r
15 *\r
16 * 0 +----------------+\r
17 * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE\r
18 * | | ("xEn3" with the 0x80 bit of the "E" set).\r
19 * 4 +----------------+\r
20 * | version | Version of this structure. Current version is 1. New\r
21 * | | versions are guaranteed to be backwards-compatible.\r
22 * 8 +----------------+\r
23 * | flags | SIF_xxx flags.\r
24 * 12 +----------------+\r
25 * | nr_modules | Number of modules passed to the kernel.\r
26 * 16 +----------------+\r
27 * | modlist_paddr | Physical address of an array of modules\r
28 * | | (layout of the structure below).\r
29 * 24 +----------------+\r
30 * | cmdline_paddr | Physical address of the command line,\r
31 * | | a zero-terminated ASCII string.\r
32 * 32 +----------------+\r
33 * | rsdp_paddr | Physical address of the RSDP ACPI data structure.\r
34 * 40 +----------------+\r
35 * | memmap_paddr | Physical address of the (optional) memory map. Only\r
36 * | | present in version 1 and newer of the structure.\r
37 * 48 +----------------+\r
38 * | memmap_entries | Number of entries in the memory map table. Zero\r
39 * | | if there is no memory map being provided. Only\r
40 * | | present in version 1 and newer of the structure.\r
41 * 52 +----------------+\r
42 * | reserved | Version 1 and newer only.\r
43 * 56 +----------------+\r
44 *\r
45 * The layout of each entry in the module structure is the following:\r
46 *\r
47 * 0 +----------------+\r
48 * | paddr | Physical address of the module.\r
49 * 8 +----------------+\r
50 * | size | Size of the module in bytes.\r
51 * 16 +----------------+\r
52 * | cmdline_paddr | Physical address of the command line,\r
53 * | | a zero-terminated ASCII string.\r
54 * 24 +----------------+\r
55 * | reserved |\r
56 * 32 +----------------+\r
57 *\r
58 * The layout of each entry in the memory map table is as follows:\r
59 *\r
60 * 0 +----------------+\r
61 * | addr | Base address\r
62 * 8 +----------------+\r
63 * | size | Size of mapping in bytes\r
64 * 16 +----------------+\r
65 * | type | Type of mapping as defined between the hypervisor\r
66 * | | and guest. See XEN_HVM_MEMMAP_TYPE_* values below.\r
67 * 20 +----------------|\r
68 * | reserved |\r
69 * 24 +----------------+\r
70 *\r
71 * The address and sizes are always a 64bit little endian unsigned integer.\r
72 *\r
73 * NB: Xen on x86 will always try to place all the data below the 4GiB\r
74 * boundary.\r
75 *\r
76 * Version numbers of the hvm_start_info structure have evolved like this:\r
77 *\r
78 * Version 0: Initial implementation.\r
79 *\r
80 * Version 1: Added the memmap_paddr/memmap_entries fields (plus 4 bytes of\r
81 * padding) to the end of the hvm_start_info struct. These new\r
82 * fields can be used to pass a memory map to the guest. The\r
83 * memory map is optional and so guests that understand version 1\r
84 * of the structure must check that memmap_entries is non-zero\r
85 * before trying to read the memory map.\r
86 */\r
ac0a286f 87#define XEN_HVM_START_MAGIC_VALUE 0x336ec578\r
60d26545
AP
88\r
89/*\r
90 * The values used in the type field of the memory map table entries are\r
91 * defined below and match the Address Range Types as defined in the "System\r
92 * Address Map Interfaces" section of the ACPI Specification. Please refer to\r
93 * section 15 in version 6.2 of the ACPI spec: http://uefi.org/specifications\r
94 */\r
95#define XEN_HVM_MEMMAP_TYPE_RAM 1\r
96#define XEN_HVM_MEMMAP_TYPE_RESERVED 2\r
97#define XEN_HVM_MEMMAP_TYPE_ACPI 3\r
98#define XEN_HVM_MEMMAP_TYPE_NVS 4\r
99#define XEN_HVM_MEMMAP_TYPE_UNUSABLE 5\r
100#define XEN_HVM_MEMMAP_TYPE_DISABLED 6\r
101#define XEN_HVM_MEMMAP_TYPE_PMEM 7\r
102\r
103/*\r
104 * C representation of the x86/HVM start info layout.\r
105 *\r
106 * The canonical definition of this layout is above, this is just a way to\r
107 * represent the layout described there using C types.\r
108 */\r
109struct hvm_start_info {\r
ac0a286f 110 UINT32 magic; /* Contains the magic value 0x336ec578 */\r
60d26545 111 /* ("xEn3" with the 0x80 bit of the "E" set).*/\r
ac0a286f
MK
112 UINT32 version; /* Version of this structure. */\r
113 UINT32 flags; /* SIF_xxx flags. */\r
114 UINT32 nr_modules; /* Number of modules passed to the kernel. */\r
115 UINT64 modlist_paddr; /* Physical address of an array of */\r
60d26545 116 /* hvm_modlist_entry. */\r
ac0a286f
MK
117 UINT64 cmdline_paddr; /* Physical address of the command line. */\r
118 UINT64 rsdp_paddr; /* Physical address of the RSDP ACPI data */\r
60d26545 119 /* structure. */\r
ac0a286f
MK
120 /* All following fields only present in version 1 and newer */\r
121 UINT64 memmap_paddr; /* Physical address of an array of */\r
60d26545 122 /* hvm_memmap_table_entry. */\r
ac0a286f 123 UINT32 memmap_entries; /* Number of entries in the memmap table. */\r
60d26545
AP
124 /* Value will be zero if there is no memory */\r
125 /* map being provided. */\r
ac0a286f 126 UINT32 reserved; /* Must be zero. */\r
60d26545
AP
127};\r
128\r
129struct hvm_modlist_entry {\r
ac0a286f
MK
130 UINT64 paddr; /* Physical address of the module. */\r
131 UINT64 size; /* Size of the module in bytes. */\r
132 UINT64 cmdline_paddr; /* Physical address of the command line. */\r
133 UINT64 reserved;\r
60d26545
AP
134};\r
135\r
136struct hvm_memmap_table_entry {\r
ac0a286f
MK
137 UINT64 addr; /* Base address of the memory region */\r
138 UINT64 size; /* Size of the memory region in bytes */\r
139 UINT32 type; /* Mapping type */\r
140 UINT32 reserved; /* Must be zero for Version 1. */\r
60d26545
AP
141};\r
142\r
143#endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */\r