Index: configure.host =================================================================== --- configure.host (revision 172224) +++ configure.host (working copy) @@ -347,8 +347,13 @@ slow_pthread_self= can_unwind_signal=yes ;; + *-*-rtems*) + can_unwind_signal=no + CHECKREFSPEC=-fcheck-references + DIVIDESPEC=-fuse-divide-subroutine + ;; esac case "${host}" in *-cygwin* | *-mingw*) fallback_backtrace_h=sysdep/i386/backtrace.h Index: configure.ac =================================================================== --- configure.ac (revision 172224) +++ configure.ac (working copy) @@ -1048,6 +1048,19 @@ ;; win32) ;; + rtems) + THREADS=posix + AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_NETINET_IN_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_ARPA_INET_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_NETDB_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_SYS_IOCTL_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_NET_IF_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_IFADDRS_H, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Required define in rtems.]) + AC_DEFINE(HAVE_GETHOSTNAME_DECL, 1, [Required define in rtems.]) + AC_DEFINE(RTEMS_PTHREADS, 1, [Required define in rtems.]) + ;; decosf1 | irix | mach | os2 | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) ;; Index: classpath/native/fdlibm/mprec.c =================================================================== --- classpath/native/fdlibm/mprec.c (revision 172224) +++ classpath/native/fdlibm/mprec.c (working copy) @@ -1004,7 +1004,7 @@ {1e-16, 1e-32}; #endif - +#ifdef RTEMS_PTHREADS double _DEFUN (_mprec_log10, (dig), int dig) @@ -1019,3 +1019,4 @@ } return v; } +#endif Index: include/config.h.in =================================================================== --- include/config.h.in (revision 172224) +++ include/config.h.in (working copy) @@ -379,6 +379,9 @@ /* Define if using POSIX threads on Linux. */ #undef LINUX_THREADS +/* Define if using POSIX threads on RTEMS. */ +#undef RTEMS_PTHREADS + /* Define to the name of the environment variable that determines the dynamic library search path. */ #undef LTDL_SHLIBPATH_VAR Index: posix-threads.cc =================================================================== --- posix-threads.cc (revision 172224) +++ posix-threads.cc (working copy) @@ -62,9 +62,11 @@ static int non_daemon_count; // The signal to use when interrupting a thread. -#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) +#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) \ + || defined(RTEMS_PTHREADS) // LinuxThreads (prior to glibc 2.1) usurps both SIGUSR1 and SIGUSR2. // GC on FreeBSD uses both SIGUSR1 and SIGUSR2. + // GC on RTEMS uses both SIGUSR1 and SIGUSR2. # define INTR SIGHUP #else /* LINUX_THREADS */ # define INTR SIGUSR2 @@ -672,6 +674,10 @@ pthread_attr_setschedparam (&attr, ¶m); pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); +#ifdef RTEMS_PTHREADS + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); +#endif // Set stack size if -Xss option was given. if (gcj::stack_size > 0) { Index: configure =================================================================== --- configure (revision 172224) +++ configure (working copy) @@ -20704,6 +20704,21 @@ ;; win32) ;; + rtems) + THREADS=posix +$as_echo "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h +$as_echo "#define HAVE_NETINET_IN_H 1" >>confdefs.h +$as_echo "#define HAVE_ARPA_INET_H 1" >>confdefs.h +$as_echo "#define HAVE_NETDB_H 1" >>confdefs.h +$as_echo "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h +$as_echo "#define HAVE_NET_IF_H 1" >>confdefs.h +$as_echo "#define HAVE_IFADDRS_H 1" >>confdefs.h +$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h +$as_echo "#define HAVE_GETHOSTNAME_DECL 1" >>confdefs.h +$as_echo "#define HAVE_MPREC_LOG10 1" >>confdefs.h +$as_echo "#define NO_TLS 1" >>confdefs.h +$as_echo "#define RTEMS_PTHREADS 1" >>confdefs.h + ;; decosf1 | irix | mach | os2 | dce | vxworks) as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5 ;; Index: java/lang/natClass.cc =================================================================== --- java/lang/natClass.cc (revision 172224) +++ java/lang/natClass.cc (working copy) @@ -1679,6 +1679,10 @@ return NULL; } +#ifdef RTEMS_PTHREADS +# undef HAVE_TLS +#endif + #ifdef HAVE_TLS // NOTE: MCACHE_SIZE should be a power of 2 minus one.