[PATCH 2/2] rtems: Relax partition buffer area alignment

Gedare Bloom gedare at rtems.org
Thu Aug 2 13:58:38 UTC 2018


nvm I see the doc patch, thanks

On Thu, Aug 2, 2018 at 9:58 AM, Gedare Bloom <gedare at rtems.org> wrote:
> This makes sense. Probably there is some documentation in c-user
> manual that needs tweaking.
>
> On Thu, Aug 2, 2018 at 8:55 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
>> The partition buffer area alignment required by rtems_partition_create()
>> was too strict since it was checked via _Addresses_Is_aligned() which
>> uses CPU_ALIGNMENT.  The CPU_ALIGNMENT must take long double and vector
>> data type alignment requirements into account.  For the partition
>> maintenance only pointer alignment is required (Chain_Node, which
>> consists of two pointers). The user should ensure that its partition
>> buffer area is suitable for the items it wants to manage.  The user
>> should not be burdened to provide buffers with the maximum architecture
>> alignment, e.g. why need a 16 byte aligned buffer if you want to manage
>> items with 4 byte integers only?
>>
>> Update #3482.
>> ---
>>  cpukit/rtems/src/partcreate.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
>> index c058adff1f..9484ccb1c3 100644
>> --- a/cpukit/rtems/src/partcreate.c
>> +++ b/cpukit/rtems/src/partcreate.c
>> @@ -68,8 +68,8 @@ rtems_status_code rtems_partition_create(
>>           !_Partition_Is_buffer_size_aligned( buffer_size ) )
>>      return RTEMS_INVALID_SIZE;
>>
>> -  if ( !_Addresses_Is_aligned( starting_address ) )
>> -     return RTEMS_INVALID_ADDRESS;
>> +  if ( !_Partition_Is_buffer_area_aligned( starting_address ) )
>> +    return RTEMS_INVALID_ADDRESS;
>>
>>  #if defined(RTEMS_MULTIPROCESSING)
>>    if ( _Attributes_Is_global( attribute_set ) &&
>> --
>> 2.13.7
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list