aboutsummaryrefslogtreecommitdiff
path: root/target/sparc/translate.c
diff options
context:
space:
mode:
authorClément Chigot <chigot@adacore.com>2024-01-31 09:50:43 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-15 16:58:46 +0100
commitc92948f22b0ef62d7b5a6a73e943a110f761273b (patch)
treeb1aae4abcc295ed34986e956ad0d9801c1d8cacb /target/sparc/translate.c
parent0fa5cd4a6016c0dc13c2882f63b58787cf3283bb (diff)
target/sparc: implement asr17 feature for smp
This allows the guest program to know its cpu id. Co-developed-by: Frederic Konrad <konrad.frederic@yahoo.fr> Signed-off-by: Clément Chigot <chigot@adacore.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240131085047.18458-6-chigot@adacore.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'target/sparc/translate.c')
-rw-r--r--target/sparc/translate.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index d9304a5bc4..692ce0b010 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -37,6 +37,7 @@
#ifdef TARGET_SPARC64
# define gen_helper_rdpsr(D, E) qemu_build_not_reached()
+# define gen_helper_rdasr17(D, E) qemu_build_not_reached()
# define gen_helper_rett(E) qemu_build_not_reached()
# define gen_helper_power_down(E) qemu_build_not_reached()
# define gen_helper_wrpsr(E, S) qemu_build_not_reached()
@@ -2382,16 +2383,8 @@ static bool trans_RDY(DisasContext *dc, arg_RDY *a)
static TCGv do_rd_leon3_config(DisasContext *dc, TCGv dst)
{
- uint32_t val;
-
- /*
- * TODO: There are many more fields to be filled,
- * some of which are writable.
- */
- val = dc->def->nwindows - 1; /* [4:0] NWIN */
- val |= 1 << 8; /* [8] V8 */
-
- return tcg_constant_tl(val);
+ gen_helper_rdasr17(dst, tcg_env);
+ return dst;
}
TRANS(RDASR17, ASR17, do_rd_special, true, a->rd, do_rd_leon3_config)