xref: /qemu/include/accel/accel-cpu-target.h (revision 897c68fb795cf03b89b6688a6f945d68a765c3e4)
1 /*
2  * Accelerator interface, specializes CPUClass
3  * This header is used only by target-specific code.
4  *
5  * Copyright 2021 SUSE LLC
6  *
7  * This work is licensed under the terms of the GNU GPL, version 2 or later.
8  * See the COPYING file in the top-level directory.
9  */
10 
11 #ifndef ACCEL_CPU_TARGET_H
12 #define ACCEL_CPU_TARGET_H
13 
14 /*
15  * This header is used to define new accelerator-specific target-specific
16  * accelerator cpu subclasses.
17  * It uses CPU_RESOLVING_TYPE, so this is clearly target-specific.
18  *
19  * Do not try to use for any other purpose than the implementation of new
20  * subclasses in target/, or the accel implementation itself in accel/
21  */
22 
23 #include "qom/object.h"
24 #include "cpu.h"
25 
26 #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE
27 #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU)
28 typedef struct AccelCPUClass AccelCPUClass;
29 DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU)
30 
31 typedef struct AccelCPUClass {
32     /*< private >*/
33     ObjectClass parent_class;
34     /*< public >*/
35 
36     void (*cpu_class_init)(CPUClass *cc);
37     void (*cpu_instance_init)(CPUState *cpu);
38     bool (*cpu_target_realize)(CPUState *cpu, Error **errp);
39 } AccelCPUClass;
40 
41 #endif /* ACCEL_CPU_H */
42