4 #include "qemu/timer.h"
8 /* CPU execution threads */
10 typedef struct CpusAccel
{
11 void (*create_vcpu_thread
)(CPUState
*cpu
); /* MANDATORY */
12 void (*kick_vcpu_thread
)(CPUState
*cpu
);
14 void (*synchronize_post_reset
)(CPUState
*cpu
);
15 void (*synchronize_post_init
)(CPUState
*cpu
);
16 void (*synchronize_state
)(CPUState
*cpu
);
17 void (*synchronize_pre_loadvm
)(CPUState
*cpu
);
19 void (*handle_interrupt
)(CPUState
*cpu
, int mask
);
21 int64_t (*get_virtual_clock
)(void);
22 int64_t (*get_elapsed_ticks
)(void);
25 /* register accel-specific cpus interface implementation */
26 void cpus_register_accel(const CpusAccel
*i
);
28 /* Create a dummy vcpu for CpusAccel->create_vcpu_thread */
29 void dummy_start_vcpu_thread(CPUState
*);
31 /* interface available for cpus accelerator threads */
33 /* For temporary buffers for forming a name */
34 #define VCPU_THREAD_NAME_SIZE 16
36 void cpus_kick_thread(CPUState
*cpu
);
37 bool cpu_work_list_empty(CPUState
*cpu
);
38 bool cpu_thread_is_idle(CPUState
*cpu
);
39 bool all_cpu_threads_idle(void);
40 bool cpu_can_run(CPUState
*cpu
);
41 void qemu_wait_io_event_common(CPUState
*cpu
);
42 void qemu_wait_io_event(CPUState
*cpu
);
43 void cpu_thread_signal_created(CPUState
*cpu
);
44 void cpu_thread_signal_destroyed(CPUState
*cpu
);
45 void cpu_handle_guest_debug(CPUState
*cpu
);
47 /* end interface for cpus accelerator threads */
49 bool qemu_in_vcpu_thread(void);
50 void qemu_init_cpu_loop(void);
51 void resume_all_vcpus(void);
52 void pause_all_vcpus(void);
53 void cpu_stop_current(void);
55 extern int icount_align_option
;
58 void qemu_cpu_kick_self(void);
60 void cpu_synchronize_all_states(void);
61 void cpu_synchronize_all_post_reset(void);
62 void cpu_synchronize_all_post_init(void);
63 void cpu_synchronize_all_pre_loadvm(void);
65 #ifndef CONFIG_USER_ONLY
67 /* *-user doesn't have configurable SMP topology */
69 extern int smp_threads
;
72 void list_cpus(const char *optarg
);