$OpenBSD: patch-src_arm_ffi_c,v 1.8 2018/01/22 06:28:00 bcallah Exp $

https://svnweb.freebsd.org/ports/head/devel/libffi/files/patch-src__arm__ffi.c?revision=337118&view=markup

Index: src/arm/ffi.c
--- src/arm/ffi.c.orig
+++ src/arm/ffi.c
@@ -33,6 +33,11 @@
 
 #include <stdlib.h>
 
+#ifdef __arm__
+#include <machine/sysarch.h>
+#include <stdint.h>
+#endif
+
 /* Forward declares. */
 static int vfp_type_p (ffi_type *);
 static void layout_vfp_args (ffi_cif *);
@@ -750,6 +755,16 @@ ffi_closure_free (void *ptr)
 }
 
 #else
+
+#ifdef __arm__
+#define __clear_cache(start, end) do {					\
+		struct arm_sync_icache_args ua;				\
+									\
+		ua.addr = (uintptr_t)(start);				\
+		ua.len = (char *)(end) - (char *)start;			\
+		sysarch(ARM_SYNC_ICACHE, &ua);				\
+	} while (0);
+#endif
 
 #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)				\
 ({ unsigned char *__tramp = (unsigned char*)(TRAMP);			\
