[Milkymist-devel] IRQ handling code
Michael Walle
michael at walle.cc
Wed Mar 31 15:08:05 PDT 2010
Am Thursday 18 March 2010 14:07:26 schrieben Sie:
> Hi,
>
> On Wednesday 17 March 2010 00:15:48 Michael Walle wrote:
> > Am Tuesday 16 March 2010 15:53:41 schrieb Sébastien Bourdeauducq:
> > > Therefore, it gets ALL interrupts (masked or not). We should AND
> > > register IP with register IM.
> >
> > yep. imho that should be done within the asm code.
>
> Yes, but this requires extra asm instructions that no longer fit between
> two LM32 exception vectors and therefore a jump is needed. I wanted to
> avoid it, that's why I did it this way. But since it is inconsistent with
> other Linux ports, I will change it.
>
> > other linux ports pass only one single irq number to do_IRQ().
> >
> > What about the following steps:
> > 1. interrupt vector gets called
> > 2. save regs
> > 3. r2 <- IM & IP
> > 4. find position of first bit set in r2, store it in r1
> > (4a. r2 <- pt_regs)
> > 5. mask irq
> > 6. call do_IRQ (which only takes one irq number)
> > 7. ack irq
> > 8. unmask irq
> > 9. restore regs
> > 10. eret
> >
> > Processing only one interrupt at a time should avoid the second problem,
> > mentioned above.
>
> Sounds good. It takes more CPU cycles to achieve the same thing when
> interrupts come at the same time, but since I guess this rarely happens,
> the small performance improvement is not worth the cost of doing
> differently than other Linux ports.
see attachment
--
wkr michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-new-irq-handling-code.patch
Type: text/x-diff
Size: 2857 bytes
Desc: not available
URL: <http://lists.milkymist.org/pipermail/devel-milkymist.org/attachments/20100401/43c42cda/attachment.patch>
More information about the Devel
mailing list