This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: kernel API calls allowed from cyg_user_start()?
- To: Grant Edwards <grante at visi dot com>
- Subject: RE: [ECOS] kernel API calls allowed from cyg_user_start()?
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Wed, 15 Aug 2001 14:32:38 -0600 (MDT)
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat, Inc.
On 15-Aug-2001 Grant Edwards wrote:
>
> Can somebody point me to a list of what kernel API calls are
> allowed before the scheduler is started (e.g. from inside
> cyg_user_start())?
>
> Some ones that obviously work involve creating and intializing
> kernel objects.
>
> One note I found states:
>
> CAUTION
>
> Remember that cyg_user_start() is invoked before the
> scheduler (and frequently the scheduler is invoked as the
> last step in cyg_user_start() ), so it should not use any
> kernel services that require the scheduler.
>
> How do you know which kernel services require the scheduler? I
> assume that anything that might normally block is in that
> category.
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].