This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to recognise that scheduler started.
- From: Motoya Kurotsu <kurotsu at allied-telesis dot co dot jp>
- To: Nick Garnett <nickg at eCosCentric dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 3 Jul 2003 17:09:54 +0900
- Subject: Re: [ECOS] How to recognise that scheduler started.
- References: <20030702174428.A30004@white.office1> <m38yrhz1x8.fsf@miso.calivar.com>
Hi, Nick;
Sorry if this mail has been sent more than two times.
Thanks for your suggestion.
I would like to reassure that I correctly understood what you mean.
For example, the following code is compliant with what you suggest?
routine(cyg_handle_t thread)
{
if (thread != cyg_thread_idle_thread())
use_kernel_serivices(); // e.g. wait on semaphore
else
no_use_kernel_serivices();
}
task
{
routine(cyg_thread_self());
}
Motoya Kurotsu
Allied Telesis K.K.
On Wed, Jul 02, 2003 at 10:57:23AM +0100, Nick Garnett wrote:
> Motoya Kurotsu <kurotsu@allied-telesis.co.jp> writes:
>
> > Hi, all;
> >
> > In my driver code, there is a routine which I would like to use
> > both at intialization and after initialization such like in
> > the follwoing manner;
> >
> > routine()
> > {
> > if (scheduler_started)
> > use_kernel_serivices(); // e.g. wait on semaphore
> > else
> > no_use_kernel_serivices();
> > }
> >
> > It seems that kernel doesn't provide a grobal variable or an external
> > function which is equivalent to 'scheduler_started' above.
> > Is there any way? Please give me your sugestion.
> >
>
> The simplest approach is probably to just pass the context in as an
> argument to the routine.
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss