Subject: Re: 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 22:58:45
On Wed 17 Dec 1997, Jason Thorpe wrote:
> 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.

It is a driver for a Leonardo VME graphics card. The framebuffer maps
into VME memory. The read/write functions used the uiomove().

I was more or less hoping I missed something. That extra copy bothers
me.

Leo.