diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-08 23:53:18 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2025-07-15 02:56:39 -0400 |
| commit | 0f64fb674360393ae09605d8d53bf81c02c78a3e (patch) | |
| tree | ebd6dfc1ff958d482f6a688fadd45e214fd57483 /include/exec | |
| parent | 16c9cb7187ef2414e3ad509048d59a8a4e7d1cd1 (diff) | |
| download | focaccia-qemu-0f64fb674360393ae09605d8d53bf81c02c78a3e.tar.gz focaccia-qemu-0f64fb674360393ae09605d8d53bf81c02c78a3e.zip | |
qemu: Declare all load/store helper in 'qemu/bswap.h'
Restrict "exec/tswap.h" to the tswap*() methods, move the load/store helpers with the other ones declared in "qemu/bswap.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20250708215320.70426-8-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/exec')
| -rw-r--r-- | include/exec/tswap.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 55ffa63359..72219e2c43 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -69,74 +69,4 @@ static inline void tswap64s(uint64_t *s) } } -/* Return ld{word}_{le,be}_p following target endianness. */ -#define LOAD_IMPL(word, args...) \ -do { \ - if (target_big_endian()) { \ - return glue(glue(ld, word), _be_p)(args); \ - } else { \ - return glue(glue(ld, word), _le_p)(args); \ - } \ -} while (0) - -static inline int lduw_p(const void *ptr) -{ - LOAD_IMPL(uw, ptr); -} - -static inline int ldsw_p(const void *ptr) -{ - LOAD_IMPL(sw, ptr); -} - -static inline int ldl_p(const void *ptr) -{ - LOAD_IMPL(l, ptr); -} - -static inline uint64_t ldq_p(const void *ptr) -{ - LOAD_IMPL(q, ptr); -} - -static inline uint64_t ldn_p(const void *ptr, int sz) -{ - LOAD_IMPL(n, ptr, sz); -} - -#undef LOAD_IMPL - -/* Call st{word}_{le,be}_p following target endianness. */ -#define STORE_IMPL(word, args...) \ -do { \ - if (target_big_endian()) { \ - glue(glue(st, word), _be_p)(args); \ - } else { \ - glue(glue(st, word), _le_p)(args); \ - } \ -} while (0) - - -static inline void stw_p(void *ptr, uint16_t v) -{ - STORE_IMPL(w, ptr, v); -} - -static inline void stl_p(void *ptr, uint32_t v) -{ - STORE_IMPL(l, ptr, v); -} - -static inline void stq_p(void *ptr, uint64_t v) -{ - STORE_IMPL(q, ptr, v); -} - -static inline void stn_p(void *ptr, int sz, uint64_t v) -{ - STORE_IMPL(n, ptr, sz, v); -} - -#undef STORE_IMPL - #endif /* TSWAP_H */ |