On Sun, 28 Dec 2025, Philippe Mathieu-Daudé wrote:
Unaligned memcpy API is buried within 'qemu/bswap.h',
supposed to be related to endianness swapping. Extract
to a new header to clarify.
Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
include/qemu/bswap.h | 62 +------------------------
include/qemu/memory_ldst_unaligned.h | 67 ++++++++++++++++++++++++++++
accel/tcg/translator.c | 1 +
hw/display/ati_2d.c | 1 +
hw/display/sm501.c | 2 +-
hw/remote/vfio-user-obj.c | 1 +
hw/vmapple/virtio-blk.c | 1 +
net/checksum.c | 1 +
ui/vnc-enc-tight.c | 1 +
util/bufferiszero.c | 2 +-
10 files changed, 76 insertions(+), 63 deletions(-)
create mode 100644 include/qemu/memory_ldst_unaligned.h
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index b77ea955de5..e8b944988c3 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -1,6 +1,7 @@
#ifndef BSWAP_H
#define BSWAP_H
+#include "qemu/memory_ldst_unaligned.h"
If it's included here do users need to also include it separately or if so
should some of those users lose bswap.h include now instead of including
both this header and bswap.h? I think it's simpler to only include it here
and let users get it through bswap.h unless you review and remove now
unnecessary bswap.h includes from places that only need this hearder but
I don't know if that's worth the effort.
Regards,
BALATON Zoltan