File indexing completed on 2025-05-11 08:24:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifdef HAVE_CONFIG_H
0018 #include "config.h"
0019 #endif
0020
0021 #include <rtems.h>
0022
0023 #if defined(RTEMS_NEWLIB)
0024
0025 #include <sys/reent.h>
0026 #include <stdlib.h>
0027 #include <string.h>
0028
0029 #include <rtems/libcsupport.h>
0030 #include <rtems/score/threadimpl.h>
0031
0032 #ifndef _REENT_THREAD_LOCAL
0033 bool newlib_create_hook(
0034 rtems_tcb *current_task RTEMS_UNUSED,
0035 rtems_tcb *creating_task
0036 )
0037 {
0038 _REENT_INIT_PTR((creating_task->libc_reent));
0039
0040 return true;
0041 }
0042 #endif
0043
0044 void newlib_terminate_hook(
0045 rtems_tcb *current_task
0046 )
0047 {
0048 #ifdef _REENT_THREAD_LOCAL
0049 _reclaim_reent(NULL);
0050 #else
0051 _reclaim_reent(current_task->libc_reent);
0052 #endif
0053 }
0054
0055 #endif