[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [N8VEM: 14659] Re: Interrupt code
- To: n8vem@googlegroups.com
- Subject: Re: [N8VEM: 14659] Re: Interrupt code
- From: Michael Haardt <mic...@moria.de>
- Date: Tue, 18 Sep 2012 22:27:33 +0200
- Authentication-results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mic...@moria.de designates 85.116.193.48 as permitted sender) smtp.mail=mic...@moria.de
- In-reply-to: <1D94E034-B23E-4C25-9E73-F8942D66FC16@mac.com>
- References: <5056E684.80407@internode.on.net> <CADQpb5Nf6TF1HZrtqk6SQ3on4zPtGfw8xBDEb=_gfhrzBZcqdw@mail.gmail.com> <5057C35A.7070306@internode.on.net> <CADQpb5OF=Z5F2x2kjzk5=ZO1cNbtDkvgN8bqZt+tU7S2_YK7Ew@mail.gmail.com> <5058120E.3020306@internode.on.net> <CADQpb5O7o+07wzpkN8L4=PFvTcENXYmT2gakGMMgj6n8owZDjw@mail.gmail.com> <CADQpb5NejkxAdb9hc6CsPki=qn_uqucT84u17SuoEt+xBsw2mg@mail.gmail.com> <1D94E034-B23E-4C25-9E73-F8942D66FC16@mac.com>
- User-agent: Heirloom mailx 12.1 6/15/06
> Currently, it is undefined whether we will allow nested interrupts. When an ISR is entered, the time between the
> disablement of the interrupt system and it's subsequent re-enablement is a guarded region and constitutes a
> latency period for all other interrupts that may be pending. In the case of some devices, it is necessary to
> servicer them immediately to prevent data loss. For this reason it is desirable to allow nested interrupts.
That's the common reasoning, but it is only true for simple minded
implementations.
An interrupt handler could just perform the minimal work to acknowledge
the interrupt, fetch/deliver any data needed to avoid losing anything
and then either send the driver an asynchronous message or do whatever
else to let it know about the interrupt, you gain a lot, because you
can manage the handler priorities in software and avoid nested interrupts.
It is worth mentioning that ring buffers can be implemented lock free,
great for communication between interruptible drivers and interrupt
handlers. A serial driver can just push characters on a ring buffer
and leave all character postprocessing to the interruptible driver,
leaving interrupts enabled all the time.
Michael