Changeset 3d35bc0 in rtems


Ignore:
Timestamp:
Jan 11, 2017, 12:41:55 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
5aa0fa1
Parents:
4e07d9b3
git-author:
Sebastian Huber <sebastian.huber@…> (01/11/17 12:41:55)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/11/17 12:52:08)
Message:

score: Improve SMP lock debug support

The CPU index starts with zero. Increment it by one, to allow global
SMP locks to reside in the BSS section.

Location:
cpukit/score
Files:
4 edited

Legend:

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

    r4e07d9b3 r3d35bc0  
    9999
    100100#if defined(RTEMS_DEBUG)
    101 #define SMP_LOCK_NO_OWNER 0xffffffff
     101#define SMP_LOCK_NO_OWNER 0
    102102#endif
    103103
     
    177177#endif
    178178
     179#if defined(RTEMS_DEBUG)
     180static inline uint32_t _SMP_lock_Who_am_I( void )
     181{
     182  /*
     183   * The CPU index starts with zero.  Increment it by one, to allow global SMP
     184   * locks to reside in the BSS section.
     185   */
     186  return _SMP_Get_current_processor() + 1;
     187}
     188#endif
     189
    179190static inline void _SMP_lock_Acquire_inline(
    180191  SMP_lock_Control *lock,
     
    193204  );
    194205#if defined(RTEMS_DEBUG)
    195   lock->owner = _SMP_Get_current_processor();
     206  lock->owner = _SMP_lock_Who_am_I();
    196207#endif
    197208}
     
    221232  _Assert( context->lock_used_for_acquire == lock );
    222233  context->lock_used_for_acquire = NULL;
    223   _Assert( lock->owner == _SMP_Get_current_processor() );
     234  _Assert( lock->owner == _SMP_lock_Who_am_I() );
    224235  lock->owner = SMP_LOCK_NO_OWNER;
    225236#else
  • cpukit/score/include/rtems/score/threadqimpl.h

    r4e07d9b3 r3d35bc0  
    468468{
    469469#if defined(RTEMS_SMP)
    470   return the_thread_queue->owner == _SMP_Get_current_processor();
     470  return the_thread_queue->owner == _SMP_lock_Who_am_I();
    471471#else
    472472  return _ISR_Get_level() != 0;
  • cpukit/score/src/smplock.c

    r4e07d9b3 r3d35bc0  
    7373bool _SMP_lock_Is_owner( const SMP_lock_Control *lock )
    7474{
    75   return lock->owner == _SMP_Get_current_processor();
     75  return lock->owner == _SMP_lock_Who_am_I();
    7676}
    7777#endif
  • cpukit/score/src/threadq.c

    r4e07d9b3 r3d35bc0  
    7777  );
    7878#if defined(RTEMS_DEBUG)
    79   the_thread_queue->owner = _SMP_Get_current_processor();
     79  the_thread_queue->owner = _SMP_lock_Who_am_I();
    8080#endif
    8181}
     
    9393  );
    9494#if defined(RTEMS_DEBUG)
    95   the_thread_queue->owner = _SMP_Get_current_processor();
     95  the_thread_queue->owner = _SMP_lock_Who_am_I();
    9696#endif
    9797}
Note: See TracChangeset for help on using the changeset viewer.