Subject: Re: uiomove and bus-ified drivers
To: Leo Weppelman <leo@wau.mis.ah.nl>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 12/17/1997 13:41:38
On Wed, 17 Dec 1997 14:32:10 +0100
Leo Weppelman <leo@wau.mis.ah.nl> wrote:
> 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?
What is the driver? In any case, with shared memory devices like this,
you really don't have much of a choice.
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: +1 408 866 1912
NAS: M/S 258-6 Work: +1 650 604 0935
Moffett Field, CA 94035 Pager: +1 415 428 6939