lkml.org 
[lkml]   [2000]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mapping user space buffer to kernel address space
Hello,

> On 13 Oct 00 at 15:31, mdaljeet@in.ibm.com wrote:
>
> > I have a user buffer and i want to map it to kernel address space
> > can anyone tell how to do this like in AIX we have xmattach
>
> Look at mm/memory.c:map_user_kiobuf. It is used by drivers/char/raw.c,
> or by drivers/media/video/bttv-driver.c, for example. It is 2.4 solution.
>
> For 2.2 solution, you have to
> (1) pagein page to memory (getuser(c, (char*)addr)),
> (2) walk pagetables (yourself, as p[gm]d_offset and pte_offset are 2.3 things),
> (3) increment page reference count (get_page(mem_map + pagenr))
> I believe that it is implemented by 2.2 drivers/char/bttv.c, and by
> vmware's vmmon module.
>

You can also apply the raw I/O patches to 2.2 and export the kiobuf
functions. I have a patch against 2.2.17 (with bugfixes), anyone who
needs it e-mail me and I'll send it along. This provides a *nearly*
compatible solution to 2.4, and it's much cleaner than driver-specific
hacks.

--
Eric Lowe
Software Engineer, Systran Corporation
elowe@systran.com


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

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