Blame SOURCES/aarch64.patch

28de58
Index: b/configure
28de58
===================================================================
28de58
--- a/configure
28de58
+++ b/configure
28de58
@@ -2858,6 +2861,9 @@
28de58
             *86_64)
28de58
                 PLATFORM=qws/linux-x86_64-g++
28de58
                 ;;
28de58
+            aarch64)
28de58
+                PLATFORM=linux-g++-aarch64
28de58
+                ;;
28de58
             *)
28de58
                 PLATFORM=qws/linux-generic-g++
28de58
                 ;;
28de58
@@ -3303,6 +3309,12 @@
28de58
             echo "    ARM (arm)"
28de58
         fi
28de58
         CFG_HOST_ARCH=arm
28de58
+	;;
28de58
+    *:*:aarch64*)
28de58
+        if [ "$OPT_VERBOSE" = "yes" ]; then
28de58
+            echo "    AArch64 (aarch64)"
28de58
+        fi
28de58
+        CFG_HOST_ARCH=aarch64
28de58
         ;;
28de58
     Linux:*:sparc*)
28de58
         if [ "$OPT_VERBOSE" = "yes" ]; then
dfeb06
diff --git a/mkspecs/linux-g++-aarch64/qmake.conf b/mkspecs/linux-g++-aarch64/qmake.conf
28de58
new file mode 100644
dfeb06
index 0000000..95611e3
28de58
--- /dev/null
28de58
+++ b/mkspecs/linux-g++-aarch64/qmake.conf
28de58
@@ -0,0 +1,28 @@
28de58
+#
28de58
+# qmake configuration for linux-g++
28de58
+#
28de58
+# Written for GNU/Linux platforms that have both lib and lib64 directories,
28de58
+# like the AMD Opteron.
28de58
+#
28de58
+
dfeb06
+MAKEFILE_GENERATOR     = UNIX
dfeb06
+TARGET_PLATFORM                = unix
dfeb06
+TEMPLATE               = app
dfeb06
+CONFIG                 += qt warn_on release incremental link_prl gdb_dwarf_index
dfeb06
+QT                     += core gui
28de58
+QMAKE_INCREMENTAL_STYLE = sublib
28de58
+
dfeb06
+QMAKE_CFLAGS           = -fpermissive
dfeb06
+QMAKE_LFLAGS           =
28de58
+
28de58
+QMAKE_CFLAGS_RELEASE   += -O2
28de58
+
28de58
+include(../common/linux.conf)
28de58
+include(../common/gcc-base-unix.conf)
28de58
+include(../common/g++-unix.conf)
28de58
+
28de58
+
28de58
+QMAKE_LIBDIR_X11      = /usr/X11R6/lib64
28de58
+QMAKE_LIBDIR_OPENGL   = /usr/X11R6/lib64
28de58
+
28de58
+load(qt_config)
dfeb06
\ No newline at end of file
dfeb06
diff --git a/mkspecs/linux-g++-aarch64/qplatformdefs.h b/mkspecs/linux-g++-aarch64/qplatformdefs.h
dfeb06
new file mode 100644
dfeb06
index 0000000..ede86e8
28de58
--- /dev/null
28de58
+++ b/mkspecs/linux-g++-aarch64/qplatformdefs.h
dfeb06
@@ -0,0 +1,44 @@
28de58
+/****************************************************************************
28de58
+**
28de58
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
28de58
+** Contact: http://www.qt-project.org/legal
28de58
+**
28de58
+** This file is part of the qmake spec of the Qt Toolkit.
28de58
+**
28de58
+** $QT_BEGIN_LICENSE:LGPL$
28de58
+** Commercial License Usage
28de58
+** Licensees holding valid commercial Qt licenses may use this file in
28de58
+** accordance with the commercial license agreement provided with the
28de58
+** Software or, alternatively, in accordance with the terms contained in
28de58
+** a written agreement between you and Digia.  For licensing terms and
28de58
+** conditions see http://qt.digia.com/licensing.  For further information
28de58
+** use the contact form at http://qt.digia.com/contact-us.
28de58
+**
28de58
+** GNU Lesser General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU Lesser
28de58
+** General Public License version 2.1 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.LGPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU Lesser General Public License version 2.1 requirements
28de58
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
28de58
+**
28de58
+** In addition, as a special exception, Digia gives you certain additional
28de58
+** rights.  These rights are described in the Digia Qt LGPL Exception
28de58
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28de58
+**
28de58
+** GNU General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU
28de58
+** General Public License version 3.0 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.GPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU General Public License version 3.0 requirements will be
28de58
+** met: http://www.gnu.org/copyleft/gpl.html.
28de58
+**
28de58
+**
28de58
+** $QT_END_LICENSE$
28de58
+**
28de58
+****************************************************************************/
28de58
+
28de58
+#include "../linux-g++/qplatformdefs.h"
28de58
+
28de58
+
dfeb06
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
dfeb06
index 4b0d779..7025f19 100644
28de58
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
28de58
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
dfeb06
@@ -221,6 +221,14 @@
dfeb06
 #define WTF_CPU_AIX64 1
28de58
 #endif
28de58
 
28de58
+/* CPU(AARCH64) - AArch64 */
28de58
+#if defined(__aarch64__)
28de58
+#define WTF_CPU_AARCH64 1
dfeb06
+#if defined(__AARCH64EB__)
dfeb06
+#define WTF_CPU_BIG_ENDIAN 1
dfeb06
+#endif
28de58
+#endif
28de58
+
dfeb06
 /* CPU(ARM) - ARM, any version*/
dfeb06
 #if   defined(arm) \
dfeb06
     || defined(__arm__) \
dfeb06
@@ -885,7 +893,7 @@
28de58
 #endif
28de58
 
28de58
 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
28de58
-#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(S390X)
28de58
+#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(S390X) || CPU(AARCH64)
28de58
 #define WTF_USE_JSVALUE64 1
28de58
 #elif CPU(ARM) || CPU(PPC64)
28de58
 #define WTF_USE_JSVALUE32 1
28de58
Index: b/src/corelib/arch/aarch64/arch.pri
28de58
===================================================================
28de58
--- /dev/null
28de58
+++ b/src/corelib/arch/aarch64/arch.pri
28de58
@@ -0,0 +1,4 @@
28de58
+#
28de58
+# AArch64 architecture
28de58
+#
28de58
+SOURCES += $$QT_ARCH_CPP/qatomic_aarch64.cpp
28de58
Index: b/src/corelib/arch/aarch64/qatomic_aarch64.cpp
28de58
===================================================================
28de58
--- /dev/null
28de58
+++ b/src/corelib/arch/aarch64/qatomic_aarch64.cpp
28de58
@@ -0,0 +1,70 @@
28de58
+/****************************************************************************
28de58
+**
28de58
+** Copyright (C) 2012, 2013 Digia Plc and/or its subsidiary(-ies).
28de58
+** Contact: http://www.qt-project.org/legal
28de58
+**
28de58
+** This file is part of the QtCore module of the Qt Toolkit.
28de58
+**
28de58
+** $QT_BEGIN_LICENSE:LGPL$
28de58
+** Commercial License Usage
28de58
+** Licensees holding valid commercial Qt licenses may use this file in
28de58
+** accordance with the commercial license agreement provided with the
28de58
+** Software or, alternatively, in accordance with the terms contained in
28de58
+** a written agreement between you and Digia.  For licensing terms and
28de58
+** conditions see http://qt.digia.com/licensing.  For further information
28de58
+** use the contact form at http://qt.digia.com/contact-us.
28de58
+**
28de58
+** GNU Lesser General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU Lesser
28de58
+** General Public License version 2.1 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.LGPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU Lesser General Public License version 2.1 requirements
28de58
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
28de58
+**
28de58
+** In addition, as a special exception, Digia gives you certain additional
28de58
+** rights.  These rights are described in the Digia Qt LGPL Exception
28de58
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28de58
+**
28de58
+** GNU General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU
28de58
+** General Public License version 3.0 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.GPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU General Public License version 3.0 requirements will be
28de58
+** met: http://www.gnu.org/copyleft/gpl.html.
28de58
+**
28de58
+**
28de58
+** $QT_END_LICENSE$
28de58
+**
28de58
+****************************************************************************/
28de58
+
28de58
+#include <QtCore/qglobal.h>
28de58
+
28de58
+#include <unistd.h>
28de58
+#ifdef _POSIX_PRIORITY_SCHEDULING
28de58
+# include <sched.h>
28de58
+#endif
28de58
+#include <time.h>
28de58
+
28de58
+QT_BEGIN_NAMESPACE
28de58
+
28de58
+QT_USE_NAMESPACE
28de58
+
28de58
+Q_CORE_EXPORT void qt_atomic_yield(int *count)
28de58
+{
28de58
+#ifdef _POSIX_PRIORITY_SCHEDULING
28de58
+    if((*count)++ < 50) {
28de58
+        sched_yield();
28de58
+    } else
28de58
+#endif
28de58
+    {
28de58
+        struct timespec tm;
28de58
+        tm.tv_sec = 0;
28de58
+        tm.tv_nsec = 2000001;
28de58
+        nanosleep(&tm, NULL);
28de58
+        *count = 0;
28de58
+    }
28de58
+}
28de58
+
28de58
+QT_END_NAMESPACE
28de58
Index: b/src/corelib/arch/arch.pri
28de58
===================================================================
28de58
--- a/src/corelib/arch/arch.pri
28de58
+++ b/src/corelib/arch/arch.pri
28de58
@@ -31,7 +31,9 @@
28de58
                        arch/qatomic_s390.h \
28de58
                        arch/qatomic_x86_64.h \
28de58
                        arch/qatomic_sh.h \
28de58
-                       arch/qatomic_sh4a.h
28de58
+                       arch/qatomic_sh4a.h \
28de58
+                       arch/qatomic_aarch64.h \
28de58
+
28de58
 
28de58
 QT_ARCH_CPP = $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH
28de58
 DEPENDPATH += $$QT_ARCH_CPP
28de58
Index: b/src/corelib/arch/qatomic_aarch64.h
28de58
===================================================================
28de58
--- /dev/null
28de58
+++ b/src/corelib/arch/qatomic_aarch64.h
28de58
@@ -0,0 +1,335 @@
28de58
+/****************************************************************************
28de58
+**
28de58
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
28de58
+** Contact: http://www.qt-project.org/legal
28de58
+**
28de58
+** This file is part of the QtCore module of the Qt Toolkit.
28de58
+**
28de58
+** $QT_BEGIN_LICENSE:LGPL$
28de58
+** Commercial License Usage
28de58
+** Licensees holding valid commercial Qt licenses may use this file in
28de58
+** accordance with the commercial license agreement provided with the
28de58
+** Software or, alternatively, in accordance with the terms contained in
28de58
+** a written agreement between you and Digia.  For licensing terms and
28de58
+** conditions see http://qt.digia.com/licensing.  For further information
28de58
+** use the contact form at http://qt.digia.com/contact-us.
28de58
+**
28de58
+** GNU Lesser General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU Lesser
28de58
+** General Public License version 2.1 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.LGPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU Lesser General Public License version 2.1 requirements
28de58
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
28de58
+**
28de58
+** In addition, as a special exception, Digia gives you certain additional
28de58
+** rights.  These rights are described in the Digia Qt LGPL Exception
28de58
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28de58
+**
28de58
+** GNU General Public License Usage
28de58
+** Alternatively, this file may be used under the terms of the GNU
28de58
+** General Public License version 3.0 as published by the Free Software
28de58
+** Foundation and appearing in the file LICENSE.GPL included in the
28de58
+** packaging of this file.  Please review the following information to
28de58
+** ensure the GNU General Public License version 3.0 requirements will be
28de58
+** met: http://www.gnu.org/copyleft/gpl.html.
28de58
+**
28de58
+**
28de58
+** $QT_END_LICENSE$
28de58
+**
28de58
+****************************************************************************/
28de58
+
28de58
+#ifndef QATOMIC_AARCH64_H
28de58
+#define QATOMIC_AARCH64_H
28de58
+
28de58
+QT_BEGIN_HEADER
28de58
+
28de58
+QT_BEGIN_NAMESPACE
28de58
+
28de58
+#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
28de58
+
28de58
+inline bool QBasicAtomicInt::isReferenceCountingNative()
28de58
+{ return true; }
28de58
+inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
28de58
+
28de58
+inline bool QBasicAtomicInt::isTestAndSetNative()
28de58
+{ return true; }
28de58
+inline bool QBasicAtomicInt::isTestAndSetWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
28de58
+
28de58
+inline bool QBasicAtomicInt::isFetchAndStoreNative()
28de58
+{ return true; }
28de58
+inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
28de58
+
28de58
+inline bool QBasicAtomicInt::isFetchAndAddNative()
28de58
+{ return true; }
28de58
+inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetNative()
28de58
+{ return true; }
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
28de58
+{ return true; }
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddNative()
28de58
+{ return true; }
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
28de58
+{ return false; }
28de58
+
28de58
+#ifndef Q_DATA_MEMORY_BARRIER
28de58
+# define Q_DATA_MEMORY_BARRIER asm volatile("dmb sy\n":::"memory")
28de58
+#endif
28de58
+#ifndef Q_COMPILER_MEMORY_BARRIER
28de58
+# define Q_COMPILER_MEMORY_BARRIER asm volatile("":::"memory")
28de58
+#endif
28de58
+
28de58
+inline bool QBasicAtomicInt::ref()
28de58
+{
28de58
+    int newValue;
28de58
+
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    newValue = __atomic_add_fetch(&_q_value, 1, __ATOMIC_ACQ_REL);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+
28de58
+    return newValue != 0;
28de58
+}
28de58
+
28de58
+inline bool QBasicAtomicInt::deref()
28de58
+{
28de58
+    int newValue;
28de58
+
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    newValue = __atomic_sub_fetch(&_q_value, 1, __ATOMIC_ACQ_REL);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+
28de58
+    return newValue != 0;
28de58
+}
28de58
+
28de58
+inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
28de58
+{
28de58
+    bool val;
28de58
+
28de58
+    Q_COMPILER_MEMORY_BARRIER;
dfeb06
+    val =  __atomic_compare_exchange_n (&_q_value, &expectedValue, newValue,
28de58
+					false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
28de58
+{
28de58
+    int val;
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    val = __atomic_exchange_n(&_q_value, newValue, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
28de58
+{
28de58
+    int val;
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    val = __atomic_fetch_add(&_q_value, valueToAdd, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
28de58
+{
28de58
+    bool val;
28de58
+    Q_COMPILER_MEMORY_BARRIER;
dfeb06
+    val =  __atomic_compare_exchange_n (&_q_value, &expectedValue, newValue,
28de58
+					false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
28de58
+{
28de58
+    T *val;
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    val = __atomic_exchange_n(&_q_value, newValue, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
28de58
+{
28de58
+    T *val;
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    val = __atomic_fetch_add(&_q_value, valueToAdd, __ATOMIC_RELAXED);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return val;
28de58
+}
28de58
+
28de58
+inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
28de58
+{
28de58
+    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return testAndSetRelaxed(expectedValue, newValue);
28de58
+}
28de58
+
28de58
+inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
28de58
+{
28de58
+    int returnValue = fetchAndStoreRelaxed(newValue);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return fetchAndStoreRelaxed(newValue);
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    int returnValue = fetchAndStoreRelaxed(newValue);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
28de58
+{
28de58
+    int returnValue = fetchAndAddRelaxed(valueToAdd);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return fetchAndAddRelaxed(valueToAdd);
28de58
+}
28de58
+
28de58
+inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    int returnValue = fetchAndAddRelaxed(valueToAdd);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
28de58
+{
28de58
+    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return testAndSetRelaxed(expectedValue, newValue);
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    bool returnValue = testAndSetAcquire(expectedValue, newValue);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
28de58
+{
28de58
+    T *returnValue = fetchAndStoreRelaxed(newValue);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return fetchAndStoreRelaxed(newValue);
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    T *returnValue = fetchAndStoreRelaxed(newValue);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
28de58
+{
28de58
+    T *returnValue = fetchAndAddRelaxed(valueToAdd);
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    return fetchAndAddRelaxed(valueToAdd);
28de58
+}
28de58
+
28de58
+template <typename T>
28de58
+Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
28de58
+{
28de58
+    Q_DATA_MEMORY_BARRIER;
28de58
+    T *returnValue = fetchAndAddRelaxed(valueToAdd);
28de58
+    Q_COMPILER_MEMORY_BARRIER;
28de58
+    return returnValue;
28de58
+}
28de58
+
28de58
+#undef Q_DATA_MEMORY_BARRIER
28de58
+#undef Q_COMPILER_MEMORY_BARRIER
28de58
+
28de58
+QT_END_NAMESPACE
28de58
+
28de58
+QT_END_HEADER
28de58
+
28de58
+#endif // QATOMIC_AARCH64_H
28de58
Index: b/src/corelib/arch/qatomic_arch.h
28de58
===================================================================
28de58
--- a/src/corelib/arch/qatomic_arch.h
28de58
+++ b/src/corelib/arch/qatomic_arch.h
28de58
@@ -92,6 +92,8 @@
28de58
 #  include "QtCore/qatomic_sh4a.h"
28de58
 #elif defined(QT_ARCH_NACL)
28de58
 #  include "QtCore/qatomic_generic.h"
28de58
+#elif defined(QT_ARCH_AARCH64)
28de58
+#  include "QtCore/qatomic_aarch64.h"
28de58
 #else
28de58
 #  error "Qt has not been ported to this architecture"
28de58
 #endif
dfeb06
diff --git a/include/QtCore/qatomic_aarch64.h b/include/QtCore/qatomic_aarch64.h
dfeb06
new file mode 100644
dfeb06
index 0000000..2049aec
dfeb06
--- /dev/null
dfeb06
+++ b/include/QtCore/qatomic_aarch64.h
dfeb06
@@ -0,0 +1 @@
dfeb06
+#include "../../src/corelib/arch/qatomic_aarch64.h"
28de58
Index: b/src/corelib/io/qfilesystemwatcher_inotify.cpp
28de58
===================================================================
28de58
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
28de58
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
28de58
@@ -138,6 +138,11 @@
28de58
 # define __NR_inotify_add_watch 285
28de58
 # define __NR_inotify_rm_watch  286
28de58
 # define __NR_inotify_init1     328
28de58
+#elif defined (__aarch64__)
28de58
+# define __NR_inotify_init1     26
28de58
+# define __NR_inotify_add_watch 27
28de58
+# define __NR_inotify_rm_watch  28
28de58
+// no inotify_init for aarch64
28de58
 #else
28de58
 # error "This architecture is not supported. Please talk to qt-bugs@trolltech.com"
28de58
 #endif
28de58
@@ -155,7 +160,11 @@
28de58
 
28de58
 static inline int inotify_init()
28de58
 {
28de58
+#ifdef __NR_inotify_init
28de58
     return syscall(__NR_inotify_init);
28de58
+#else
28de58
+    return syscall(__NR_inotify_init1, 0);
28de58
+#endif
28de58
 }
28de58
 
28de58
 static inline int inotify_add_watch(int fd, const char *name, __u32 mask)