Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Nov 2005 16:12:49 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        John Giacomoni <John.Giacomoni@colorado.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Sharing the same VM address space between Kernel and UserSpace
Message-ID:  <20051115001249.GA79020@funkthat.com>
In-Reply-To: <AA4AEE17-32CC-4D47-96C0-0B0B0BC13B68@colorado.edu>
References:  <AA4AEE17-32CC-4D47-96C0-0B0B0BC13B68@colorado.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
John Giacomoni wrote this message on Mon, Nov 14, 2005 at 13:39 -0700:
> I am in need of a way to share memory between kernel space and possibly
> multiple different user-space processes for an extended period of time.
> This memory would need to be a single unpageable region.
> 
> I am using the vm routines as cribbed from mmap, however I'd like the
> address spaces to be viewed as the same regardless of which process I'm
> in to avoid swizzling pointers as I'm storing data structures in the
> shared memory region.
> 
> I imagine I'd need to find a way to expose part of the kernel address
> space to user space to accomplish this.
> 
> Is there a way to do this?

Getting a common address between userland processes is easy, as you
can always just use fixed mappings using the MAP_FIXED flag to mmap..

Getting the same address will take some kernel vm magic, and also not
be very portable across platforms, since each platform may/can have a
different code address (though we try to keep them the same)...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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