Re: MmMapLockedPages with UserMode pointer
- From: Gunter <Gunter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Mar 2009 09:55:00 -0700
Pavel,
You can just pass NULL and the system will pick an unused address
range for you.
I know. However, this is not what I want to do. I want to reserve a large
address range in user mode (2GByte) and have the driver map locked
pages into that space. Let me explain briefly.
I have designed an FPGA-accelerator which sits in a PCI-X-slot in my
64-bit Server 2003 machine. The PC has 32GByte of memory.
What I want to establish is "uniform memory access for heterogeneous
processors". Both the FPGA and the CPU are processing a large data set
simultaneously, the FPGA needs to access the data frequently just as the
CPU does. Explicit copying on demand from the CPU to the FPGA would
annihilate any performance gains.
So I want to lock a 2GByte memory region, which of course I don't always
get in one chunk. So, instead, I allocate 512 contiguous 4MByte-
segments and pin them down. The FPGA has an address translation table
with 512 entries, so I program the physical addresses into that "MMU".
This works fine.
However, when I try to map that memory into user space there is a
problem. I pass NULL to the first MmMapLockedPages, but for all other
4MByte chunks I pass the returned VA plus n*4MByte to create a
contiguous user space address range. Sooner or later, of course, it fails
because most likely it will cross already allocated space.
So, the other way round, first reserving 2GByte user VA range, and then
passing the start address to MmMapLockedPages would solve the
problem.
But, alas, that doesn't work.
Any idea how I can solve this problem?
Thanks
.
- References:
- MmMapLockedPages with UserMode pointer
- From: Gunter
- Re: MmMapLockedPages with UserMode pointer
- From: Pavel Lebedinsky [MSFT]
- MmMapLockedPages with UserMode pointer
- Prev by Date: RE: Signed Test Certificate does not work on Windows 2008 R2 Beta x64
- Next by Date: Re: MmMapLockedPages with UserMode pointer
- Previous by thread: Re: MmMapLockedPages with UserMode pointer
- Next by thread: Re: MmMapLockedPages with UserMode pointer
- Index(es):
Relevant Pages
|