This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
m68k patch for m68000
- From: Alan Hourihane <alanh at fairlite dot co dot uk>
- To: libffi-discuss at sourceware dot org
- Date: Wed, 27 Feb 2013 11:03:44 +0000
- Subject: m68k patch for m68000
Hi Anthony,
I missed the 3.0.12 release and this patch for m68000 machines is
required as it doesn't support the extb instruction, so we have to do it
with two shift operations.
Thanks,
Alan.
diff --git a/src/m68k/sysv.S b/src/m68k/sysv.S
index 9504c6a..ec2b14f 100644
--- a/src/m68k/sysv.S
+++ b/src/m68k/sysv.S
@@ -176,7 +176,13 @@ retstruct2:
retsint8:
btst #8,%d2
jbeq retsint16
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
extb.l %d0
+#endif
move.l %d0,(%a1)
jbra epilogue
@@ -279,7 +285,13 @@ CALLFUNC(ffi_closure_SYSV):
jra .Lcls_epilogue
.Lcls_ret_sint8:
move.l (%a0),%d0
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ ext.w %d0
+ ext.l %d0
+#else
extb.l %d0
+#endif
jra .Lcls_epilogue
1:
| CIF_FLAGS_SINT16