Changeset 35453000 in rtems


Ignore:
Timestamp:
Oct 17, 2011, 6:51:44 PM (10 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 5, master
Children:
c0b35f9
Parents:
d63f1c9
Message:

2011-10-17 Daniel Hellstrom <daniel@…>

PR 1935/cpukit

  • score/include/rtems/score/smplock.h, score/src/smplock.c: SMP nested count variable was being overritten when nested lock was taken more than once.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rd63f1c9 r35453000  
     12011-10-17      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        PR 1935/cpukit
     4        * score/include/rtems/score/smplock.h, score/src/smplock.c: SMP nested
     5        count variable was being overritten when nested lock was taken more
     6        than once.
     7
    182011-10-17      Sebastian Huber <sebastian.huber@embedded-brains.de>
    29
  • cpukit/score/include/rtems/score/smplock.h

    rd63f1c9 r35453000  
    5151 */
    5252typedef struct {
     53  SMP_lock_spinlock_simple_Control lock;
    5354  uint32_t  count;
    5455  int       cpu_id;
  • cpukit/score/src/smplock.c

    rd63f1c9 r35453000  
    115115)
    116116{
     117  lock->lock = 0;
    117118  lock->count = 0;
    118119  lock->cpu_id = -1;
     
    144145    lock->cpu_id = -1;
    145146    debug_logit( 'U', lock );
     147    lock->count  = 0;
    146148    RTEMS_COMPILER_MEMORY_BARRIER();
    147     lock->count = 0;
     149    lock->lock = 0;
    148150  } else {
    149151    debug_logit( 'u', lock );
     
    175177  while (1) {
    176178    RTEMS_COMPILER_MEMORY_BARRIER();
    177     SMP_CPU_SWAP( &lock->count, value, previous );
     179    SMP_CPU_SWAP( &lock->lock, value, previous );
    178180    RTEMS_COMPILER_MEMORY_BARRIER();
    179181    if ( previous == 0 ) {
     
    191193
    192194  lock->cpu_id = cpu_id;
     195  lock->count = 1;
    193196  debug_logit( 'L', lock );
    194197
Note: See TracChangeset for help on using the changeset viewer.