PATCH [02/02] leon3: add smp cpu index to asr17
Quoted 1 line
From
1ba3070160d5baab73ba9e500ed58d0ace7121aaMon Sep 17 00:00:00 2001
From: Steven Seeger <[email protected]>
Date: Mon, 26 Mar 2018 20:50:53 -0400
Subject: [PATCH 2/6] leon3: add smp cpu index to asr17
Signed-off-by Steven Seeger <[email protected]>
--- target/sparc/helper.c | 5 +++++ target/sparc/helper.h | 1 + target/sparc/translate.c | 1 + 3 files changed, 7 insertions(+)
target/sparc/helper.c +0 -0
@@ -117,6 +117,11 @@ target_ulong helper_udiv_cc(CPUSPARCState *env,
target_ulong a, target_ulong b)
return do_udiv(env, a, b, 1, GETPC());
}
+target_ulong helper_asr17(CPUSPARCState *env, target_ulong input) +{
+ return input | (CPU(sparc_env_get_cpu(env))->cpu_index << 28);
+}
+
static target_ulong do_sdiv(CPUSPARCState *env, target_ulong a,
target_ulong b, int cc, uintptr_t ra)
{
target/sparc/helper.h +1 -0
@@ -166,3 +166,4 @@ VIS_CMPHELPER(cmpne)#undef VIS_CMPHELPER DEF_HELPER_1(compute_psr, void, env) DEF_HELPER_FLAGS_1(compute_C_icc, TCG_CALL_NO_WG_SE, i32, env) +DEF_HELPER_2 (asr17, tl, env, tl)
target/sparc/translate.c +0 -0
@@ -3440,6 +3440,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
TCGv t = gen_dest_gpr(dc, rd);
/* Read Asr17 for a Leon3 monoprocessor */
tcg_gen_movi_tl(t, (1 << 8) | (dc->def->nwindows -
1));
+ gen_helper_asr17(t, cpu_env, t);
gen_store_gpr(dc, rd, t);
break;
}Signature · 1 line
2.16.1