iPXE
version.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/******************************************************************************
3 * version.h
4 *
5 * Xen version, type, and compile information.
6 *
7 * Copyright (c) 2005, Nguyen Anh Quynh <aquynh@gmail.com>
8 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
9 */
10
11#ifndef __XEN_PUBLIC_VERSION_H__
12#define __XEN_PUBLIC_VERSION_H__
13
15FILE_SECBOOT ( PERMITTED );
16
17#include "xen.h"
18
19/* NB. All ops return zero on success, except XENVER_{version,pagesize}
20 * XENVER_{version,pagesize,build_id} */
21
22/* arg == NULL; returns major:minor (16:16). */
23#define XENVER_version 0
24
25/*
26 * arg == xen_extraversion_t.
27 *
28 * This API/ABI is broken. Use XENVER_extraversion2 where possible.
29 */
30#define XENVER_extraversion 1
31typedef char xen_extraversion_t[16];
32#define XEN_EXTRAVERSION_LEN (sizeof(xen_extraversion_t))
33
34/*
35 * arg == xen_compile_info_t.
36 *
37 * This API/ABI is broken and truncates data.
38 */
39#define XENVER_compile_info 2
41 char compiler[64];
42 char compile_by[16];
44 char compile_date[32];
45};
47
48/*
49 * arg == xen_capabilities_info_t.
50 *
51 * This API/ABI is broken. Use XENVER_capabilities2 where possible.
52 */
53#define XENVER_capabilities 3
54typedef char xen_capabilities_info_t[1024];
55#define XEN_CAPABILITIES_INFO_LEN (sizeof(xen_capabilities_info_t))
56
57/*
58 * arg == xen_changeset_info_t.
59 *
60 * This API/ABI is broken. Use XENVER_changeset2 where possible.
61 */
62#define XENVER_changeset 4
63typedef char xen_changeset_info_t[64];
64#define XEN_CHANGESET_INFO_LEN (sizeof(xen_changeset_info_t))
65
66/*
67 * This API is problematic.
68 *
69 * It is only applicable to guests which share pagetables with Xen (x86 PV
70 * guests), but unfortunately has leaked into other guest types and
71 * architectures with an expectation of never failing.
72 *
73 * It is intended to identify the virtual address split between guest kernel
74 * and Xen.
75 *
76 * For 32bit PV guests, there is a split, and it is variable (between two
77 * fixed bounds), and this boundary is reported to guests. The detail missing
78 * from the hypercall is that the second boundary is the 32bit architectural
79 * boundary at 4G.
80 *
81 * For 64bit PV guests, Xen lives at the bottom of the upper canonical range.
82 * This hypercall happens to report the architectural boundary, not the one
83 * which would be necessary to make a variable split work. As such, this
84 * hypercall entirely useless for 64bit PV guests, and all inspected
85 * implementations at the time of writing were found to have compile time
86 * expectations about the split.
87 *
88 * For architectures where this hypercall is implemented, for backwards
89 * compatibility with the expectation of the hypercall never failing Xen will
90 * return 0 instead of failing with -ENOSYS in cases where the guest should
91 * not be making the hypercall.
92 */
93#define XENVER_platform_parameters 5
98
99#define XENVER_get_features 6
101 uint32_t submap_idx; /* IN: which 32-bit submap to return */
102 uint32_t submap; /* OUT: 32-bit submap */
103};
105
106/* Declares the features reported by XENVER_get_features. */
107#include "features.h"
108
109/* arg == NULL; returns host memory page size. */
110#define XENVER_pagesize 7
111
112/* arg == xen_domain_handle_t.
113 *
114 * The toolstack fills it out for guest consumption. It is intended to hold
115 * the UUID of the guest.
116 */
117#define XENVER_guest_handle 8
118
119/*
120 * arg == xen_commandline_t.
121 *
122 * This API/ABI is broken. Use XENVER_commandline2 where possible.
123 */
124#define XENVER_commandline 9
125typedef char xen_commandline_t[1024];
126
127/*
128 * Return value is the number of bytes written, or XEN_Exx on error.
129 * Calling with empty parameter returns the size of build_id.
130 *
131 * Note: structure only kept for backwards compatibility. Xen operates in
132 * terms of xen_varbuf_t.
133 */
135 uint32_t len; /* IN: size of buf[]. */
136 unsigned char buf[XEN_FLEX_ARRAY_DIM];
137 /* OUT: Variable length buffer with build_id. */
138};
140
141/*
142 * Container for an arbitrary variable length buffer.
143 */
145 uint32_t len; /* IN: size of buf[] in bytes. */
146 unsigned char buf[XEN_FLEX_ARRAY_DIM]; /* OUT: requested data. */
147};
149
150/*
151 * arg == xen_varbuf_t
152 *
153 * Equivalent to the original ops, but with a non-truncating API/ABI.
154 *
155 * These hypercalls can fail for a number of reasons. All callers must handle
156 * -XEN_xxx return values appropriately.
157 *
158 * Passing arg == NULL is a request for size, which will be signalled with a
159 * non-negative return value. Note: a return size of 0 may be legitimate for
160 * the requested subop.
161 *
162 * Otherwise, the input xen_varbuf_t provides the size of the following
163 * buffer. Xen will fill the buffer, and return the number of bytes written
164 * (e.g. if the input buffer was longer than necessary).
165 *
166 * Some subops may return binary data. Some subops may be expected to return
167 * textural data. These are returned without a NUL terminator, and while the
168 * contents is expected to be ASCII/UTF-8, Xen makes no guarentees to this
169 * effect. e.g. Xen has no control over the formatting used for the command
170 * line.
171 */
172#define XENVER_build_id 10
173#define XENVER_extraversion2 11
174#define XENVER_capabilities2 12
175#define XENVER_changeset2 13
176#define XENVER_commandline2 14
177
178#endif /* __XEN_PUBLIC_VERSION_H__ */
179
180/*
181 * Local variables:
182 * mode: C
183 * c-file-style: "BSD"
184 * c-basic-offset: 4
185 * tab-width: 4
186 * indent-tabs-mode: nil
187 * End:
188 */
unsigned int uint32_t
Definition stdint.h:12
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define XEN_FLEX_ARRAY_DIM
Definition xen.h:52
unsigned long xen_ulong_t
Definition nonxen.h:30
unsigned char buf[XEN_FLEX_ARRAY_DIM]
Definition version.h:136
uint32_t len
Definition version.h:135
char compile_by[16]
Definition version.h:42
char compile_date[32]
Definition version.h:44
char compiler[64]
Definition version.h:41
char compile_domain[32]
Definition version.h:43
uint32_t submap_idx
Definition version.h:101
uint32_t submap
Definition version.h:102
xen_ulong_t virt_start
Definition version.h:95
uint32_t len
Definition version.h:145
unsigned char buf[XEN_FLEX_ARRAY_DIM]
Definition version.h:146
struct xen_feature_info xen_feature_info_t
Definition version.h:104
struct xen_compile_info xen_compile_info_t
Definition version.h:46
char xen_extraversion_t[16]
Definition version.h:31
char xen_commandline_t[1024]
Definition version.h:125
struct xen_platform_parameters xen_platform_parameters_t
Definition version.h:97
struct xen_varbuf xen_varbuf_t
Definition version.h:148
char xen_changeset_info_t[64]
Definition version.h:63
char xen_capabilities_info_t[1024]
Definition version.h:54
struct xen_build_id xen_build_id_t
Definition version.h:139