1ace9bad4SMark Rutlandcat <<EOF 2765dcd20SMarco Elverstatic __always_inline ${ret} 3f3e615b4SMark Rutlandarch_${atomic}_read_acquire(const ${atomic}_t *v) 4ace9bad4SMark Rutland{ 5*dc1b4df0SMark Rutland ${int} ret; 6*dc1b4df0SMark Rutland 7*dc1b4df0SMark Rutland if (__native_word(${atomic}_t)) { 8*dc1b4df0SMark Rutland ret = smp_load_acquire(&(v)->counter); 9*dc1b4df0SMark Rutland } else { 10*dc1b4df0SMark Rutland ret = arch_${atomic}_read(v); 11*dc1b4df0SMark Rutland __atomic_acquire_fence(); 12*dc1b4df0SMark Rutland } 13*dc1b4df0SMark Rutland 14*dc1b4df0SMark Rutland return ret; 15ace9bad4SMark Rutland} 16ace9bad4SMark RutlandEOF 17