This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: dynamic allocation of memory during driver initializat ion?
On Fri, Aug 08, 2003 at 02:56:02PM -0600, Gary Thomas wrote:
> > > One possiblity might be to do this from the device lookup()
> > > function that is called from cyg_io_lookup().
> >
> > That's what we're doing now. It works as long as the lookup()
> > is performed before interrupts are enabled and the device
> > operation starts. If interrupts are enabled before the first
> > lookup() call, then the DSRs break because there are no buffers
> > allocated. I could add code to the DSRs to check to see if the
> > buffers have been allocated, and discard the data if they
> > haven't, but I was hoping to avoid make the DSRs any longer.
>
> It would seem wrong to me to have the device generating and/or
> handling interrupts before any "lookup" has been done. Normally
> one doesn't enable interrupts to a device until there is some
> process (thread, whatever) ready to utilize the device.
That seems like a good approach, and would involve simply
moving more stuff from the init routine to the lookup routine.
--
Grant Edwards
grante@visi.com
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss