]> granicus.if.org Git - gc/commitdiff
2011-04-11 Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)
authorivmai <ivmai>
Mon, 11 Apr 2011 20:20:05 +0000 (20:20 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:57 +0000 (21:06 +0400)
* mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
* mach_dep.c (GC_with_callee_saves_pushed): Don't call
__builtin_unwind_init() for RTEMS; use setjmp() without the
leading underscore (for RTEMS).
* tests/test.c (BIG): Use smaller value for RTEMS.
* tests/test.c (main): Customize for RTEMS.

ChangeLog
mach_dep.c
tests/test.c

index 8d700e09363af577ddb5a051dc4c93a7ceaa01d0..318e6a3f9fdb6d3384f00efabcc19130bf933674 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)
+
+       * mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
+       * mach_dep.c (GC_with_callee_saves_pushed): Don't call
+       __builtin_unwind_init() for RTEMS; use setjmp() without the
+       leading underscore (for RTEMS).
+       * tests/test.c (BIG): Use smaller value for RTEMS.
+       * tests/test.c (main): Customize for RTEMS.
+
 2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (mostly really Jim Meyering)
 
        * configure.host: Remove doubled words in comments.
index 546977596899399cc60a1f4fda35ab1831f52a4b..416dec8aeffcc4bc66fd3ffbfd6a30e269f16f0c 100644 (file)
@@ -171,13 +171,11 @@ asm static void PushMacRegisters()
 # undef HAVE_PUSH_REGS
 #endif
 
-#if defined(UNIX_LIKE) && !defined(NO_GETCONTEXT) && \
-        (defined(DARWIN) || defined(HURD) || defined(OPENBSD) \
-         || defined(ARM32) || defined(MIPS) || defined(AVR32))
-# define NO_GETCONTEXT
-#endif
-
-#if defined(LINUX) && defined(SPARC) && !defined(NO_GETCONTEXT)
+#if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HURD) \
+                             || defined(OPENBSD) || defined(ARM32) \
+                             || defined(MIPS) || defined(AVR32))) \
+     || (defined(LINUX) && defined(SPARC)) \
+     || (defined(RTEMS) && defined(I386))) && !defined(NO_GETCONTEXT)
 # define NO_GETCONTEXT
 #endif
 
@@ -244,8 +242,9 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
         /* subsumed by the getcontext() call.                           */
         GC_save_regs_ret_val = GC_save_regs_in_stack();
 #     endif /* register windows. */
-#   elif defined(HAVE_BUILTIN_UNWIND_INIT) && \
-         !(defined(POWERPC) && defined(DARWIN))
+#   elif defined(HAVE_BUILTIN_UNWIND_INIT) \
+         && !(defined(POWERPC) && defined(DARWIN)) \
+         && !(defined(I386) && defined(RTEMS))
       /* This was suggested by Richard Henderson as the way to  */
       /* force callee-save registers and register windows onto  */
       /* the stack.                                             */
@@ -267,8 +266,8 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
         for (; (char *)i < lim; i++) {
             *i = 0;
         }
-#       if defined(MSWIN32) || defined(MSWINCE) \
-                  || defined(UTS4) || defined(LINUX) || defined(EWS4800)
+#       if defined(MSWIN32) || defined(MSWINCE) || defined(UTS4) \
+           || defined(LINUX) || defined(EWS4800) || defined(RTEMS)
           (void) setjmp(regs);
 #       else
           (void) _setjmp(regs);
index 654332eebffc7249b5db4dfa78ddf1e92c48545e..63a105270190ee0e6d44d1136c8a4e3f6e83af21 100644 (file)
@@ -539,7 +539,7 @@ void *GC_CALLBACK reverse_test_inner(void *data)
 #   elif defined(PCR)
       /* PCR default stack is 100K.  Stack frames are up to 120 bytes. */
 #     define BIG 700
-#   elif defined(MSWINCE)
+#   elif defined(MSWINCE) || defined(RTEMS)
       /* WinCE only allows 64K stacks */
 #     define BIG 500
 #   elif defined(OSF1)
@@ -1377,12 +1377,21 @@ void GC_CALLBACK warn_proc(char *msg, GC_word p)
 # define WINMAIN_LPTSTR LPSTR
 #endif
 
-#if !defined(PCR) \
-    && !defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) \
+#if !defined(PCR) && !defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS) \
     || defined(LINT)
 #if defined(MSWIN32) && !defined(__MINGW32__) || defined(MSWINCE)
   int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev,
                        WINMAIN_LPTSTR cmd, int n)
+#elif defined(RTEMS)
+# include <bsp.h>
+# define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+# define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+# define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+# define CONFIGURE_MAXIMUM_TASKS 1
+# define CONFIGURE_INIT
+# define CONFIGURE_INIT_TASK_STACK_SIZE (64*1024)
+# include <rtems/confdefs.h>
+  rtems_task Init(rtems_task_argument ignord)
 #else
   int main(void)
 #endif