diff -r -c3 kaffe-1.0.7-rc1/config/mips/linux/md.h kaffe-1.0.7-rc1-ps2/config/mips/linux/md.h *** kaffe-1.0.7-rc1/config/mips/linux/md.h Mon Sep 6 23:44:39 1999 --- kaffe-1.0.7-rc1-ps2/config/mips/linux/md.h Sat Jun 15 22:05:06 2002 *************** *** 21,26 **** --- 21,31 ---- #define SP_OFFSET 1 #define FP_OFFSET 10 + #ifdef HAVE_PS2_LINUX + #undef FP_OFFSET + #define FP_OFFSET 36 + #endif + #if defined(TRANSLATOR) #include "jit-md.h" #endif *************** *** 28,34 **** --- 33,43 ---- /**/ /* Signal handling */ /**/ + #ifdef HAVE_PS2_LINUX + #include + #else #include + #endif /* Define the entry into a signal handler */ #define EXCEPTIONPROTO int sig, int c1, int c2, int c3, int c4, int c5, int c6, int c7, struct sigcontext ctx diff -r -c3 kaffe-1.0.7-rc1/config/mips/mips.c kaffe-1.0.7-rc1-ps2/config/mips/mips.c *** kaffe-1.0.7-rc1/config/mips/mips.c Fri Oct 15 03:38:46 1999 --- kaffe-1.0.7-rc1-ps2/config/mips/mips.c Sat Jun 15 22:01:11 2002 *************** *** 20,25 **** --- 20,28 ---- #include "support.h" #include "../../kaffe/kaffevm/thread.h" + #ifdef HAVE_PS2_LINUX + # include "jit.h" + #endif extern int maxArgs; extern int isStatic; diff -r -c3 kaffe-1.0.7-rc1/config/mips/o32-sysdepCallMethod.h kaffe-1.0.7-rc1-ps2/config/mips/o32-sysdepCallMethod.h *** kaffe-1.0.7-rc1/config/mips/o32-sysdepCallMethod.h Thu Apr 15 20:19:31 1999 --- kaffe-1.0.7-rc1-ps2/config/mips/o32-sysdepCallMethod.h Sat Jun 15 23:16:30 2002 *************** *** 103,110 **** --- 103,120 ---- register ARG_TYPE a2 asm("$6"); register ARG_TYPE a3 asm("$7"); + #ifdef HAVE_PS2_LINUX + union { + double d; + struct { + int hi; + int lo; + } fake_double; + } split; + #else register double d0 asm("$f12"); register double d2 asm("$f14"); + #endif register float f0 asm("$f12"); register float f2 asm("$f14"); *************** *** 129,135 **** --- 139,151 ---- } if (calltype[2] == D) { + #ifdef HAVE_PS2_LINUX + split.d = callargs[2].d; + a2 = split.fake_double.hi; + a3 = split.fake_double.lo; + #else d2 = callargs[2].d; + #endif goto alldouble_2; } *************** *** 154,160 **** --- 170,183 ---- case 2: if (calltype[0] == D) { alldouble_2: + #ifdef HAVE_PS2_LINUX + /* move double into a0/a1 */ + split.d = callargs[0].d; + a0 = split.fake_double.hi; + a1 = split.fake_double.lo; + #else d0=callargs[0].d; + #endif } else { testfloat_2: if (calltype[0] != F) { *************** *** 183,189 **** --- 206,216 ---- noargs: #endif /* Ensure that the assignments to f* registers won't be optimized away. */ + #ifdef HAVE_PS2_LINUX + asm ("" :: "f" (f0), "f" (f2)); + #else asm ("" :: "f" (f0), "f" (f2), "f" (d0), "f" (d2)); + #endif switch(call->retsize) { case 0: diff -r -c3 kaffe-1.0.7-rc1/config/mips/threads.h kaffe-1.0.7-rc1-ps2/config/mips/threads.h *** kaffe-1.0.7-rc1/config/mips/threads.h Mon Mar 12 13:50:47 2001 --- kaffe-1.0.7-rc1-ps2/config/mips/threads.h Sat Jun 15 23:19:40 2002 *************** *** 27,32 **** --- 27,37 ---- #define THREADSTACKSIZE (32 * 1024) #endif + #ifdef HAVE_PS2_LINUX + #undef THREADSTACKSIZE + #define THREADSTACKSIZE (128 * 1024) + #endif + /* * Stack offset. * This is the offset into the setjmp buffer where the stack pointer is diff -r -c3 kaffe-1.0.7-rc1/configure.in kaffe-1.0.7-rc1-ps2/configure.in *** kaffe-1.0.7-rc1/configure.in Sun Jun 2 07:03:49 2002 --- kaffe-1.0.7-rc1-ps2/configure.in Sat Jun 15 21:51:09 2002 *************** *** 831,836 **** --- 831,849 ---- dnl ------------------------------------------------------------------------- dnl ========================================================================= + dnl Compile specifically for PS2/Linux + dnl ------------------------------------------------------------------------- + + AC_ARG_ENABLE(ps2linux, [ --enable-ps2linux Compile Specifically For PS2]) + AC_MSG_CHECKING([whether to enable PS2/Linux Specific patches]) + AC_MSG_RESULT($enable_ps2linux) + if test "x$enable_ps2linux" = "xyes"; then + AC_DEFINE([HAVE_PS2_LINUX], 1, [Enable PS2 Linux patches]) + fi + + dnl ------------------------------------------------------------------------- + + dnl ========================================================================= dnl Checks for typedefs, structures, and compiler characteristics. dnl -------------------------------------------------------------------------