Fix atomic operations on ARM
This commit is contained in:
parent
6fb76860d5
commit
71a9ad6a8c
81
pegasus-2.12.1-atomic-operations-on-arm.patch
Normal file
81
pegasus-2.12.1-atomic-operations-on-arm.patch
Normal file
@ -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
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Name: tog-pegasus
|
Name: tog-pegasus
|
||||||
Version: %{major_ver}.1
|
Version: %{major_ver}.1
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Summary: OpenPegasus WBEM Services for Linux
|
Summary: OpenPegasus WBEM Services for Linux
|
||||||
|
|
||||||
@ -78,6 +78,8 @@ Patch24: pegasus-2.12.0-empty_arrays.patch
|
|||||||
Patch25: pegasus-2.12.0-cimmofl-allow-experimental.patch
|
Patch25: pegasus-2.12.0-cimmofl-allow-experimental.patch
|
||||||
# 26: use external schema and add missing includes there
|
# 26: use external schema and add missing includes there
|
||||||
Patch26: pegasus-2.12.0-schema-version-and-includes.patch
|
Patch26: pegasus-2.12.0-schema-version-and-includes.patch
|
||||||
|
# 27: patch by D. Marlin, already upstream
|
||||||
|
Patch27: pegasus-2.12.1-atomic-operations-on-arm.patch
|
||||||
|
|
||||||
BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++
|
BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++
|
||||||
BuildRequires: libstdc++, make, pam-devel
|
BuildRequires: libstdc++, make, pam-devel
|
||||||
@ -209,6 +211,7 @@ yes | mak/CreateDmtfSchema 233 %{SOURCE9} cim_schema_2.33.0
|
|||||||
%patch24 -p1 -b .empty_arrays
|
%patch24 -p1 -b .empty_arrays
|
||||||
%patch25 -p1 -b .cimmofl-allow-experimental
|
%patch25 -p1 -b .cimmofl-allow-experimental
|
||||||
%patch26 -p1 -b .schema-version-and-includes
|
%patch26 -p1 -b .schema-version-and-includes
|
||||||
|
%patch27 -p0 -b .atomic-operations-on-arm
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -475,6 +478,10 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 07 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2:2.12.1-3
|
||||||
|
- Fix atomic operations on ARM (patch by D. Marlin)
|
||||||
|
Resolves: #922770
|
||||||
|
|
||||||
* Thu Apr 25 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2:2.12.1-2
|
* Thu Apr 25 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2:2.12.1-2
|
||||||
- Add -fno-strict-aliasing
|
- Add -fno-strict-aliasing
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user