Subject: kernfs and mmap
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 05/05/2006 23:59:54
Hi,
for Xen-3 I need to support mmap on a kernfs file. I see there was some
code in kernfs but it was removed, it was probably incomplete. However,
it looks like it can call a per-entry mmap function and it's exactly
what I need. EOPNOTSUP is will be returned for entries that don't support
mmap.

Now, the problem is what do I have to do in my entry-specific funtion.
I have a struct vop_mmap_args*, and I need to map in the process VM space
a page which is already mapped in kernel space (yes, it will be shared
memory, and the space to be mapped is only one page long). How can I do this ?
Is there some code doing this already in the tree ?

Note that this file in /kern appears as a regular file, and I'd prefer to
keep it this way (not turn it into a character device)

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--