[rtems commit] bsps/powerpc: Unconditionally clear reservations

Sebastian Huber sebh at rtems.org
Tue Dec 3 11:52:17 UTC 2013


Module:    rtems
Branch:    master
Commit:    057c294afdffc0c0f9a4a2d7b6b6cdecf7487f1e
Changeset: http://git.rtems.org/rtems/commit/?id=057c294afdffc0c0f9a4a2d7b6b6cdecf7487f1e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Dec  3 09:55:52 2013 +0100

bsps/powerpc: Unconditionally clear reservations

---

 c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S |   15 ++++++++-------
 1 files 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 c40803a..73dbc87 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)




More information about the vc mailing list