[rtems commit] rtems: Relax partition buffer area alignment

Sebastian Huber sebh at rtems.org
Fri Aug 3 11:04:32 UTC 2018


Module:    rtems
Branch:    master
Commit:    83ca9f0a77dff9eee3ca3046430ceeba7cc323f2
Changeset: http://git.rtems.org/rtems/commit/?id=83ca9f0a77dff9eee3ca3046430ceeba7cc323f2

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Aug  2 14:52:12 2018 +0200

rtems: Relax partition buffer area alignment

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 2facb42..2134b99 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -79,8 +79,8 @@ rtems_status_code rtems_partition_create(
   if ( buffer_size < sizeof( Chain_Node ) )
     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 ) &&




More information about the vc mailing list