public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] uITRON implementation
@ 2000-08-02 18:40 Fabrice Gautier
  2000-08-03  5:21 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Gautier @ 2000-08-02 18:40 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

Apparently, the eCos implementation of uITRON only provide static
initialisation for the tasks' stack. Is this a uITRON "feature"? Or is this
an eCos "feature" ?

Idem for semaphores and message box.

Thank you

A+

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] uITRON implementation
  2000-08-02 18:40 [ECOS] uITRON implementation Fabrice Gautier
@ 2000-08-03  5:21 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2000-08-03  5:21 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Ecos-List (E-mail)

Fabrice Gautier wrote:
> 
> Apparently, the eCos implementation of uITRON only provide static
> initialisation for the tasks' stack. Is this a uITRON "feature"? Or is this
> an eCos "feature" ?
> 
> Idem for semaphores and message box.

It's an eCos "feature". I thought you maybe could get away with changing
CYGDAT_UITRON_TASK_EXTERNS to use extern char *'s, but I don't think that
would work.

As far as I know, no-one is working on getting this to work with either
uItron variable memory pools or just plain malloc, so feel free to go ahead
and try this. If you do this in a suitably generic way, obviously we could
accept your changes into the main sources.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] uITRON implementation
  2000-08-03 12:50 Fabrice Gautier
@ 2000-08-04  5:23 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2000-08-04  5:23 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Ecos-List (E-mail)

Fabrice Gautier wrote:
> 
> > -----Original Message-----
> > From: Jonathan Larmour [ mailto:jlarmour@redhat.co.uk ]
> > Subject: Re: [ECOS] uITRON implementation
> 
> The tasks structures are allocated statically too, right?
> And same thing for semaphores and event flags ,
> And for Msg Box both control structure and buffer are allocated statically.
> 
> Is that all right?
> 
> And for memory-pools ?
> It seems this is the same situation than with tasks (just replace "stack" by
> "memory aera")
> So i would have to do the same kind of thing.

Yes.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] uITRON implementation
@ 2000-08-03 12:50 Fabrice Gautier
  2000-08-04  5:23 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Gautier @ 2000-08-03 12:50 UTC (permalink / raw)
  To: 'Jonathan Larmour', Fabrice Gautier; +Cc: Ecos-List (E-mail)

> -----Original Message-----
> From: Jonathan Larmour [ mailto:jlarmour@redhat.co.uk ]
> Subject: Re: [ECOS] uITRON implementation

The tasks structures are allocated statically too, right? 
And same thing for semaphores and event flags , 
And for Msg Box both control structure and buffer are allocated statically.

Is that all right?

And for memory-pools ?
It seems this is the same situation than with tasks (just replace "stack" by
"memory aera")
So i would have to do the same kind of thing.

Thanks

A+
-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] uITRON implementation
  2000-08-03 11:56 Fabrice Gautier
@ 2000-08-03 12:13 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2000-08-03 12:13 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Ecos-List (E-mail)

Fabrice Gautier wrote:
> 
> > -----Original Message-----
> > From: Jonathan Larmour [ mailto:jlarmour@redhat.co.uk ]
> > Subject: Re: [ECOS] uITRON implementation
> >
> > It's an eCos "feature". I thought you maybe could get away
> > with changing
> > CYGDAT_UITRON_TASK_EXTERNS to use extern char *'s, but I
> > don't think that would work.
> 
> About this Macro, there is:
> 
> extern "C" void task1( unsigned int ); \
> extern "C" void task2( unsigned int ); \
> extern "C" void task3( unsigned int ); \
> extern "C" void task4( unsigned int ); \
> static char stack1[ CYGNUM_UITRON_STACK_SIZE ], \
> stack2[ CYGNUM_UITRON_STACK_SIZE ], \
> stack3[ CYGNUM_UITRON_STACK_SIZE ], \
> stack4[ CYGNUM_UITRON_STACK_SIZE ];
> 
> and in CYGDAT_UITRON_TASK_INITIALIZERS:
> 
> CYG_UIT_TASK( "t1", 1, task1, &stack1, CYGNUM_UITRON_STACK_SIZE ), \
> CYG_UIT_TASK( "t2", 2, task2, &stack2, CYGNUM_UITRON_STACK_SIZE ), \
> CYG_UIT_TASK( "t3", 3, task3, &stack3, CYGNUM_UITRON_STACK_SIZE ), \
> CYG_UIT_TASK( "t4", 4, task4, &stack4, CYGNUM_UITRON_STACK_SIZE ),
> 
> Does the 4 task described here are all the task in the system or only the
> task created at startup ?
>
> The first case seems improbable because that would mean the task not yet
> created should ne named task1() task2() ...
> 
> The second case seems improbable too because the staks fot the task not yet
> created are not allocated.

In the example above the 4 tasks are all the tasks in the system and are
created at startup. Tasks that are to be used with create/delete semantics
instead need to use the macro CYG_UIT_TASK_NOEXS, with the syntax e.g.:

CYG_UIT_TASK_NOEXS( "t5", &stack4, CYGNUM_UITRON_STACK_SIZE ),

i.e. you still specify the stack information. See the definition of cre_tsk
in <cyg/compat/uitron/uit_func.inl>.
 
> Or should I read:
> > extern "C" void task1( unsigned int ); \
> > extern "C" void task2( unsigned int ); \
> > extern "C" void task3( unsigned int ); \
> > extern "C" void task4( unsigned int ); \
> ==> Task created initially

Yes.

> static char stack1[ CYGNUM_UITRON_STACK_SIZE ], \
> stack2[ CYGNUM_UITRON_STACK_SIZE ], \
> stack3[ CYGNUM_UITRON_STACK_SIZE ], \
> stack4[ CYGNUM_UITRON_STACK_SIZE ];
> ==> Stack for all task in the system
> (in the configuration default task created at start=total task in system so
> ...)

Yes.

Perhaps you could change cre_tsk() to call malloc if p->get_stack_base() is
NULL, and then in the instantiations in your configuration, you pass NULL
for the stack size.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] uITRON implementation
@ 2000-08-03 11:56 Fabrice Gautier
  2000-08-03 12:13 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Gautier @ 2000-08-03 11:56 UTC (permalink / raw)
  To: 'Jonathan Larmour', Fabrice Gautier; +Cc: Ecos-List (E-mail)

> -----Original Message-----
> From: Jonathan Larmour [ mailto:jlarmour@redhat.co.uk ]
> Subject: Re: [ECOS] uITRON implementation
> 
> It's an eCos "feature". I thought you maybe could get away 
> with changing
> CYGDAT_UITRON_TASK_EXTERNS to use extern char *'s, but I 
> don't think that would work.

About this Macro, there is:

extern "C" void task1( unsigned int ); \
extern "C" void task2( unsigned int ); \
extern "C" void task3( unsigned int ); \
extern "C" void task4( unsigned int ); \
static char stack1[ CYGNUM_UITRON_STACK_SIZE ], \
stack2[ CYGNUM_UITRON_STACK_SIZE ], \
stack3[ CYGNUM_UITRON_STACK_SIZE ], \
stack4[ CYGNUM_UITRON_STACK_SIZE ];

and in CYGDAT_UITRON_TASK_INITIALIZERS:

CYG_UIT_TASK( "t1", 1, task1, &stack1, CYGNUM_UITRON_STACK_SIZE ), \
CYG_UIT_TASK( "t2", 2, task2, &stack2, CYGNUM_UITRON_STACK_SIZE ), \
CYG_UIT_TASK( "t3", 3, task3, &stack3, CYGNUM_UITRON_STACK_SIZE ), \
CYG_UIT_TASK( "t4", 4, task4, &stack4, CYGNUM_UITRON_STACK_SIZE ),

Does the 4 task described here are all the task in the system or only the
task created at startup ?

The first case seems improbable because that would mean the task not yet
created should ne named task1() task2() ...

The second case seems improbable too because the staks fot the task not yet
created are not allocated.

Or should I read:
> extern "C" void task1( unsigned int ); \
> extern "C" void task2( unsigned int ); \
> extern "C" void task3( unsigned int ); \
> extern "C" void task4( unsigned int ); \
==> Task created initially
static char stack1[ CYGNUM_UITRON_STACK_SIZE ], \
stack2[ CYGNUM_UITRON_STACK_SIZE ], \
stack3[ CYGNUM_UITRON_STACK_SIZE ], \
stack4[ CYGNUM_UITRON_STACK_SIZE ];
==> Stack for all task in the system
(in the configuration default task created at start=total task in system so
...)

Thanks

A+
-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-08-04  5:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-02 18:40 [ECOS] uITRON implementation Fabrice Gautier
2000-08-03  5:21 ` Jonathan Larmour
2000-08-03 11:56 Fabrice Gautier
2000-08-03 12:13 ` Jonathan Larmour
2000-08-03 12:50 Fabrice Gautier
2000-08-04  5:23 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).