| 1 | /* |
| 2 | * Accelerator handlers |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef ACCEL_OPS_H |
| 8 | #define ACCEL_OPS_H |
| 9 | |
| 10 | #include "exec/hwaddr.h" |
| 11 | #include "qemu/accel.h" |
| 12 | #include "qom/object.h" |
| 13 | |
| 14 | struct AccelState { |
| 15 | Object parent_obj; |
| 16 | |
| 17 | AccelGdbConfig gdbstub; |
| 18 | }; |
| 19 | |
| 20 | struct AccelClass { |
| 21 | ObjectClass parent_class; |
| 22 | |
| 23 | const char *name; |
| 24 | /* Cached by accel_init_ops_interfaces() when created */ |
| 25 | AccelOpsClass *ops; |
| 26 | |
| 27 | int (*init_machine)(AccelState *as, MachineState *ms); |
| 28 | /* used mainly by confidential guests to rebuild guest state upon reset */ |
| 29 | int (*rebuild_guest)(MachineState *ms); |
| 30 | bool (*cpu_common_realize)(CPUState *cpu, Error **errp); |
| 31 | void (*cpu_common_unrealize)(CPUState *cpu); |
| 32 | /* get_stats: Append statistics to @buf */ |
| 33 | void (*get_stats)(AccelState *as, GString *buf); |
| 34 | |
| 35 | /* system related hooks */ |
| 36 | void (*setup_post)(AccelState *as); |
| 37 | void (*pre_resume_vm)(AccelState *as, bool step_pending); |
| 38 | bool (*has_memory)(AccelState *accel, AddressSpace *as, |
| 39 | hwaddr start_addr, hwaddr size); |
| 40 | |
| 41 | bool *allowed; |
| 42 | /* |
| 43 | * Array of global properties that would be applied when specific |
| 44 | * accelerator is chosen. It works like MachineClass.compat_props |
| 45 | * but it's for accelerators not machines. Accelerator-provided |
| 46 | * global properties may be overridden by machine-type |
| 47 | * compat_props or user-provided global properties. |
| 48 | */ |
| 49 | GPtrArray *compat_props; |
| 50 | }; |
| 51 | |
| 52 | #endif /* ACCEL_OPS_H */ |