[ECOS] context for creating interrupts on edb7312
Fri Nov 21 17:22:00 GMT 2003
On Fri, 2003-11-21 at 09:32, Aaron Case wrote:
> > >
> > > Im looking for something along the lines of #define
> > hal_interrupts_enable
> > > cyg_interrupt_enable().
> > Actually, there is no explicit call like this (anymore). Interrupts
> > will get enabled when the scheduler "starts" the first thread (minimally
> > the 'idle' thread). Thread contexts are initialized with interrupts
> > enabled and this just sort of falls out with the washing :-)
> > --
> > Gary Thomas <firstname.lastname@example.org>
> > MLB Associates
> Thanks for the prompt answer. I was speaking more in the context of linking
> and compiling the image.
> I see that a call to enable interrupts is not necessary when threads are
> I also see the cyg_interrupt_enable in the map file, which jumps to the
> hal_interrupts_enable( from vector.S but not in the map file) code in the
I'm not sure I understand what you mean by this (in the map file?), but
if a function isn't used (cyg_interrupt_enable() is not used by the
kernel except for a single test), then even if that function is defined
it doesn't end up in the resulting application.
IMO there is absolutely no need to ever call cyg_interrupt_enable(),
except for the kernel test which tests it.
If you need to manipulate the interrupt state (and there are very few
cases even for this), this is a better approach:
HAL_DISABLE_INTERRUPTS(state); // Disables interrupts
HAL_RESTORE_INTERRUPTS(state); // Restore interrupts
Gary Thomas <email@example.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
More information about the Ecos-discuss