diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-09 10:12:14 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-12 09:08:36 +0100 |
commit | f4dbf37dd432623c345f8e19f78a4eb01fcedb8b (patch) | |
tree | cb18eb86ccce8ab3fff22c9c4543ddaf9d93b183 /cpukit/include/rtems/score | |
parent | score: Simplify FP context allocation (diff) | |
download | rtems-f4dbf37dd432623c345f8e19f78a4eb01fcedb8b.tar.bz2 |
score: Simplify TLS area allocation
Use the stack area to allocate the TLS area.
Update #3835.
Diffstat (limited to 'cpukit/include/rtems/score')
-rw-r--r-- | cpukit/include/rtems/score/stack.h | 11 | ||||
-rw-r--r-- | cpukit/include/rtems/score/stackimpl.h | 4 | ||||
-rw-r--r-- | cpukit/include/rtems/score/tls.h | 25 |
3 files changed, 15 insertions, 25 deletions
diff --git a/cpukit/include/rtems/score/stack.h b/cpukit/include/rtems/score/stack.h index 1158f3472e..2ad362abd2 100644 --- a/cpukit/include/rtems/score/stack.h +++ b/cpukit/include/rtems/score/stack.h @@ -58,12 +58,19 @@ typedef struct { } Stack_Control; /** - * This variable contains the the minimum stack size; + * @brief The minimum stack size. * - * @note It is instantiated and set by User Configuration via confdefs.h. + * Application provided via <rtems/confdefs.h>. */ extern uint32_t rtems_minimum_stack_size; +/** + * @brief The configured stack space size. + * + * Application provided via <rtems/confdefs.h>. + */ +extern const uintptr_t _Stack_Space_size; + /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/score/stackimpl.h b/cpukit/include/rtems/score/stackimpl.h index 60704534c7..aafde5d1a0 100644 --- a/cpukit/include/rtems/score/stackimpl.h +++ b/cpukit/include/rtems/score/stackimpl.h @@ -23,6 +23,7 @@ #include <rtems/score/stack.h> #include <rtems/score/context.h> +#include <rtems/score/tls.h> #ifdef __cplusplus extern "C" { @@ -87,7 +88,8 @@ RTEMS_INLINE_ROUTINE bool _Stack_Is_enough( { size_t minimum; - minimum = _Stack_Minimum(); + minimum = _TLS_Get_allocation_size(); + minimum += _Stack_Minimum(); #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { diff --git a/cpukit/include/rtems/score/tls.h b/cpukit/include/rtems/score/tls.h index dadcb770ad..1b9dae11b1 100644 --- a/cpukit/include/rtems/score/tls.h +++ b/cpukit/include/rtems/score/tls.h @@ -134,30 +134,11 @@ static inline uintptr_t _TLS_Get_thread_control_block_area_size( } /** - * @brief Returns the actual size that has to be allocated for this size and - * alignment. + * @brief Return the TLS area allocation size. * - * @param size The size for the operation. - * @param alignment The alignment for the operation. - * - * @return The actual allocation size. + * @return The TLS area allocation size. */ -static inline uintptr_t _TLS_Get_allocation_size( - uintptr_t size, - uintptr_t alignment -) -{ - uintptr_t allocation_size = 0; - - allocation_size += _TLS_Heap_align_up( size ); - allocation_size += _TLS_Get_thread_control_block_area_size( alignment ); - -#ifndef __i386__ - allocation_size += sizeof(TLS_Dynamic_thread_vector); -#endif - - return allocation_size; -} +uintptr_t _TLS_Get_allocation_size( void ); /** * @brief Copies TLS size bytes from the address tls_area and returns a pointer |