Re: Equivalent of Linux kmap on Mac OS
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rwB5bvNZ4/GuZqz+tWS4LM6rSpPqwdCJGP3VohZwc7bIsp/DuvGyPhtUUNru1BGgX3UphyqaVROTzlwYlMppnqiBabWQhG2YsAnHMPQSmlRWt18oAcDM9/1RRsn6xgr645d6Q98vteZCRiQAhoe2qOfEn19fxWN5L1cQSek1hhY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dcXHO7/dCUjmCIFXIyJ1iSuC5XoOQteurCJP+eTOSdZR0Nc7XCJu4a+ldVFnc772zLtECSnjrUBEkgOVGY0ljZw/ZHC8A9sy4scMpDB/F+VcJb2YYkXAxzyylkTKc2m9Qc2/AF4cYmLWcZV2uImjN6CSlxsUWoJLhxy+3sL6I/k= Hi Rob, Sure sounds like I can 1. IOMemoryDescriptor::initWithAddress(userAddr,..., kernel_task) to map the user address into the kernel map, and 2. prepare() to wire the address down. Have I got that right? But then, what's the kernel virtual address I can use from other tasks running in the KEXT to access this kernel mapped address? Thanks! - Bhavesh This sounds like a perfect use of an I/O Kit IOMemoryDescriptor. Have you looked at this and would it be an option for you? -Rob -- Rob McKeever, rmckeever@apple.com Developer Technical Support, CoreOS/Hardware Apple Computer On Mar 7, 2007, at 9:54 AM, Bhavesh Davda wrote:
Sorry for not providing more context.
Yes, what I'm looking for is something that has memory semantics (i.e. I don't need to call map/unmap functions ever time I want to access this piece of memory), where the memory is allocated in a user space task, but should be accessible without these map/unmap calls like "global" memory within a KEXT, for all tasks running the KEXT code as part of a synchronous system call, and also for all kernel threads running the KEXT code as some sort of a "bottom-half".
I understand that in the context of the userspace task that allocates and owns the memory, the kernel (KEXT) doesn't need any special mapping code to access the tasks userspace memory.
I'm also not looking for the bounce buffer element of Linux's kmap. All I would like is a way to, through non-kernel-private APIs, be able to map the userspace memory into the kernel map, so that all tasks can access it in KEXT code.
Hopefully this makes the intent more clear.
Thank you!
- Bhavesh
On 3/7/07, Michael Smith <drivers@mu.org> wrote:
On Mar 7, 2007, at 3:45 AM, Anton Altaparmakov wrote:
If you are not working with a file system then I would suggest checking out what ubc_upl_map() does and following it up that way to figure out what to do analogously.
That's probably not a good suggestion; the UBC implementation does not use KPI. If the page is sourced from an address space (as I inferred from the Bhavesh's original request) then there's no need to construct the UPL (it will happen automagically if the page has to be faulted in).
What this boils down to, again, is that without more information on what Bhavesh actually wants to do (i.e. not "there is this call in Linux"), we're not really able to help him very much. 8)
= Mike
-- Bhavesh P. Davda _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/rmckeever% 40apple.com
This email sent to rmckeever@apple.com
-- Bhavesh P. Davda _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On 3/7/07, Rob McKeever <rmckeever@apple.com> wrote: This email sent to site_archiver@lists.apple.com
participants (1)
-
Bhavesh Davda