From 0ffc89ee30372debea4b09c903350d256e213c85 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 27 Aug 2014 11:00:24 +0200 Subject: [PATCH] hw: clrex during context switch (Fixes #1196) --- repos/base-hw/src/core/spec/arm_v7/mode_transition.s | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/repos/base-hw/src/core/spec/arm_v7/mode_transition.s b/repos/base-hw/src/core/spec/arm_v7/mode_transition.s index 7566b9768..ad41f5a8c 100644 --- a/repos/base-hw/src/core/spec/arm_v7/mode_transition.s +++ b/repos/base-hw/src/core/spec/arm_v7/mode_transition.s @@ -369,6 +369,13 @@ add sp, sp, #PSR_OFFSET stm sp, {r0, r1} + /* + * Clear exclusive access in local monitor, + * as we use strex/ldrex in our cmpxchg method, we've to do this during + * a context switch (ARM Reference Manual paragraph 3.4.4.) + */ + clrex + /********************************************************* ** Kernel-entry code that is common for all exceptions ** *********************************************************/