summaryrefslogtreecommitdiffstats
path: root/src/corelib/arch/qatomic_mips.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-03 20:02:03 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-07 14:32:51 +0200
commit1dca602122d551475354fed2a2673a0f61cf618f (patch)
tree56159fe1534dbfe06f7430d4f1664e5eb24b61e6 /src/corelib/arch/qatomic_mips.h
parent49278dc5a77b84c06d2456a4eafde39e6cae735c (diff)
Add a T parameter to the memory barrier functions in atomics.
This is so we can insert valgrind (helgrind) annotation macros. They require the actual address of the variable to work. Change-Id: I988f6a46385ad58143c53ad34b6cf0f58be2cdb8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/arch/qatomic_mips.h')
-rw-r--r--src/corelib/arch/qatomic_mips.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h
index 39119ba411..116906a541 100644
--- a/src/corelib/arch/qatomic_mips.h
+++ b/src/corelib/arch/qatomic_mips.h
@@ -77,9 +77,12 @@ template<> struct QAtomicIntegerTraits<unsigned int> { enum { IsInteger = 1 }; }
template <int size> struct QBasicAtomicOps: QGenericAtomicOps<QBasicAtomicOps<size> >
{
- static void acquireMemoryFence();
- static void releaseMemoryFence();
- static void orderedMemoryFence();
+ template <typename T>
+ static void acquireMemoryFence(const T &);
+ template <typename T>
+ static void releaseMemoryFence(const T &);
+ template <typename T>
+ static void orderedMemoryFence(const T &);
static inline bool isReferenceCountingNative() { return true; }
template <typename T> static bool ref(T &_q_value);
@@ -109,20 +112,20 @@ template <typename T> struct QAtomicOps : QBasicAtomicOps<sizeof(T)>
# error "please set '-march=' to your architecture (e.g., -march=mips32)"
#endif
-template <int size> inline
-void QBasicAtomicOps<size>::acquireMemoryFence()
+template <int size> template <typename T> inline
+void QBasicAtomicOps<size>::acquireMemoryFence(const T &)
{
asm volatile ("sync 0x11" ::: "memory");
}
-template <int size> inline
-void QBasicAtomicOps<size>::releaseMemoryFence()
+template <int size> template <typename T> inline
+void QBasicAtomicOps<size>::releaseMemoryFence(const T &)
{
asm volatile ("sync 0x12" ::: "memory");
}
-template <int size> inline
-void QBasicAtomicOps<size>::orderedMemoryFence()
+template <int size> template <typename T> inline
+void QBasicAtomicOps<size>::orderedMemoryFence(const T &)
{
asm volatile ("sync 0" ::: "memory");
}