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 <thiago.macieira@intel.com>
!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 \
+++ /dev/null
-#
-# HP PA-RISC architecture
-#
-SOURCES += $$QT_ARCH_CPP/q_ldcw.s \
- $$QT_ARCH_CPP/qatomic_parisc.cpp
+++ /dev/null
-;/****************************************************************************
-;**
-;** 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
+++ /dev/null
-/****************************************************************************
-**
-** 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 <QtCore/qglobal.h>
-#include <QtCore/qhash.h>
-
-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<void *>(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
# 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)
+++ /dev/null
-/****************************************************************************
-**
-** 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 <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetNative()
-{ return false; }
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
-{ return false; }
-
-#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
-{ return false; }
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
-{ return false; }
-
-#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddNative()
-{ return false; }
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::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 <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::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 <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
-{
- return testAndSetOrdered(expectedValue, newValue);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
-{
- return testAndSetOrdered(expectedValue, newValue);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
-{
- return testAndSetOrdered(expectedValue, newValue);
-}
-
-// Fetch and store for pointers
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
-{
- q_atomic_lock(_q_lock);
- T *returnValue = (_q_value);
- _q_value = newValue;
- q_atomic_unlock(_q_lock);
- return returnValue;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
-{
- return fetchAndStoreOrdered(newValue);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
-{
- return fetchAndStoreOrdered(newValue);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
-{
- return fetchAndStoreOrdered(newValue);
-}
-
-// Fetch and add for pointers
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
-{
- q_atomic_lock(_q_lock);
- T *returnValue = (_q_value);
- _q_value += valueToAdd;
- q_atomic_unlock(_q_lock);
- return returnValue;
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
-{
- return fetchAndAddOrdered(valueToAdd);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
-{
- return fetchAndAddOrdered(valueToAdd);
-}
-
-template <typename T>
-Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
-{
- return fetchAndAddOrdered(valueToAdd);
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QATOMIC_PARISC_H
# endif
/*
- PA-RISC family, no revisions or variants
-*/
-// #elif defined(__parisc__)
-// # define Q_PROCESSOR_PARISC
-
-/*
POWER family, optional variant: 64-bit
There are many more known variants/revisions that we do not handle/detect.
// 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());
}
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<T> &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());
}
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;
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;
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) }
ptr = cptr.constCast<Data>();
ptr = vptr.constCast<Data>();
-#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<const volatile Data> cvptr(ptr);
QSharedPointer<const volatile Data> cvptr2(cptr);
QSharedPointer<const volatile Data> cvptr3(vptr);
cvptr3 = vptr;
ptr = qSharedPointerConstCast<Data>(cvptr);
ptr = cvptr.constCast<Data>();
-#endif
}
safetyCheck();