Browse Source
Only accelerator implementations (and the common accelator code) need to know about AccelClass internals. Move the definition out but forward declare AccelState and AccelClass. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250703173248.44995-39-philmd@linaro.org>pull/294/head
19 changed files with 71 additions and 39 deletions
@ -0,0 +1,49 @@ |
|||
/*
|
|||
* Accelerator handlers |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#ifndef ACCEL_OPS_H |
|||
#define ACCEL_OPS_H |
|||
|
|||
#include "exec/hwaddr.h" |
|||
#include "qemu/accel.h" |
|||
#include "qom/object.h" |
|||
|
|||
struct AccelState { |
|||
Object parent_obj; |
|||
}; |
|||
|
|||
struct AccelClass { |
|||
ObjectClass parent_class; |
|||
|
|||
const char *name; |
|||
/* Cached by accel_init_ops_interfaces() when created */ |
|||
AccelOpsClass *ops; |
|||
|
|||
int (*init_machine)(AccelState *as, MachineState *ms); |
|||
bool (*cpu_common_realize)(CPUState *cpu, Error **errp); |
|||
void (*cpu_common_unrealize)(CPUState *cpu); |
|||
|
|||
/* system related hooks */ |
|||
void (*setup_post)(AccelState *as); |
|||
void (*pre_resume_vm)(AccelState *as, bool step_pending); |
|||
bool (*has_memory)(AccelState *accel, AddressSpace *as, |
|||
hwaddr start_addr, hwaddr size); |
|||
|
|||
/* gdbstub related hooks */ |
|||
int (*gdbstub_supported_sstep_flags)(AccelState *as); |
|||
|
|||
bool *allowed; |
|||
/*
|
|||
* Array of global properties that would be applied when specific |
|||
* accelerator is chosen. It works like MachineClass.compat_props |
|||
* but it's for accelerators not machines. Accelerator-provided |
|||
* global properties may be overridden by machine-type |
|||
* compat_props or user-provided global properties. |
|||
*/ |
|||
GPtrArray *compat_props; |
|||
}; |
|||
|
|||
#endif /* ACCEL_OPS_H */ |
|||
Loading…
Reference in new issue