Patchwork [qom-cpu,v2,3/7] target-i386: Pass X86CPU to cpu_x86_load_seg_cache_sipi()

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

Comments

Andreas Färber - Oct. 12, 2012, 1:26 a.m.
Simplifies the call in apic_sipi() again and needed for moving halted
field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/apic.c         |    2 +-
 target-i386/cpu.h |    4 +++-
 2 Dateien geändert, 4 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
Igor Mammedov - Oct. 15, 2012, 11:29 p.m.
On Fri, 12 Oct 2012 03:26:39 +0200
Andreas Färber <afaerber@suse.de> wrote:

> Simplifies the call in apic_sipi() again and needed for moving halted
> field to CPUState.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  hw/apic.c         |    2 +-
>  target-i386/cpu.h |    4 +++-
>  2 Dateien geändert, 4 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
> 
> diff --git a/hw/apic.c b/hw/apic.c
> index f1f804d..ccf2819 100644
> --- a/hw/apic.c
> +++ b/hw/apic.c
> @@ -487,7 +487,7 @@ void apic_sipi(DeviceState *d)
>  
>      if (!s->wait_for_sipi)
>          return;
> -    cpu_x86_load_seg_cache_sipi(&s->cpu->env, s->sipi_vector);
> +    cpu_x86_load_seg_cache_sipi(s->cpu, s->sipi_vector);
>      s->wait_for_sipi = 0;
>  }
>  
> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
> index 871c270..e54596f 100644
> --- a/target-i386/cpu.h
> +++ b/target-i386/cpu.h
> @@ -907,9 +907,11 @@ static inline void cpu_x86_load_seg_cache(CPUX86State *env,
>      }
>  }
>  
> -static inline void cpu_x86_load_seg_cache_sipi(CPUX86State *env,
> +static inline void cpu_x86_load_seg_cache_sipi(X86CPU *cpu,
>                                                 int sipi_vector)
>  {
> +    CPUX86State *env = &cpu->env;
> +
>      env->eip = 0;
>      cpu_x86_load_seg_cache(env, R_CS, sipi_vector << 8,
>                             sipi_vector << 12,
> -- 
> 1.7.10.4
> 
> 
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

Patch

diff --git a/hw/apic.c b/hw/apic.c
index f1f804d..ccf2819 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -487,7 +487,7 @@  void apic_sipi(DeviceState *d)
 
     if (!s->wait_for_sipi)
         return;
-    cpu_x86_load_seg_cache_sipi(&s->cpu->env, s->sipi_vector);
+    cpu_x86_load_seg_cache_sipi(s->cpu, s->sipi_vector);
     s->wait_for_sipi = 0;
 }
 
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 871c270..e54596f 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -907,9 +907,11 @@  static inline void cpu_x86_load_seg_cache(CPUX86State *env,
     }
 }
 
-static inline void cpu_x86_load_seg_cache_sipi(CPUX86State *env,
+static inline void cpu_x86_load_seg_cache_sipi(X86CPU *cpu,
                                                int sipi_vector)
 {
+    CPUX86State *env = &cpu->env;
+
     env->eip = 0;
     cpu_x86_load_seg_cache(env, R_CS, sipi_vector << 8,
                            sipi_vector << 12,