tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Interrupt handlers in NetBSD 5.0



On Monday 08 June 2009 23:46:18 Andrew Doran wrote:
> On Mon, Jun 08, 2009 at 09:24:26PM +0100, Mindaugas Rasiukevicius wrote:
> > Hans Petter Selasky <hselasky%c2i.net@localhost> wrote:
> > > I have a quick question:
> > >
> > > How are interrupt handlers implemented in NetBSD 5.0?
> >
> > It looks like you are interested in software interrupts. They are
> > described in softint(9) manual page.
> >
> > > Are the interrupt handlers deferred to an interrupt thread so that
> > > locking a kernel mutex from within the interrupt handler is allowed?
> >
> > Yes, mutex(9) could be used from soft interrupt handlers.
>
> To elaborate on what Mindaugas said:
>
> - Interrrupt handlers look somewhat like a traditional Unix system, but
>   there are fewer priority levels.
>
> - Software interrupts work like hardware interrupts for the most part, but
>   they have partial thread context and so can sleep on locks. This works a
>   bit like Solaris, if you are familiar with it.
>
> - There's no implicit deferral of work to threads like FreeBSD does with
>   hardware interrupts. If you need thread context for locking then work
> must be passed to another level: to a softint, to a workqueue, to the
> eventual consumer, or to a kthread using a custom mechanism.
>
> Also have a look at the spl(9) page, it gives some more details on
> interrupt structure and what you can do at the various priority levels.

Thank you for your information! One more question. If I want to defer a 
hardware interrupt, how do I disable that interrupt until the deferred 
interrupt handler gets executed. Not all interrupts are edge triggered!

--HPS


Home | Main Index | Thread Index | Old Index