Patchwork [qom-cpu,v2,5/7] cpus: Pass CPUState to qemu_cpu_kick_thread()

login
register
mail settings
Submitter Andreas Färber
Date Oct. 12, 2012, 1:26 a.m.
Message ID <1350005203-15405-6-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/191038/
State New
Headers show

Comments

Andreas Färber - Oct. 12, 2012, 1:26 a.m.
CPUArchState is no longer needed there.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c |    9 ++++-----
 1 Datei geändert, 4 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)
Igor Mammedov - Oct. 16, 2012, 12:53 a.m.
On Fri, 12 Oct 2012 03:26:41 +0200
Andreas Färber <afaerber@suse.de> wrote:

> CPUArchState is no longer needed there.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  cpus.c |    9 ++++-----
>  1 Datei geändert, 4 Zeilen hinzugefügt(+), 5 Zeilen entfernt(-)
> 
> diff --git a/cpus.c b/cpus.c
> index 849ea8a..54b765e 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -844,9 +844,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
>      return NULL;
>  }
>  
> -static void qemu_cpu_kick_thread(CPUArchState *env)
> +static void qemu_cpu_kick_thread(CPUState *cpu)
>  {
> -    CPUState *cpu = ENV_GET_CPU(env);
>  #ifndef _WIN32
>      int err;
>  
> @@ -871,7 +870,7 @@ void qemu_cpu_kick(void *_env)
>  
>      qemu_cond_broadcast(env->halt_cond);
>      if (!tcg_enabled() && !cpu->thread_kicked) {
> -        qemu_cpu_kick_thread(env);
> +        qemu_cpu_kick_thread(cpu);
>          cpu->thread_kicked = true;
>      }
>  }
> @@ -883,7 +882,7 @@ void qemu_cpu_kick_self(void)
>      CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
>  
>      if (!cpu_single_cpu->thread_kicked) {
> -        qemu_cpu_kick_thread(cpu_single_env);
> +        qemu_cpu_kick_thread(cpu_single_cpu);
>          cpu_single_cpu->thread_kicked = true;
>      }
>  #else
> @@ -903,7 +902,7 @@ void qemu_mutex_lock_iothread(void)
>      } else {
>          iothread_requesting_mutex = true;
>          if (qemu_mutex_trylock(&qemu_global_mutex)) {
> -            qemu_cpu_kick_thread(first_cpu);
> +            qemu_cpu_kick_thread(ENV_GET_CPU(first_cpu));
>              qemu_mutex_lock(&qemu_global_mutex);
>          }
>          iothread_requesting_mutex = false;
> -- 
> 1.7.10.4
> 
> 
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

Patch

diff --git a/cpus.c b/cpus.c
index 849ea8a..54b765e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -844,9 +844,8 @@  static void *qemu_tcg_cpu_thread_fn(void *arg)
     return NULL;
 }
 
-static void qemu_cpu_kick_thread(CPUArchState *env)
+static void qemu_cpu_kick_thread(CPUState *cpu)
 {
-    CPUState *cpu = ENV_GET_CPU(env);
 #ifndef _WIN32
     int err;
 
@@ -871,7 +870,7 @@  void qemu_cpu_kick(void *_env)
 
     qemu_cond_broadcast(env->halt_cond);
     if (!tcg_enabled() && !cpu->thread_kicked) {
-        qemu_cpu_kick_thread(env);
+        qemu_cpu_kick_thread(cpu);
         cpu->thread_kicked = true;
     }
 }
@@ -883,7 +882,7 @@  void qemu_cpu_kick_self(void)
     CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
 
     if (!cpu_single_cpu->thread_kicked) {
-        qemu_cpu_kick_thread(cpu_single_env);
+        qemu_cpu_kick_thread(cpu_single_cpu);
         cpu_single_cpu->thread_kicked = true;
     }
 #else
@@ -903,7 +902,7 @@  void qemu_mutex_lock_iothread(void)
     } else {
         iothread_requesting_mutex = true;
         if (qemu_mutex_trylock(&qemu_global_mutex)) {
-            qemu_cpu_kick_thread(first_cpu);
+            qemu_cpu_kick_thread(ENV_GET_CPU(first_cpu));
             qemu_mutex_lock(&qemu_global_mutex);
         }
         iothread_requesting_mutex = false;