summaryrefslogtreecommitdiffstats
path: root/src/corelib/arch/symbian/qatomic_symbian.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/arch/symbian/qatomic_symbian.cpp')
-rw-r--r--src/corelib/arch/symbian/qatomic_symbian.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp
new file mode 100644
index 0000000..bcb0bd4
--- /dev/null
+++ b/src/corelib/arch/symbian/qatomic_symbian.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_EMBEDDED_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qatomic.h>
+
+#if defined(Q_CC_RVCT)
+
+#include "../arm/qatomic_arm.cpp"
+
+QT_BEGIN_NAMESPACE
+
+// This declspec needs to be explicit. RVCT has a bug which prevents embedded
+// assembler functions from being exported (normally all functions are
+// exported, and Q_CORE_EXPORT resolves to nothing).
+__declspec(dllexport) __asm char q_atomic_swp(volatile char *ptr, char newval)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swpb r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+__declspec(dllexport) __asm int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swp r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+QT_END_NAMESPACE
+
+#endif // Q_CC_RVCT
+