mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
cpus-common: move CPU list management to common code
Add a mutex for the CPU list to system emulation, as it will be used to manage safe work. Abstract manipulation of the CPU list in new functions cpu_list_add and cpu_list_remove. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -23,6 +23,11 @@ typedef struct CPUListState {
|
||||
FILE *file;
|
||||
} CPUListState;
|
||||
|
||||
/* The CPU list lock nests outside tb_lock/tb_unlock. */
|
||||
void qemu_init_cpu_list(void);
|
||||
void cpu_list_lock(void);
|
||||
void cpu_list_unlock(void);
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
|
||||
enum device_endian {
|
||||
|
||||
@@ -56,17 +56,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||
target_ulong pc, target_ulong cs_base,
|
||||
uint32_t flags,
|
||||
int cflags);
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
void cpu_list_lock(void);
|
||||
void cpu_list_unlock(void);
|
||||
#else
|
||||
static inline void cpu_list_unlock(void)
|
||||
{
|
||||
}
|
||||
static inline void cpu_list_lock(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void cpu_exec_init(CPUState *cpu, Error **errp);
|
||||
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
|
||||
|
||||
Reference in New Issue
Block a user