diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-07 20:30:30 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-11 09:05:07 +0100 |
commit | cc466a53a1a5ce1d5cce848cc3a24bef5afacc2d (patch) | |
tree | f3a4f4ebb59c047450c771a0f3b40826933cdbe3 /cpukit/include/rtems/score/tls.h | |
parent | bb99cd0d83ae32e1f222bf2c8235a8f95128815d (diff) |
score: Optimize _TLS_Get_size()
Diffstat (limited to 'cpukit/include/rtems/score/tls.h')
-rw-r--r-- | cpukit/include/rtems/score/tls.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpukit/include/rtems/score/tls.h b/cpukit/include/rtems/score/tls.h index 941de715d7..dadcb770ad 100644 --- a/cpukit/include/rtems/score/tls.h +++ b/cpukit/include/rtems/score/tls.h @@ -87,15 +87,20 @@ typedef struct { /** * @brief Gets the TLS size. * - * @return the TLS size. + * @return The TLS size. */ static inline uintptr_t _TLS_Get_size( void ) { + uintptr_t size; + /* - * Do not use _TLS_Size here since this will lead GCC to assume that this - * symbol is not 0 and the tests for 0 will be optimized away. + * We must be careful with using _TLS_Size here since this could lead GCC to + * assume that this symbol is not 0 and the tests for 0 will be optimized + * away. */ - return (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; + size = (uintptr_t) _TLS_Size; + RTEMS_OBFUSCATE_VARIABLE( size ); + return size; } /** |