[rtems commit] smp: Support ASR path in rtems_task_mode()

Sebastian Huber sebh at rtems.org
Mon Aug 5 13:46:43 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jul 29 15:06:02 2013 +0200

smp: Support ASR path in rtems_task_mode()

---

 cpukit/rtems/src/taskmode.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 3d6dee8..606366b 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -32,11 +32,25 @@ static void _RTEMS_Tasks_Dispatch_if_necessary(
   if ( _Thread_Dispatch_is_enabled() ) {
     bool dispatch_necessary = needs_asr_dispatching;
 
+    /*
+     * FIXME: This locking approach is brittle.  It only works since the
+     * current simple SMP scheduler has no support for the non-preempt mode.
+     */
+#if defined( RTEMS_SMP )
+    ISR_Level level;
+
+    _ISR_Disable( level );
+#endif
+
     if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) {
       dispatch_necessary = true;
       _Thread_Dispatch_necessary = dispatch_necessary;
     }
 
+#if defined( RTEMS_SMP )
+    _ISR_Enable( level );
+#endif
+
     if ( dispatch_necessary ) {
       _Thread_Dispatch();
     }




More information about the vc mailing list