Re: Equivalent of Linux kmap on Mac OS
Re: Equivalent of Linux kmap on Mac OS
- Subject: Re: Equivalent of Linux kmap on Mac OS
- From: Michael Smith <email@hidden>
- Date: Wed, 7 Mar 2007 03:32:12 -0800
On Mar 6, 2007, at 4:35 PM, Bhavesh Davda wrote:
What's the equivalent of Linux's kmap to map a user virtual address
into the kernel memory space so that it is accessible "magically"
(i.e. without any additional mapping/unmapping required) to all other
tasks and kernel threads?
What do you mean by 'accessible "magically"'?
Are you just trying to make a portion of a user map visible in the
kernel map, or are you trying to project that space into other maps
as well? From what I can tell, the Linux 'kmap' call just maps a
single user page somewhere into the kernel address space, so I'm
assuming that you mean "so that other processes can call code in the
kernel and see this page from there".
Typically, you don't want to map user data into the kernel in the
first place; it's expensive and kernel VM is a scarce resource -
typically you will find it's faster just to copy the page in/out. If
you are trying to establish a shared page for the purposes of
communication, I'd be inclined to encourage you to consider the
system's native communication primitives instead. There are lots of
ways of moving map entries around depending on what you're trying to
achieve.
I've already looked at vm_map and AFAICT, that ain't it.
If you're doing this in an I/O Kit kext, the canonical tool for
handling memory in another address space is the IOMemoryDescriptor.
You can use this to map said memory, if you really need it.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden