1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI types |
5 | * |
6 | * Copyright IBM, Corp. 2011 |
7 | * Copyright (c) 2013-2018 Red Hat Inc. |
8 | * |
9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
10 | * See the COPYING.LIB file in the top-level directory. |
11 | */ |
12 | |
13 | #ifndef QAPI_TYPES_MACHINE_H |
14 | #define QAPI_TYPES_MACHINE_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | |
18 | typedef enum SysEmuTarget { |
19 | SYS_EMU_TARGET_AARCH64, |
20 | SYS_EMU_TARGET_ALPHA, |
21 | SYS_EMU_TARGET_ARM, |
22 | SYS_EMU_TARGET_CRIS, |
23 | SYS_EMU_TARGET_HPPA, |
24 | SYS_EMU_TARGET_I386, |
25 | SYS_EMU_TARGET_LM32, |
26 | SYS_EMU_TARGET_M68K, |
27 | SYS_EMU_TARGET_MICROBLAZE, |
28 | SYS_EMU_TARGET_MICROBLAZEEL, |
29 | SYS_EMU_TARGET_MIPS, |
30 | SYS_EMU_TARGET_MIPS64, |
31 | SYS_EMU_TARGET_MIPS64EL, |
32 | SYS_EMU_TARGET_MIPSEL, |
33 | SYS_EMU_TARGET_MOXIE, |
34 | SYS_EMU_TARGET_NIOS2, |
35 | SYS_EMU_TARGET_OR1K, |
36 | SYS_EMU_TARGET_PPC, |
37 | SYS_EMU_TARGET_PPC64, |
38 | SYS_EMU_TARGET_RISCV32, |
39 | SYS_EMU_TARGET_RISCV64, |
40 | SYS_EMU_TARGET_S390X, |
41 | SYS_EMU_TARGET_SH4, |
42 | SYS_EMU_TARGET_SH4EB, |
43 | SYS_EMU_TARGET_SPARC, |
44 | SYS_EMU_TARGET_SPARC64, |
45 | SYS_EMU_TARGET_TRICORE, |
46 | SYS_EMU_TARGET_UNICORE32, |
47 | SYS_EMU_TARGET_X86_64, |
48 | SYS_EMU_TARGET_XTENSA, |
49 | SYS_EMU_TARGET_XTENSAEB, |
50 | SYS_EMU_TARGET__MAX, |
51 | } SysEmuTarget; |
52 | |
53 | #define SysEmuTarget_str(val) \ |
54 | qapi_enum_lookup(&SysEmuTarget_lookup, (val)) |
55 | |
56 | extern const QEnumLookup SysEmuTarget_lookup; |
57 | |
58 | typedef enum CpuInfoArch { |
59 | CPU_INFO_ARCH_X86, |
60 | CPU_INFO_ARCH_SPARC, |
61 | CPU_INFO_ARCH_PPC, |
62 | CPU_INFO_ARCH_MIPS, |
63 | CPU_INFO_ARCH_TRICORE, |
64 | CPU_INFO_ARCH_S390, |
65 | CPU_INFO_ARCH_RISCV, |
66 | CPU_INFO_ARCH_OTHER, |
67 | CPU_INFO_ARCH__MAX, |
68 | } CpuInfoArch; |
69 | |
70 | #define CpuInfoArch_str(val) \ |
71 | qapi_enum_lookup(&CpuInfoArch_lookup, (val)) |
72 | |
73 | extern const QEnumLookup CpuInfoArch_lookup; |
74 | |
75 | typedef struct q_obj_CpuInfo_base q_obj_CpuInfo_base; |
76 | |
77 | typedef struct CpuInfo CpuInfo; |
78 | |
79 | typedef struct CpuInfoX86 CpuInfoX86; |
80 | |
81 | typedef struct CpuInfoSPARC CpuInfoSPARC; |
82 | |
83 | typedef struct CpuInfoPPC CpuInfoPPC; |
84 | |
85 | typedef struct CpuInfoMIPS CpuInfoMIPS; |
86 | |
87 | typedef struct CpuInfoTricore CpuInfoTricore; |
88 | |
89 | typedef struct CpuInfoRISCV CpuInfoRISCV; |
90 | |
91 | typedef enum CpuS390State { |
92 | S390_CPU_STATE_UNINITIALIZED, |
93 | S390_CPU_STATE_STOPPED, |
94 | S390_CPU_STATE_CHECK_STOP, |
95 | S390_CPU_STATE_OPERATING, |
96 | S390_CPU_STATE_LOAD, |
97 | S390_CPU_STATE__MAX, |
98 | } CpuS390State; |
99 | |
100 | #define CpuS390State_str(val) \ |
101 | qapi_enum_lookup(&CpuS390State_lookup, (val)) |
102 | |
103 | extern const QEnumLookup CpuS390State_lookup; |
104 | |
105 | typedef struct CpuInfoS390 CpuInfoS390; |
106 | |
107 | typedef struct CpuInfoList CpuInfoList; |
108 | |
109 | typedef struct q_obj_CpuInfoFast_base q_obj_CpuInfoFast_base; |
110 | |
111 | typedef struct CpuInfoFast CpuInfoFast; |
112 | |
113 | typedef struct CpuInfoFastList CpuInfoFastList; |
114 | |
115 | typedef struct q_obj_cpu_add_arg q_obj_cpu_add_arg; |
116 | |
117 | typedef struct MachineInfo MachineInfo; |
118 | |
119 | typedef struct MachineInfoList MachineInfoList; |
120 | |
121 | typedef struct CurrentMachineParams CurrentMachineParams; |
122 | |
123 | typedef struct TargetInfo TargetInfo; |
124 | |
125 | typedef enum NumaOptionsType { |
126 | NUMA_OPTIONS_TYPE_NODE, |
127 | NUMA_OPTIONS_TYPE_DIST, |
128 | NUMA_OPTIONS_TYPE_CPU, |
129 | NUMA_OPTIONS_TYPE__MAX, |
130 | } NumaOptionsType; |
131 | |
132 | #define NumaOptionsType_str(val) \ |
133 | qapi_enum_lookup(&NumaOptionsType_lookup, (val)) |
134 | |
135 | extern const QEnumLookup NumaOptionsType_lookup; |
136 | |
137 | typedef struct q_obj_NumaOptions_base q_obj_NumaOptions_base; |
138 | |
139 | typedef struct NumaOptions NumaOptions; |
140 | |
141 | typedef struct NumaNodeOptions NumaNodeOptions; |
142 | |
143 | typedef struct NumaDistOptions NumaDistOptions; |
144 | |
145 | typedef enum X86CPURegister32 { |
146 | X86_CPU_REGISTER32_EAX, |
147 | X86_CPU_REGISTER32_EBX, |
148 | X86_CPU_REGISTER32_ECX, |
149 | X86_CPU_REGISTER32_EDX, |
150 | X86_CPU_REGISTER32_ESP, |
151 | X86_CPU_REGISTER32_EBP, |
152 | X86_CPU_REGISTER32_ESI, |
153 | X86_CPU_REGISTER32_EDI, |
154 | X86_CPU_REGISTER32__MAX, |
155 | } X86CPURegister32; |
156 | |
157 | #define X86CPURegister32_str(val) \ |
158 | qapi_enum_lookup(&X86CPURegister32_lookup, (val)) |
159 | |
160 | extern const QEnumLookup X86CPURegister32_lookup; |
161 | |
162 | typedef struct X86CPUFeatureWordInfo X86CPUFeatureWordInfo; |
163 | |
164 | typedef struct X86CPUFeatureWordInfoList X86CPUFeatureWordInfoList; |
165 | |
166 | typedef struct DummyForceArrays DummyForceArrays; |
167 | |
168 | typedef struct NumaCpuOptions NumaCpuOptions; |
169 | |
170 | typedef enum HostMemPolicy { |
171 | HOST_MEM_POLICY_DEFAULT, |
172 | HOST_MEM_POLICY_PREFERRED, |
173 | HOST_MEM_POLICY_BIND, |
174 | HOST_MEM_POLICY_INTERLEAVE, |
175 | HOST_MEM_POLICY__MAX, |
176 | } HostMemPolicy; |
177 | |
178 | #define HostMemPolicy_str(val) \ |
179 | qapi_enum_lookup(&HostMemPolicy_lookup, (val)) |
180 | |
181 | extern const QEnumLookup HostMemPolicy_lookup; |
182 | |
183 | typedef struct Memdev Memdev; |
184 | |
185 | typedef struct MemdevList MemdevList; |
186 | |
187 | typedef struct CpuInstanceProperties CpuInstanceProperties; |
188 | |
189 | typedef struct HotpluggableCPU HotpluggableCPU; |
190 | |
191 | typedef struct HotpluggableCPUList HotpluggableCPUList; |
192 | |
193 | struct q_obj_CpuInfo_base { |
194 | int64_t CPU; |
195 | bool current; |
196 | bool halted; |
197 | char *qom_path; |
198 | int64_t thread_id; |
199 | bool has_props; |
200 | CpuInstanceProperties *props; |
201 | CpuInfoArch arch; |
202 | }; |
203 | |
204 | struct CpuInfoX86 { |
205 | int64_t pc; |
206 | }; |
207 | |
208 | struct CpuInfoSPARC { |
209 | int64_t pc; |
210 | int64_t npc; |
211 | }; |
212 | |
213 | struct CpuInfoPPC { |
214 | int64_t nip; |
215 | }; |
216 | |
217 | struct CpuInfoMIPS { |
218 | int64_t PC; |
219 | }; |
220 | |
221 | struct CpuInfoTricore { |
222 | int64_t PC; |
223 | }; |
224 | |
225 | struct CpuInfoS390 { |
226 | CpuS390State cpu_state; |
227 | }; |
228 | |
229 | struct CpuInfoRISCV { |
230 | int64_t pc; |
231 | }; |
232 | |
233 | struct CpuInfo { |
234 | int64_t CPU; |
235 | bool current; |
236 | bool halted; |
237 | char *qom_path; |
238 | int64_t thread_id; |
239 | bool has_props; |
240 | CpuInstanceProperties *props; |
241 | CpuInfoArch arch; |
242 | union { /* union tag is @arch */ |
243 | CpuInfoX86 x86; |
244 | CpuInfoSPARC q_sparc; |
245 | CpuInfoPPC ppc; |
246 | CpuInfoMIPS q_mips; |
247 | CpuInfoTricore tricore; |
248 | CpuInfoS390 s390; |
249 | CpuInfoRISCV riscv; |
250 | } u; |
251 | }; |
252 | |
253 | void qapi_free_CpuInfo(CpuInfo *obj); |
254 | |
255 | void qapi_free_CpuInfoX86(CpuInfoX86 *obj); |
256 | |
257 | void qapi_free_CpuInfoSPARC(CpuInfoSPARC *obj); |
258 | |
259 | void qapi_free_CpuInfoPPC(CpuInfoPPC *obj); |
260 | |
261 | void qapi_free_CpuInfoMIPS(CpuInfoMIPS *obj); |
262 | |
263 | void qapi_free_CpuInfoTricore(CpuInfoTricore *obj); |
264 | |
265 | void qapi_free_CpuInfoRISCV(CpuInfoRISCV *obj); |
266 | |
267 | void qapi_free_CpuInfoS390(CpuInfoS390 *obj); |
268 | |
269 | struct CpuInfoList { |
270 | CpuInfoList *next; |
271 | CpuInfo *value; |
272 | }; |
273 | |
274 | void qapi_free_CpuInfoList(CpuInfoList *obj); |
275 | |
276 | struct q_obj_CpuInfoFast_base { |
277 | int64_t cpu_index; |
278 | char *qom_path; |
279 | int64_t thread_id; |
280 | bool has_props; |
281 | CpuInstanceProperties *props; |
282 | CpuInfoArch arch; |
283 | SysEmuTarget target; |
284 | }; |
285 | |
286 | struct CpuInfoFast { |
287 | int64_t cpu_index; |
288 | char *qom_path; |
289 | int64_t thread_id; |
290 | bool has_props; |
291 | CpuInstanceProperties *props; |
292 | CpuInfoArch arch; |
293 | SysEmuTarget target; |
294 | union { /* union tag is @target */ |
295 | CpuInfoS390 s390x; |
296 | } u; |
297 | }; |
298 | |
299 | void qapi_free_CpuInfoFast(CpuInfoFast *obj); |
300 | |
301 | struct CpuInfoFastList { |
302 | CpuInfoFastList *next; |
303 | CpuInfoFast *value; |
304 | }; |
305 | |
306 | void qapi_free_CpuInfoFastList(CpuInfoFastList *obj); |
307 | |
308 | struct q_obj_cpu_add_arg { |
309 | int64_t id; |
310 | }; |
311 | |
312 | struct MachineInfo { |
313 | char *name; |
314 | bool has_alias; |
315 | char *alias; |
316 | bool has_is_default; |
317 | bool is_default; |
318 | int64_t cpu_max; |
319 | bool hotpluggable_cpus; |
320 | bool numa_mem_supported; |
321 | bool deprecated; |
322 | bool has_default_cpu_type; |
323 | char *default_cpu_type; |
324 | }; |
325 | |
326 | void qapi_free_MachineInfo(MachineInfo *obj); |
327 | |
328 | struct MachineInfoList { |
329 | MachineInfoList *next; |
330 | MachineInfo *value; |
331 | }; |
332 | |
333 | void qapi_free_MachineInfoList(MachineInfoList *obj); |
334 | |
335 | struct CurrentMachineParams { |
336 | bool wakeup_suspend_support; |
337 | }; |
338 | |
339 | void qapi_free_CurrentMachineParams(CurrentMachineParams *obj); |
340 | |
341 | struct TargetInfo { |
342 | SysEmuTarget arch; |
343 | }; |
344 | |
345 | void qapi_free_TargetInfo(TargetInfo *obj); |
346 | |
347 | struct q_obj_NumaOptions_base { |
348 | NumaOptionsType type; |
349 | }; |
350 | |
351 | struct NumaNodeOptions { |
352 | bool has_nodeid; |
353 | uint16_t nodeid; |
354 | bool has_cpus; |
355 | uint16List *cpus; |
356 | bool has_mem; |
357 | uint64_t mem; |
358 | bool has_memdev; |
359 | char *memdev; |
360 | }; |
361 | |
362 | struct NumaDistOptions { |
363 | uint16_t src; |
364 | uint16_t dst; |
365 | uint8_t val; |
366 | }; |
367 | |
368 | struct NumaCpuOptions { |
369 | /* Members inherited from CpuInstanceProperties: */ |
370 | bool has_node_id; |
371 | int64_t node_id; |
372 | bool has_socket_id; |
373 | int64_t socket_id; |
374 | bool has_die_id; |
375 | int64_t die_id; |
376 | bool has_core_id; |
377 | int64_t core_id; |
378 | bool has_thread_id; |
379 | int64_t thread_id; |
380 | /* Own members: */ |
381 | }; |
382 | |
383 | struct NumaOptions { |
384 | NumaOptionsType type; |
385 | union { /* union tag is @type */ |
386 | NumaNodeOptions node; |
387 | NumaDistOptions dist; |
388 | NumaCpuOptions cpu; |
389 | } u; |
390 | }; |
391 | |
392 | void qapi_free_NumaOptions(NumaOptions *obj); |
393 | |
394 | void qapi_free_NumaNodeOptions(NumaNodeOptions *obj); |
395 | |
396 | void qapi_free_NumaDistOptions(NumaDistOptions *obj); |
397 | |
398 | struct X86CPUFeatureWordInfo { |
399 | int64_t cpuid_input_eax; |
400 | bool has_cpuid_input_ecx; |
401 | int64_t cpuid_input_ecx; |
402 | X86CPURegister32 cpuid_register; |
403 | int64_t features; |
404 | }; |
405 | |
406 | void qapi_free_X86CPUFeatureWordInfo(X86CPUFeatureWordInfo *obj); |
407 | |
408 | struct X86CPUFeatureWordInfoList { |
409 | X86CPUFeatureWordInfoList *next; |
410 | X86CPUFeatureWordInfo *value; |
411 | }; |
412 | |
413 | void qapi_free_X86CPUFeatureWordInfoList(X86CPUFeatureWordInfoList *obj); |
414 | |
415 | struct DummyForceArrays { |
416 | X86CPUFeatureWordInfoList *unused; |
417 | }; |
418 | |
419 | void qapi_free_DummyForceArrays(DummyForceArrays *obj); |
420 | |
421 | static inline CpuInstanceProperties *qapi_NumaCpuOptions_base(const NumaCpuOptions *obj) |
422 | { |
423 | return (CpuInstanceProperties *)obj; |
424 | } |
425 | |
426 | void qapi_free_NumaCpuOptions(NumaCpuOptions *obj); |
427 | |
428 | struct Memdev { |
429 | bool has_id; |
430 | char *id; |
431 | uint64_t size; |
432 | bool merge; |
433 | bool dump; |
434 | bool prealloc; |
435 | uint16List *host_nodes; |
436 | HostMemPolicy policy; |
437 | }; |
438 | |
439 | void qapi_free_Memdev(Memdev *obj); |
440 | |
441 | struct MemdevList { |
442 | MemdevList *next; |
443 | Memdev *value; |
444 | }; |
445 | |
446 | void qapi_free_MemdevList(MemdevList *obj); |
447 | |
448 | struct CpuInstanceProperties { |
449 | bool has_node_id; |
450 | int64_t node_id; |
451 | bool has_socket_id; |
452 | int64_t socket_id; |
453 | bool has_die_id; |
454 | int64_t die_id; |
455 | bool has_core_id; |
456 | int64_t core_id; |
457 | bool has_thread_id; |
458 | int64_t thread_id; |
459 | }; |
460 | |
461 | void qapi_free_CpuInstanceProperties(CpuInstanceProperties *obj); |
462 | |
463 | struct HotpluggableCPU { |
464 | char *type; |
465 | int64_t vcpus_count; |
466 | CpuInstanceProperties *props; |
467 | bool has_qom_path; |
468 | char *qom_path; |
469 | }; |
470 | |
471 | void qapi_free_HotpluggableCPU(HotpluggableCPU *obj); |
472 | |
473 | struct HotpluggableCPUList { |
474 | HotpluggableCPUList *next; |
475 | HotpluggableCPU *value; |
476 | }; |
477 | |
478 | void qapi_free_HotpluggableCPUList(HotpluggableCPUList *obj); |
479 | |
480 | #endif /* QAPI_TYPES_MACHINE_H */ |
481 | |