summaryrefslogtreecommitdiff
path: root/src/lj_mcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_mcode.c')
-rw-r--r--src/lj_mcode.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c
index a48f9e55..7857ebc0 100644
--- a/src/lj_mcode.c
+++ b/src/lj_mcode.c
@@ -29,15 +29,6 @@
void sys_icache_invalidate(void *start, size_t len);
#endif
-#if LJ_TARGET_LINUX && LJ_TARGET_PPC
-#include <dlfcn.h>
-static void (*mcode_sync_ppc)(void *start, void *end);
-static void mcode_sync_dummy(void *start, void *end)
-{
- UNUSED(start); UNUSED(end);
-}
-#endif
-
/* Synchronize data/instruction cache. */
void lj_mcode_sync(void *start, void *end)
{
@@ -48,14 +39,9 @@ void lj_mcode_sync(void *start, void *end)
UNUSED(start); UNUSED(end);
#elif LJ_TARGET_OSX
sys_icache_invalidate(start, (char *)end-(char *)start);
-#elif LJ_TARGET_LINUX && LJ_TARGET_PPC
- if (!mcode_sync_ppc) {
- void *vdso = dlopen("linux-vdso32.so.1", RTLD_LAZY);
- if (!vdso || !(mcode_sync_ppc = dlsym(vdso, "__kernel_sync_dicache")))
- mcode_sync_ppc = mcode_sync_dummy;
- }
- mcode_sync_ppc(start, end);
-#elif defined(__GNUC__) && !LJ_TARGET_PPC
+#elif LJ_TARGET_PPC
+ lj_vm_cachesync(start, end);
+#elif defined(__GNUC__)
__clear_cache(start, end);
#else
#error "Missing builtin to flush instruction cache"