diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2013-05-08 23:13:51 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2013-05-08 23:13:51 +0000 |
commit | 1b7ad41e50ce327c3258d5a33e2cb86f2c855192 (patch) | |
tree | a1822c535879d5dc3ecbdbf0c15fd11b3cb354f6 /newlib/libc/include | |
parent | ad48b1b79c64baafaa029f67ce83ed5e47286c0b (diff) | |
download | newlib-1b7ad41e50ce327c3258d5a33e2cb86f2c855192.zip newlib-1b7ad41e50ce327c3258d5a33e2cb86f2c855192.tar.gz newlib-1b7ad41e50ce327c3258d5a33e2cb86f2c855192.tar.bz2 |
2013-05-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/config.h (_REENT_GLOBAL_ATEXIT): Define for
RTEMS.
* libc/include/sys/reent.h (_reent): Use _REENT_GLOBAL_ATEXIT.
(_global_atexit): Declare if _REENT_GLOBAL_ATEXIT is defined.
* libc/reent/reent.c (_reclaim_reent): Remove atexit cleanup if
_REENT_GLOBAL_ATEXIT is defined.
(_wrapup_reent): Remove atexit handling if _REENT_GLOBAL_ATEXIT
is defined.
* libc/stdlib/__atexit.c (_global_atexit0): Define if
_REENT_GLOBAL_ATEXIT is defined.
* libc/stdlib/__call_atexit.c (_global_atexit): Define if
_REENT_GLOBAL_ATEXIT is defined.
Diffstat (limited to 'newlib/libc/include')
-rw-r--r-- | newlib/libc/include/sys/config.h | 1 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index a6528b8..b26017b 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -217,6 +217,7 @@ #if defined(__rtems__) #define __FILENAME_MAX__ 255 #define _READ_WRITE_RETURN_TYPE _ssize_t +#define _REENT_GLOBAL_ATEXIT #endif #ifndef __EXPORT diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 8b78f5b..21f02cc 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -108,10 +108,15 @@ struct _atexit { (var)->_on_exit_args._fnargs[0] = _NULL #endif -#define _REENT_INIT_ATEXIT \ +#ifdef _REENT_GLOBAL_ATEXIT +# define _REENT_INIT_ATEXIT +# define _REENT_INIT_ATEXIT_PTR(var, var0) +#else +# define _REENT_INIT_ATEXIT \ _NULL, _ATEXIT_INIT, -#define _REENT_INIT_ATEXIT_PTR(var, var0) \ +# define _REENT_INIT_ATEXIT_PTR(var, var0) \ (var)->_atexit = _NULL; _ATEXIT_INIT_PTR(var0); +#endif /* * Stdio buffers. @@ -410,9 +415,11 @@ struct _reent /* signal info */ void (**(_sig_func))(int); +# ifndef _REENT_GLOBAL_ATEXIT /* atexit stuff */ struct _atexit *_atexit; struct _atexit _atexit0; +# endif struct _glue __sglue; /* root of glue chain */ __FILE *__sf; /* file descriptors */ @@ -654,9 +661,11 @@ struct _reent } _unused; } _new; +# ifndef _REENT_GLOBAL_ATEXIT /* atexit stuff */ struct _atexit *_atexit; /* points to head of LIFO stack */ struct _atexit _atexit0; /* one guaranteed table, required by ANSI */ +# endif /* signal info */ void (**(_sig_func))(int); @@ -803,7 +812,12 @@ void _reclaim_reent _PARAMS ((struct _reent *)); #define _GLOBAL_REENT _global_impure_ptr -#define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit) +#ifdef _REENT_GLOBAL_ATEXIT +extern struct _atexit *_global_atexit; /* points to head of LIFO stack */ +# define _GLOBAL_ATEXIT _global_atexit +#else +# define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit) +#endif #ifdef __cplusplus } |