remapping kernel buffer in VMS of user process

Alexej Sokolov bsd.quest at googlemail.com
Sun Nov 30 17:39:34 PST 2008


Hello, 

I would like to remap some buffers allocated in kernel space to memory
space of certain process. 

For Example, in attach function of driver: 

static int
driver_attach {
	...
	struct vmspace *vms = some_thread->td_proc->p_vmspace;
	bufp = malloc (PAGE_SIZE, M_DEVBUF, M_NOWAIT);

	/* 	How to create in vms of some_thread->td_proc remapping of buffer 
		pointed  (in kernel) by bufp ? 
		some_thread should access the buffer using its virtual user 
		addresses  and driver should access the same data using its kernel 
		virtual addresses (bufp) 
	*/

	...

}
-- 
Alexej Sokolov <bsd.quest at googlemail.com>


More information about the freebsd-hackers mailing list