qemu/target/nios2
Richard Henderson 945a5bd3f8 target/nios2: Introduce shadow register sets
Do not actually enable them so far, in terms of being able
to change the current register set, but add all of the
plumbing to address them.  Do not enable them for user-only.

Add an env->regs pointer that handles the indirection to
the current register set.  The naming of the pointer hides
the difference between old and new, user-only and sysemu.

From the notes on wrprs, which states that r0 must be initialized
before use in shadow register sets, infer that R_ZERO is *not*
hardwired to zero in shadow register sets, but that it is still
read-only.  Introduce tbflags bit R0_0 to track that it has been
properly set to zero.  Adjust load_gpr to reflect this.

At the same time we might as well special case crs == 0 to avoid
the indirection through env->regs during translation as well; this
is intended to be the most common case for non-interrupt handlers.

Init env->regs at reset.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220421151735.31996-54-richard.henderson@linaro.org>
2022-04-26 08:17:05 -07:00
..
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu.c target/nios2: Introduce shadow register sets 2022-04-26 08:17:05 -07:00
cpu.h target/nios2: Introduce shadow register sets 2022-04-26 08:17:05 -07:00
helper.c target/nios2: Enable unaligned traps for system mode 2022-04-26 08:17:05 -07:00
helper.h target/nios2: Support division error exception 2022-04-26 08:16:41 -07:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
meson.build target/nios2: Build helper.c for system only 2022-04-26 08:16:40 -07:00
mmu.c target/nios2: Use hw/registerfields.h for CR_TLBMISC fields 2022-04-26 08:16:41 -07:00
mmu.h target: Include missing 'cpu.h' 2022-03-06 13:15:42 +01:00
monitor.c hmp: Pass monitor to mon_get_cpu_env() 2020-11-13 12:45:51 +00:00
nios2-semi.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
op_helper.c target/nios2: Implement Misaligned destination exception 2022-04-26 08:17:05 -07:00
trace-events target/nios2: Replace MMU_LOG with tracepoints 2022-03-03 09:36:38 -10:00
translate.c target/nios2: Introduce shadow register sets 2022-04-26 08:17:05 -07:00