|
| |||||||||
| Tags: address, allocating, base, block, mapping, memory, pci, physical, regisrer |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Allocating Physical Memory Block for PCI Base Address Regisrer Mapping
Hi Everyone, In my current project, I have a requirement to map a piece of physical memory into one of the PCI base address register. This BAR maps the inbound PCI cycles to the local memory of this board. This PCI device do not support DMA. I have added the following code in the AddDevice function for this PCI WDM Driver. LowestAcceptableAddress.QuadPart = 0x0000000000000000; HighestAcceptableAddress.QuadPart = 0x00000000FFFFFFFF; BoundaryAddressMultiple.QuadPart = 0x0000000000000000; fdoData->pNPVirtualMemory = (PULONG)MmAllocateContiguousMemorySpecifyCache( 0x10000, LowestAcceptableAddress, HighestAcceptableAddress, BoundaryAddressMultiple, MmNonCached ); fdoData->pNPPhysicalMemory = MmGetPhysicalAddress( fdoData->pNPVirtualMemory); PI7C9X110DebugPrint(INFO, "NP MEMORY VA:0x%x PA:0x%x\n", fdoData->pNPVirtualMemory,fdoData->pNPPhysicalMemory); Note: fdoData->pNPVirtualMemory is declared as PULONG fdoData->pNPPhysicalMemory is declared as PHYSICAL_ADDRESS I plug in the value in fdoData->pNPPhysicalMemory variable to the PCI Device BAR. But somehow inbound mapping still don't seem to work. One of the question is, is MmGetPhysicalAddress really returning a physical address of the memory that can be used with PCI devices. I see that in places in MSDN, not to use the physical address returned by MmGetPhysicalAddress for DMA. Even though I am not using DMA, does this statement still apply to my design? Below is what I get from windbg for the pool, which says 0x10000 is my physical address for the non-paged pool. Windbg Output: PI7C9X110: NP MEMORY VA:0xf6a21000 PA:0x10000 Thanks in Advance, Boby |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Allocating Physical Memory Block for PCI Base Address Regisrer Mapping" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the base address of huawei u8230 | $Bradan$ | Portable Devices | 5 | 14-11-2010 12:13 AM |
| Vista 64 Installed Physical Memory vs Total Physical Memory | Fitz | Vista Help | 4 | 02-04-2009 09:49 AM |
| Installed Physical Memory/Total Physical Memory | Roy69z | Vista Setup and Install | 1 | 06-06-2008 03:52 AM |
| inetinfo.exe process is allocating more memory than usual | JoeF | Small Business Server | 5 | 09-05-2007 05:26 AM |
| The store.exe process is allocating more memory than usual. | Nikki | Small Business Server | 5 | 31-10-2005 09:52 AM |