Changeset da06fe9 in rtems


Ignore:
Timestamp:
Mar 6, 2015, 12:20:44 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
c096dc1
Parents:
5fca9ef
Message:

score: Fix SMP lock implementation

See also:

https://nahratzah.wordpress.com/2012/10/12/a-trivial-fair-spinlock/

http://concurrencyfreaks.blogspot.de/2014/05/relaxed-atomics-optimizations-for.html

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

Legend:

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

    r5fca9ef rda06fe9  
    5050
    5151#define ATOMIC_ORDER_RELEASE CPU_ATOMIC_ORDER_RELEASE
     52
     53#define ATOMIC_ORDER_ACQ_REL CPU_ATOMIC_ORDER_ACQ_REL
    5254
    5355#define ATOMIC_ORDER_SEQ_CST CPU_ATOMIC_ORDER_SEQ_CST
  • cpukit/score/include/rtems/score/cpustdatomic.h

    r5fca9ef rda06fe9  
    5757#define CPU_ATOMIC_ORDER_RELEASE std::memory_order_release
    5858
     59#define CPU_ATOMIC_ORDER_ACQ_REL std::memory_order_acq_rel
     60
    5961#define CPU_ATOMIC_ORDER_SEQ_CST std::memory_order_seq_cst
    6062
     
    8688#define CPU_ATOMIC_ORDER_RELEASE memory_order_release
    8789
     90#define CPU_ATOMIC_ORDER_ACQ_REL memory_order_acq_rel
     91
    8892#define CPU_ATOMIC_ORDER_SEQ_CST memory_order_seq_cst
    8993
     
    114118
    115119#define CPU_ATOMIC_ORDER_RELEASE 3
     120
     121#define CPU_ATOMIC_ORDER_ACQ_REL 4
    116122
    117123#define CPU_ATOMIC_ORDER_SEQ_CST 5
  • cpukit/score/include/rtems/score/smplock.h

    r5fca9ef rda06fe9  
    281281
    282282  my_ticket =
    283     _Atomic_Fetch_add_uint( &lock->next_ticket, 1U, ATOMIC_ORDER_RELAXED );
     283    _Atomic_Fetch_add_uint( &lock->next_ticket, 1U, ATOMIC_ORDER_ACQ_REL );
    284284
    285285#if defined( RTEMS_PROFILING )
Note: See TracChangeset for help on using the changeset viewer.