aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 14:05:48 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 14:05:48 +0200
commit03a72cd36ee1a0d2bb412f7e7353e30512627fe3 (patch)
treee2488e4fa1bdad3c7f323f40b81091562c736f8b /gcc/ada/init.c
parentfc90cc6293fbe3e3254ed73290f83f6c402c40a7 (diff)
downloadgcc-03a72cd36ee1a0d2bb412f7e7353e30512627fe3.zip
gcc-03a72cd36ee1a0d2bb412f7e7353e30512627fe3.tar.gz
gcc-03a72cd36ee1a0d2bb412f7e7353e30512627fe3.tar.bz2
[multiple changes]
2015-10-20 Yannick Moy <moy@adacore.com> * exp_ch9.adb (Expand_Entry_Barrier): Default initialize local variable Func. 2015-10-20 Jerome Lambourg <lambourg@adacore.com> * init.c (__gnat_error_handler for vxworks): Force SPE bit in the MSR when handling signals 2015-10-20 Arnaud Charlet <charlet@adacore.com> * einfo.ads, sem_ch12.adb, sem_ch6.adb, table.ads, s-stposu.ads, g-table.ads, g-dyntab.ads, makeutl.ads, a-crdlli.ads: Fix typos. 2015-10-20 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): Element iterators over multidimensional arrays create additional loops during expansion. For such loops we create a label as a scope name. Attach this label properly to tree, for use in GNATProve over such element iterators. * sem_attr.adb (Analyze_Attribute, case Loop_Entry): The loop to which the attribute applies comes from source, not from expansion of an element iterator or a quantified expression. * exp_attr.adb (Expand_N_Attribute_Reference): Ditto. From-SVN: r229057
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index c76ae64..1db3009 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -46,6 +46,7 @@
that the __vxworks header appear before any other include. */
#ifdef __vxworks
#include "vxWorks.h"
+#include "version.h" /* for _WRS_VXWORKS_MAJOR */
#endif
#ifdef __ANDROID__
@@ -1916,6 +1917,20 @@ __gnat_error_handler (int sig, siginfo_t *si, void *sc)
{
sigset_t mask;
+ /* VxWorks 7 on e500v2 clears the SPE bit of the MSR when entering CPU
+ exception state. To allow the handler and exception to work properly
+ when they contain SPE instructions, we need to set it back before doing
+ anything else. */
+#if (CPU == PPCE500V2) && (_WRS_VXWORKS_MAJOR == 7)
+ register unsigned msr;
+ /* Read the MSR value */
+ asm volatile ("mfmsr %0" : "=r" (msr));
+ /* Force the SPE bit */
+ msr |= 0x02000000;
+ /* Store to MSR */
+ asm volatile ("mtmsr %0" : : "r" (msr));
+#endif
+
/* VxWorks will always mask out the signal during the signal handler and
will reenable it on a longjmp. GNAT does not generate a longjmp to
return from a signal handler so the signal will still be masked unless