|
From: | Richard Henderson |
Subject: | Re: [RFC PATCH 1/6] qemu/bswap: Add const_le64() |
Date: | Tue, 11 Oct 2022 08:22:33 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 10/11/22 02:48, Peter Maydell wrote:
+# define const_le64(_x) (_x) # define const_le32(_x) (_x) # define const_le16(_x) (_x) #endifThis 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~
[Prev in Thread] | Current Thread | [Next in Thread] |