site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In message <459AB119.2000805@cs.uiuc.edu>,John Criswell writes:
Is there a way in Darwin to map, within a single address space, physical memory to multiple virtual addresses?
use IOConnectMapMemory(). i have done this to map the same physical region back to back in virtual space to handle wrap around on a streaming buffer. address = 0; size = SIZEOF_PHYS_REGION; kresult = IOConnectMapMemory(connection, kMyUserClientBuffer, mach_task_self(), &address, &size, kIOMapAnywhere); address += size; kresult = IOConnectMapMemory(connection, kMyUserClientBuffer, mach_task_self(), &address, &size, 0); if you didnt care where the second mapping was located you could just pass kIOMapAnywhere instead of 0. there is likely a more efficient way to do this with mach_vm_remap() after you get the first mapping. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com