[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu() |
Date: |
Tue, 13 Dec 2022 13:52:18 +0100 |
This partly revert commit d48751ed4f ("xilinx-ethlite:
Simplify byteswapping to/from brams") which states the
packet data is stored in big-endian.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/net/xilinx_ethlite.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c
index 6e09f7e422..efe627d734 100644
--- a/hw/net/xilinx_ethlite.c
+++ b/hw/net/xilinx_ethlite.c
@@ -24,8 +24,8 @@
#include "qemu/osdep.h"
#include "qemu/module.h"
+#include "qemu/bswap.h"
#include "qom/object.h"
-#include "cpu.h" /* FIXME should not use tswap* */
#include "hw/sysbus.h"
#include "hw/irq.h"
#include "hw/qdev-properties.h"
@@ -102,8 +102,8 @@ eth_read(void *opaque, hwaddr addr, unsigned int size)
D(qemu_log("%s " TARGET_FMT_plx "=%x\n", __func__, addr * 4, r));
break;
- default:
- r = tswap32(s->regs[addr]);
+ default: /* Packet data */
+ r = be32_to_cpu(s->regs[addr]);
break;
}
return r;
@@ -160,8 +160,8 @@ eth_write(void *opaque, hwaddr addr,
s->regs[addr] = value;
break;
- default:
- s->regs[addr] = tswap32(value);
+ default: /* Packet data */
+ s->regs[addr] = cpu_to_be32(value);
break;
}
}
--
2.38.1
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), (continued)
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Peter Maydell, 2022/12/13
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Daniel Henrique Barboza, 2022/12/16
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Peter Maydell, 2022/12/16
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), David Gibson, 2022/12/19
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Peter Maydell, 2022/12/19
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), David Gibson, 2022/12/20
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Peter Maydell, 2022/12/21
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Cédric Le Goater, 2022/12/21
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), Peter Maydell, 2022/12/21
- Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE), David Gibson, 2022/12/21
[RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(),
Philippe Mathieu-Daudé <=
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Peter Maydell, 2022/12/13
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Edgar E. Iglesias, 2022/12/13
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Peter Maydell, 2022/12/13
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Edgar E. Iglesias, 2022/12/13
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Peter Maydell, 2022/12/13
- Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu(), Edgar E. Iglesias, 2022/12/13
Re: [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls, Cédric Le Goater, 2022/12/13