summaryrefslogtreecommitdiffstats
path: root/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch')
-rw-r--r--meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch
new file mode 100644
index 0000000..7efa58e
--- /dev/null
+++ b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch
@@ -0,0 +1,37 @@
1Index: libffi-3.0.13/src/arm/ffi.c
2===================================================================
3--- libffi-3.0.13.orig/src/arm/ffi.c
4+++ libffi-3.0.13/src/arm/ffi.c
5@@ -582,6 +582,7 @@ ffi_closure_free (void *ptr)
6
7 #else
8
9+#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__))
10 #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
11 ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
12 unsigned int __fun = (unsigned int)(FUN); \
13@@ -595,7 +596,23 @@ ffi_closure_free (void *ptr)
14 /* Clear instruction \
15 mapping. */ \
16 })
17-
18+#else /* armv7 big endian: be8 instructions are still little endian */
19+#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
20+({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
21+ unsigned int __fun = (unsigned int)(FUN); \
22+ unsigned int __ctx = (unsigned int)(CTX); \
23+ unsigned char *insns = (unsigned char *)(CTX); \
24+ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \
25+ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \
26+ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \
27+ *(unsigned int*) &__tramp[12] = __ctx; \
28+ *(unsigned int*) &__tramp[16] = __fun; \
29+ __clear_cache((&__tramp[0]), (&__tramp[19])); /* Clear data mapping. */ \
30+ __clear_cache(insns, insns + 3 * sizeof (unsigned int)); \
31+ /* Clear instruction \
32+ mapping. */ \
33+ })
34+#endif
35 #endif
36
37 /* the cif must already be prep'ed */