|
@@ -29,15 +29,6 @@
|
|
void sys_icache_invalidate(void *start, size_t len);
|
|
void sys_icache_invalidate(void *start, size_t len);
|
|
#endif
|
|
#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. */
|
|
/* Synchronize data/instruction cache. */
|
|
void lj_mcode_sync(void *start, void *end)
|
|
void lj_mcode_sync(void *start, void *end)
|
|
{
|
|
{
|
|
@@ -48,14 +39,9 @@ void lj_mcode_sync(void *start, void *end)
|
|
UNUSED(start); UNUSED(end);
|
|
UNUSED(start); UNUSED(end);
|
|
#elif LJ_TARGET_OSX
|
|
#elif LJ_TARGET_OSX
|
|
sys_icache_invalidate(start, (char *)end-(char *)start);
|
|
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);
|
|
__clear_cache(start, end);
|
|
#else
|
|
#else
|
|
#error "Missing builtin to flush instruction cache"
|
|
#error "Missing builtin to flush instruction cache"
|