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:
Paolo Bonzini 2016-08-28 03:45:14 +02:00
parent 178f94297a
commit 267f685b8b
9 changed files with 109 additions and 68 deletions

View file

@ -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 {