Skip to contentSkip to conversation

PATCH [02/02] leon3: add smp cpu index to asr17

Qemu-devel Steven Seeger 1 participant 1 message Mar 27, 2018

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

From 1ba3070160d5baab73ba9e500ed58d0ace7121aa Mon 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

---
 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
index 1d854890b4..8304c3e3f3 100644
@@ -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
index b8f1e78c75..fe6554fd76 100644
@@ -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
index ab8d0a0c72..de482952e1 100644
@@ -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