[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/12] util: add atomic64
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/12] util: add atomic64 |
Date: |
Tue, 11 Sep 2018 05:43:38 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
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~
- [Qemu-devel] [PATCH v2 09/12] cpus: access .qemu_icount with atomic64, (continued)
- [Qemu-devel] [PATCH v2 09/12] cpus: access .qemu_icount with atomic64, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 11/12] target/i386/translate: use thread-local storage in !user-mode, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 10/12] cpus: access .qemu_icount_bias with atomic64, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 12/12] configure: enable mttcg for i386 and x86_64, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 01/12] cacheinfo: add i/d cache_linesize_log, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 02/12] util: add atomic64, Emilio G. Cota, 2018/09/10
[Qemu-devel] [PATCH v2 06/12] atomic: fix comment s/x64_64/x86_64/, Emilio G. Cota, 2018/09/10
[Qemu-devel] [PATCH v2 05/12] test-rcu-list: access n_reclaims and n_nodes_removed with atomic64, Emilio G. Cota, 2018/09/10