[PATCH 06/13] config: Add rtems_malloc_task_stack_for_idle()

Chris Johns chrisj at rtems.org
Fri Oct 7 04:29:35 UTC 2022


On 7/10/2022 3:25 pm, Sebastian Huber wrote:
> On 07.10.22 04:57, Chris Johns wrote:
>> On 6/10/2022 6:35 pm, Sebastian Huber wrote:
>>> On 06/10/2022 00:13, Chris Johns wrote:
>>>> Will the IDLE TLS size be based on the
>>>> CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE if it is not zero? This effects
>>>> libdl once it supports loading TLS based code.
>>>
>>> Currently, only the actual TLS size is used. We would have to change
>>> _TLS_Get_allocation_size() to use the maximum if it is non-zero.
>>
>> It would be good to get this sorted and in before a push is made on libdl to
>> support TLS. I think the newlib change will make TLS a visible issue in libdl in
>> 6 so it needs to be fixed.
> 
> I checked _TLS_Get_allocation_size(). It already returns the maximum size if it
> is configured:
> 
>     if ( _Thread_Maximum_TLS_size != 0 ) {
>       if ( allocation_size <= _Thread_Maximum_TLS_size ) {
>         _Assert( _Thread_Maximum_TLS_size % CPU_STACK_ALIGNMENT == 0 );
>         allocation_size = _Thread_Maximum_TLS_size;
>       } else {
>         _Internal_error( INTERNAL_ERROR_TOO_LARGE_TLS_SIZE );
>       }
>     }
> 

Thanks. I also checked and found this. It looks good to me.

Is the end of the TLS BSS area the start of the TSL space available for libdl to
use?

Chris


More information about the devel mailing list