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