From 583a1da34888c6b300de1ddc61f4c8e60e782e90 Mon Sep 17 00:00:00 2001 From: Teufelchen1 Date: Fri, 19 May 2023 11:08:08 +0200 Subject: [PATCH] cpu/arm7: Fix undefined behavior based on invalid assembly --- cpu/arm7_common/common.s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/arm7_common/common.s b/cpu/arm7_common/common.s index 1df52e62d5..6094742cac 100644 --- a/cpu/arm7_common/common.s +++ b/cpu/arm7_common/common.s @@ -101,6 +101,10 @@ task_return: /* Restore all registers, PC & cpsr */ ldmfd r0, {r0-lr}^ + /* According to ARM Architecture Reference Manual DDI 0100I, + * ldms which affect banked registers must be followed by a nop. + */ + nop /* return to task */ movs pc, lr