From 37efd88e58c08ed72d6dc3fa4c2e4eff1ff04b6f Mon Sep 17 00:00:00 2001 From: Jose Ruiz Date: Tue, 5 Aug 2008 11:27:49 +0200 Subject: [PATCH] init.c (__gnat_install_handler for linux): If we are building the Xenomai run time then we need to do two additional things... 2008-08-05 Jose Ruiz * init.c (__gnat_install_handler for linux): If we are building the Xenomai run time then we need to do two additional things: avoid memory swapping and transform the Linux environment task into a native Xenomai task. * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for xenomai run time): Use interface to Xenomai native skin and avoid linux-specific way of setting CPU affinity. (EH_MECHANISM for the xenomai run time): Use sjlj exception mechanism. From-SVN: r138684 --- gcc/ada/gcc-interface/Makefile.in | 23 +++++++++++++++++------ gcc/ada/init.c | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index ff8ebbe..058094c 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -850,13 +850,24 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),) LIBGNAT_TARGET_PAIRS += \ g-soccon.ads +#include + +RT_TASK main_task; +#endif + void __gnat_install_handler (void) { struct sigaction act; +#ifdef __XENO__ + int prio; + + if (__gl_main_priority == -1) + prio = 49; + else + prio = __gl_main_priority; + + /* Avoid memory swapping for this program */ + + mlockall (MCL_CURRENT|MCL_FUTURE); + + /* Turn the current Linux task into a native Xenomai task */ + + rt_task_shadow(&main_task, "environment_task", prio, T_FPU); +#endif + /* Set up signal handler to map synchronous signals to appropriate exceptions. Make sure that the handler isn't interrupted by another signal that might cause a scheduling event! Also setup an alternate -- 2.7.4