summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authors1341 <github@shmarya.net>2016-08-10 14:57:22 +0200
committerOle André Vadla Ravnås <oleavr@gmail.com>2016-08-10 17:09:17 +0200
commited8488345eaae41c161ab741b0c44299ee99dc6c (patch)
tree00d6a7f12fa537a989a83a7b9fd6c7c6c413a7de /src
parentf03ba2032850545dc6869bb495170a8c6cbf849d (diff)
downloadlibffi-ed8488345eaae41c161ab741b0c44299ee99dc6c.tar.gz
arm: Fix cache flushing on QNX
Use `msync()` directly as `__clear_cache()` is broken in the qnx650_gcc4.8.3 toolchain.
Diffstat (limited to 'src')
-rw-r--r--src/arm/ffi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arm/ffi.c b/src/arm/ffi.c
index c24085d..124a128 100644
--- a/src/arm/ffi.c
+++ b/src/arm/ffi.c
@@ -566,8 +566,13 @@ ffi_prep_closure_loc (ffi_closure * closure,
config[1] = closure_func;
#else
memcpy (closure->tramp, ffi_arm_trampoline, 8);
+#if defined (__QNX__)
+ msync(closure->tramp, 8, 0x1000000); /* clear data map */
+ msync(codeloc, 8, 0x1000000); /* clear insn map */
+#else
__clear_cache(closure->tramp, closure->tramp + 8); /* clear data map */
__clear_cache(codeloc, codeloc + 8); /* clear insn map */
+#endif
*(void (**)(void))(closure->tramp + 8) = closure_func;
#endif