From 27bbc0598b4f1a85321fbc47d0f8446e37ea0d12 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 2 Aug 2018 14:49:01 +0200 Subject: score: Remove CPU_PARTITION_ALIGNMENT Use the CPU_SIZEOF_POINTER alignment instead. The internal alignment requirement is defined by the use of Chain_Node (consisting of two pointers) to manage the free chain of partitions. It seems that previously the condition CPU_PARTITION_ALIGNMENT >= sizeof(Chain_Node) was true on all CPU ports. Now, we need an additional check. Update #3482. --- cpukit/include/rtems/rtems/partimpl.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cpukit/include/rtems/rtems') diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h index 13ee86b4c2..ff857708f0 100644 --- a/cpukit/include/rtems/rtems/partimpl.h +++ b/cpukit/include/rtems/rtems/partimpl.h @@ -110,18 +110,18 @@ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_valid ( ); } -/** - * @brief Checks if partition is buffer size aligned. - * - * This function returns TRUE if the use of the specified buffer_size - * will result in the allocation of buffers whose first byte is - * properly aligned, and FALSE otherwise. - */ -RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( - uint32_t buffer_size +RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned( + uint32_t buffer_size +) +{ + return (buffer_size % CPU_SIZEOF_POINTER) == 0; +} + +RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_area_aligned( + const void *starting_address ) { - return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); + return (((uintptr_t) starting_address) % CPU_SIZEOF_POINTER) == 0; } /** -- cgit v1.2.3