Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2008 02:38:51 +0100
From:      Alexej Sokolov <bsd.quest@googlemail.com>
To:        freebsd-hackers@freebsd.org
Subject:   remapping kernel buffer in VMS of user process
Message-ID:  <20081201013851.GA20549@debian.samsung.router>

next in thread | raw e-mail | index | archive | help
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@googlemail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081201013851.GA20549>