Re: Mapping Physical Memory to Multiple Virtual Memory Addresses
Re: Mapping Physical Memory to Multiple Virtual Memory Addresses
- Subject: Re: Mapping Physical Memory to Multiple Virtual Memory Addresses
- From: "chas williams - CONTRACTOR" <email@hidden>
- Date: Tue, 02 Jan 2007 23:34:12 -0500
In message <email@hidden>,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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden