]> git.ipfire.org Git - thirdparty/qemu.git/commit
include/exec: Provide the tswap() functions for target independent code, too
authorThomas Huth <thuth@redhat.com>
Tue, 11 Apr 2023 18:34:17 +0000 (20:34 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 20 Sep 2023 07:17:02 +0000 (10:17 +0300)
commitaeb931d82b13c50587268f462dcd46b23d2086ff
treeb24cfce6729960c56cfd4e03996764bb18cd4a48
parent3af03de983108bc8c60a1a274b3e81a9553d4ce1
include/exec: Provide the tswap() functions for target independent code, too

In some cases of target independent code, it would be useful to have access
to the functions that swap endianess in case it differs between guest and
host. Thus re-implement the tswapXX() functions in a new header that can be
included separately. The check whether the swapping is needed continues to
be done at compile-time for target specific code, while it is done at
run-time in target-independent code.

Message-Id: <20230411183418.1640500-3-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 24be3369ad63c3882be42dd510a45bad52816fd1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(trivial change needed for the next commit 058096f1c5
 "hw/char/riscv_htif: Fix the console syscall on big endian hosts")
include/exec/cpu-all.h
include/exec/tswap.h [new file with mode: 0644]