public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Gc] bdwgc for RTEMS pthread support
       [not found] ` <E1QqiwX-0004rk-00.ivmai-mail-ru@f288.mail.ru>
@ 2011-08-09 16:41   ` Jie Liu
  0 siblings, 0 replies; only message in thread
From: Jie Liu @ 2011-08-09 16:41 UTC (permalink / raw)
  To: Ivan Maidanski, gc, java-patches; +Cc: Joel Sherrill

[-- Attachment #1: Type: text/plain, Size: 10380 bytes --]

Hi Ivan,

I have modified the patch according to your advice. And the patch is attached.

Thanks,
Jie

2011/8/9 Ivan Maidanski <ivmai@mail.ru>:
> Hi Jie,
>
> 1. Send patches as attachments
> 2. Please add ChangeLog entres.
> 3. Exclude auto-generated files (like configure)
> 4. Fix issues given below:
>
> 08 08 2011, 19:08 Jie Liu <lj8175@gmail.com>:
>> Hi,
>>
>> Here is the patch for bdwgc on RTEMS with pthread support, while no
>> thread support's patch has been merged.
>>
>> Index: configure
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/configure,v
>> retrieving revision 1.72
>> diff -u -r1.72 configure
>> --- configure   4 Jul 2011 13:29:55 -0000       1.72
>> +++ configure   5 Aug 2011 06:31:43 -0000
>> @@ -5293,6 +5293,11 @@
>>      $as_echo "#define _REENTRANT 1" >>confdefs.h
>>
>>      ;;
>> + rtems)
>> +    THREADS=posix
>> +    $as_echo "#define GC_RTEMS_PTHREADS 1" >>confdefs.h
>> +    $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h
>> +    ;;
>>   decosf1 | irix | mach | os2 | solaris | dce | vxworks)
>>      as_fn_error $? "thread package $THREADS not yet supported" "$LINENO" 5
>>      ;;
>> Index: os_dep.c
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/os_dep.c,v
>> retrieving revision 1.125
>> diff -u -r1.125 os_dep.c
>> --- os_dep.c    5 Jul 2011 17:53:24 -0000       1.125
>> +++ os_dep.c    5 Aug 2011 06:32:33 -0000
>> @@ -1351,6 +1351,16 @@
>>  # define HAVE_GET_STACK_BASE
>>  #endif /* GC_SOLARIS_THREADS */
>>
>> +#ifdef GC_RTEMS_PTHREADS
>> +  GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
>> +  {
>> +    printf("run in GC_get_stack_base\n");
>
> Remove printf here or ifdef with DEBUG_... and use GC_log_printf instead.
>
>> +    sb->mem_base = rtems_get_stack_bottom();
>> +    return GC_SUCCESS;
>> +  }
>> +# define HAVE_GET_STACK_BASE
>> +#endif /* GC_RTEMS_PTHREADS */
>> +
>>  #ifndef HAVE_GET_STACK_BASE
>>    /* Retrieve stack base.                                               */
>>    /* Using the GC_find_limit version is risky.                          */
>> Index: pthread_stop_world.c
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/pthread_stop_world.c,v
>> retrieving revision 1.40
>> diff -u -r1.40 pthread_stop_world.c
>> --- pthread_stop_world.c        16 May 2011 13:12:14 -0000      1.40
>> +++ pthread_stop_world.c        5 Aug 2011 06:32:36 -0000
>> @@ -816,7 +816,11 @@
>>          ABORT("sem_init failed");
>>  #   endif
>>
>> +#   ifdef SA_RESTART
>>      act.sa_flags = SA_RESTART
>> +#   else
>> +    act.sa_flags = 0
>> +#   endif
>>  #   ifdef SA_SIGINFO
>>          | SA_SIGINFO
>>  #   endif
>> @@ -824,6 +828,11 @@
>>      if (sigfillset(&act.sa_mask) != 0) {
>>          ABORT("sigfillset() failed");
>>      }
>> +#   ifdef GC_RTEMS_PTHREADS
>> +    if(sigprocmask(SIG_UNBLOCK,&act.sa_mask,NULL) !=0) {
>> +        ABORT("rtems sigprocmask() failed\n");
>> +    }
>> +#   endif
>>      GC_remove_allowed_signals(&act.sa_mask);
>>      /* SIG_THR_RESTART is set in the resulting mask.            */
>>      /* It is unmasked by the handler when necessary.            */
>> Index: pthread_support.c
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/pthread_support.c,v
>> retrieving revision 1.101
>> diff -u -r1.101 pthread_support.c
>> --- pthread_support.c   5 Jul 2011 17:53:24 -0000       1.101
>> +++ pthread_support.c   5 Aug 2011 06:32:40 -0000
>> @@ -52,7 +52,9 @@
>>  # include <time.h>
>>  # include <errno.h>
>>  # include <unistd.h>
>> +#if !defined(GC_RTEMS_PTHREADS)
>>  # include <sys/mman.h>
>> +#endif
>>  # include <sys/time.h>
>>  # include <sys/types.h>
>>  # include <sys/stat.h>
>> @@ -953,6 +955,8 @@
>>        GC_nprocs = get_ncpu();
>>  #   elif defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
>>        GC_nprocs = GC_get_nprocs();
>> +#   elif defined(GC_RTEMS_PTHREADS)
>> +      if (GC_nprocs <= 0) GC_nprocs = 1;
>
> Is this really needed? see " if (GC_nprocs <= 0)" below.
>
I think it's better to use this. Or there is always "GC_get_nprocs()
returned ..." printing.

>>  #   endif
>>    }
>>    if (GC_nprocs <= 0) {
>> Index: include/gc_config_macros.h
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/include/gc_config_macros.h,v
>> retrieving revision 1.25
>> diff -u -r1.25 gc_config_macros.h
>> --- include/gc_config_macros.h  24 Apr 2011 13:09:21 -0000      1.25
>> +++ include/gc_config_macros.h  5 Aug 2011 06:33:24 -0000
>> @@ -50,6 +50,9 @@
>>  #if defined(WIN32_THREADS)
>>  # define GC_WIN32_THREADS
>>  #endif
>> +#if defined(RTEMS_THREADS)
>> +# define GC_RTEMS_PTHREADS
>> +#endif
>>  #if defined(USE_LD_WRAP)
>>  # define GC_USE_LD_WRAP
>>  #endif
>> @@ -65,7 +68,7 @@
>>      || defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
>>      || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
>>      || defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \
>> -    || defined(GC_WIN32_THREADS)
>> +    || defined(GC_WIN32_THREADS) || defined(GC_RTEMS_PTHREADS)
>>  # ifndef GC_THREADS
>>  #   define GC_THREADS
>>  # endif
>> @@ -115,10 +118,13 @@
>>      /* Either posix or native Win32 threads. */
>>  #   define GC_WIN32_THREADS
>>  # endif
>> +# if defined(__rtems__) && (defined(i386) || defined(__i386__))
>> +#   define GC_RTEMS_PTHREADS
>> +# endif
>>  #endif /* GC_THREADS */
>>
>>  #undef GC_PTHREADS
>> -#if (!defined(GC_WIN32_THREADS) || defined(GC_WIN32_PTHREADS) \
>> +#if (!defined(GC_WIN32_THREADS) || defined(GC_WIN32_PTHREADS) ||
>> defined(GC_RTEMS_PTHREADS)\
>
> Split this line into 2.
>
>>       || defined(__CYGWIN32__) || defined(__CYGWIN__)) && defined(GC_THREADS)
>>    /* Posix threads. */
>>  # define GC_PTHREADS
>> @@ -289,7 +295,8 @@
>>  #ifdef GC_PTHREADS
>>
>>  # if (defined(GC_DARWIN_THREADS) || defined(GC_WIN32_PTHREADS) \
>> -      || defined(__native_client__)) && !defined(GC_NO_DLOPEN)
>> +      || defined(__native_client__) || defined(GC_RTEMS_PTHREADS)) \
>> +      && !defined(GC_NO_DLOPEN)
>>      /* Either there is no dlopen() or we do not need to intercept it.   */
>>  #   define GC_NO_DLOPEN
>>  # endif
>> Index: include/private/config.h.in
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/include/private/config.h.in,v
>> retrieving revision 1.9
>> diff -u -r1.9 config.h.in
>> --- include/private/config.h.in 4 Jul 2011 13:29:55 -0000       1.9
>> +++ include/private/config.h.in 5 Aug 2011 06:33:27 -0000
>> @@ -87,6 +87,9 @@
>>  /* Define to support Win32 threads. */
>>  #undef GC_WIN32_THREADS
>>
>> +/* Define to support RTEMS pthreads. */
>> +#undef GC_RTEMS_PTHREADS
>> +
>>  /* Define to 1 if you have the <dlfcn.h> header file. */
>>  #undef HAVE_DLFCN_H
>>
>> Index: include/private/gc_locks.h
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/include/private/gc_locks.h,v
>> retrieving revision 1.26
>> diff -u -r1.26 gc_locks.h
>> --- include/private/gc_locks.h  4 Jul 2011 13:29:55 -0000       1.26
>> +++ include/private/gc_locks.h  5 Aug 2011 06:33:28 -0000
>> @@ -51,6 +51,10 @@
>>  #    define USE_PTHREAD_LOCKS
>>  #  endif
>>
>> +#  if defined(GC_RTEMS_PTHREADS) && defined(GC_PTHREADS)
>
> Why do you test GC_PTHREADS?
>
>> +#    define USE_PTHREAD_LOCKS
>> +#  endif
>> +
>>  #  if defined(GC_WIN32_THREADS) && !defined(USE_PTHREAD_LOCKS)
>>  #    ifndef WIN32_LEAN_AND_MEAN
>>  #      define WIN32_LEAN_AND_MEAN 1
>> Index: include/private/gcconfig.h
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/include/private/gcconfig.h,v
>> retrieving revision 1.95
>> diff -u -r1.95 gcconfig.h
>> --- include/private/gcconfig.h  4 Jul 2011 14:56:16 -0000       1.95
>> +++ include/private/gcconfig.h  5 Aug 2011 06:33:35 -0000
>> @@ -1380,10 +1380,13 @@
>>  #       include <sys/unistd.h>
>>          extern int etext[];
>>          extern int end[];
>> -        extern void *InitStackBottom;
>> +        void *rtems_get_stack_bottom();
>
> Place "void" into ().
>
>> +#       define InitStackBottom rtems_get_stack_bottom()
>>  #       define DATASTART ((ptr_t)etext)
>>  #       define DATAEND ((ptr_t)end)
>>  #       define STACKBOTTOM ((ptr_t)InitStackBottom)
>> +#       define SIG_SUSPEND SIGUSR1
>> +#       define SIG_THR_RESTART SIGUSR2
>>  #   endif
>>  #   ifdef DOS4GW
>>  #     define OS_TYPE "DOS4GW"
>> Index: include/private/thread_local_alloc.h
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/include/private/thread_local_alloc.h,v
>> retrieving revision 1.22
>> diff -u -r1.22 thread_local_alloc.h
>> --- include/private/thread_local_alloc.h        13 May 2011 14:40:31
>> -0000      1.22
>> +++ include/private/thread_local_alloc.h        5 Aug 2011 06:33:36 -0000
>> @@ -47,7 +47,7 @@
>>  #   define USE_COMPILER_TLS
>>  # elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \
>>         || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
>> -       || defined(GC_NETBSD_THREADS)
>> +       || defined(GC_NETBSD_THREADS) || defined(GC_RTEMS_PTHREADS)
>>  #   define USE_PTHREAD_SPECIFIC
>>  # elif defined(GC_HPUX_THREADS)
>>  #   ifdef __GNUC__
>> Index: tests/test.c
>> ===================================================================
>> RCS file: /cvsroot/bdwgc/bdwgc/tests/test.c,v
>> retrieving revision 1.63
>> diff -u -r1.63 test.c
>> --- tests/test.c        14 Jul 2011 13:43:13 -0000      1.63
>> +++ tests/test.c        5 Aug 2011 06:34:44 -0000
>> @@ -1462,6 +1462,9 @@
>>  #   ifdef MSWIN32
>>        GC_win32_free_heap();
>>  #   endif
>> +#   ifdef RTEMS
>> +      exit(0);
>
> The compiler might issue an "unreachable" warning here: consider changing return type to void and removing "return".
>
>> +#   endif
>>      return(0);
>>  }
>>  # endif
>>
>>
>>
>> Thanks,
>> Jie
>

[-- Attachment #2: bdwgc.patch --]
[-- Type: application/octet-stream, Size: 10043 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/ChangeLog,v
retrieving revision 1.540
diff -u -r1.540 ChangeLog
--- ChangeLog	14 Jul 2011 13:43:13 -0000	1.540
+++ ChangeLog	9 Aug 2011 15:26:09 -0000
@@ -1,3 +1,25 @@
+2011-08-09  Jie Liu <lj8175@gmail.com>
+
+	* configure.ac: Add GC_RTEMS_PTHREADS AH_TEMPLATE and configure
+	for rtems.
+	* os_dep.c: Add GC_get_stack_base if GC_RTEMS_PTHREADS for rtems.
+	* pthread_stop_world.c (GC_stop_init): Add ifdef SA_RESTART.
+	* pthread_stop_world.c (GC_stop_init): Use sigprocmask for rtems
+	when defined GC_RTEMS_PTHREADS.
+	* pthread_support.c: Exclued sys/mman.h for rtems.
+	* pthread_support.c (GC_thr_init): Set default GC_nprocs for 
+	rtems.
+	* include/gc_config_macros.h: Define GC_RTEMS_PTHREADS for rtems 
+	pthread and define GC_NO_DLOPEN for rtems.
+	* include/private/gc_locks.h: Define USE_PTHREAD_LOCKS for rtems.
+	* include/private/gcconfig.h: Use rtems_get_stack_bottom(void)
+	for InitStackBottom; and use SIGUSR1 for SIG_SUSPEND, SIGUSR2
+	for SIG_THR_RESTART on rtems.
+	* include/private/thread_local_alloc.h: Use USE_PTHREAD_SPECIFIC
+	for rtems.
+	* tests/test.c (Init): Use exit(0) for rtems while return(0) for
+	others.
+
 2011-07-14  Ivan Maidanski <ivmai@mail.ru>
 
 	* new_hblk.c (GC_build_fl): Adjust "h" local variable cast type
Index: configure.ac
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/configure.ac,v
retrieving revision 1.69
diff -u -r1.69 configure.ac
--- configure.ac	4 Jul 2011 13:29:55 -0000	1.69
+++ configure.ac	9 Aug 2011 15:27:06 -0000
@@ -93,6 +93,7 @@
 AH_TEMPLATE([GC_SOLARIS_THREADS],   [Define to support Solaris pthreads.])
 AH_TEMPLATE([GC_WIN32_THREADS],     [Define to support Win32 threads.])
 AH_TEMPLATE([GC_WIN32_PTHREADS],    [Define to support win32-pthreads.])
+AH_TEMPLATE([GC_RTEMS_PTHREADS],    [Define to support rtems-pthreads.])
 
 dnl System header feature requests.
 AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.])
@@ -280,6 +281,11 @@
     AC_DEFINE(GC_AIX_THREADS)
     AC_DEFINE(_REENTRANT)
     ;;
+ rtems)
+    THREADS=posix
+    AC_DEFINE(GC_RTEMS_PTHREADS)
+    AC_DEFINE(THREAD_LOCAL_ALLOC)
+    ;;
  decosf1 | irix | mach | os2 | solaris | dce | vxworks)
     AC_MSG_ERROR(thread package $THREADS not yet supported)
     ;;
Index: os_dep.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/os_dep.c,v
retrieving revision 1.125
diff -u -r1.125 os_dep.c
--- os_dep.c	5 Jul 2011 17:53:24 -0000	1.125
+++ os_dep.c	9 Aug 2011 15:27:37 -0000
@@ -1351,6 +1351,15 @@
 # define HAVE_GET_STACK_BASE
 #endif /* GC_SOLARIS_THREADS */
 
+#ifdef GC_RTEMS_PTHREADS
+  GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
+  {
+    sb->mem_base = rtems_get_stack_bottom();
+    return GC_SUCCESS;
+  } 
+# define HAVE_GET_STACK_BASE
+#endif /* GC_RTEMS_PTHREADS */
+
 #ifndef HAVE_GET_STACK_BASE
   /* Retrieve stack base.                                               */
   /* Using the GC_find_limit version is risky.                          */
Index: pthread_stop_world.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/pthread_stop_world.c,v
retrieving revision 1.40
diff -u -r1.40 pthread_stop_world.c
--- pthread_stop_world.c	16 May 2011 13:12:14 -0000	1.40
+++ pthread_stop_world.c	9 Aug 2011 15:27:38 -0000
@@ -816,7 +816,11 @@
         ABORT("sem_init failed");
 #   endif
 
+#   ifdef SA_RESTART
     act.sa_flags = SA_RESTART
+#   else
+    act.sa_flags = 0
+#   endif
 #   ifdef SA_SIGINFO
         | SA_SIGINFO
 #   endif
@@ -824,6 +828,11 @@
     if (sigfillset(&act.sa_mask) != 0) {
         ABORT("sigfillset() failed");
     }
+#   ifdef GC_RTEMS_PTHREADS
+    if(sigprocmask(SIG_UNBLOCK,&act.sa_mask,NULL) !=0) {
+        ABORT("rtems sigprocmask() failed\n");
+    }
+#   endif
     GC_remove_allowed_signals(&act.sa_mask);
     /* SIG_THR_RESTART is set in the resulting mask.            */
     /* It is unmasked by the handler when necessary.            */
Index: pthread_support.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/pthread_support.c,v
retrieving revision 1.101
diff -u -r1.101 pthread_support.c
--- pthread_support.c	5 Jul 2011 17:53:24 -0000	1.101
+++ pthread_support.c	9 Aug 2011 15:27:40 -0000
@@ -52,7 +52,9 @@
 # include <time.h>
 # include <errno.h>
 # include <unistd.h>
+#if !defined(GC_RTEMS_PTHREADS)
 # include <sys/mman.h>
+#endif
 # include <sys/time.h>
 # include <sys/types.h>
 # include <sys/stat.h>
@@ -953,6 +955,8 @@
       GC_nprocs = get_ncpu();
 #   elif defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
       GC_nprocs = GC_get_nprocs();
+#   elif defined(GC_RTEMS_PTHREADS)
+      if (GC_nprocs <= 0) GC_nprocs = 1;
 #   endif
   }
   if (GC_nprocs <= 0) {
Index: include/gc_config_macros.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/gc_config_macros.h,v
retrieving revision 1.25
diff -u -r1.25 gc_config_macros.h
--- include/gc_config_macros.h	24 Apr 2011 13:09:21 -0000	1.25
+++ include/gc_config_macros.h	9 Aug 2011 15:28:13 -0000
@@ -50,6 +50,9 @@
 #if defined(WIN32_THREADS)
 # define GC_WIN32_THREADS
 #endif
+#if defined(RTEMS_THREADS)
+# define GC_RTEMS_PTHREADS
+#endif
 #if defined(USE_LD_WRAP)
 # define GC_USE_LD_WRAP
 #endif
@@ -65,7 +68,7 @@
     || defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
     || defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
     || defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \
-    || defined(GC_WIN32_THREADS)
+    || defined(GC_WIN32_THREADS) || defined(GC_RTEMS_PTHREADS)
 # ifndef GC_THREADS
 #   define GC_THREADS
 # endif
@@ -115,11 +118,15 @@
     /* Either posix or native Win32 threads. */
 #   define GC_WIN32_THREADS
 # endif
+# if defined(__rtems__) && (defined(i386) || defined(__i386__))
+#   define GC_RTEMS_PTHREADS
+# endif
 #endif /* GC_THREADS */
 
 #undef GC_PTHREADS
 #if (!defined(GC_WIN32_THREADS) || defined(GC_WIN32_PTHREADS) \
-     || defined(__CYGWIN32__) || defined(__CYGWIN__)) && defined(GC_THREADS)
+     || defined(GC_RTEMS_PTHREADS) || defined(__CYGWIN32__) \
+     || defined(__CYGWIN__)) && defined(GC_THREADS)
   /* Posix threads. */
 # define GC_PTHREADS
 #endif
@@ -289,7 +296,8 @@
 #ifdef GC_PTHREADS
 
 # if (defined(GC_DARWIN_THREADS) || defined(GC_WIN32_PTHREADS) \
-      || defined(__native_client__)) && !defined(GC_NO_DLOPEN)
+      || defined(__native_client__) || defined(GC_RTEMS_PTHREADS)) \
+      && !defined(GC_NO_DLOPEN)
     /* Either there is no dlopen() or we do not need to intercept it.   */
 #   define GC_NO_DLOPEN
 # endif
Index: include/private/config.h.in
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/config.h.in,v
retrieving revision 1.9
diff -u -r1.9 config.h.in
--- include/private/config.h.in	4 Jul 2011 13:29:55 -0000	1.9
+++ include/private/config.h.in	9 Aug 2011 15:28:18 -0000
@@ -87,6 +87,9 @@
 /* Define to support Win32 threads. */
 #undef GC_WIN32_THREADS
 
+/* Define to support RTEMS pthreads. */
+#undef GC_RTEMS_PTHREADS
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
Index: include/private/gc_locks.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/gc_locks.h,v
retrieving revision 1.26
diff -u -r1.26 gc_locks.h
--- include/private/gc_locks.h	4 Jul 2011 13:29:55 -0000	1.26
+++ include/private/gc_locks.h	9 Aug 2011 15:28:19 -0000
@@ -51,6 +51,10 @@
 #    define USE_PTHREAD_LOCKS
 #  endif
 
+#  if defined(GC_RTEMS_PTHREADS)
+#    define USE_PTHREAD_LOCKS
+#  endif
+
 #  if defined(GC_WIN32_THREADS) && !defined(USE_PTHREAD_LOCKS)
 #    ifndef WIN32_LEAN_AND_MEAN
 #      define WIN32_LEAN_AND_MEAN 1
Index: include/private/gcconfig.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/gcconfig.h,v
retrieving revision 1.95
diff -u -r1.95 gcconfig.h
--- include/private/gcconfig.h	4 Jul 2011 14:56:16 -0000	1.95
+++ include/private/gcconfig.h	9 Aug 2011 15:28:35 -0000
@@ -1380,10 +1380,13 @@
 #       include <sys/unistd.h>
         extern int etext[];
         extern int end[];
-        extern void *InitStackBottom;
+        void *rtems_get_stack_bottom(void);
+#       define InitStackBottom rtems_get_stack_bottom()
 #       define DATASTART ((ptr_t)etext)
 #       define DATAEND ((ptr_t)end)
 #       define STACKBOTTOM ((ptr_t)InitStackBottom)
+#       define SIG_SUSPEND SIGUSR1
+#       define SIG_THR_RESTART SIGUSR2
 #   endif
 #   ifdef DOS4GW
 #     define OS_TYPE "DOS4GW"
Index: include/private/thread_local_alloc.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/thread_local_alloc.h,v
retrieving revision 1.22
diff -u -r1.22 thread_local_alloc.h
--- include/private/thread_local_alloc.h	13 May 2011 14:40:31 -0000	1.22
+++ include/private/thread_local_alloc.h	9 Aug 2011 15:28:35 -0000
@@ -47,7 +47,7 @@
 #   define USE_COMPILER_TLS
 # elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \
        || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
-       || defined(GC_NETBSD_THREADS)
+       || defined(GC_NETBSD_THREADS) || defined(GC_RTEMS_PTHREADS)
 #   define USE_PTHREAD_SPECIFIC
 # elif defined(GC_HPUX_THREADS)
 #   ifdef __GNUC__
Index: tests/test.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/tests/test.c,v
retrieving revision 1.63
diff -u -r1.63 test.c
--- tests/test.c	14 Jul 2011 13:43:13 -0000	1.63
+++ tests/test.c	9 Aug 2011 15:34:44 -0000
@@ -1462,7 +1462,11 @@
 #   ifdef MSWIN32
       GC_win32_free_heap();
 #   endif
-    return(0);
+#   ifdef RTEMS
+      exit(0);
+#   else
+      return(0);
+#   endif
 }
 # endif
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-09 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABc96T8SD0GKDXTZPFR9PXMH-5rbwGrxQT331ci4fOHvdVg2A@mail.gmail.com>
     [not found] ` <E1QqiwX-0004rk-00.ivmai-mail-ru@f288.mail.ru>
2011-08-09 16:41   ` [Gc] bdwgc for RTEMS pthread support Jie Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).