summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-02-05 13:14:23 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-08 12:33:26 +0100
commit43a6739beb19d33aa1b0b2920bc2fe2c0356194a (patch)
treee9cc7d69f3c1db1a6950e6d6bfed3defb7e34272
parenteebc124f4c7fd28b3e8da327dcfcda354712cce3 (diff)
Use Q_PROCESSOR_* when chosing an atomic implementation
Use the new Q_PROCESSOR_* macros to decide which headers to include in the atomic implementation. This also removes qatomic_arm.h, which isn't needed anymore, just select the correct qatomic_armv*.h from qbasicatomic.h Change-Id: I954848feafb8c420949d066ffcee1dd2b271e13b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/arch/arch.pri1
-rw-r--r--src/corelib/arch/qatomic_arm.h75
-rw-r--r--src/corelib/arch/qatomic_mips.h2
-rw-r--r--src/corelib/thread/qbasicatomic.h18
4 files changed, 12 insertions, 84 deletions
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 62b07a4a99..08ab17e0f4 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -19,7 +19,6 @@ integrity:HEADERS += arch/qatomic_integrity.h
arch/qatomic_arch.h \
arch/qatomic_generic.h \
arch/qatomic_powerpc.h \
- arch/qatomic_arm.h \
arch/qatomic_armv5.h \
arch/qatomic_armv6.h \
arch/qatomic_armv7.h \
diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h
deleted file mode 100644
index 4394765d45..0000000000
--- a/src/corelib/arch/qatomic_arm.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QATOMIC_ARM_H
-#define QATOMIC_ARM_H
-
-#if defined(__ARM_ARCH_7__) \
- || defined(__ARM_ARCH_7A__) \
- || defined(__ARM_ARCH_7R__) \
- || defined(__ARM_ARCH_7M__)
-# define QT_ARCH_ARMV7
-# include "QtCore/qatomic_armv7.h"
-#elif defined(__ARM_ARCH_6__) \
- || defined(__ARM_ARCH_6J__) \
- || defined(__ARM_ARCH_6T2__) \
- || defined(__ARM_ARCH_6Z__) \
- || defined(__ARM_ARCH_6K__) \
- || defined(__ARM_ARCH_6ZK__) \
- || defined(__ARM_ARCH_6M__) \
- || (defined(__TARGET_ARCH_ARM) && (__TARGET_ARCH_ARM-0 >= 6))
-# define QT_ARCH_ARMV6
-# include "QtCore/qatomic_armv6.h"
-#else
-# define QT_ARCH_ARMV5
-# include "QtCore/qatomic_armv5.h"
-#endif
-
-#if 0
-// silence syncqt warnings
-QT_BEGIN_HEADER
-QT_BEGIN_NAMESPACE
-
-QT_END_NAMESPACE
-QT_END_HEADER
-#endif
-
-#endif // QATOMIC_ARM_H
diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h
index af6e93d06e..39119ba411 100644
--- a/src/corelib/arch/qatomic_mips.h
+++ b/src/corelib/arch/qatomic_mips.h
@@ -227,7 +227,7 @@ T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy
return originalValue;
}
-#if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
+#if defined(Q_PROCESSOR_MIPS_64)
#define Q_ATOMIC_INT64_IS_SUPPORTED
#define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 527031bbd1..fee7561056 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -48,15 +48,19 @@
# include <QtCore/qatomic_bootstrap.h>
#elif defined(Q_CC_MSVC)
# include <QtCore/qatomic_msvc.h>
-#elif defined(__arm__) || defined(__TARGET_ARCH_ARM)
-# include <QtCore/qatomic_arm.h>
-#elif defined(__i386) || defined(__i386__)
-# include <QtCore/qatomic_i386.h>
-#elif defined(__ia64) || defined(__ia64__)
+#elif defined(Q_PROCESSOR_ARM_V7)
+# include "QtCore/qatomic_armv7.h"
+#elif defined(Q_PROCESSOR_ARM_V6)
+# include "QtCore/qatomic_armv6.h"
+#elif defined(Q_PROCESSOR_ARM_V5)
+# include "QtCore/qatomic_armv5.h"
+#elif defined(Q_PROCESSOR_IA64)
# include "QtCore/qatomic_ia64.h"
-#elif defined(__mips) || defined(__mips__)
+#elif defined(Q_PROCESSOR_MIPS)
# include "QtCore/qatomic_mips.h"
-#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64)
+#elif defined(Q_PROCESSOR_X86_32)
+# include <QtCore/qatomic_i386.h>
+#elif defined(Q_PROCESSOR_X86_64)
# include <QtCore/qatomic_x86_64.h>
#elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR)
# include <QtCore/qatomic_cxx11.h>