summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/include/confdefs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-17 11:44:55 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-17 13:09:49 +0200
commit9c9b62d8ddc9d61abad5106b819bb3ca9912d572 (patch)
tree1d1fb30e471d55ee053b6d98f31b6dde500bc374 /cpukit/sapi/include/confdefs.h
parentscore: Add _Thread_Get_executing() (diff)
downloadrtems-9c9b62d8ddc9d61abad5106b819bb3ca9912d572.tar.bz2
score: Changes due to Newlib __DYNAMIC_REENT__
Delete _Thread_libc_reent and add __getreent() instead according to __DYNAMIC_REENT__ define. For SMP configurations __DYNAMIC_REENT__ must be defined. A Newlib including the following patch is required: 2013-07-09 Sebastian Huber <sebastian.huber@embedded-brains.de> * libc/include/sys/config.h (__DYNAMIC_REENT__): Define for RTEMS.
Diffstat (limited to 'cpukit/sapi/include/confdefs.h')
-rw-r--r--cpukit/sapi/include/confdefs.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index bf9f5e8d6f..1585548e7c 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -61,6 +61,10 @@
#include <bsp.h>
#endif
+#ifdef RTEMS_NEWLIB
+ #include <sys/reent.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -1650,6 +1654,16 @@ const rtems_libio_helper rtems_fs_init_helper =
#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
#endif
+#if defined(RTEMS_NEWLIB) && defined(__DYNAMIC_REENT__)
+ struct _reent *__getreent(void)
+ {
+ #ifdef CONFIGURE_DISABLE_NEWLIB_REENTRANCY
+ return _GLOBAL_REENT;
+ #else
+ return _Thread_Get_executing()->libc_reent;
+ #endif
+ }
+#endif
#endif
@@ -1939,8 +1953,6 @@ const rtems_libio_helper rtems_fs_init_helper =
*/
#if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
- #include <reent.h>
-
#define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \
_Configure_From_workspace(sizeof(struct _reent))
#else