diff options
author | ctruta@blackberry.com <ctruta@blackberry.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-06 12:27:37 +0000 |
---|---|---|
committer | ctruta@blackberry.com <ctruta@blackberry.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-06 12:27:37 +0000 |
commit | eda7afa19c189f1ce02a1dc3665bf20051a7e115 (patch) | |
tree | e28b00062c3eb5f459bf6eb57620d58849ae8574 | |
parent | 0a418bc7c8de942fa2fb5094e740ab17587577a3 (diff) | |
download | chromium_src-eda7afa19c189f1ce02a1dc3665bf20051a7e115.zip chromium_src-eda7afa19c189f1ce02a1dc3665bf20051a7e115.tar.gz chromium_src-eda7afa19c189f1ce02a1dc3665bf20051a7e115.tar.bz2 |
Add support for threading and atomic ops in QNX Neutrino.
BUG=
Patch by:
Eli Fidler <efidler@blackberry.com>,
Jeff Rogers <jrogers@blackberry.com>,
Cosmin Truta <ctruta@blackberry.com>.
Review URL: https://codereview.chromium.org/156233002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249390 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | PRESUBMIT.py | 1 | ||||
-rw-r--r-- | base/atomicops_internals_arm_gcc.h | 13 | ||||
-rw-r--r-- | base/threading/platform_thread_posix.cc | 2 | ||||
-rw-r--r-- | build/build_config.h | 4 |
5 files changed, 17 insertions, 4 deletions
@@ -343,6 +343,7 @@ Zheng Chuang <zhengchuangscu@gmail.com> Ziran Sun <ziran.sun@samsung.com> 方觉 (Fang Jue) <fangjue23303@gmail.com> +BlackBerry Limited <*@blackberry.com> Code Aurora Forum <*@codeaurora.org> Comodo CA Limited Google Inc. <*@google.com> diff --git a/PRESUBMIT.py b/PRESUBMIT.py index cd5baaa..714b8a7 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -249,6 +249,7 @@ _VALID_OS_MACROS = ( 'OS_NACL', 'OS_OPENBSD', 'OS_POSIX', + 'OS_QNX', 'OS_SOLARIS', 'OS_WIN', ) diff --git a/base/atomicops_internals_arm_gcc.h b/base/atomicops_internals_arm_gcc.h index 9f4fe2e..7c3d51d 100644 --- a/base/atomicops_internals_arm_gcc.h +++ b/base/atomicops_internals_arm_gcc.h @@ -9,6 +9,10 @@ #ifndef BASE_ATOMICOPS_INTERNALS_ARM_GCC_H_ #define BASE_ATOMICOPS_INTERNALS_ARM_GCC_H_ +#if defined(OS_QNX) +#include <sys/cpuinline.h> +#endif + namespace base { namespace subtle { @@ -40,10 +44,15 @@ namespace subtle { // inline void MemoryBarrier() { - // Note: This is a function call, which is also an implicit compiler - // barrier. +#if defined(OS_LINUX) || defined(OS_ANDROID) + // Note: This is a function call, which is also an implicit compiler barrier. typedef void (*KernelMemoryBarrierFunc)(); ((KernelMemoryBarrierFunc)0xffff0fa0)(); +#elif defined(OS_QNX) + __cpu_membarrier(); +#else +#error MemoryBarrier() is not implemented on this platform. +#endif } // An ARM toolchain would only define one of these depending on which diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc index 392d461..421830e 100644 --- a/base/threading/platform_thread_posix.cc +++ b/base/threading/platform_thread_posix.cc @@ -150,7 +150,7 @@ PlatformThreadId PlatformThread::CurrentId() { return syscall(__NR_gettid); #elif defined(OS_ANDROID) return gettid(); -#elif defined(OS_SOLARIS) +#elif defined(OS_SOLARIS) || defined(OS_QNX) return pthread_self(); #elif defined(OS_NACL) && defined(__GLIBC__) return pthread_self(); diff --git a/build/build_config.h b/build/build_config.h index 3784512..2a4837b 100644 --- a/build/build_config.h +++ b/build/build_config.h @@ -50,6 +50,8 @@ #elif defined(__sun) #define OS_SOLARIS 1 #define TOOLKIT_GTK +#elif defined(__QNXNTO__) +#define OS_QNX 1 #else #error Please add support for your platform in build/build_config.h #endif @@ -68,7 +70,7 @@ // more specific macro. #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ - defined(OS_NACL) + defined(OS_NACL) || defined(OS_QNX) #define OS_POSIX 1 #endif |