Changeset e8d9b26 in rtems


Ignore:
Timestamp:
Mar 22, 2016, 6:24:14 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2518516
Parents:
426f35f
git-author:
Sebastian Huber <sebastian.huber@…> (03/22/16 06:24:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/23/16 06:33:42)
Message:

score: Add and use RTEMS_UNREACHABLE

Location:
cpukit/score
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/assert.h

    r426f35f re8d9b26  
    121121#endif
    122122
    123 /**
    124  * @brief Asserts that this point is not reached during run-time.
    125  */
    126 #if RTEMS_SCHEDSIM
    127 #define _Assert_Not_reached()
    128 #else
    129 #define _Assert_Not_reached() _Assert( 0 )
    130 #endif
    131 
    132123#ifdef __cplusplus
    133124}
  • cpukit/score/include/rtems/score/basedefs.h

    r426f35f re8d9b26  
    191191/* Provided for backward compatibility */
    192192#define RTEMS_COMPILER_PACKED_ATTRIBUTE RTEMS_PACKED
     193
     194#if defined(RTEMS_DEBUG) && !defined(RTEMS_SCHEDSIM)
     195  #define _Assert_Unreachable() _Assert( 0 )
     196#else
     197  #define _Assert_Unreachable() do { } while ( 0 )
     198#endif
     199
     200/**
     201 * @brief Tells the compiler that this program point is unreachable.
     202 */
     203#if defined(__GNUC__) && !defined(RTEMS_SCHEDSIM)
     204  #define RTEMS_UNREACHABLE() \
     205    do { \
     206      __builtin_unreachable(); \
     207      _Assert_Unreachable(); \
     208    } while ( 0 )
     209#else
     210  #define RTEMS_UNREACHABLE() _Assert_Unreachable()
     211#endif
    193212
    194213#if __cplusplus >= 201103L
  • cpukit/score/src/threadglobalconstruction.c

    r426f35f re8d9b26  
    6262  _Thread_Restart( executing, executing, entry );
    6363  _Thread_Enable_dispatch();
    64 
    65   _Assert_Not_reached();
     64  RTEMS_UNREACHABLE();
    6665}
  • cpukit/score/src/threadrestart.c

    r426f35f re8d9b26  
    238238
    239239    _Thread_Enable_dispatch();
    240 
    241     _Assert_Not_reached();
     240    RTEMS_UNREACHABLE();
    242241  } else {
    243242    _Assert( _Thread_Is_life_restarting( previous_life_state ) );
     
    259258      _Thread_Load_environment( executing );
    260259      _Thread_Restart_self( executing );
    261 
    262       _Assert_Not_reached();
     260      RTEMS_UNREACHABLE();
    263261    }
    264262  }
Note: See TracChangeset for help on using the changeset viewer.