diff mbox

[qom-cpu,03/59] cpus: Simplify cpu_synchronize_all_post_reset()

Message ID 1370805206-26574-4-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber June 9, 2013, 7:12 p.m. UTC
Use new qemu_for_each_cpu().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

liguang June 10, 2013, 2:04 a.m. UTC | #1
在 2013-06-09日的 21:12 +0200,Andreas Färber写道:
> Use new qemu_for_each_cpu().
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>

Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>

> ---
>  cpus.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/cpus.c b/cpus.c
> index 8ff66c3..1186ad3 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -415,13 +415,14 @@ void cpu_synchronize_all_states(void)
>      qemu_for_each_cpu(cpu_synchronize_one_state, NULL);
>  }
>  
> -void cpu_synchronize_all_post_reset(void)
> +static void cpu_synchronize_one_post_reset(CPUState *cpu, void *data)
>  {
> -    CPUArchState *cpu;
> +    cpu_synchronize_post_reset(cpu);
> +}
>  
> -    for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) {
> -        cpu_synchronize_post_reset(ENV_GET_CPU(cpu));
> -    }
> +void cpu_synchronize_all_post_reset(void)
> +{
> +    qemu_for_each_cpu(cpu_synchronize_one_post_reset, NULL);
>  }
>  
>  void cpu_synchronize_all_post_init(void)
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 8ff66c3..1186ad3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -415,13 +415,14 @@  void cpu_synchronize_all_states(void)
     qemu_for_each_cpu(cpu_synchronize_one_state, NULL);
 }
 
-void cpu_synchronize_all_post_reset(void)
+static void cpu_synchronize_one_post_reset(CPUState *cpu, void *data)
 {
-    CPUArchState *cpu;
+    cpu_synchronize_post_reset(cpu);
+}
 
-    for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) {
-        cpu_synchronize_post_reset(ENV_GET_CPU(cpu));
-    }
+void cpu_synchronize_all_post_reset(void)
+{
+    qemu_for_each_cpu(cpu_synchronize_one_post_reset, NULL);
 }
 
 void cpu_synchronize_all_post_init(void)