diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-05-03 15:51:55 +0300 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-05-04 18:31:04 +0300 |
commit | ad51d0006a0aaf17aa61ec34221add09bfe01f0c (patch) | |
tree | 0800b3cb5f5fb77eac189dc66c48ee779ade7c53 /newlib/libc/reent | |
parent | 357d7fcc6ad1b0660e2b3131d09eb22e2559e46d (diff) |
Remove _global_impure_ptr indirection
Remove the pointer indirection through the read-only _global_impure_ptr and
directly use a externally visible _impure_data object of type struct _reent.
This enables the static initialization of global data structures in a follow up
patch. In addition, we get rid of a machine-specific file.
Diffstat (limited to 'newlib/libc/reent')
-rw-r--r-- | newlib/libc/reent/impure.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c index 76f67459e..f10665fd0 100644 --- a/newlib/libc/reent/impure.c +++ b/newlib/libc/reent/impure.c @@ -1,14 +1,5 @@ #include <reent.h> -/* Note that there is a copy of this in sys/reent.h. */ -#ifndef __ATTRIBUTE_IMPURE_PTR__ -#define __ATTRIBUTE_IMPURE_PTR__ -#endif - -#ifndef __ATTRIBUTE_IMPURE_DATA__ -#define __ATTRIBUTE_IMPURE_DATA__ -#endif - /* 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 @@ -20,9 +11,8 @@ extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE ((weak)); extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE ((weak)); #endif -static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data); +struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT (_impure_data); #ifdef __CYGWIN__ -extern struct _reent reent_data __attribute__ ((alias("impure_data"))); +extern struct _reent reent_data __attribute__ ((alias("_impure_data"))); #endif -struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data; -struct _reent *const __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data; +struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &_impure_data; |