On Tue, 8 Mar 2022 at 07:20, Richard Henderson
<richard.hender...@linaro.org> wrote:
>
> Decode 'break 1' during translation, rather than doing
> it again during exception processing.
>
> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
> ---
>  target/nios2/cpu.h       |  1 +
>  target/nios2/helper.c    | 15 ++++++---------
>  target/nios2/translate.c | 17 ++++++++++++++++-
>  3 files changed, 23 insertions(+), 10 deletions(-)
>
> diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
> index c48daa5640..13e1d49f38 100644
> --- a/target/nios2/cpu.h
> +++ b/target/nios2/cpu.h
> @@ -162,6 +162,7 @@ FIELD(CR_TLBMISC, EE, 24, 1)
>
>  /* Exceptions */
>  #define EXCP_BREAK    0x1000
> +#define EXCP_SEMIHOST 0x1001
>  #define EXCP_RESET    0
>  #define EXCP_PRESET   1
>  #define EXCP_IRQ      2
> diff --git a/target/nios2/helper.c b/target/nios2/helper.c
> index 007496b957..a338d02f6b 100644
> --- a/target/nios2/helper.c
> +++ b/target/nios2/helper.c
> @@ -146,17 +146,14 @@ void nios2_cpu_do_interrupt(CPUState *cs)
>          env->pc = cpu->exception_addr;
>          break;
>
> +    case EXCP_SEMIHOST:
> +        qemu_log_mask(CPU_LOG_INT, "BREAK semihosting at pc=%x\n", env->pc);
> +        env->pc += 4;
> +        do_nios2_semihosting(env);
> +        return;

Ah, here's the "return" I asked for in the earlier patch :-)

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

thanks
-- PMM

Reply via email to