diff --git a/qemu/cpus.c b/qemu/cpus.c index aeb543cd..e1c924bd 100644 --- a/qemu/cpus.c +++ b/qemu/cpus.c @@ -58,9 +58,9 @@ bool cpu_is_stopped(CPUState *cpu) return cpu->stopped; } -void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data) +void run_on_cpu(CPUState *cpu, run_on_cpu_func func, void *data) { - func(data); + func(cpu, data); } int resume_all_vcpus(struct uc_struct *uc) diff --git a/qemu/include/qom/cpu.h b/qemu/include/qom/cpu.h index a099b8fd..124409e0 100644 --- a/qemu/include/qom/cpu.h +++ b/qemu/include/qom/cpu.h @@ -189,6 +189,8 @@ struct kvm_run; #define TB_JMP_CACHE_BITS 12 #define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS) +typedef void (*run_on_cpu_func)(CPUState *cpu, void *data); + // Unicorn: Moved CPUAddressSpace here from exec.c /** * CPUAddressSpace: all the information a CPU needs about an AddressSpace @@ -545,7 +547,7 @@ bool cpu_is_stopped(CPUState *cpu); * * Schedules the function @func for execution on the vCPU @cpu. */ -void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); +void run_on_cpu(CPUState *cpu, run_on_cpu_func func, void *data); /** * async_run_on_cpu: @@ -555,7 +557,7 @@ void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); * * Schedules the function @func for execution on the vCPU @cpu asynchronously. */ -void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); +void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, void *data); /** * qemu_get_cpu: diff --git a/qemu/target-i386/helper.c b/qemu/target-i386/helper.c index 36238d2a..6837c94f 100644 --- a/qemu/target-i386/helper.c +++ b/qemu/target-i386/helper.c @@ -932,7 +932,6 @@ out: } typedef struct MCEInjectionParams { - X86CPU *cpu; int bank; uint64_t status; uint64_t mcg_status;