[rtems commit] score: Delete _Thread_Dispatch_set_disable_level()

Sebastian Huber sebh at rtems.org
Thu Mar 6 08:39:32 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar  4 13:02:18 2014 +0100

score: Delete _Thread_Dispatch_set_disable_level()

This function was only used in some tests and can be replaced with other
functions.

---

 cpukit/score/include/rtems/score/threaddispatch.h |   20 ----------
 cpukit/score/src/threaddispatchdisablelevel.c     |   40 ---------------------
 testsuites/rhealstone/rhilatency/ilatency.c       |    1 -
 testsuites/tmtests/tm26/task1.c                   |    4 ++-
 testsuites/tmtests/tm27/task1.c                   |   10 +----
 5 files changed, 5 insertions(+), 70 deletions(-)

diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h
index cf9b801..54786eb 100644
--- a/cpukit/score/include/rtems/score/threaddispatch.h
+++ b/cpukit/score/include/rtems/score/threaddispatch.h
@@ -121,14 +121,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
   void _Giant_Drop( uint32_t self_cpu );
 
   /**
-   *  @brief Sets thread dispatch level to the value passed in.
-   *
-   * This routine sets thread dispatch level to the
-   * value passed in.
-   */
-  uint32_t _Thread_Dispatch_set_disable_level(uint32_t value);
-
-  /**
    *  @brief Increments the thread dispatch level.
    *
    * This rountine increments the thread dispatch level
@@ -143,18 +135,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void )
   uint32_t _Thread_Dispatch_decrement_disable_level(void);
 #else /* RTEMS_SMP */
   /**
-   * @brief Set thread dispatch disable level.
-   *
-   * This routine sets thread dispatch level to the
-   * value passed in.
-   */
-  RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
-  {
-    _Thread_Dispatch_disable_level = value;
-    return value;
-  }
-
-  /**
    * @brief Increase thread dispatch disable level.
    *
    * This rountine increments the thread dispatch level
diff --git a/cpukit/score/src/threaddispatchdisablelevel.c b/cpukit/score/src/threaddispatchdisablelevel.c
index ec5ac81..b6eb49f 100644
--- a/cpukit/score/src/threaddispatchdisablelevel.c
+++ b/cpukit/score/src/threaddispatchdisablelevel.c
@@ -118,46 +118,6 @@ uint32_t _Thread_Dispatch_decrement_disable_level( void )
   return disable_level;
 }
 
-
-/*
- * Note this method is taking a heavy handed approach to 
- * setting the dispatch level. This may be optimized at a 
- * later timee, but it must be in such a way that the nesting
- * level is decremented by the same number as the dispatch level.
- * This approach is safest until we are sure the nested spinlock
- * is successfully working with smp isr source code.  
- */
-
-uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
-{
-  ISR_Level isr_level;
-  uint32_t disable_level;
-
-  _ISR_Disable_without_giant( isr_level );
-  disable_level = _Thread_Dispatch_disable_level;
-  _ISR_Enable_without_giant( isr_level );
-
-  /*
-   * If we need the dispatch level to go higher 
-   * call increment method the desired number of times.
-   */
-
-  while ( value > disable_level ) {
-    disable_level = _Thread_Dispatch_increment_disable_level();
-  }
-
-  /*
-   * If we need the dispatch level to go lower
-   * call increment method the desired number of times.
-   */
-
-  while ( value < disable_level ) {
-    disable_level = _Thread_Dispatch_decrement_disable_level();
-  }
-
-  return value;
-}
-
 void _Giant_Acquire( void )
 {
   ISR_Level isr_level;
diff --git a/testsuites/rhealstone/rhilatency/ilatency.c b/testsuites/rhealstone/rhilatency/ilatency.c
index 57b26e2..b7f5a1a 100644
--- a/testsuites/rhealstone/rhilatency/ilatency.c
+++ b/testsuites/rhealstone/rhilatency/ilatency.c
@@ -93,7 +93,6 @@ rtems_task Task_1(
 {
   Install_tm27_vector( Isr_handler ) ;
   Interrupt_nest = 0;
-  _Thread_Dispatch_set_disable_level( 0 );
 
   /* Benchmark code */
   benchmark_timer_initialize();
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c
index 416e5f7..37761a4 100644
--- a/testsuites/tmtests/tm26/task1.c
+++ b/testsuites/tmtests/tm26/task1.c
@@ -584,7 +584,9 @@ void complete_test( void )
   set_thread_heir( _Thread_Get_executing() );
   set_thread_dispatch_necessary( false );
 
-  _Thread_Dispatch_set_disable_level( 0 );
+  for (index = 0; index < 2 * OPERATION_COUNT; ++index) {
+    _Thread_Unnest_dispatch();
+  }
 
   /*
    *  Now dump all the times
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index bf04d19..ecf01cb 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -112,8 +112,6 @@ rtems_task Task_1(
 
   Interrupt_nest = 0;
 
-  _Thread_Dispatch_set_disable_level( 0 );
-
   Interrupt_occurred = 0;
 
   benchmark_timer_initialize();
@@ -145,7 +143,7 @@ rtems_task Task_1(
    *  No preempt .. nested
    */
 
-  _Thread_Dispatch_set_disable_level( 1 );
+  _Thread_Disable_dispatch();
 
   Interrupt_nest = 1;
 
@@ -159,7 +157,7 @@ rtems_task Task_1(
 #endif
   Interrupt_return_time = benchmark_timer_read();
 
-  _Thread_Dispatch_set_disable_level( 0 );
+  _Thread_Unnest_dispatch();
 
   put_time(
     "rtems interrupt: entry overhead returns to nested interrupt",
@@ -181,8 +179,6 @@ rtems_task Task_1(
    *  Does a preempt .. not nested
    */
 
-  _Thread_Dispatch_set_disable_level( 0 );
-
 #if defined(RTEMS_SMP)
   _ISR_Disable_without_giant(level);
 #endif
@@ -253,8 +249,6 @@ rtems_task Task_2(
    *  Switch back to the other task to exit the test.
    */
 
-  _Thread_Dispatch_set_disable_level( 0 );
-
 #if defined(RTEMS_SMP)
   rtems_interrupt_disable(level);
 #endif




More information about the vc mailing list