diff options
author | Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> | 2021-05-07 05:40:35 +0000 |
---|---|---|
committer | Alfredo Dal'Ava Junior <alfredo@FreeBSD.org> | 2021-08-30 16:14:20 +0000 |
commit | 7e583075a411cecbad1ca88b13b82c8a357d5b4e (patch) | |
tree | ca6303b0cf2472ae6dfc2a1c6293c59fa8e64a9b /sys/dev/virtio | |
parent | b3931cb0a8077cc650738404f03e4fa7a1943bd3 (diff) | |
download | src-7e583075a411cecbad1ca88b13b82c8a357d5b4e.tar.gz src-7e583075a411cecbad1ca88b13b82c8a357d5b4e.zip |
Diffstat (limited to 'sys/dev/virtio')
-rw-r--r-- | sys/dev/virtio/pci/virtio_pci_modern.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/virtio/pci/virtio_pci_modern.c b/sys/dev/virtio/pci/virtio_pci_modern.c index 7029d2ff76ce..33fdebf19402 100644 --- a/sys/dev/virtio/pci/virtio_pci_modern.c +++ b/sys/dev/virtio/pci/virtio_pci_modern.c @@ -1315,13 +1315,15 @@ vtpci_modern_read_common_1(struct vtpci_modern_softc *sc, bus_size_t off) static uint16_t vtpci_modern_read_common_2(struct vtpci_modern_softc *sc, bus_size_t off) { - return (bus_read_2(&sc->vtpci_common_res_map.vtrm_map, off)); + return virtio_htog16(true, + bus_read_2(&sc->vtpci_common_res_map.vtrm_map, off)); } static uint32_t vtpci_modern_read_common_4(struct vtpci_modern_softc *sc, bus_size_t off) { - return (bus_read_4(&sc->vtpci_common_res_map.vtrm_map, off)); + return virtio_htog32(true, + bus_read_4(&sc->vtpci_common_res_map.vtrm_map, off)); } static void @@ -1335,14 +1337,16 @@ static void vtpci_modern_write_common_2(struct vtpci_modern_softc *sc, bus_size_t off, uint16_t val) { - bus_write_2(&sc->vtpci_common_res_map.vtrm_map, off, val); + bus_write_2(&sc->vtpci_common_res_map.vtrm_map, + off, virtio_gtoh16(true, val)); } static void vtpci_modern_write_common_4(struct vtpci_modern_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(&sc->vtpci_common_res_map.vtrm_map, off, val); + bus_write_4(&sc->vtpci_common_res_map.vtrm_map, + off, virtio_gtoh32(true, val)); } static void |