diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2020-11-10 22:52:49 +0100 |
|---|---|---|
| committer | Jason Wang <jasowang@redhat.com> | 2020-11-11 20:34:36 +0800 |
| commit | 676ea985c0d13c9d39b9ead4c60005abb9ea4218 (patch) | |
| tree | f9b6317f2d24de711595330538bb56c231dfd951 /hw/net/virtio-net.c | |
| parent | e0784d8375962da584fa92be8457845f433e2ae2 (diff) | |
| download | focaccia-qemu-676ea985c0d13c9d39b9ead4c60005abb9ea4218.tar.gz focaccia-qemu-676ea985c0d13c9d39b9ead4c60005abb9ea4218.zip | |
hw/net/can/ctucan_core: Handle big-endian hosts
The ctucan driver defines types for its registers which are a union of a uint32_t with a struct with bitfields for the individual fields within that register. This is a bad idea, because bitfields aren't portable. The ctu_can_fd_regs.h header works around the most glaring of the portability issues by defining the fields in two different orders depending on the setting of the __LITTLE_ENDIAN_BITFIELD define. However, in ctucan_core.h this is unconditionally set to 1, which is wrong for big-endian hosts. Set it only if HOST_WORDS_BIGENDIAN is not set. There is no need for a "have we defined it already" guard, because the only place that should set it is ctucan_core.h, which has the usual double-inclusion guard. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Tested-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions