lkml.org 
[lkml]   [1999]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: locking user memory and kiobuf
Bret Indrelee wrote:
> > Note struct kiobuf includes an array of pages which causes some of my
> > confusion. Is it legal/possible to do:
> >
> > /* maps in four pages for read/write access */
> > err = map_user_kiobuf (WRITE, iobuf, (ulong) vmaddr,
> > PAGE_SIZE * 4);
> >
> > /* manipulate data in chunks greater than PAGE_SIZE */
> > phys = page_address(iobuf->maplist[0]);
> > memcpy (foo, phys, PAGE_SIZE * 4);
>
> The pages should be virtually contiguous in user space, so I think something
> like this my work.
>
> Does page_address() return a virtual or physical address? To me it looks
> like it may be a physical address, in which case you would have to do:
> memcpy (foo, phys_to_virt(phys), PAGE_SIZE *4);

Not true. The above code example was in kernel space, and the memcpy is
definitely in kernel (physical) address space as well.

--
Jeff Garzik | Just once, I wish we would encounter
Building 1024 | an alien menace that wasn't immune to
MandrakeSoft, Inc. | bullets. -- The Brigadier, "Dr. Who"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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