s-intman-vxworks.adb (Notify_Exception): removed useless check for current task being suspended.
* s-intman-vxworks.adb (Notify_Exception): removed useless check for current task being suspended. * init.c (__gnat_clear_exception): added to reset VxWorks exception count. (__gnat_map_signal): removed test for current task being suspended. From-SVN: r91873
This commit is contained in:
parent
de40e4dd33
commit
8cd9e2ac30
|
@ -1661,6 +1661,10 @@ __gnat_initialize ()
|
||||||
#include <intLib.h>
|
#include <intLib.h>
|
||||||
#include <iv.h>
|
#include <iv.h>
|
||||||
|
|
||||||
|
#ifdef VTHREADS
|
||||||
|
#include "private/vThreadsP.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int __gnat_inum_to_ivec (int);
|
extern int __gnat_inum_to_ivec (int);
|
||||||
static void __gnat_error_handler (int, int, struct sigcontext *);
|
static void __gnat_error_handler (int, int, struct sigcontext *);
|
||||||
void __gnat_map_signal (int);
|
void __gnat_map_signal (int);
|
||||||
|
@ -1686,6 +1690,16 @@ __gnat_inum_to_ivec (int num)
|
||||||
return INUM_TO_IVEC (num);
|
return INUM_TO_IVEC (num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* VxWorks expects the field excCnt to be zeroed when a signal is handled.
|
||||||
|
The VxWorks version of longjmp does this; gcc's builtin_longjmp does not */
|
||||||
|
void
|
||||||
|
__gnat_clear_exception_count (void)
|
||||||
|
{
|
||||||
|
#ifdef VTHREADS
|
||||||
|
taskIdCurrent->vThreads.excCnt = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Exported to 5zintman.adb in order to handle different signal
|
/* Exported to 5zintman.adb in order to handle different signal
|
||||||
to exception mappings in different VxWorks versions */
|
to exception mappings in different VxWorks versions */
|
||||||
void
|
void
|
||||||
|
@ -1700,11 +1714,11 @@ __gnat_map_signal (int sig)
|
||||||
exception = &constraint_error;
|
exception = &constraint_error;
|
||||||
msg = "SIGFPE";
|
msg = "SIGFPE";
|
||||||
break;
|
break;
|
||||||
|
#ifdef VTHREADS
|
||||||
case SIGILL:
|
case SIGILL:
|
||||||
exception = &constraint_error;
|
exception = &constraint_error;
|
||||||
msg = "SIGILL";
|
msg = "Floating point exception or SIGILL";
|
||||||
break;
|
break;
|
||||||
#ifdef VTHREADS
|
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
exception = &storage_error;
|
exception = &storage_error;
|
||||||
msg = "SIGSEGV: possible stack overflow";
|
msg = "SIGSEGV: possible stack overflow";
|
||||||
|
@ -1714,6 +1728,10 @@ __gnat_map_signal (int sig)
|
||||||
msg = "SIGBUS: possible stack overflow";
|
msg = "SIGBUS: possible stack overflow";
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
|
case SIGILL:
|
||||||
|
exception = &constraint_error;
|
||||||
|
msg = "SIGILL";
|
||||||
|
break;
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
exception = &program_error;
|
exception = &program_error;
|
||||||
msg = "SIGSEGV";
|
msg = "SIGSEGV";
|
||||||
|
@ -1728,6 +1746,7 @@ __gnat_map_signal (int sig)
|
||||||
msg = "unhandled signal";
|
msg = "unhandled signal";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__gnat_clear_exception_count ();
|
||||||
Raise_From_Signal_Handler (exception, msg);
|
Raise_From_Signal_Handler (exception, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1745,11 +1764,6 @@ __gnat_error_handler (int sig, int code, struct sigcontext *sc)
|
||||||
sigdelset (&mask, sig);
|
sigdelset (&mask, sig);
|
||||||
sigprocmask (SIG_SETMASK, &mask, NULL);
|
sigprocmask (SIG_SETMASK, &mask, NULL);
|
||||||
|
|
||||||
/* VxWorks will suspend the task when it gets a hardware exception. We
|
|
||||||
take the liberty of resuming the task for the application. */
|
|
||||||
if (taskIsSuspended (taskIdSelf ()) != 0)
|
|
||||||
taskResume (taskIdSelf ());
|
|
||||||
|
|
||||||
__gnat_map_signal (sig);
|
__gnat_map_signal (sig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ package body System.Interrupt_Management is
|
||||||
|
|
||||||
procedure Notify_Exception (signo : Signal) is
|
procedure Notify_Exception (signo : Signal) is
|
||||||
Mask : aliased sigset_t;
|
Mask : aliased sigset_t;
|
||||||
My_Id : t_id;
|
|
||||||
|
|
||||||
Result : int;
|
Result : int;
|
||||||
pragma Unreferenced (Result);
|
pragma Unreferenced (Result);
|
||||||
|
@ -96,16 +95,6 @@ package body System.Interrupt_Management is
|
||||||
Result := sigdelset (Mask'Access, signo);
|
Result := sigdelset (Mask'Access, signo);
|
||||||
Result := pthread_sigmask (SIG_SETMASK, Mask'Unchecked_Access, null);
|
Result := pthread_sigmask (SIG_SETMASK, Mask'Unchecked_Access, null);
|
||||||
|
|
||||||
-- VxWorks will suspend the task when it gets a hardware
|
|
||||||
-- exception. We take the liberty of resuming the task
|
|
||||||
-- for the application.
|
|
||||||
|
|
||||||
My_Id := taskIdSelf;
|
|
||||||
|
|
||||||
if taskIsSuspended (My_Id) /= 0 then
|
|
||||||
Result := taskResume (My_Id);
|
|
||||||
end if;
|
|
||||||
|
|
||||||
Map_And_Raise_Exception (signo);
|
Map_And_Raise_Exception (signo);
|
||||||
end Notify_Exception;
|
end Notify_Exception;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue