Re: [Qemu-devel] [PATCH v5 26/73] sparc: convert to cpu_halted

2018-12-17 Thread Mark Cave-Ayland
On 13/12/2018 05:04, Emilio G. Cota wrote:

> Cc: Fabien Chouteau 
> Cc: Mark Cave-Ayland 
> Cc: Artyom Tarasenko 
> Reviewed-by: Richard Henderson 
> Reviewed-by: Alex Bennée 
> Signed-off-by: Emilio G. Cota 
> ---
>  hw/sparc/leon3.c  | 2 +-
>  hw/sparc/sun4m.c  | 8 
>  hw/sparc64/sparc64.c  | 4 ++--
>  target/sparc/helper.c | 2 +-
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index fa98ab8177..0746001f91 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -61,7 +61,7 @@ static void main_cpu_reset(void *opaque)
>  
>  cpu_reset(cpu);
>  
> -cpu->halted = 0;
> +cpu_halted_set(cpu, 0);
>  env->pc = s->entry;
>  env->npc= s->entry + 4;
>  env->regbase[6] = s->sp;
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 3c29b68e67..5bd6512b2b 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -168,7 +168,7 @@ static void cpu_kick_irq(SPARCCPU *cpu)
>  CPUSPARCState *env = >env;
>  CPUState *cs = CPU(cpu);
>  
> -cs->halted = 0;
> +cpu_halted_set(cs, 0);
>  cpu_check_irqs(env);
>  qemu_cpu_kick(cs);
>  }
> @@ -199,7 +199,7 @@ static void main_cpu_reset(void *opaque)
>  CPUState *cs = CPU(cpu);
>  
>  cpu_reset(cs);
> -cs->halted = 0;
> +cpu_halted_set(cs, 0);
>  }
>  
>  static void secondary_cpu_reset(void *opaque)
> @@ -208,7 +208,7 @@ static void secondary_cpu_reset(void *opaque)
>  CPUState *cs = CPU(cpu);
>  
>  cpu_reset(cs);
> -cs->halted = 1;
> +cpu_halted_set(cs, 1);
>  }
>  
>  static void cpu_halt_signal(void *opaque, int irq, int level)
> @@ -825,7 +825,7 @@ static void cpu_devinit(const char *cpu_type, unsigned 
> int id,
>  } else {
>  qemu_register_reset(secondary_cpu_reset, cpu);
>  cs = CPU(cpu);
> -cs->halted = 1;
> +cpu_halted_set(cs, 1);
>  }
>  *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS);
>  env->prom_addr = prom_addr;
> diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
> index 408388945e..372bbd4f5b 100644
> --- a/hw/sparc64/sparc64.c
> +++ b/hw/sparc64/sparc64.c
> @@ -100,7 +100,7 @@ static void cpu_kick_irq(SPARCCPU *cpu)
>  CPUState *cs = CPU(cpu);
>  CPUSPARCState *env = >env;
>  
> -cs->halted = 0;
> +cpu_halted_set(cs, 0);
>  cpu_check_irqs(env);
>  qemu_cpu_kick(cs);
>  }
> @@ -115,7 +115,7 @@ void sparc64_cpu_set_ivec_irq(void *opaque, int irq, int 
> level)
>  if (!(env->ivec_status & 0x20)) {
>  trace_sparc64_cpu_ivec_raise_irq(irq);
>  cs = CPU(cpu);
> -cs->halted = 0;
> +cpu_halted_set(cs, 0);
>  env->interrupt_index = TT_IVEC;
>  env->ivec_status |= 0x20;
>  env->ivec_data[0] = (0x1f << 6) | irq;
> diff --git a/target/sparc/helper.c b/target/sparc/helper.c
> index 46232788c8..dd00cf7cac 100644
> --- a/target/sparc/helper.c
> +++ b/target/sparc/helper.c
> @@ -245,7 +245,7 @@ void helper_power_down(CPUSPARCState *env)
>  {
>  CPUState *cs = CPU(sparc_env_get_cpu(env));
>  
> -cs->halted = 1;
> +cpu_halted_set(cs, 1);
>  cs->exception_index = EXCP_HLT;
>  env->pc = env->npc;
>  env->npc = env->pc + 4;

Reviewed-by: Mark Cave-Ayland 


ATB,

Mark.



[Qemu-devel] [PATCH v5 26/73] sparc: convert to cpu_halted

2018-12-12 Thread Emilio G. Cota
Cc: Fabien Chouteau 
Cc: Mark Cave-Ayland 
Cc: Artyom Tarasenko 
Reviewed-by: Richard Henderson 
Reviewed-by: Alex Bennée 
Signed-off-by: Emilio G. Cota 
---
 hw/sparc/leon3.c  | 2 +-
 hw/sparc/sun4m.c  | 8 
 hw/sparc64/sparc64.c  | 4 ++--
 target/sparc/helper.c | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index fa98ab8177..0746001f91 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -61,7 +61,7 @@ static void main_cpu_reset(void *opaque)
 
 cpu_reset(cpu);
 
-cpu->halted = 0;
+cpu_halted_set(cpu, 0);
 env->pc = s->entry;
 env->npc= s->entry + 4;
 env->regbase[6] = s->sp;
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 3c29b68e67..5bd6512b2b 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -168,7 +168,7 @@ static void cpu_kick_irq(SPARCCPU *cpu)
 CPUSPARCState *env = >env;
 CPUState *cs = CPU(cpu);
 
-cs->halted = 0;
+cpu_halted_set(cs, 0);
 cpu_check_irqs(env);
 qemu_cpu_kick(cs);
 }
@@ -199,7 +199,7 @@ static void main_cpu_reset(void *opaque)
 CPUState *cs = CPU(cpu);
 
 cpu_reset(cs);
-cs->halted = 0;
+cpu_halted_set(cs, 0);
 }
 
 static void secondary_cpu_reset(void *opaque)
@@ -208,7 +208,7 @@ static void secondary_cpu_reset(void *opaque)
 CPUState *cs = CPU(cpu);
 
 cpu_reset(cs);
-cs->halted = 1;
+cpu_halted_set(cs, 1);
 }
 
 static void cpu_halt_signal(void *opaque, int irq, int level)
@@ -825,7 +825,7 @@ static void cpu_devinit(const char *cpu_type, unsigned int 
id,
 } else {
 qemu_register_reset(secondary_cpu_reset, cpu);
 cs = CPU(cpu);
-cs->halted = 1;
+cpu_halted_set(cs, 1);
 }
 *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS);
 env->prom_addr = prom_addr;
diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
index 408388945e..372bbd4f5b 100644
--- a/hw/sparc64/sparc64.c
+++ b/hw/sparc64/sparc64.c
@@ -100,7 +100,7 @@ static void cpu_kick_irq(SPARCCPU *cpu)
 CPUState *cs = CPU(cpu);
 CPUSPARCState *env = >env;
 
-cs->halted = 0;
+cpu_halted_set(cs, 0);
 cpu_check_irqs(env);
 qemu_cpu_kick(cs);
 }
@@ -115,7 +115,7 @@ void sparc64_cpu_set_ivec_irq(void *opaque, int irq, int 
level)
 if (!(env->ivec_status & 0x20)) {
 trace_sparc64_cpu_ivec_raise_irq(irq);
 cs = CPU(cpu);
-cs->halted = 0;
+cpu_halted_set(cs, 0);
 env->interrupt_index = TT_IVEC;
 env->ivec_status |= 0x20;
 env->ivec_data[0] = (0x1f << 6) | irq;
diff --git a/target/sparc/helper.c b/target/sparc/helper.c
index 46232788c8..dd00cf7cac 100644
--- a/target/sparc/helper.c
+++ b/target/sparc/helper.c
@@ -245,7 +245,7 @@ void helper_power_down(CPUSPARCState *env)
 {
 CPUState *cs = CPU(sparc_env_get_cpu(env));
 
-cs->halted = 1;
+cpu_halted_set(cs, 1);
 cs->exception_index = EXCP_HLT;
 env->pc = env->npc;
 env->npc = env->pc + 4;
-- 
2.17.1