[rtems commit] rtems: Simplify _Signal_Action_handler()

Sebastian Huber sebh at rtems.org
Tue Mar 2 20:47:23 UTC 2021


Module:    rtems
Branch:    master
Commit:    9a13f3796ad48b7b737dffebc3dc6af2dfc0fb64
Changeset: http://git.rtems.org/rtems/commit/?id=9a13f3796ad48b7b737dffebc3dc6af2dfc0fb64

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar  2 10:55:10 2021 +0100

rtems: Simplify _Signal_Action_handler()

Use the invariant that an ASR is only processed if ASR processing is
enabled.

---

 cpukit/rtems/src/signalsend.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/cpukit/rtems/src/signalsend.c b/cpukit/rtems/src/signalsend.c
index 8c4ce10..72407e2 100644
--- a/cpukit/rtems/src/signalsend.c
+++ b/cpukit/rtems/src/signalsend.c
@@ -41,7 +41,6 @@ static void _Signal_Action_handler(
   bool                         normal_is_preemptible;
   uint32_t                     normal_cpu_time_budget;
   Thread_CPU_budget_algorithms normal_budget_algorithm;
-  bool                         normal_asr_is_enabled;
   uint32_t                     normal_isr_level;
   uint32_t                     before_call_isr_level;
   bool                         after_call_is_preemptible;
@@ -68,8 +67,8 @@ static void _Signal_Action_handler(
 
   /* Save normal mode */
 
+  _Assert( asr->is_enabled );
   normal_is_preemptible = executing->is_preemptible;
-  normal_asr_is_enabled = asr->is_enabled;
   normal_cpu_time_budget = executing->cpu_time_budget;
   normal_budget_algorithm = executing->budget_algorithm;
 
@@ -133,13 +132,9 @@ static void _Signal_Action_handler(
    */
 
   after_call_asr_is_enabled = asr->is_enabled;
-  asr->is_enabled = normal_asr_is_enabled;
+  asr->is_enabled = true;
 
-  if (
-    normal_asr_is_enabled &&
-    !after_call_asr_is_enabled &&
-    asr->signals_pending != 0
-  ) {
+  if ( !after_call_asr_is_enabled && asr->signals_pending != 0 ) {
     _Thread_Append_post_switch_action( executing, action );
   }
 }



More information about the vc mailing list