[Tinyos-devel] Nested interrupts
John Regehr
regehr at cs.utah.edu
Sun Aug 12 20:53:45 PDT 2007
To elaborate a bit on Phil's msg:
On AVR interrupt priorities come into play only when there are multiple
pending interupts and the processor needs to choose one to fire. This is
counterintuitive for most of us who expect a model similar to Windows NT
or most UNIX kernels where a higher-priority interrupt can nest on a
lower-priority interrupt, but not the other way around.
AVR permits both nested and reentrant interrupts, where nesting means A
preempts B and reentrancy means B preempts B. The maximum depth of both
reentrancy and nesting is limited only by stack constraints -- this has to
be the case since the processor keeps no history regarding what interrupts
are being processed.
Small puzzle problem: Is there ever a legitimate (i.e., correct and
appropriate) use of a reentrant interrupt handler?
John Regehr
On Fri, 10 Aug 2007, Philip Levis wrote:
> On Aug 10, 2007, at 9:52 AM, Rodrigo Fonseca wrote:
>
> > Hi,
> >
> > in a project we are doing we need to take care of nested interrupts:
> > interrupts that fire while the processor is inside an interrupt
> > handler.
> >
> > The question is, for each processor, is there a bound for the number
> > of nested interrupts we can have? Is that the number of different
> > interrupt priorities, or is it only bounded by the size of the stack
> > :) ?
>
>
> Size of the stack. E.g., an interrupt can be self-preemptive.
>
> Phil
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
More information about the Tinyos-devel
mailing list