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>
bb10
Bradley T. Hughes 2012-02-05 13:14:23 +01:00 committed by Qt by Nokia
parent eebc124f4c
commit 43a6739beb
4 changed files with 12 additions and 84 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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>