2 * Accelerator OPS, used for cpus.c module
4 * Copyright 2021 SUSE LLC
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
13 #include "qom/object.h"
15 #define ACCEL_OPS_SUFFIX "-ops"
16 #define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX
17 #define ACCEL_OPS_NAME(name) (name "-" TYPE_ACCEL_OPS)
19 typedef struct AccelOpsClass AccelOpsClass
;
20 DECLARE_CLASS_CHECKERS(AccelOpsClass
, ACCEL_OPS
, TYPE_ACCEL_OPS
)
22 /* cpus.c operations interface */
23 struct AccelOpsClass
{
25 ObjectClass parent_class
;
28 /* initialization function called when accel is chosen */
29 void (*ops_init
)(AccelOpsClass
*ops
);
31 void (*create_vcpu_thread
)(CPUState
*cpu
); /* MANDATORY NON-NULL */
32 void (*kick_vcpu_thread
)(CPUState
*cpu
);
34 void (*synchronize_post_reset
)(CPUState
*cpu
);
35 void (*synchronize_post_init
)(CPUState
*cpu
);
36 void (*synchronize_state
)(CPUState
*cpu
);
37 void (*synchronize_pre_loadvm
)(CPUState
*cpu
);
39 void (*handle_interrupt
)(CPUState
*cpu
, int mask
);
41 int64_t (*get_virtual_clock
)(void);
42 int64_t (*get_elapsed_ticks
)(void);
45 #endif /* ACCEL_OPS_H */