From d6b9e0d60cc511eca210834428bb74508cff3d33 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 24 Apr 2013 22:58:04 +0200 Subject: cpu: Add qemu_for_each_cpu() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrapper to avoid open-coded loops and to make CPUState iteration independent of CPUArchState. Signed-off-by: Michael S. Tsirkin Signed-off-by: Igor Mammedov Signed-off-by: Andreas Färber --- include/qom/cpu.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/qom/cpu.h') diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 1b4de17..a28e5ff 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -216,6 +216,15 @@ bool cpu_is_stopped(CPUState *cpu); void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); /** + * qemu_for_each_cpu: + * @func: The function to be executed. + * @data: Data to pass to the function. + * + * Executes @func for each CPU. + */ +void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data); + +/** * qemu_get_cpu: * @index: The CPUState@cpu_index value of the CPU to obtain. * -- cgit v1.1