Subject: uiomove and bus-ified drivers
To: None <tech-kern@NetBSD.ORG>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 12/17/1997 14:32:10
Yesterday, I was looking at a contributed driver that contained a line
like:
uiomove((caddr_t)(sc->sc_memt + sc->sc_memh + uio->uio_offset),
length, uio);
obviously, this is not correct. However, what *is* the correct solution
here? Should there always be an intermediate copy to a buffer like:
bus_space_read_multi_1(sc->sc_memt, sc->sc_memh, uio->uio_offset,
buf, length);
uiomove(buf, length, uio);
This is not very efficient. Am I missing something obvious?
Leo.