CPUState structure is not modified, make it const. Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> --- include/hw/core/cpu.h | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- system/cpus.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index fb397cdfc53..782c43ac8b3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -838,7 +838,7 @@ static inline bool cpu_has_work(CPUState *cpu) * * Returns: %true if called from @cpu's thread, %false otherwise. */ -bool qemu_cpu_is_self(CPUState *cpu); +bool qemu_cpu_is_self(const CPUState *cpu); /** * qemu_cpu_kick: diff --git a/bsd-user/main.c b/bsd-user/main.c index b2f6a9be2f2..6dc4512cebf 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -205,7 +205,7 @@ void stop_all_tasks(void) start_exclusive(); } -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return thread_cpu == cpu; } diff --git a/linux-user/main.c b/linux-user/main.c index 7198fa0986b..104704ace96 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -181,7 +181,7 @@ void fork_end(pid_t pid) __thread CPUState *thread_cpu; -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return thread_cpu == cpu; } diff --git a/system/cpus.c b/system/cpus.c index 37e5892c240..e4910d670cf 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -502,7 +502,7 @@ void qemu_cpu_kick_self(void) cpus_kick_thread(current_cpu); } -bool qemu_cpu_is_self(CPUState *cpu) +bool qemu_cpu_is_self(const CPUState *cpu) { return qemu_thread_is_self(cpu->thread); } -- 2.47.1