From: David Brenken <david.brenken@efs-auto.org>
To: qemu-devel@nongnu.org
Cc: kbastian@mail.uni-paderborn.de,
David Brenken <david.brenken@efs-auto.de>,
Florian Artmeier <florian.artmeier@efs-auto.de>,
Georg Hofstetter <georg.hofstetter@efs-auto.de>
Subject: [Qemu-devel] [PATCH v2 3/4] tricore: renamed masking of IE
Date: Thu, 1 Mar 2018 16:56:18 +0100 [thread overview]
Message-ID: <20180301155619.8640-4-david.brenken@efs-auto.org> (raw)
In-Reply-To: <20180301155619.8640-1-david.brenken@efs-auto.org>
From: David Brenken <david.brenken@efs-auto.de>
Signed-off-by: David Brenken <david.brenken@efs-auto.de>
Signed-off-by: Florian Artmeier <florian.artmeier@efs-auto.de>
Signed-off-by: Georg Hofstetter <georg.hofstetter@efs-auto.de>
---
target/tricore/cpu.h | 3 ++-
target/tricore/op_helper.c | 17 +++++++++--------
target/tricore/translate.c | 4 ++--
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
index c295763..a98b6f2 100644
--- a/target/tricore/cpu.h
+++ b/target/tricore/cpu.h
@@ -257,7 +257,8 @@ void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
#define MASK_CPUID_REV 0x000000ff
#define MASK_ICR_PIPN 0x00ff0000
-#define MASK_ICR_IE 0x00000100
+#define MASK_ICR_IE_1_3 0x00000100
+#define MASK_ICR_IE_1_6 0x00008000
#define MASK_ICR_CCPN 0x000000ff
#define MASK_FCX_FCXS 0x000f0000
diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c
index 098f217..475b6ce 100644
--- a/target/tricore/op_helper.c
+++ b/target/tricore/op_helper.c
@@ -85,7 +85,7 @@ raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin,
/* PCXI.PIE = ICR.IE */
env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) +
- ((env->ICR & MASK_ICR_IE) << 15));
+ ((env->ICR & MASK_ICR_IE_1_3) << 15));
/* PCXI.PCPN = ICR.CCPN */
env->PCXI = (env->PCXI & 0xffffff) +
((env->ICR & MASK_ICR_CCPN) << 24);
@@ -2465,7 +2465,7 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc)
((env->ICR & MASK_ICR_CCPN) << 24);
/* PCXI.PIE = ICR.IE; */
env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) +
- ((env->ICR & MASK_ICR_IE) << 15));
+ ((env->ICR & MASK_ICR_IE_1_3) << 15));
/* PCXI.UL = 1; */
env->PCXI |= MASK_PCXI_UL;
@@ -2563,7 +2563,7 @@ void helper_bisr(CPUTriCoreState *env, uint32_t const9)
((env->ICR & MASK_ICR_CCPN) << 24);
/* PCXI.PIE = ICR.IE */
env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) +
- ((env->ICR & MASK_ICR_IE) << 15));
+ ((env->ICR & MASK_ICR_IE_1_3) << 15));
/* PCXI.UL = 0 */
env->PCXI &= ~(MASK_PCXI_UL);
/* PCXI[19: 0] = FCX[19: 0] */
@@ -2571,7 +2571,7 @@ void helper_bisr(CPUTriCoreState *env, uint32_t const9)
/* FXC[19: 0] = new_FCX[19: 0] */
env->FCX = (env->FCX & 0xfff00000) + (new_FCX & 0xfffff);
/* ICR.IE = 1 */
- env->ICR |= MASK_ICR_IE;
+ env->ICR |= MASK_ICR_IE_1_3;
env->ICR |= const9; /* ICR.CCPN = const9[7: 0];*/
@@ -2603,7 +2603,8 @@ void helper_rfe(CPUTriCoreState *env)
}
env->PC = env->gpr_a[11] & ~0x1;
/* ICR.IE = PCXI.PIE; */
- env->ICR = (env->ICR & ~MASK_ICR_IE) + ((env->PCXI & MASK_PCXI_PIE) >> 15);
+ env->ICR = (env->ICR & ~MASK_ICR_IE_1_3)
+ + ((env->PCXI & MASK_PCXI_PIE) >> 15);
/* ICR.CCPN = PCXI.PCPN; */
env->ICR = (env->ICR & ~MASK_ICR_CCPN) +
((env->PCXI & MASK_PCXI_PCPN) >> 24);
@@ -2627,7 +2628,7 @@ void helper_rfm(CPUTriCoreState *env)
{
env->PC = (env->gpr_a[11] & ~0x1);
/* ICR.IE = PCXI.PIE; */
- env->ICR = (env->ICR & ~MASK_ICR_IE) |
+ env->ICR = (env->ICR & ~MASK_ICR_IE_1_3) |
((env->PCXI & MASK_PCXI_PIE) >> 15);
/* ICR.CCPN = PCXI.PCPN; */
env->ICR = (env->ICR & ~MASK_ICR_CCPN) |
@@ -2694,7 +2695,7 @@ void helper_svlcx(CPUTriCoreState *env)
((env->ICR & MASK_ICR_CCPN) << 24);
/* PCXI.PIE = ICR.IE; */
env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) +
- ((env->ICR & MASK_ICR_IE) << 15));
+ ((env->ICR & MASK_ICR_IE_1_3) << 15));
/* PCXI.UL = 0; */
env->PCXI &= ~MASK_PCXI_UL;
@@ -2737,7 +2738,7 @@ void helper_svucx(CPUTriCoreState *env)
((env->ICR & MASK_ICR_CCPN) << 24);
/* PCXI.PIE = ICR.IE; */
env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) +
- ((env->ICR & MASK_ICR_IE) << 15));
+ ((env->ICR & MASK_ICR_IE_1_3) << 15));
/* PCXI.UL = 1; */
env->PCXI |= MASK_PCXI_UL;
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index 54de0dd..aef0d9c 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -8379,12 +8379,12 @@ static void decode_sys_interrupts(CPUTriCoreState *env, DisasContext *ctx)
/* raise EXCP_DEBUG */
break;
case OPC2_32_SYS_DISABLE:
- tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~MASK_ICR_IE);
+ tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~MASK_ICR_IE_1_3);
break;
case OPC2_32_SYS_DSYNC:
break;
case OPC2_32_SYS_ENABLE:
- tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE);
+ tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE_1_3);
break;
case OPC2_32_SYS_ISYNC:
break;
--
2.7.4
next prev parent reply other threads:[~2018-03-01 15:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 15:56 [Qemu-devel] [PATCH v2 0/4] tricore: added small features + fixed wrong masks David Brenken
2018-03-01 15:56 ` [Qemu-devel] [PATCH v2 1/4] tricore: added some missing cpu instructions David Brenken
2018-03-02 10:47 ` Bastian Koppelmann
2018-03-01 15:56 ` [Qemu-devel] [PATCH v2 2/4] tricore: added CORE_ID David Brenken
2018-03-02 10:49 ` Bastian Koppelmann
2018-03-01 15:56 ` David Brenken [this message]
2018-03-02 10:48 ` [Qemu-devel] [PATCH v2 3/4] tricore: renamed masking of IE Bastian Koppelmann
2018-03-01 15:56 ` [Qemu-devel] [PATCH v2 4/4] tricore: renamed masking of PIE David Brenken
2018-03-02 10:41 ` [Qemu-devel] [PATCH v2 0/4] tricore: added small features + fixed wrong masks Bastian Koppelmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180301155619.8640-4-david.brenken@efs-auto.org \
--to=david.brenken@efs-auto.org \
--cc=david.brenken@efs-auto.de \
--cc=florian.artmeier@efs-auto.de \
--cc=georg.hofstetter@efs-auto.de \
--cc=kbastian@mail.uni-paderborn.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).