Changeset 49cdf40 in rtems


Ignore:
Timestamp:
Jun 12, 2013, 7:25:39 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
5c78940d
Parents:
ec978d9
git-author:
Sebastian Huber <sebastian.huber@…> (06/12/13 07:25:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/13 14:26:06)
Message:

score: Add and use _Thread_Dispatch_is_enabled()

Delete _Thread_Dispatch_in_critical_section() and
_Thread_Is_dispatching_enabled().

Files:
17 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/startup/panic.c

    rec978d9 r49cdf40  
    5757  break;
    5858  }
    59   if ( _Thread_Dispatch_in_critical_section() )
     59  if ( _Thread_Dispatch_is_enabled() )
     60    printk("enabled\n");
     61  else
    6062    printk(
    6163      "  Error occurred in a Thread Dispatching DISABLED context (level %i)\n",
    6264      _Thread_Dispatch_get_disable_level());
    63   else
    64     printk("enabled\n");
    6565
    6666  if ( _ISR_Nest_level ) {
  • c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c

    rec978d9 r49cdf40  
    171171    return;
    172172
    173   if ( _Thread_Dispatch_in_critical_section() ) {
     173  if ( !_Thread_Dispatch_is_enabled() ) {
    174174    return;
    175175  }
  • c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c

    rec978d9 r49cdf40  
    173173    return;
    174174
    175   if ( _Thread_Dispatch_in_critical_section() ) {
     175  if ( !_Thread_Dispatch_is_enabled() ) {
    176176    return;
    177177  }
  • c/src/lib/libcpu/sh/sh7750/score/cpu_asm.c

    rec978d9 r49cdf40  
    9696    return;
    9797
    98   if ( _Thread_Dispatch_in_critical_section() ) {
     98  if ( !_Thread_Dispatch_is_enabled() ) {
    9999    return;
    100100  }
  • c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c

    rec978d9 r49cdf40  
    7070    return;
    7171
    72   if ( _Thread_Dispatch_in_critical_section() ) {
     72  if ( !_Thread_Dispatch_is_enabled() ) {
    7373    return;
    7474  }
  • cpukit/libcsupport/src/malloc_deferred.c

    rec978d9 r49cdf40  
    3232bool malloc_is_system_state_OK(void)
    3333{
    34   if ( _Thread_Dispatch_in_critical_section() )
     34  if ( !_Thread_Dispatch_is_enabled() )
    3535    return false;
    3636
  • cpukit/libcsupport/src/realloc.c

    rec978d9 r49cdf40  
    3939
    4040  if (_System_state_Is_up(_System_state_Get())) {
    41     if (_Thread_Dispatch_in_critical_section())
     41    if (!_Thread_Dispatch_is_enabled())
    4242      return (void *) 0;
    4343
  • cpukit/libcsupport/src/sup_fs_location.c

    rec978d9 r49cdf40  
    179179)
    180180{
    181   if (!_Thread_Dispatch_in_critical_section()) {
     181  if (_Thread_Dispatch_is_enabled()) {
    182182    release_with_count(global_loc, 1);
    183183  } else {
  • cpukit/rtems/src/clocktick.c

    rec978d9 r49cdf40  
    3636
    3737  if ( _Thread_Is_context_switch_necessary() &&
    38        _Thread_Is_dispatching_enabled() )
     38       _Thread_Dispatch_is_enabled() )
    3939    _Thread_Dispatch();
    4040
  • cpukit/score/cpu/lm32/irq.c

    rec978d9 r49cdf40  
    7373    return;
    7474
    75   if ( _Thread_Dispatch_necessary && !_Thread_Dispatch_in_critical_section() ) {
     75  if ( _Thread_Dispatch_necessary && _Thread_Dispatch_is_enabled() ) {
    7676    /* save off our stack frame so the context switcher can get to it */
    7777    _exception_stack_frame = ifr;
  • cpukit/score/cpu/nios2/nios2-iic-irq.c

    rec978d9 r49cdf40  
    118118#endif
    119119
    120     if( !_Thread_Dispatch_in_critical_section() )
     120    if( _Thread_Dispatch_is_enabled() )
    121121    {
    122122      if ( _Thread_Dispatch_necessary ) {
  • cpukit/score/include/rtems/score/coremutex.h

    rec978d9 r49cdf40  
    353353#else
    354354  #define _CORE_mutex_Check_dispatch_for_seize(_wait) \
    355       (_Thread_Dispatch_in_critical_section() \
     355      (!_Thread_Dispatch_is_enabled() \
    356356        && (_wait) \
    357357        && (_System_state_Get() >= SYSTEM_STATE_BEGIN_MULTITASKING))
  • cpukit/score/include/rtems/score/threaddispatch.h

    rec978d9 r49cdf40  
    4646 */
    4747SCORE_EXTERN volatile uint32_t   _Thread_Dispatch_disable_level;
     48
     49/**
     50 * @brief Indicates if the executing thread is inside a thread dispatch
     51 * critical section.
     52 *
     53 * @retval true Thread dispatching is enabled.
     54 * @retval false The executing thread is inside a thread dispatch critical
     55 * section and dispatching is not allowed.
     56 */
     57RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_is_enabled(void)
     58{
     59  return _Thread_Dispatch_disable_level == 0;
     60}
    4861
    4962#if defined(RTEMS_SMP)
     
    6982
    7083  /**
    71    *  @brief Checks if thread dispatch says that we are in a critical section.
    72    *
    73    * This routine returns true if thread dispatch indicates
    74    * that we are in a critical section.
    75    */
    76   bool _Thread_Dispatch_in_critical_section(void);
    77 
    78   /**
    7984   *  @brief Returns value of the the thread dispatch level.
    8085   *
     
    105110  uint32_t _Thread_Dispatch_decrement_disable_level(void);
    106111#else /* RTEMS_SMP */
    107   /**
    108    * @brief _Thread_Dispatch_in_critical_section
    109    *
    110    * This routine returns true if thread dispatch indicates
    111    * that we are in a critical section.
    112    */
    113   RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void)
    114   {
    115      if (  _Thread_Dispatch_disable_level == 0 )
    116       return false;
    117 
    118      return true;
    119   }
    120 
    121112  /**
    122113   * @brief Get thread dispatch disable level.
     
    247238}
    248239
    249 /**
    250  * This function returns true if dispatching is disabled, and false
    251  * otherwise.
    252  */
    253 
    254 RTEMS_INLINE_ROUTINE bool _Thread_Is_dispatching_enabled( void )
    255 {
    256   return  ( _Thread_Dispatch_in_critical_section() == false );
    257 }
    258 
    259240/** @} */
    260241
  • cpukit/score/src/heapfree.c

    rec978d9 r49cdf40  
    8888     * disable level is a way to detect this use case.
    8989     */
    90     if ( !_Thread_Dispatch_in_critical_section() ) {
     90    if ( _Thread_Dispatch_is_enabled() ) {
    9191      Heap_Block *const next = block->Protection_begin.next_delayed_free_block;
    9292      if ( next == NULL ) {
  • cpukit/score/src/pheapwalk.c

    rec978d9 r49cdf40  
    3838   * NOTE: Dispatching is also disabled during initialization.
    3939   */
    40   if ( _Thread_Dispatch_in_critical_section() == false ) {
     40  if ( _Thread_Dispatch_is_enabled() ) {
    4141    _RTEMS_Lock_allocator();
    4242      status = _Heap_Walk( the_heap, source, do_dump );
  • cpukit/score/src/threaddispatchdisablelevel.c

    rec978d9 r49cdf40  
    3838  level_lock->owner_cpu = NO_OWNER_CPU;
    3939  _Thread_Dispatch_set_disable_level( 1 );
    40 }
    41 
    42 bool _Thread_Dispatch_in_critical_section(void)
    43 {
    44   if (  _Thread_Dispatch_disable_level == 0 )
    45    return false;
    46 
    47   return true;
    4840}
    4941
  • testsuites/support/include/tmacros.h

    rec978d9 r49cdf40  
    5555  do { \
    5656    if ( (_expect) != -1 \
    57            && ((_Thread_Dispatch_in_critical_section() == false && (_expect) != 0) \
    58              || (_Thread_Dispatch_in_critical_section() && (_expect) == 0)) \
     57           && ((!_Thread_Dispatch_is_enabled() == false && (_expect) != 0) \
     58             || (!_Thread_Dispatch_is_enabled() && (_expect) == 0)) \
    5959    ) { \
    6060      printk( \
    6161        "\n_Thread_Dispatch_disable_level is (%" PRId32 \
    6262           ") not %d detected at %s:%d\n", \
    63          _Thread_Dispatch_in_critical_section(), (_expect), __FILE__, __LINE__ ); \
     63         !_Thread_Dispatch_is_enabled(), (_expect), __FILE__, __LINE__ ); \
    6464      FLUSH_OUTPUT(); \
    6565      rtems_test_exit( 1 ); \
Note: See TracChangeset for help on using the changeset viewer.