qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Emilio G. Cota" <cota@braap.org>, qemu-devel@nongnu.org
Cc: Stafford Horne <shorne@gmail.com>, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/2] target/openrisc: convert to DisasContextBase
Date: Wed, 21 Feb 2018 10:22:55 -0800	[thread overview]
Message-ID: <0a5ab077-e033-2a89-a3a2-43d2dcaeed8e@linaro.org> (raw)
In-Reply-To: <1518917557-12063-2-git-send-email-cota@braap.org>

On 02/17/2018 05:32 PM, Emilio G. Cota wrote:
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  target/openrisc/translate.c | 87 ++++++++++++++++++++++-----------------------
>  1 file changed, 43 insertions(+), 44 deletions(-)
> 
> diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
> index 2747b24..0450144 100644
> --- a/target/openrisc/translate.c
> +++ b/target/openrisc/translate.c
> @@ -36,7 +36,8 @@
>  #include "exec/log.h"
>  
>  #define LOG_DIS(str, ...) \
> -    qemu_log_mask(CPU_LOG_TB_IN_ASM, "%08x: " str, dc->pc, ## __VA_ARGS__)
> +    qemu_log_mask(CPU_LOG_TB_IN_ASM, "%08x: " str, dc->base.pc_next,    \
> +                  ## __VA_ARGS__)
>  
>  /* is_jmp field values */
>  #define DISAS_JUMP    DISAS_TARGET_0 /* only pc was modified dynamically */
> @@ -44,13 +45,10 @@
>  #define DISAS_TB_JUMP DISAS_TARGET_2 /* only pc was modified statically */
>  
>  typedef struct DisasContext {
> -    TranslationBlock *tb;
> -    target_ulong pc;
> -    uint32_t is_jmp;
> +    DisasContextBase base;
>      uint32_t mem_idx;
>      uint32_t tb_flags;
>      uint32_t delayed_branch;
> -    bool singlestep_enabled;
>  } DisasContext;
>  
>  static TCGv cpu_sr;
> @@ -126,9 +124,9 @@ static void gen_exception(DisasContext *dc, unsigned int excp)
>  
>  static void gen_illegal_exception(DisasContext *dc)
>  {
> -    tcg_gen_movi_tl(cpu_pc, dc->pc);
> +    tcg_gen_movi_tl(cpu_pc, dc->base.pc_next);
>      gen_exception(dc, EXCP_ILLEGAL);
> -    dc->is_jmp = DISAS_UPDATE;
> +    dc->base.is_jmp = DISAS_UPDATE;

Should be NORETURN.

> @@ -1254,14 +1252,14 @@ static void dec_sys(DisasContext *dc, uint32_t insn)
>      switch (op0) {
>      case 0x000:    /* l.sys */
>          LOG_DIS("l.sys %d\n", K16);
> -        tcg_gen_movi_tl(cpu_pc, dc->pc);
> +        tcg_gen_movi_tl(cpu_pc, dc->base.pc_next);
>          gen_exception(dc, EXCP_SYSCALL);
> -        dc->is_jmp = DISAS_UPDATE;
> +        dc->base.is_jmp = DISAS_UPDATE;

Likewise.


r~

  parent reply	other threads:[~2018-02-21 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18  1:32 [Qemu-devel] [PATCH 0/2] target/openrisc: translator loop conversion Emilio G. Cota
2018-02-18  1:32 ` [Qemu-devel] [PATCH 1/2] target/openrisc: convert to DisasContextBase Emilio G. Cota
2018-02-18  3:10   ` Stafford Horne
2018-02-18  6:11     ` Emilio G. Cota
2018-02-21 18:22   ` Richard Henderson [this message]
2018-02-18  1:32 ` [Qemu-devel] [PATCH 2/2] target/openrisc: convert to TranslatorOps Emilio G. Cota
2018-02-18  3:13   ` Stafford Horne
2018-02-21 18:24   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a5ab077-e033-2a89-a3a2-43d2dcaeed8e@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=shorne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).