mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
cpus: prepare new CpusAccel cpu accelerator interface
The new interface starts unused, will start being used by the next patches. It provides methods for each accelerator to start a vcpu, kick a vcpu, synchronize state, get cpu virtual clock and elapsed ticks. In qemu_wait_io_event, make it clear that APC is used only for HAX on Windows. Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
8191d36841
commit
430065dab0
11 changed files with 225 additions and 123 deletions
|
@ -4,7 +4,43 @@
|
|||
#include "qemu/timer.h"
|
||||
|
||||
/* cpus.c */
|
||||
|
||||
/* CPU execution threads */
|
||||
|
||||
typedef struct CpusAccel {
|
||||
void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY */
|
||||
void (*kick_vcpu_thread)(CPUState *cpu);
|
||||
|
||||
void (*synchronize_post_reset)(CPUState *cpu);
|
||||
void (*synchronize_post_init)(CPUState *cpu);
|
||||
void (*synchronize_state)(CPUState *cpu);
|
||||
void (*synchronize_pre_loadvm)(CPUState *cpu);
|
||||
|
||||
int64_t (*get_virtual_clock)(void);
|
||||
int64_t (*get_elapsed_ticks)(void);
|
||||
} CpusAccel;
|
||||
|
||||
/* register accel-specific cpus interface implementation */
|
||||
void cpus_register_accel(const CpusAccel *i);
|
||||
|
||||
/* interface available for cpus accelerator threads */
|
||||
|
||||
/* For temporary buffers for forming a name */
|
||||
#define VCPU_THREAD_NAME_SIZE 16
|
||||
|
||||
void cpus_kick_thread(CPUState *cpu);
|
||||
bool cpu_work_list_empty(CPUState *cpu);
|
||||
bool cpu_thread_is_idle(CPUState *cpu);
|
||||
bool all_cpu_threads_idle(void);
|
||||
bool cpu_can_run(CPUState *cpu);
|
||||
void qemu_wait_io_event_common(CPUState *cpu);
|
||||
void qemu_wait_io_event(CPUState *cpu);
|
||||
void cpu_thread_signal_created(CPUState *cpu);
|
||||
void cpu_thread_signal_destroyed(CPUState *cpu);
|
||||
void cpu_handle_guest_debug(CPUState *cpu);
|
||||
|
||||
/* end interface for cpus accelerator threads */
|
||||
|
||||
bool qemu_in_vcpu_thread(void);
|
||||
void qemu_init_cpu_loop(void);
|
||||
void resume_all_vcpus(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue