mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
cpu: Add qemu_for_each_cpu()
Wrapper to avoid open-coded loops and to make CPUState iteration independent of CPUArchState. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
997395d388
commit
d6b9e0d60c
2 changed files with 19 additions and 0 deletions
|
@ -215,6 +215,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue