summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/cpu.c
diff options
context:
space:
mode:
authorDaniel Krueger <daniel.krueger@systec-electronic.com>2015-03-17 14:02:59 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-10 08:12:14 +0200
commita6c5a7e0b68ea9b9eed98997b85fe49434eeb1c8 (patch)
tree7822bc369d83ffe5e97f8a01dfe8cd091b1b7a3e /cpukit/score/cpu/arm/cpu.c
parentAdd hardware FPU flags for Raspberry Pi 2 BSP (diff)
downloadrtems-a6c5a7e0b68ea9b9eed98997b85fe49434eeb1c8.tar.bz2
arm: Align ARM exception frame to 8 bytes
The stack pointer must be aligned on 8 byte boundary on ARM, so the size of the exception frame must be a multiple of 8 bytes. Otherwise we might/will get an alignment fault, when executing code in the data abort handler for example. Close #2318. Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
Diffstat (limited to 'cpukit/score/cpu/arm/cpu.c')
-rw-r--r--cpukit/score/cpu/arm/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpukit/score/cpu/arm/cpu.c b/cpukit/score/cpu/arm/cpu.c
index 9942c4a40e..944ca630c7 100644
--- a/cpukit/score/cpu/arm/cpu.c
+++ b/cpukit/score/cpu/arm/cpu.c
@@ -64,6 +64,11 @@ RTEMS_STATIC_ASSERT(
);
RTEMS_STATIC_ASSERT(
+ sizeof( CPU_Exception_frame ) % CPU_STACK_ALIGNMENT == 0,
+ CPU_Exception_frame_alignment
+);
+
+RTEMS_STATIC_ASSERT(
offsetof( CPU_Exception_frame, register_sp )
== ARM_EXCEPTION_FRAME_REGISTER_SP_OFFSET,
ARM_EXCEPTION_FRAME_REGISTER_SP_OFFSET