xref: /openbmc/qemu/include/sysemu/cpus.h (revision 2b74dd91)
1 #ifndef QEMU_CPUS_H
2 #define QEMU_CPUS_H
3 
4 #include "sysemu/accel-ops.h"
5 
6 /* register accel-specific operations */
7 void cpus_register_accel(const AccelOpsClass *i);
8 
9 /* return registers ops */
10 const AccelOpsClass *cpus_get_accel(void);
11 
12 /* accel/dummy-cpus.c */
13 
14 /* Create a dummy vcpu for AccelOpsClass->create_vcpu_thread */
15 void dummy_start_vcpu_thread(CPUState *);
16 
17 /* interface available for cpus accelerator threads */
18 
19 /* For temporary buffers for forming a name */
20 #define VCPU_THREAD_NAME_SIZE 16
21 
22 void cpus_kick_thread(CPUState *cpu);
23 bool cpu_work_list_empty(CPUState *cpu);
24 bool cpu_thread_is_idle(CPUState *cpu);
25 bool all_cpu_threads_idle(void);
26 bool cpu_can_run(CPUState *cpu);
27 void qemu_wait_io_event_common(CPUState *cpu);
28 void qemu_wait_io_event(CPUState *cpu);
29 void cpu_thread_signal_created(CPUState *cpu);
30 void cpu_thread_signal_destroyed(CPUState *cpu);
31 void cpu_handle_guest_debug(CPUState *cpu);
32 
33 /* end interface for cpus accelerator threads */
34 
35 bool qemu_in_vcpu_thread(void);
36 void qemu_init_cpu_loop(void);
37 void resume_all_vcpus(void);
38 void pause_all_vcpus(void);
39 void cpu_stop_current(void);
40 
41 extern int icount_align_option;
42 
43 /* Unblock cpu */
44 void qemu_cpu_kick_self(void);
45 
46 bool cpus_are_resettable(void);
47 
48 void cpu_synchronize_all_states(void);
49 void cpu_synchronize_all_post_reset(void);
50 void cpu_synchronize_all_post_init(void);
51 void cpu_synchronize_all_pre_loadvm(void);
52 
53 #endif
54