]> git.proxmox.com Git - mirror_qemu.git/blame - include/sysemu/accel-ops.h
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into...
[mirror_qemu.git] / include / sysemu / accel-ops.h
CommitLineData
b86f59c7
CF
1/*
2 * Accelerator OPS, used for cpus.c module
3 *
4 * Copyright 2021 SUSE LLC
5 *
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.
8 */
9
10#ifndef ACCEL_OPS_H
11#define ACCEL_OPS_H
12
55b5b8e9 13#include "exec/cpu-common.h"
b86f59c7
CF
14#include "qom/object.h"
15
16#define ACCEL_OPS_SUFFIX "-ops"
17#define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX
18#define ACCEL_OPS_NAME(name) (name "-" TYPE_ACCEL_OPS)
19
20typedef struct AccelOpsClass AccelOpsClass;
21DECLARE_CLASS_CHECKERS(AccelOpsClass, ACCEL_OPS, TYPE_ACCEL_OPS)
22
23/* cpus.c operations interface */
24struct AccelOpsClass {
25 /*< private >*/
26 ObjectClass parent_class;
27 /*< public >*/
28
29 /* initialization function called when accel is chosen */
30 void (*ops_init)(AccelOpsClass *ops);
31
39196355
PMD
32 bool (*cpus_are_resettable)(void);
33
b86f59c7
CF
34 void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */
35 void (*kick_vcpu_thread)(CPUState *cpu);
ad7d684d 36 bool (*cpu_thread_is_idle)(CPUState *cpu);
b86f59c7
CF
37
38 void (*synchronize_post_reset)(CPUState *cpu);
39 void (*synchronize_post_init)(CPUState *cpu);
40 void (*synchronize_state)(CPUState *cpu);
41 void (*synchronize_pre_loadvm)(CPUState *cpu);
d7482ffe 42 void (*synchronize_pre_resume)(bool step_pending);
b86f59c7
CF
43
44 void (*handle_interrupt)(CPUState *cpu, int mask);
45
46 int64_t (*get_virtual_clock)(void);
47 int64_t (*get_elapsed_ticks)(void);
ae7467b1
AB
48
49 /* gdbstub hooks */
a48e7d9e 50 bool (*supports_guest_debug)(void);
412ae126 51 int (*update_guest_debug)(CPUState *cpu);
55b5b8e9
PMD
52 int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
53 int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
ae7467b1 54 void (*remove_all_breakpoints)(CPUState *cpu);
b86f59c7
CF
55};
56
57#endif /* ACCEL_OPS_H */