|
Author: eliot
Date: 2011-03-21 10:48:42 -0700 (Mon, 21 Mar 2011)
New Revision: 2373
Modified:
branches/Cog/platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c
branches/Cog/platforms/unix/plugins/SqueakFFIPrims/ffi-config
branches/Cog/platforms/unix/vm/sqUnixMain.c
Log:
Integrate David Graham's FreeBSD patches.
Modified: branches/Cog/platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c
===================================================================
--- branches/Cog/platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c 2011-03-20 16:51:29 UTC (rev 2372)
+++ branches/Cog/platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c 2011-03-21 17:48:42 UTC (rev 2373)
@@ -10,7 +10,7 @@
*****************************************************************************/
#include <stdio.h>
-#if !WIN32
+#if !WIN32 && !__FreeBSD__
# include <alloca.h>
#endif
#include <string.h>
Modified: branches/Cog/platforms/unix/plugins/SqueakFFIPrims/ffi-config
===================================================================
--- branches/Cog/platforms/unix/plugins/SqueakFFIPrims/ffi-config 2011-03-20 16:51:29 UTC (rev 2372)
+++ branches/Cog/platforms/unix/plugins/SqueakFFIPrims/ffi-config 2011-03-21 17:48:42 UTC (rev 2373)
@@ -39,6 +39,7 @@
case ${abi} in
linux) abi=sysv;;
+ freebsd) abi=sysv;;
darwin*) abi=darwin;;
*) abi=libffi; lib="-lffi";;
esac
Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c 2011-03-20 16:51:29 UTC (rev 2372)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c 2011-03-21 17:48:42 UTC (rev 2373)
@@ -60,6 +60,9 @@
# include <execinfo.h>
# define BACKTRACE_DEPTH 64
#endif
+#if __FreeBSD__
+# include <sys/ucontext.h>
+#endif
#if defined(__alpha__) && defined(__osf__)
# include <sys/sysinfo.h>
@@ -777,6 +780,9 @@
# elif __linux__ && __i386__
void *fp = (void *)(uap ? uap->uc_mcontext.gregs[REG_EBP]: 0);
void *sp = (void *)(uap ? uap->uc_mcontext.gregs[REG_ESP]: 0);
+# elif __FreeBSD__ && __i386__
+ void *fp = (void *)(uap ? uap->uc_mcontext.mc_ebp: 0);
+ void *sp = (void *)(uap ? uap->uc_mcontext.mc_esp: 0);
# else
# error need to implement extracting pc from a ucontext_t on this system
# endif
|