When reading via memory, read in (amount + 1) / 2 (to properly round

up) rather than amount + 1 / 2, which is the same as amount, or 2x too
many words which leads to data corruption.

# This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.
This commit is contained in:
Warner Losh 2009-03-28 06:22:11 +00:00
parent a53e89e3a1
commit 84e924047d

View File

@ -1311,7 +1311,7 @@ ed_shmem_readmem16(struct ed_softc *sc, bus_size_t src, uint8_t *dst,
uint16_t amount)
{
bus_space_read_region_2(sc->mem_bst, sc->mem_bsh, src, (uint16_t *)dst,
amount + 1 / 2);
(amount + 1) / 2);
}
/*