Commit 0b557da2 authored by jbriance's avatar jbriance Committed by Commit bot

[arm/Linux] Don't rely on KUSER_HELPERS feature

ARM specific CONFIG_KUSER_HELPERS kernel feature for Linux can be disabled,
and in this case, we shouldn't crash. Use a __sync_synchronize() call
instead for Linux platforms.

BUG=chromium:599051
LOG=Y

Review URL: https://codereview.chromium.org/1840203004

Cr-Commit-Position: refs/heads/master@{#35170}
parent 9da14dbe
......@@ -71,6 +71,7 @@ Jianghua Yang <jianghua.yjh@alibaba-inc.com>
Joel Stanley <joel@jms.id.au>
Johan Bergström <johan@bergstroem.nu>
Jonathan Liu <net147@gmail.com>
Julien Brianceau <jbriance@cisco.com>
JunHo Seo <sejunho@gmail.com>
Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Karl Skomski <karl@skomski.com>
......
......@@ -44,14 +44,15 @@ namespace base {
//
inline void MemoryBarrier() {
#if defined(__linux__) || defined(__ANDROID__)
#if defined(__ANDROID__)
// Note: This is a function call, which is also an implicit compiler barrier.
typedef void (*KernelMemoryBarrierFunc)();
((KernelMemoryBarrierFunc)0xffff0fa0)();
#elif defined(__QNXNTO__)
__cpu_membarrier();
#else
#error MemoryBarrier() is not implemented on this platform.
// Fallback to GCC built-in function
__sync_synchronize();
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment