On 10/11/22 02:48, Peter Maydell wrote:
+# define const_le64(_x) (_x)
# define const_le32(_x) (_x)
# define const_le16(_x) (_x)
#endif
This is kind of a weird API, because:
* it only exists for little-endian, not big-endian
* we use it in exactly two files (linux-user/elfload.c and
hw/input/virtio-input-hid.c)
which leaves me wondering if there's a better way of doing
it that I'm missing. But maybe it's just that we never filled
out the missing bits of the API surface because we haven't
needed them yet. Richard ?
It's piecemeal because, as you note, very few places require a version of byte swapping
that must be applicable to static data. I certainly don't want to completely fill this
out and have most of it remain unused.
r~