diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-02 14:49:01 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-08-02 15:33:00 +0200 |
commit | 27bbc0598b4f1a85321fbc47d0f8446e37ea0d12 (patch) | |
tree | 80e1367a979a1046d0285bbed60e814aa8696951 /cpukit/include/rtems/rtems | |
parent | bsp/riscv: Add missing BSP variant (diff) | |
download | rtems-27bbc0598b4f1a85321fbc47d0f8446e37ea0d12.tar.bz2 |
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.
Diffstat (limited to 'cpukit/include/rtems/rtems')
-rw-r--r-- | cpukit/include/rtems/rtems/partimpl.h | 20 |
1 files changed, 10 insertions, 10 deletions
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; } /** |