[lkml]   [2000]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How to transfer memory from PCI memory directly to user space safely and portable?
On Sun, 26 Nov 2000, you wrote:
> On Sun, Nov 26, 2000 at 02:21:31PM +0100, Anders Torger wrote:
> > memcpy_toio(iobase, user_space_src, count);
> I hope count isn't provided by userspace here ?

Fortunately, 'count' is controlled by the driver architecture (ALSA), and not
the user.

> > 1. What happens if the user space memory is swapped to disk? Will
> > verify_area() make sure that the memory is in physical RAM when it
> > returns, or will it return -EFAULT, or will something even worse happen?
> On i386, you'll sleep implicitly waiting for the page fault to be handled;
> in the generic case, anything could happen.

Do you know of an architecture that will not do like i386 in this case?

> > 2. Is this code really portable? I currently have an I386 architecture,
> > and I could use copy_to/from_user on that instead, but that is not
> > portable. Now, by using memcpy_to/fromio instead, is this code fully
> > portable?
> No. It would be portable if you were using memcpy_fromuser_toio and it
> existed.

Oh, I see. Again, I wonder, do you know of any architecture, currently
supported by Linux, where my code would fail? It would be helpful to know.

/Anders Torger
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:0.053 / U:3.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site