Changeset 372bee84 in rtems


Ignore:
Timestamp:
Jun 26, 2015, 1:51:28 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
635ed82
Parents:
f59f2fe9
git-author:
Sebastian Huber <sebastian.huber@…> (06/26/15 13:51:28)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/01/15 06:28:01)
Message:

score: Simplify _SMP_ticket_lock_Release()

Add a SMP lock statistics pointer to SMP_lock_Stats_context and drop the
SMP lock statistics parameter from _SMP_ticket_lock_Release().

Location:
cpukit/score/include/rtems/score
Files:
2 edited

Legend:

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

    rf59f2fe9 r372bee84  
    407407  _SMP_ticket_lock_Release( \
    408408    &( cpu )->Lock, \
    409     &( cpu )->Lock_stats, \
    410409    &( cpu )->Lock_stats_context \
    411410  )
  • cpukit/score/include/rtems/score/smplock.h

    rf59f2fe9 r372bee84  
    156156   */
    157157  CPU_Counter_ticks acquire_instant;
     158
     159  /**
     160   * @brief The lock stats used for the last lock acquire.
     161   */
     162  SMP_lock_Stats *stats;
    158163} SMP_lock_Stats_context;
    159164
     
    189194
    190195/**
    191  * @brief Destroys an SMP lock statistics block.
    192  *
    193  * @param[in] stats The SMP lock statistics block.
     196 * @brief Updates an SMP lock statistics block during a lock release.
     197 *
    194198 * @param[in] stats_context The SMP lock statistics context.
    195199 */
    196200static inline void _SMP_lock_Stats_release_update(
    197   SMP_lock_Stats *stats,
    198201  const SMP_lock_Stats_context *stats_context
    199202);
     
    309312  }
    310313  ++stats->contention_counts[initial_queue_length];
     314
     315  stats_context->stats = stats;
    311316#endif
    312317}
     
    335340#if defined( RTEMS_PROFILING )
    336341  ,
    337   SMP_lock_Stats *stats,
    338342  const SMP_lock_Stats_context *stats_context
    339343#endif
     
    345349
    346350#if defined( RTEMS_PROFILING )
    347   _SMP_lock_Stats_release_update( stats, stats_context );
     351  _SMP_lock_Stats_release_update( stats_context );
    348352#endif
    349353
     
    355359 *
    356360 * @param[in] lock The SMP ticket lock control.
    357  * @param[in] stats The SMP lock statistics.
    358361 * @param[in] stats_context The SMP lock statistics context.
    359362 */
    360363#if defined( RTEMS_PROFILING )
    361   #define _SMP_ticket_lock_Release( lock, stats, stats_context ) \
    362     _SMP_ticket_lock_Do_release( lock, stats, stats_context )
    363 #else
    364   #define _SMP_ticket_lock_Release( lock, stats, stats_context ) \
     364  #define _SMP_ticket_lock_Release( lock, stats_context ) \
     365    _SMP_ticket_lock_Do_release( lock, stats_context )
     366#else
     367  #define _SMP_ticket_lock_Release( lock, stats_context ) \
    365368    _SMP_ticket_lock_Do_release( lock )
    366369#endif
     
    503506  _SMP_ticket_lock_Release(
    504507    &lock->Ticket_lock,
    505     &lock->Stats,
    506508    &context->Stats_context
    507509  );
     
    678680
    679681static inline void _SMP_lock_Stats_release_update(
    680   SMP_lock_Stats *stats,
    681682  const SMP_lock_Stats_context *stats_context
    682683)
    683684{
     685  SMP_lock_Stats *stats = stats_context->stats;
    684686  CPU_Counter_ticks first = stats_context->acquire_instant;
    685687  CPU_Counter_ticks second = _CPU_Counter_read();
Note: See TracChangeset for help on using the changeset viewer.