On 09/10/2018 04:27 PM, Emilio G. Cota wrote: > +#define GEN_READ(name, type) \ > + type name(const type *ptr) \ > + { \ > + QemuSpin *lock = addr_to_lock(ptr); \ > + type ret; \ > + \ > + qemu_spin_lock(lock); \ > + ret = *ptr; \ > + qemu_spin_unlock(lock); \ > + return ret; \ > + } > + > +GEN_READ(atomic_read_i64, int64_t) > +GEN_READ(atomic_read_u64, uint64_t)
Is there really a good reason to have two external functions instead of having one of them inline and perform a cast? Is this any better than using libatomic? r~