RFC Eliminate Use of Task Variables in cpukit

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Mar 7 06:08:54 UTC 2014


On 2014-03-06 20:27, Joel Sherrill wrote:
> + cpukit/libcsupport/src/privateenv.c
>    - Uses rtems_global_user_env. Switch to POSIX Keys?

We can use POSIX keys, or do some optimization:

Since applications using a file system will very likely also enable the Newlib 
re-entrancy we can re-use the __getreent() function for the file system 
environment.  In newlib_create_hook() we create a structure

struct S {
   struct _reent reent;
   rtems_user_env_t *env;
}

and assign it to thread->libc_reent;

The file system can then use

(struct S *) __getreent()

to get its file system environment.  This approach allows a slightly faster 
lock-up compared to POSIX keys and uses less memory.

+ cpukit/score/include/rtems/score/threadimpl.h

/**
  *  Self for the GNU Ada Run-Time
  */
SCORE_EXTERN void *rtems_ada_self;

This should be replaced with a function:

   void *rtems_ada_self(void)
   {
     return _Thread_Get_executing()->rtems_ada_self;
   }

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list