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: kernel API calls allowed from cyg_user_start()?


On Wed, Aug 15, 2001 at 10:34:29PM +0100, Jonathan Larmour wrote:
> Gary Thomas wrote:
>
> > That's what the warning is for.  You can't expect to do
> > anything which might cause the thread to block, because there
> > is no scheduler running, thus no way to get it restarted.
> > 
> > The safest thing to do is only use this routine to set up
> > initial threads and then start the kernel.  Other things like
> > creating and initializing kernel objects (mutexes, etc) are
> > also safe, but not using them [in general].
> 
> Actually we do take some care to allow people to do things like
> lock/unlock mutexes, as quite often you can't help "shared"
> code needing to do that.

Yup, I remember having to deal with that sort of problem in a
kernel I wrote years and years ago.  It's the sort of thing you
never think of until you've tripped over it once.

> Of course every lock must match an unlock. The kernel is
> deliberately set up such that it thinks the current thread is
> the idle thread in order to do that

That's a clever solution.  Wish I'd thought of it.

> (even though it's on a different stack of course) and that the
> scheduler is locked.

-- 
Grant Edwards
grante@visi.com


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