From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] Disable interrupts on Cortex M3 (lm3s6965evb)
Date: Sun, 05 Jun 2011 15:06:29 +0200 [thread overview]
Message-ID: <4DEB7F55.9030700@embedded-brains.de> (raw)
In-Reply-To: <4DEB5AFF.3010604@embedded-brains.de>
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
On 05/06/11 12:31, Sebastian Huber wrote:
> Hello,
>
> how can I disable interrupts on the Cortex M3 based board LM3S6965EVB?
> Even if I set PRIMASK, FAULTMASK and BASEPRI to 1 the SYSTICK interrupt
> handler gets called.
>
> Have a nice day!
>
I think the interrupt handling logic for ARMv7M is wrong in cpu-exec.c
line 470. Please have a look at the attached patch.
[-- Attachment #2: 0001-Fixed-interrupt-handling-for-ARMv7M.patch --]
[-- Type: text/x-patch, Size: 1061 bytes --]
>From b424c34d0202950307b3a12778a06834917b2947 Mon Sep 17 00:00:00 2001
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Sun, 5 Jun 2011 14:57:17 +0200
Subject: [PATCH] Fixed interrupt handling for ARMv7M.
---
cpu-exec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 6ddd8dd..2782076 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -470,8 +470,8 @@ int cpu_exec(CPUState *env1)
We avoid this by disabling interrupts when
pc contains a magic address. */
if (interrupt_request & CPU_INTERRUPT_HARD
- && ((IS_M(env) && env->regs[15] < 0xfffffff0)
- || !(env->uncached_cpsr & CPSR_I))) {
+ && !(env->uncached_cpsr & CPSR_I)
+ && (IS_M(env) && env->regs[15] < 0xfffffff0)) {
env->exception_index = EXCP_IRQ;
do_interrupt(env);
next_tb = 0;
--
1.7.1
next prev parent reply other threads:[~2011-06-05 13:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 10:31 [Qemu-devel] Disable interrupts on Cortex M3 (lm3s6965evb) Sebastian Huber
2011-06-05 13:06 ` Sebastian Huber [this message]
2011-06-05 13:44 ` Peter Maydell
2011-06-05 14:17 ` Sebastian Huber
2011-06-05 14:57 ` Peter Maydell
2011-06-05 16:32 ` Sebastian Huber
2011-06-05 19:23 ` Peter Maydell
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=4DEB7F55.9030700@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=paul@codesourcery.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).