cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

read_acquire (275B)


      1cat <<EOF
      2static __always_inline ${ret}
      3arch_${atomic}_read_acquire(const ${atomic}_t *v)
      4{
      5	${int} ret;
      6
      7	if (__native_word(${atomic}_t)) {
      8		ret = smp_load_acquire(&(v)->counter);
      9	} else {
     10		ret = arch_${atomic}_read(v);
     11		__atomic_acquire_fence();
     12	}
     13
     14	return ret;
     15}
     16EOF