This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RedBoot serial rx interrupts


Grant Edwards <grante@visi.com> writes:

> On Sat, Jan 13, 2001 at 04:13:47PM -0700, Gary Thomas wrote:
> 
> > > My Ethernet driver initialization routine ends up calling
> > > cyg_drv_isr_lock() and cyg_drv_isr_unlock().  The latter
> > > enables interrupts.
> > 
> > Maybe we should improve this interface to return an indication
> > of whether the interrupts _were_ on when "isr_lock()" was
> > called to avoid this in the future.  I'll think about it.
> 
> I doubt it's worth the extra overhead.
> 
> I hacked my way around the lock/unlock-during-init issue in
> another kernel by statically initializing the lock counter to
> its max value and then setting it to 0 just before the
> scheduler first enables interrupts.  You'd still get interrupts
> enabled during init if you called ulock() a lot of times
> without calling lock(), but it behaved properly for balanced
> lock/unlock calls.
> 

This looks like a bug in drv_api.c. the isr_disable_counter variable
should be initialized to 1 - indicating that the interrupts start off
disabled. Then any lock/unlock pairs will keep interrupts masked.
The equivalent variable in the kernel is initialized to 1.

Until RedBoot came along a lot of this code wasn't being exercised
much, so nobody noticed that this had not been kept up to date with
the kernel.

I'll fix this in our CVS tree, and it should filter out to anoncvs
with the next update.


-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]