From 109f09d2849db75ea51452dff1169f4418ac74b5 Mon Sep 17 00:00:00 2001 From: ivmai Date: Mon, 11 Apr 2011 20:20:05 +0000 Subject: [PATCH] 2011-04-11 Ivan Maidanski (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. --- ChangeLog | 9 +++++++++ mach_dep.c | 21 ++++++++++----------- tests/test.c | 15 ++++++++++++--- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d700e09..318e6a3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-04-11 Ivan Maidanski (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 (mostly really Jim Meyering) * configure.host: Remove doubled words in comments. diff --git a/mach_dep.c b/mach_dep.c index 54697759..416dec8a 100644 --- a/mach_dep.c +++ b/mach_dep.c @@ -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); diff --git a/tests/test.c b/tests/test.c index 654332ee..63a10527 100644 --- a/tests/test.c +++ b/tests/test.c @@ -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 +# 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_task Init(rtems_task_argument ignord) #else int main(void) #endif -- 2.40.0