Implement atomic_add_not_zero using LR/SC directly
authorAndrew Waterman <waterman@cs.berkeley.edu>
Wed, 27 Mar 2013 10:22:30 +0000 (03:22 -0700)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Wed, 27 Mar 2013 10:22:30 +0000 (03:22 -0700)
commit36562c9eefd9af5e239b0219c749a2078d8ea966
tree09ae1a3ad689e653ff895dda496a0548573068fb
parent9f5cca6e0e78ef51adc9568610e0b48b52066216
Implement atomic_add_not_zero using LR/SC directly

It takes fewer instructions than the CAS loop and should be less
starvation-prone.
kern/arch/riscv/atomic.h