[En-Nut-Discussion] RFC: Moving part of the thread stuff out of the arch directory

Moritz Struebe morty at gmx.net
Fri May 30 11:51:27 CEST 2008


Hi There,

this is a RFC for moving part of the NutThreadCreate-code out of the 
arch directory.

!! Reason: !!
Quite a bit of the NutThreadCreate Code is shared between the 
architectures. Making adjustments to thread structure becomes difficult 
because all arch-dependent files must be adjusted. (Extensions may be 
assigning allocated memory to threads or other fun stuff (see recent 
discussions).)

!! Solution: !!
Part of the code is moved to a special header file. Actually it is a 
include-file, but has the ending .h for the sake of IDEs. This header 
file is in an arch independent directory an is included by the 
architecture dependent files.

The headerfile contains to functions: NutThreadGetStack and 
NutThreadStartThread. Both are static inline and are only included by 
NutThreadStart. Further more the architecture must provide an additional 
function called NutThreadLoadContext, for loading the first context 
(when no thread is running by now);

I attached a sample for the AVR. It isn't really tested yet, but it's a 
RFC. I think the other platforms can be ported quite quickly.

As it's a RFC: Comments are welcome! ;-)

Cheers
Morty
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: thread_create.h
Url: http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20080530/2fd73277/attachment.pot 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: context_gcc.c
Url: http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20080530/2fd73277/attachment.asc 



More information about the En-Nut-Discussion mailing list