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 18 struct AccelClass { 19 ObjectClass parent_class; 20 21 const char *name; 22 /* Cached by accel_init_ops_interfaces() when created */ 23 AccelOpsClass *ops; 24 25 int (*init_machine)(AccelState *as, MachineState *ms); 26 bool (*cpu_common_realize)(CPUState *cpu, Error **errp); 27 void (*cpu_common_unrealize)(CPUState *cpu); 28 29 /* system related hooks */ 30 void (*setup_post)(AccelState *as); 31 void (*pre_resume_vm)(AccelState *as, bool step_pending); 32 bool (*has_memory)(AccelState *accel, AddressSpace *as, 33 hwaddr start_addr, hwaddr size); 34 35 /* gdbstub related hooks */ 36 int (*gdbstub_supported_sstep_flags)(AccelState *as); 37 38 bool *allowed; 39 /* 40 * Array of global properties that would be applied when specific 41 * accelerator is chosen. It works like MachineClass.compat_props 42 * but it's for accelerators not machines. Accelerator-provided 43 * global properties may be overridden by machine-type 44 * compat_props or user-provided global properties. 45 */ 46 GPtrArray *compat_props; 47 }; 48 49 #endif /* ACCEL_OPS_H */ 50