qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Steven Seeger
Subject: [Qemu-devel] PATCH [02/02] leon3: add smp cpu index to asr17
Date: Mon, 26 Mar 2018 22:25:26 -0400

>From 1ba3070160d5baab73ba9e500ed58d0ace7121aa Mon Sep 17 00:00:00 2001
From: Steven Seeger <address@hidden>
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 <address@hidden>
---
 target/sparc/helper.c    | 5 +++++
 target/sparc/helper.h    | 1 +
 target/sparc/translate.c | 1 +
 3 files changed, 7 insertions(+)

diff --git a/target/sparc/helper.c b/target/sparc/helper.c
index 1d854890b4..8304c3e3f3 100644
--- a/target/sparc/helper.c
+++ b/target/sparc/helper.c
@@ -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)
 {
diff --git a/target/sparc/helper.h b/target/sparc/helper.h
index b8f1e78c75..fe6554fd76 100644
--- a/target/sparc/helper.h
+++ b/target/sparc/helper.h
@@ -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)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index ab8d0a0c72..de482952e1 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -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;
                     }
-- 
2.16.1







reply via email to

[Prev in Thread] Current Thread [Next in Thread]