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

malloc/free from ISR



On Wednesday, November 13, 2002, at 10:19  AM, Brett Swimley wrote:

> Hi All,
>
> Is it legal to call malloc/free from an ISR?  I'm got a device driver 
> that
> does this and having a bit of problem.  Don't know if this is the 
> issue but
> thought I would ask the question.
>

You're probably better off rewriting the device driver so that the bulk 
of the ISR code runs in the context of an interrupt handler task rather 
than in the interrupt handler itself.  This is the way network drivers 
work, for example.  Someday terminal drivers will work this way, too.

-- 
Eric Norum <eric.norum at usask.ca>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394   FAX:   (306) 966-5407