diff mbox

fixup! Pass generic CPUState to gen_intermediate_code()

Message ID 20170626100422.6390-1-alex.bennee@linaro.org
State New
Headers show

Commit Message

Alex Bennée June 26, 2017, 10:04 a.m. UTC
---
 target/hppa/translate.c     | 5 ++---
 target/nios2/translate.c    | 5 ++---
 target/openrisc/translate.c | 3 +--
 3 files changed, 5 insertions(+), 8 deletions(-)

-- 
2.13.0

Comments

Lluís Vilanova June 26, 2017, 12:37 p.m. UTC | #1
Alex Bennée writes:

> ---

>  target/hppa/translate.c     | 5 ++---

>  target/nios2/translate.c    | 5 ++---

>  target/openrisc/translate.c | 3 +--

>  3 files changed, 5 insertions(+), 8 deletions(-)


I rebased the patches and forgot to test the compilation of other
architectures. Sorry about that.

Thanks,
  Lluis



> diff --git a/target/hppa/translate.c b/target/hppa/translate.c

> index e10abc5e04..900870cd5a 100644

> --- a/target/hppa/translate.c

> +++ b/target/hppa/translate.c

> @@ -3740,10 +3740,9 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)

>      return gen_illegal(ctx);

>  }

 
> -void gen_intermediate_code(CPUHPPAState *env, struct TranslationBlock *tb)

> +void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)

>  {

> -    HPPACPU *cpu = hppa_env_get_cpu(env);

> -    CPUState *cs = CPU(cpu);

> +    CPUHPPAState *env = cs->env_ptr;

>      DisasContext ctx;

>      ExitStatus ret;

>      int num_insns, max_insns, i;

> diff --git a/target/nios2/translate.c b/target/nios2/translate.c

> index 2f3c2e5dfb..8b97d6585f 100644

> --- a/target/nios2/translate.c

> +++ b/target/nios2/translate.c

> @@ -799,10 +799,9 @@ static void gen_exception(DisasContext *dc, uint32_t excp)

>  }

 
>  /* generate intermediate code for basic block 'tb'.  */

> -void gen_intermediate_code(CPUNios2State *env, TranslationBlock *tb)

> +void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)

>  {

> -    Nios2CPU *cpu = nios2_env_get_cpu(env);

> -    CPUState *cs = CPU(cpu);

> +    CPUNios2State *env = cs->env_ptr;

>      DisasContext dc1, *dc = &dc1;

>      int num_insns;

>      int max_insns;

> diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c

> index aaac359d5b..4a28c96e53 100644

> --- a/target/openrisc/translate.c

> +++ b/target/openrisc/translate.c

> @@ -1520,9 +1520,8 @@ static void disas_openrisc_insn(DisasContext *dc, OpenRISCCPU *cpu)

 
>  void gen_intermediate_code(CPUState *cpu, struct TranslationBlock *tb)

>  {

> -    OpenRISCState *env = cpu->env_ptr;

> +    CPUOpenRISCState *env = cpu->env_ptr;

>      OpenRISCCPU *or_cpu = openrisc_env_get_cpu(env);

> -    CPUState *cs = CPU(cpu);

>      struct DisasContext ctx, *dc = &ctx;

>      uint32_t pc_start;

>      uint32_t next_page_start;

> -- 

> 2.13.0
diff mbox

Patch

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index e10abc5e04..900870cd5a 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -3740,10 +3740,9 @@  static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
     return gen_illegal(ctx);
 }
 
-void gen_intermediate_code(CPUHPPAState *env, struct TranslationBlock *tb)
+void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
 {
-    HPPACPU *cpu = hppa_env_get_cpu(env);
-    CPUState *cs = CPU(cpu);
+    CPUHPPAState *env = cs->env_ptr;
     DisasContext ctx;
     ExitStatus ret;
     int num_insns, max_insns, i;
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 2f3c2e5dfb..8b97d6585f 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -799,10 +799,9 @@  static void gen_exception(DisasContext *dc, uint32_t excp)
 }
 
 /* generate intermediate code for basic block 'tb'.  */
-void gen_intermediate_code(CPUNios2State *env, TranslationBlock *tb)
+void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
 {
-    Nios2CPU *cpu = nios2_env_get_cpu(env);
-    CPUState *cs = CPU(cpu);
+    CPUNios2State *env = cs->env_ptr;
     DisasContext dc1, *dc = &dc1;
     int num_insns;
     int max_insns;
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index aaac359d5b..4a28c96e53 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -1520,9 +1520,8 @@  static void disas_openrisc_insn(DisasContext *dc, OpenRISCCPU *cpu)
 
 void gen_intermediate_code(CPUState *cpu, struct TranslationBlock *tb)
 {
-    OpenRISCState *env = cpu->env_ptr;
+    CPUOpenRISCState *env = cpu->env_ptr;
     OpenRISCCPU *or_cpu = openrisc_env_get_cpu(env);
-    CPUState *cs = CPU(cpu);
     struct DisasContext ctx, *dc = &ctx;
     uint32_t pc_start;
     uint32_t next_page_start;