Patches for QNX4

jso at lyngso-industri.dk jso at lyngso-industri.dk
Thu Oct 1 06:02:05 PDT 1998


The patch below brings kaffe back on track w.r.t. QNX4 support. With
this patch, kaffe may be compiled with internal thread support. All
regression tests supported by internal threads then passes.

The patch is against kaffe-snap of sept 29. 

The major obstacle for supporting jthreads is that QNX4 has no
"user-time" timers (ITIMER_VIRTUAL or equivalent) needing for time
slicing. It might make sense to use a real-time timer instead, if
jthreads will survive this - i.e., if jthreads can manage getting time
slice signals with arbitrarily little CPU time inbetween?!?

Another - and in my oppinion more interesting - approach would be to
use POSIX threads. Is anybody working on a POSIX threads interface for
kaffe? I'm affraid I don't have the time.

Jeppe





diff -cr kaffe-snap/config.guess kaffe-snap-980929/config.guess
*** kaffe-snap/config.guess	Wed Aug 19 18:22:59 1998
--- kaffe-snap-980929/config.guess	Thu Oct  1 08:10:07 1998
***************
*** 342,347 ****
--- 342,350 ----
      *:AIX:*:*)
  	echo rs6000-ibm-aix
  	exit 0 ;;
+     *:QNX:*:*)
+         echo i386-pc-qnx`echo ${UNAME_VERSION}|sed -e 's/\(.\)/\1./'`
+         exit 0 ;;
      ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  	echo romp-ibm-bsd4.4
  	exit 0 ;;
diff -cr kaffe-snap/config.sub kaffe-snap-980929/config.sub
*** kaffe-snap/config.sub	Wed Aug 19 18:22:58 1998
--- kaffe-snap-980929/config.sub	Thu Oct  1 08:10:07 1998
***************
*** 714,720 ****
  	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
! 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
  	# Remember, each alternative MUST END IN *, to match a version number.
  		;;
  	-linux*)
--- 714,720 ----
  	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
! 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -qnx*)
  	# Remember, each alternative MUST END IN *, to match a version number.
  		;;
  	-linux*)
diff -cr kaffe-snap/config/i386/qnx/md.h kaffe-snap-980929/config/i386/qnx/md.h
*** kaffe-snap/config/i386/qnx/md.h	Tue Mar 31 14:10:53 1998
--- kaffe-snap-980929/config/i386/qnx/md.h	Thu Oct  1 08:10:07 1998
***************
*** 22,27 ****
--- 22,33 ----
  #include "i386/common.h"
  #include "i386/threads.h"
  
+ /*
+  * Redefine stack pointer offset.
+  */
+ #undef  SP_OFFSET
+ #define SP_OFFSET       7
+ 
  #if defined(TRANSLATOR)
  #include "jit-md.h"
  #endif
***************
*** 55,63 ****
  		movl %5,%%ebx						\n\
  		movb %4,%%cl						\n\
  		movl %%eax,(%%ebx)					\n\
! 		cmpb $'D',%%cl						\n\
  		je 4f							\n\
! 		cmpb $'J',%%cl						\n\
  		jne 5f							\n\
  4:									\n\
  		movl %%edx,4(%%ebx)					\n\
--- 61,69 ----
  		movl %5,%%ebx						\n\
  		movb %4,%%cl						\n\
  		movl %%eax,(%%ebx)					\n\
! 		cmpb $0x44,%%cl						\n\
  		je 4f							\n\
! 		cmpb $0x4a,%%cl						\n\
  		jne 5f							\n\
  4:									\n\
  		movl %%edx,4(%%ebx)					\n\
***************
*** 66,72 ****
  	  : "r" ((CALL)->nrargs),					\
  	    "r" ((CALL)->args),						\
  	    "r" ((CALL)->callsize),					\
! 	    "m" (METHOD_NATIVECODE((CALL)->meth)),			\
  	    "m" ((CALL)->rettype),					\
  	    "m" ((CALL)->ret)						\
  	  : "eax", "ebx", "ecx", "edx", "edi", "esi", "cc", "memory");	\
--- 72,78 ----
  	  : "r" ((CALL)->nrargs),					\
  	    "r" ((CALL)->args),						\
  	    "r" ((CALL)->callsize),					\
! 	    "m" ((CALL)->function),					\
  	    "m" ((CALL)->rettype),					\
  	    "m" ((CALL)->ret)						\
  	  : "eax", "ebx", "ecx", "edx", "edi", "esi", "cc", "memory");	\
diff -cr kaffe-snap/kaffe/kaffevm/systems/unix-internal/internalCalls.c kaffe-snap-980929/kaffe/kaffevm/systems/unix-internal/internalCalls.c
*** kaffe-snap/kaffe/kaffevm/systems/unix-internal/internalCalls.c	Thu Aug  6 18:03:03 1998
--- kaffe-snap-980929/kaffe/kaffevm/systems/unix-internal/internalCalls.c	Thu Oct  1 08:23:30 1998
***************
*** 16,21 ****
--- 16,22 ----
  #include "config-std.h"
  #include "config-io.h"
  #include "config-mem.h"
+ #include "config-signal.h"
  #include "lerrno.h"
  #include "object.h"
  #include "thread.h"




More information about the kaffe mailing list