[tog-pegasus/f18] Fix atomic operations on ARM

vcrhonek vcrhonek at fedoraproject.org
Tue May 7 13:58:14 UTC 2013


commit 5a4a7cf64e22c46846d2dd281f7b95d414ace4a1
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date:   Tue May 7 15:58:04 2013 +0200

    Fix atomic operations on ARM

 pegasus-2.12.1-atomic-operations-on-arm.patch |   81 +++++++++++++++++++++++++
 tog-pegasus.spec                              |    9 +++-
 2 files changed, 89 insertions(+), 1 deletions(-)
---
diff --git a/pegasus-2.12.1-atomic-operations-on-arm.patch b/pegasus-2.12.1-atomic-operations-on-arm.patch
new file mode 100644
index 0000000..25273fb
--- /dev/null
+++ b/pegasus-2.12.1-atomic-operations-on-arm.patch
@@ -0,0 +1,81 @@
+Index: src/Pegasus/Common/AtomicInt.h
+===================================================================
+RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/AtomicInt.h,v
+retrieving revision 1.23
+diff -u -r1.23 AtomicInt.h
+--- src/Pegasus/Common/AtomicInt.h	30 Jul 2012 09:23:47 -0000	1.23
++++ src/Pegasus/Common/AtomicInt.h	30 Apr 2013 14:04:53 -0000
+@@ -95,6 +95,64 @@
+ 
+ PEGASUS_NAMESPACE_END
+ 
++// if GNU GCC version >= 4.7.0, use the built-in atomic operations
++#if defined(GCC_VERSION) && GCC_VERSION >= 40700
++# define PEGASUS_ATOMIC_INT_DEFINED
++
++PEGASUS_NAMESPACE_BEGIN
++
++struct AtomicType
++{
++    volatile int n;
++};
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline AtomicIntTemplate<AtomicType>::AtomicIntTemplate(Uint32 n)
++{
++    __atomic_store_n (&_rep.n, n, __ATOMIC_SEQ_CST);
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline AtomicIntTemplate<AtomicType>::~AtomicIntTemplate()
++{
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline Uint32 AtomicIntTemplate<AtomicType>::get() const
++{
++    return __atomic_load_n (&_rep.n, __ATOMIC_SEQ_CST);
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline void AtomicIntTemplate<AtomicType>::set(Uint32 n)
++{
++    __atomic_store_n (&_rep.n, n, __ATOMIC_SEQ_CST);
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline void AtomicIntTemplate<AtomicType>::inc()
++{
++    __atomic_fetch_add (&_rep.n, 1, __ATOMIC_SEQ_CST);
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline void AtomicIntTemplate<AtomicType>::dec()
++{
++    __atomic_fetch_sub (&_rep.n, 1, __ATOMIC_SEQ_CST);
++}
++
++PEGASUS_TEMPLATE_SPECIALIZATION
++inline bool AtomicIntTemplate<AtomicType>::decAndTestIfZero()
++{
++    return (__atomic_fetch_sub (&_rep.n, 1, __ATOMIC_SEQ_CST) == 1);
++}
++
++typedef AtomicIntTemplate<AtomicType> AtomicInt;
++
++PEGASUS_NAMESPACE_END
++
++#else //!(GCC_VERSION && GCC_VERSION >= 40700), use platform specific atomics
++
+ //==============================================================================
+ //
+ // PEGASUS_PLATFORM_LINUX_IX86_GNU
+@@ -1056,6 +1114,8 @@
+ #endif /* PEGASUS_PLATFORM_AIX_RS_IBMCXX, \
+         PEGASUS_PLATFORM_PASE_ISERIES_IBMCXX */
+ 
++#endif /* GCC_VERSION && GCC_VERSION >= 40700 */
++
+ //==============================================================================
+ //
+ // Generic Implementation
diff --git a/tog-pegasus.spec b/tog-pegasus.spec
index 9bba549..228c3c4 100644
--- a/tog-pegasus.spec
+++ b/tog-pegasus.spec
@@ -8,7 +8,7 @@
 
 Name:           tog-pegasus
 Version:        %{major_ver}.0
-Release:        6%{?dist}
+Release:        7%{?dist}
 Epoch:          2
 Summary:        OpenPegasus WBEM Services for Linux
 
@@ -82,6 +82,8 @@ Patch25:        pegasus-2.12.0-empty_arrays.patch
 Patch26:        pegasus-2.12.0-cimmofl-allow-experimental.patch
 # 27: use external schema and add missing includes there
 Patch27:        pegasus-2.12.0-schema-version-and-includes.patch
+# 28: patch by D. Marlin, already upstream
+Patch28:        pegasus-2.12.1-atomic-operations-on-arm.patch
 
 BuildRequires:  bash, sed, grep, coreutils, procps, gcc, gcc-c++
 BuildRequires:  libstdc++, make, pam-devel
@@ -217,6 +219,7 @@ yes | mak/CreateDmtfSchema 233 %{SOURCE9} cim_schema_2.33.0
 %patch25 -p1 -b .empty_arrays
 %patch26 -p1 -b .cimmofl-allow-experimental
 %patch27 -p1 -b .schema-version-and-includes
+%patch28 -p0 -b .atomic-operations-on-arm
 
 
 %build
@@ -483,6 +486,10 @@ fi
 
 
 %changelog
+* Tue May 07 2013 Vitezslav Crhonek <vcrhonek at redhat.com> - 2:2.12.0-7
+- Fix atomic operations on ARM (patch by D. Marlin)
+  Resolves: #922770
+
 * Mon Feb 18 2013 Vitezslav Crhonek <vcrhonek at redhat.com> - 2:2.12.0-6
 - Fix /usr/lib/systemd* unintentionally included in -libs subpackage 
 


More information about the scm-commits mailing list