summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-03-17 08:09:49 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-03-19 16:55:48 +0100
commit53bd5e3246a02eff102c21d7b7a10629c5c23ff6 (patch)
tree2536a9bfaefd88df601f485bf4afc4ee8a4de4bc
parentfa1e7ea054ae4bde00e3bc4d1996fa05ed001a6d (diff)
downloadrtems-53bd5e3246a02eff102c21d7b7a10629c5c23ff6.tar.bz2
rtems: Relax mode checks in rtems_signal_catch()
Check only for invalid modes if a valid handler is presented to rtems_signal_catch(). When NULL is used for the handler, ASR processing is disabled and the mode is not used. Update #4244.
-rw-r--r--cpukit/rtems/src/signalcatch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index 9907908a40..6924f34428 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -39,7 +39,10 @@ rtems_status_code rtems_signal_catch(
ISR_lock_Context lock_context;
#if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE
- if ( !_Modes_Is_interrupt_level_supported( mode_set ) ) {
+ if (
+ asr_handler != NULL &&
+ !_Modes_Is_interrupt_level_supported( mode_set )
+ ) {
return RTEMS_NOT_IMPLEMENTED;
}
#endif
@@ -47,7 +50,10 @@ rtems_status_code rtems_signal_catch(
executing = _Thread_State_acquire_for_executing( &lock_context );
#if defined(RTEMS_SMP)
- if ( !_Modes_Is_preempt_mode_supported( mode_set, executing ) ) {
+ if (
+ asr_handler != NULL &&
+ !_Modes_Is_preempt_mode_supported( mode_set, executing )
+ ) {
_Thread_State_release( executing, &lock_context );
return RTEMS_NOT_IMPLEMENTED;
}