From 057c294afdffc0c0f9a4a2d7b6b6cdecf7487f1e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 3 Dec 2013 09:55:52 +0100 Subject: bsps/powerpc: Unconditionally clear reservations --- c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S b/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S index c40803ac2a..73dbc87f42 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S +++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S @@ -267,18 +267,19 @@ PROC (_CPU_Context_switch): mfmsr r5 mflr r6 mfcr r7 -#if defined(RTEMS_MULTIPROCESSING) || defined(RTEMS_SMP) + /* * We have to clear the reservation of the executing thread. See also - * Book E section 6.1.6.2 "Atomic Update Primitives". + * Book E section 6.1.6.2 "Atomic Update Primitives". Recent GCC + * versions use atomic operations in the C++ library for example. */ - #if PPC_CONTEXT_OFFSET_GPR1 != PPC_CONTEXT_CACHE_LINE_0 \ - || !BSP_DATA_CACHE_ENABLED \ - || PPC_CACHE_ALIGNMENT != 32 +#if PPC_CONTEXT_OFFSET_GPR1 != PPC_CONTEXT_CACHE_LINE_0 \ + || !BSP_DATA_CACHE_ENABLED \ + || PPC_CACHE_ALIGNMENT != 32 li r10, PPC_CONTEXT_OFFSET_GPR1 - #endif - stwcx. r1, r3, r10 #endif + stwcx. r1, r3, r10 + stw r1, PPC_CONTEXT_OFFSET_GPR1(r3) stw r5, PPC_CONTEXT_OFFSET_MSR(r3) stw r6, PPC_CONTEXT_OFFSET_LR(r3) -- cgit v1.2.3