2000-02-18 03:39:52 +08:00
|
|
|
#include <reent.h>
|
|
|
|
|
Add --enable-newlib-reent-thread-local option
By default, Newlib uses a huge object of type struct _reent to store
thread-specific data. This object is returned by __getreent() if the
__DYNAMIC_REENT__ Newlib configuration option is defined.
The reentrancy structure contains for example errno and the standard input,
output, and error file streams. This means that if an application only uses
errno it has a dependency on the file stream support even if it does not use
it. This is an issue for lower end targets and applications which need to
qualify the software according to safety standards (for example ECSS-E-ST-40C,
ECSS-Q-ST-80C, IEC 61508, ISO 26262, DO-178, DO-330, DO-333).
If the new _REENT_THREAD_LOCAL configuration option is enabled, then struct
_reent is replaced by dedicated thread-local objects for each struct _reent
member. The thread-local objects are defined in translation units which use
the corresponding object.
2022-05-16 17:51:54 +08:00
|
|
|
#ifndef _REENT_THREAD_LOCAL
|
|
|
|
|
2009-04-22 02:38:53 +08:00
|
|
|
/* Redeclare these symbols locally as weak so that the file containing
|
|
|
|
their definitions (along with a lot of other stuff) isn't sucked in
|
|
|
|
unless they are actually used by other compilation units. This is
|
|
|
|
important to reduce image size for targets with very small amounts
|
|
|
|
of memory. */
|
|
|
|
#ifdef _REENT_SMALL
|
2022-05-18 02:39:35 +08:00
|
|
|
extern __FILE __sf[3] _ATTRIBUTE ((weak));
|
|
|
|
#endif
|
2009-04-22 02:38:53 +08:00
|
|
|
|
2022-05-03 20:51:55 +08:00
|
|
|
struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT (_impure_data);
|
2004-09-16 05:44:39 +08:00
|
|
|
#ifdef __CYGWIN__
|
2022-05-03 20:51:55 +08:00
|
|
|
extern struct _reent reent_data __attribute__ ((alias("_impure_data")));
|
2004-09-16 05:44:39 +08:00
|
|
|
#endif
|
2022-05-03 20:51:55 +08:00
|
|
|
struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &_impure_data;
|
Add --enable-newlib-reent-thread-local option
By default, Newlib uses a huge object of type struct _reent to store
thread-specific data. This object is returned by __getreent() if the
__DYNAMIC_REENT__ Newlib configuration option is defined.
The reentrancy structure contains for example errno and the standard input,
output, and error file streams. This means that if an application only uses
errno it has a dependency on the file stream support even if it does not use
it. This is an issue for lower end targets and applications which need to
qualify the software according to safety standards (for example ECSS-E-ST-40C,
ECSS-Q-ST-80C, IEC 61508, ISO 26262, DO-178, DO-330, DO-333).
If the new _REENT_THREAD_LOCAL configuration option is enabled, then struct
_reent is replaced by dedicated thread-local objects for each struct _reent
member. The thread-local objects are defined in translation units which use
the corresponding object.
2022-05-16 17:51:54 +08:00
|
|
|
|
|
|
|
#endif /* _REENT_THREAD_LOCAL */
|