Dear all,

I've a strange problem I cannot understand...
I implemented a piece of code within the FreeBSD 7.2 kernel that basically 
allocate a per-thread memory page to store a certain amount of information that 
must be read and written without crossing user to kernel and kernel to user 
boundaries.
To read and write the memory page I decided to allocate it in kernel space and 
then mmap'ing it to user space using a "virtual cdev" as an entry point for 
user space threads. The implementation of the mmap I came up with is really 
trivial, I basically do:

*paddr = vtophys(curthread->private_info);

Now for the problem.
I enter the mmap and private_info is the correct kernel space virtual address, 
each thread as its own address and the physical address - returned by vtophys - 
is different too. The problem is that when I come back to user space all the 
threads write in memory page mapped by the first thread that called the mmap 
leaving their memory pages untouched.

This problem bugs me but I cannot find a solution. I don't really understand 
the behavior.

Any ideas?
Thanks a lot,
Filippo


_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to