From 771a3f29f96d2004d6d39740180a80ef93567cb8 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 10 Feb 2012 11:16:41 +0100 Subject: Remove HP PA-RISC atomic implementation. This architecture is obsolete and discontinued. Support for PA-RISC can be re-added if needed, but it would be preferred to use the GCC intrinsic support from qatomic_gcc.h (on Linux/HPPA, for example). Change-Id: I952e521a2c8c68840df0d44843b5487d5c20b135 Reviewed-by: Thiago Macieira --- src/corelib/arch/arch.pri | 1 - src/corelib/arch/parisc/arch.pri | 5 - src/corelib/arch/parisc/q_ldcw.s | 62 ----- src/corelib/arch/parisc/qatomic_parisc.cpp | 88 ------ src/corelib/arch/qatomic_arch.h | 2 - src/corelib/arch/qatomic_parisc.h | 305 --------------------- src/corelib/global/qprocessordetection.h | 6 - src/corelib/thread/qatomic.h | 12 - src/corelib/thread/qoldbasicatomic.h | 10 +- .../tools/qsharedpointer/tst_qsharedpointer.cpp | 5 - 10 files changed, 1 insertion(+), 495 deletions(-) delete mode 100644 src/corelib/arch/parisc/arch.pri delete mode 100644 src/corelib/arch/parisc/q_ldcw.s delete mode 100644 src/corelib/arch/parisc/qatomic_parisc.cpp delete mode 100644 src/corelib/arch/qatomic_parisc.h diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index b94fa01309..4803d6f8b0 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -14,7 +14,6 @@ integrity:HEADERS += arch/qatomic_integrity.h !wince*:!win32:!mac:HEADERS += arch/qatomic_alpha.h \ arch/qatomic_ia64.h \ - arch/qatomic_parisc.h \ arch/qatomic_sparc.h \ arch/qatomic_arch.h \ arch/qatomic_generic.h \ diff --git a/src/corelib/arch/parisc/arch.pri b/src/corelib/arch/parisc/arch.pri deleted file mode 100644 index fab2897f04..0000000000 --- a/src/corelib/arch/parisc/arch.pri +++ /dev/null @@ -1,5 +0,0 @@ -# -# HP PA-RISC architecture -# -SOURCES += $$QT_ARCH_CPP/q_ldcw.s \ - $$QT_ARCH_CPP/qatomic_parisc.cpp diff --git a/src/corelib/arch/parisc/q_ldcw.s b/src/corelib/arch/parisc/q_ldcw.s deleted file mode 100644 index 8af2861c50..0000000000 --- a/src/corelib/arch/parisc/q_ldcw.s +++ /dev/null @@ -1,62 +0,0 @@ -;/**************************************************************************** -;** -;** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -;** Contact: http://www.qt-project.org/ -;** -;** This file is part of the QtGui 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$ -;** -;****************************************************************************/ - .SPACE $PRIVATE$ - .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 - .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82 - .SPACE $TEXT$ - .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44 - .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY - .IMPORT $global$,DATA - .IMPORT $$dyncall,MILLICODE - .SPACE $TEXT$ - .SUBSPA $CODE$ - - .align 4 - .EXPORT q_ldcw,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR -q_ldcw - .PROC - .CALLINFO FRAME=0,CALLS,SAVE_RP - .ENTRY - ldcw 0(%r26),%r1 - bv %r0(%r2) - copy %r1,%r28 - .EXIT - .PROCEND diff --git a/src/corelib/arch/parisc/qatomic_parisc.cpp b/src/corelib/arch/parisc/qatomic_parisc.cpp deleted file mode 100644 index 5e59669b22..0000000000 --- a/src/corelib/arch/parisc/qatomic_parisc.cpp +++ /dev/null @@ -1,88 +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$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -QT_USE_NAMESPACE - -#define UNLOCKED {-1,-1,-1,-1} -#define UNLOCKED2 UNLOCKED,UNLOCKED -#define UNLOCKED4 UNLOCKED2,UNLOCKED2 -#define UNLOCKED8 UNLOCKED4,UNLOCKED4 -#define UNLOCKED16 UNLOCKED8,UNLOCKED8 -#define UNLOCKED32 UNLOCKED16,UNLOCKED16 -#define UNLOCKED64 UNLOCKED32,UNLOCKED32 -#define UNLOCKED128 UNLOCKED64,UNLOCKED64 -#define UNLOCKED256 UNLOCKED128,UNLOCKED128 - -// use a 4k page for locks -static int locks[256][4] = { UNLOCKED256 }; - -int *getLock(volatile void *addr) -{ return locks[qHash(const_cast(addr)) % 256]; } - -static int *align16(int *lock) -{ - ulong off = (((ulong) lock) % 16); - return off ? (int *)(ulong(lock) + 16 - off) : lock; -} - -extern "C" { - - int q_ldcw(volatile int *addr); - - void q_atomic_lock(int *lock) - { - // ldcw requires a 16-byte aligned address - volatile int *x = align16(lock); - while (q_ldcw(x) == 0) - ; - } - - void q_atomic_unlock(int *lock) - { lock[0] = lock[1] = lock[2] = lock[3] = -1; } -} - - -QT_END_NAMESPACE diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h index 140cb4702a..6f6d1c45a0 100644 --- a/src/corelib/arch/qatomic_arch.h +++ b/src/corelib/arch/qatomic_arch.h @@ -56,8 +56,6 @@ QT_BEGIN_HEADER # include "QtCore/qatomic_bfin.h" #elif defined(QT_ARCH_GENERIC) # include "QtCore/qatomic_generic.h" -#elif defined(QT_ARCH_PARISC) -# include "QtCore/qatomic_parisc.h" #elif defined(QT_ARCH_POWERPC) # include "QtCore/qatomic_powerpc.h" #elif defined(QT_ARCH_S390) diff --git a/src/corelib/arch/qatomic_parisc.h b/src/corelib/arch/qatomic_parisc.h deleted file mode 100644 index 221d0e36ff..0000000000 --- a/src/corelib/arch/qatomic_parisc.h +++ /dev/null @@ -1,305 +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_PARISC_H -#define QATOMIC_PARISC_H - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE - -inline bool QBasicAtomicInt::isReferenceCountingNative() -{ return false; } -inline bool QBasicAtomicInt::isReferenceCountingWaitFree() -{ return false; } - -#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE - -inline bool QBasicAtomicInt::isTestAndSetNative() -{ return false; } -inline bool QBasicAtomicInt::isTestAndSetWaitFree() -{ return false; } - -#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE - -inline bool QBasicAtomicInt::isFetchAndStoreNative() -{ return false; } -inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() -{ return false; } - -#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE - -inline bool QBasicAtomicInt::isFetchAndAddNative() -{ return false; } -inline bool QBasicAtomicInt::isFetchAndAddWaitFree() -{ return false; } - -#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() -{ return false; } -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() -{ return false; } - -#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() -{ return false; } -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() -{ return false; } - -#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() -{ return false; } -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() -{ return false; } - -extern "C" { - Q_CORE_EXPORT void q_atomic_lock(int *lock); - Q_CORE_EXPORT void q_atomic_unlock(int *lock); -} - -// Reference counting - -inline bool QBasicAtomicInt::ref() -{ - q_atomic_lock(_q_lock); - bool ret = (++_q_value != 0); - q_atomic_unlock(_q_lock); - return ret; -} - -inline bool QBasicAtomicInt::deref() -{ - q_atomic_lock(_q_lock); - bool ret = (--_q_value != 0); - q_atomic_unlock(_q_lock); - return ret; -} - -// Test-and-set for integers - -inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) -{ - q_atomic_lock(_q_lock); - if (_q_value == expectedValue) { - _q_value = newValue; - q_atomic_unlock(_q_lock); - return true; - } - q_atomic_unlock(_q_lock); - return false; -} - -inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -// Fetch-and-store for integers - -inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) -{ - q_atomic_lock(_q_lock); - int returnValue = _q_value; - _q_value = newValue; - q_atomic_unlock(_q_lock); - return returnValue; -} - -inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -// Fetch-and-add for integers - -inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) -{ - q_atomic_lock(_q_lock); - int originalValue = _q_value; - _q_value += valueToAdd; - q_atomic_unlock(_q_lock); - return originalValue; -} - -inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -// Test and set for pointers - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) -{ - q_atomic_lock(_q_lock); - if (_q_value == expectedValue) { - _q_value = newValue; - q_atomic_unlock(_q_lock); - return true; - } - q_atomic_unlock(_q_lock); - return false; -} - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -template -Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) -{ - return testAndSetOrdered(expectedValue, newValue); -} - -// Fetch and store for pointers - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) -{ - q_atomic_lock(_q_lock); - T *returnValue = (_q_value); - _q_value = newValue; - q_atomic_unlock(_q_lock); - return returnValue; -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) -{ - return fetchAndStoreOrdered(newValue); -} - -// Fetch and add for pointers - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) -{ - q_atomic_lock(_q_lock); - T *returnValue = (_q_value); - _q_value += valueToAdd; - q_atomic_unlock(_q_lock); - return returnValue; -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -template -Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) -{ - return fetchAndAddOrdered(valueToAdd); -} - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QATOMIC_PARISC_H diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index dc219e7321..bec070747f 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -141,12 +141,6 @@ # define Q_PROCESSOR_MIPS_64 # endif -/* - PA-RISC family, no revisions or variants -*/ -// #elif defined(__parisc__) -// # define Q_PROCESSOR_PARISC - /* POWER family, optional variant: 64-bit diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index b75ae94429..94cef790db 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -63,17 +63,11 @@ public: // Non-atomic API inline QAtomicInt(int value = 0) { -#ifdef QT_ARCH_PARISC - this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; -#endif _q_value = value; } inline QAtomicInt(const QAtomicInt &other) { -#ifdef QT_ARCH_PARISC - this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; -#endif store(other.load()); } @@ -123,16 +117,10 @@ class QAtomicPointer : public QBasicAtomicPointer public: inline QAtomicPointer(T *value = 0) { -#ifdef QT_ARCH_PARISC - this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; -#endif this->store(value); } inline QAtomicPointer(const QAtomicPointer &other) { -#ifdef QT_ARCH_PARISC - this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; -#endif this->store(other.load()); } diff --git a/src/corelib/thread/qoldbasicatomic.h b/src/corelib/thread/qoldbasicatomic.h index 4697da6301..2bd62f6942 100644 --- a/src/corelib/thread/qoldbasicatomic.h +++ b/src/corelib/thread/qoldbasicatomic.h @@ -61,9 +61,6 @@ QT_END_HEADER class Q_CORE_EXPORT QBasicAtomicInt { public: -#ifdef QT_ARCH_PARISC - int _q_lock[4]; -#endif #if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) union { // needed for Q_BASIC_ATOMIC_INITIALIZER volatile long _q_value; @@ -114,9 +111,6 @@ template class QBasicAtomicPointer { public: -#ifdef QT_ARCH_PARISC - int _q_lock[4]; -#endif #if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) union { T * volatile _q_value; @@ -163,9 +157,7 @@ public: T *fetchAndAddOrdered(qptrdiff valueToAdd); }; -#ifdef QT_ARCH_PARISC -# define Q_BASIC_ATOMIC_INITIALIZER(a) {{-1,-1,-1,-1},(a)} -#elif defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) +#if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) # define Q_BASIC_ATOMIC_INITIALIZER(a) { {(a)} } #else # define Q_BASIC_ATOMIC_INITIALIZER(a) { (a) } diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 6dae58a006..5b697a3509 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -1093,10 +1093,6 @@ void tst_QSharedPointer::constCorrectness() ptr = cptr.constCast(); ptr = vptr.constCast(); -#if !defined(Q_CC_HPACC) && !defined(QT_ARCH_PARISC) - // the aCC series 3 compiler we have on the PA-RISC - // machine crashes compiling this code - QSharedPointer cvptr(ptr); QSharedPointer cvptr2(cptr); QSharedPointer cvptr3(vptr); @@ -1105,7 +1101,6 @@ void tst_QSharedPointer::constCorrectness() cvptr3 = vptr; ptr = qSharedPointerConstCast(cvptr); ptr = cvptr.constCast(); -#endif } safetyCheck(); -- cgit v1.2.3