From: Michael Walle <michael@walle.cc>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Michael Walle <michael@walle.cc>
Subject: [Qemu-devel] [PATCH 1/4] lm32: fix exception handling
Date: Wed, 13 Apr 2011 00:29:33 +0200 [thread overview]
Message-ID: <1302647376-26764-2-git-send-email-michael@walle.cc> (raw)
In-Reply-To: <1302647376-26764-1-git-send-email-michael@walle.cc>
Global interrupt enable bit is already saved within the exception handler
helper routine. Thus remove extra code in translation routines.
Additionally, debug exceptions has always DEBA as base address.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/helper.c | 6 +-----
target-lm32/translate.c | 26 --------------------------
2 files changed, 1 insertions(+), 31 deletions(-)
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index 318e2cf..4f3e7e0 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -76,11 +76,7 @@ void do_interrupt(CPUState *env)
env->regs[R_BA] = env->pc;
env->ie |= (env->ie & IE_IE) ? IE_BIE : 0;
env->ie &= ~IE_IE;
- if (env->dc & DC_RE) {
- env->pc = env->deba + (env->exception_index * 32);
- } else {
- env->pc = env->eba + (env->exception_index * 32);
- }
+ env->pc = env->deba + (env->exception_index * 32);
log_cpu_state_mask(CPU_LOG_INT, env, 0);
break;
default:
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index ccdf959..2cfa253 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -614,36 +614,10 @@ static void dec_scall(DisasContext *dc)
t0 = tcg_temp_new();
l1 = gen_new_label();
- /* save IE.IE */
- tcg_gen_andi_tl(t0, cpu_ie, IE_IE);
-
- /* IE.IE = 0 */
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_IE);
-
if (dc->imm5 == 7) {
- /* IE.EIE = IE.IE */
- tcg_gen_ori_tl(cpu_ie, cpu_ie, IE_EIE);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, IE_IE, l1);
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_EIE);
- gen_set_label(l1);
-
- /* gpr[ea] = PC */
- tcg_gen_movi_tl(cpu_R[R_EA], dc->pc);
- tcg_temp_free(t0);
-
tcg_gen_movi_tl(cpu_pc, dc->pc);
t_gen_raise_exception(dc, EXCP_SYSTEMCALL);
} else {
- /* IE.BIE = IE.IE */
- tcg_gen_ori_tl(cpu_ie, cpu_ie, IE_BIE);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, IE_IE, l1);
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_BIE);
- gen_set_label(l1);
-
- /* gpr[ba] = PC */
- tcg_gen_movi_tl(cpu_R[R_BA], dc->pc);
- tcg_temp_free(t0);
-
tcg_gen_movi_tl(cpu_pc, dc->pc);
t_gen_raise_exception(dc, EXCP_BREAKPOINT);
}
--
1.7.2.3
next prev parent reply other threads:[~2011-04-13 1:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 22:29 [Qemu-devel] [PATCH 0/4] lm32 and BSP fixes Michael Walle
2011-04-12 22:29 ` Michael Walle [this message]
2011-04-12 22:29 ` [Qemu-devel] [PATCH 2/4] milkymist-vgafb: fix console resizing Michael Walle
2011-04-12 22:29 ` [Qemu-devel] [PATCH 3/4] milkymist-sysctl: fix timers Michael Walle
2011-04-12 22:29 ` [Qemu-devel] [PATCH 4/4] lm32: add Milkymist Minimac2 support Michael Walle
2011-05-02 20:10 ` [Qemu-devel] [PATCH 0/4] lm32 and BSP fixes Michael Walle
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=1302647376-26764-2-git-send-email-michael@walle.cc \
--to=michael@walle.cc \
--cc=edgar.iglesias@gmail.com \
--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).