[rtems commit] score/arm: Ensure that copile time alignment is 64 bytes for Cortex-A multilib.
Pavel Pisa
ppisa at rtems.org
Sun Oct 2 08:47:07 UTC 2016
Module: rtems
Branch: 4.11
Commit: 9aaf8f2b0b3fb4b95b1a635714c13091c30e00e2
Changeset: http://git.rtems.org/rtems/commit/?id=9aaf8f2b0b3fb4b95b1a635714c13091c30e00e2
Author: Pavel Pisa <pisa at cmp.felk.cvut.cz>
Date: Sat Jul 2 14:33:11 2016 +0200
score/arm: Ensure that copile time alignment is 64 bytes for Cortex-A multilib.
Some/many Cortex-A cores have data cache line length 64 bytes and maximum
value has to be used for system structures alignment.
Updates #2782
Updates #2783
---
cpukit/score/cpu/arm/rtems/score/arm.h | 4 ++++
cpukit/score/cpu/arm/rtems/score/cpu.h | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/cpukit/score/cpu/arm/rtems/score/arm.h b/cpukit/score/cpu/arm/rtems/score/arm.h
index 6d1f850..af32fc3 100644
--- a/cpukit/score/cpu/arm/rtems/score/arm.h
+++ b/cpukit/score/cpu/arm/rtems/score/arm.h
@@ -53,6 +53,10 @@ extern "C" {
#define ARM_MULTILIB_HAS_THREAD_ID_REGISTER
#endif
+#if defined(__ARM_ARCH_7A__)
+ #define ARM_MULTILIB_CACHE_LINE_MAX_64
+#endif
+
#if !defined(__SOFTFP__)
#if defined(__ARM_NEON__)
#define ARM_MULTILIB_VFP_D32
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index 9dc4d07..25d4ee2 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -145,8 +145,13 @@
#define CPU_STACK_GROWS_UP FALSE
-/* XXX Why 32? */
-#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (32)))
+#if defined(ARM_MULTILIB_CACHE_LINE_MAX_64)
+ #define CPU_CACHE_LINE_BYTES 32
+#else
+ #define CPU_CACHE_LINE_BYTES 64
+#endif
+
+#define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (CPU_CACHE_LINE_BYTES )))
#define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC TRUE
More information about the vc
mailing list