From: Dirk Behme <dirk.behme@googlemail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Simulation of MIPS interrupts?
Date: Sun, 11 Jun 2006 19:03:46 +0200 [thread overview]
Message-ID: <448C4CF2.6000308@gmail.com> (raw)
Hi,
looking in cpu_exec.c at cpu_exec() there are two code
blocks which call MIPS interrupt handling code (please see
below, (a) & (b) )
When is which block called?
I ask because a simple MIPS IRQ test doesn't work for me
like I would expect. I enable interrupts in status register.
Then, using code (b), system jumps to 0xbfc00380 like
expected. My expectation would be that I now can do
everything in ISR. As long as EXL is set it locks out
interrupts globally (like done in code (b) ). Even touching
HW and raising an additional IRQ in ISR shouldn't come
through until first called ISR exits with 'eret'. This is
what is checked in code (b): As long EXL ist set,
do_interrupt() isn't called again there.
But if additional IRQ is raised while in ISR, block (a) is
called (which does no checks like code (b)), system jumps to
0xbfc00380, executes ~7-8 assembly instructions and jumps
again to 0xbfc00380 via block (a). This results in an
infinite loop. eret of first ISR is never executed:
IRQ
exec (b)
jump 0xbfc00380
do sth, issue second IRQ
IRQ
exec (a)
jump 0xbfc00380
do ~7-8 assembly instructions
exec (a)
jump 0xbfc00380
do ~7-8 assembly instructions
exec (a)
jump 0xbfc00380
do ~7-8 assembly instructions
...
Best regards
Dirk
(a)
...
#elif defined(TARGET_MIPS)
do_interrupt(env);
#elif defined(TARGET_SPARC)
...
(b)
...
#elif defined(TARGET_MIPS)
if ((interrupt_request &
CPU_INTERRUPT_HARD) &&
(env->CP0_Status & (1 << CP0St_IE)) &&
(env->CP0_Status & env->CP0_Cause &
0x0000FF00) &&
!(env->hflags & MIPS_HFLAG_EXL) &&
!(env->hflags & MIPS_HFLAG_ERL) &&
!(env->hflags & MIPS_HFLAG_DM)) {
/* Raise it */
env->exception_index =
EXCP_EXT_INTERRUPT;
env->error_code = 0;
do_interrupt(env);
env->interrupt_request &=
~CPU_INTERRUPT_HARD;
...
next reply other threads:[~2006-06-11 17:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-11 17:03 Dirk Behme [this message]
2006-06-14 16:32 ` [Qemu-devel] Simulation of MIPS interrupts? Paul Brook
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=448C4CF2.6000308@gmail.com \
--to=dirk.behme@googlemail.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).