* [Qemu-devel] Simulation of MIPS interrupts?
@ 2006-06-11 17:03 Dirk Behme
2006-06-14 16:32 ` Paul Brook
0 siblings, 1 reply; 2+ messages in thread
From: Dirk Behme @ 2006-06-11 17:03 UTC (permalink / raw)
To: qemu-devel
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;
...
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Simulation of MIPS interrupts?
2006-06-11 17:03 [Qemu-devel] Simulation of MIPS interrupts? Dirk Behme
@ 2006-06-14 16:32 ` Paul Brook
0 siblings, 0 replies; 2+ messages in thread
From: Paul Brook @ 2006-06-14 16:32 UTC (permalink / raw)
To: qemu-devel
> IRQ
> exec (b)
> jump 0xbfc00380
> do sth, issue second IRQ
> IRQ
Are you sure this is actually an IRQ, not some other sort of exception?
Paul
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-14 16:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-11 17:03 [Qemu-devel] Simulation of MIPS interrupts? Dirk Behme
2006-06-14 16:32 ` Paul Brook
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).