Date: Thu, 22 Mar 2012 15:33:53 -0400 From: Ryan Stone <rysto32@gmail.com> To: Eric Saint-Etienne <eric.saintetienne@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: malloc pages map to user space Message-ID: <CAFMmRNxvLz9G73Kn2BXq9WG5-0ZcTN%2BSumawWDzz5DRj=hN4PQ@mail.gmail.com> In-Reply-To: <CACJX%2B51Po_RfhUF7Ba1VT0XLfLWQYWFmnRBRcNuDp%2B3nh_AopQ@mail.gmail.com> References: <CACJX%2B52DPPYea5k6QxQ6WQ62GEA9YHGr4y=ETUpPArNL83kh5w@mail.gmail.com> <CACJX%2B535YeOwWZodE1w8jiECKbDgyBbZgYDd=M31NwyTMTx83g@mail.gmail.com> <CACJX%2B51Po_RfhUF7Ba1VT0XLfLWQYWFmnRBRcNuDp%2B3nh_AopQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 22, 2012 at 10:42 AM, Eric Saint-Etienne <eric.saintetienne@gmail.com> wrote: > Actually when using kernel_map, the object returned is NULL! However the > the vm_entry_t it returns seems a valid address, its 'object' field is NULL > too (that's consistent) > That's the reason why I didn't find it in any existing 'puclic' map (such as > kernel_map, buffers_map, kmem_map, exec_map or pipe_map) > > But a NULL object isn't good at anything and I'm not sure what to do with > a vm_entry_t only... Any idea how to insert it in the process map? If your kernel module creates a device in /dev that implements the mmap method, then you don't need to worry about mucking around with vm_maps and objects and whatnot. Your mmap method just needs to be able to convert offsets into the device into physical memory addresses, and the vm infrastructure will do the rest for you.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNxvLz9G73Kn2BXq9WG5-0ZcTN%2BSumawWDzz5DRj=hN4PQ>