title: Writing a Windows 64-bit device driver for a 32-bit PCI device
body: <p>I'm evaluating to port a device driver I wrote several years ago from 32 to 64 bits. The physical device is a 32-bit PCI card. That is, the device is 32 bits but I need to access it from Win7x64. The device presents some registers to the Windows world and then performs heavy bus master data transferring into a chunk of driver-allocated memory.</p>
  
  <p>I've read in the Microsoft documentation that you can signal whether the driver supports 64-bit DMA or not. If it doesn't, then the DMA is double buffered. However, I'm not sure if this is the case. My driver would/could be a full 64-bit one, so it could support 64-bit addresses in the processor address space, but the actual physical device WON'T support it. In fact, the device BARs must be mapped under 4 GB and the device must get a PC RAM address to perform bus master below 4 GB. Does this mean that my driver will go through double buffering always? This is a very performance-sensitive process and the double buffering could prevent the whole system from working.</p>
  
  <p>Of course, designing a new 64-bit PCI (or PCI-E) board is out of question.</p>
  
  <p>Anybody could give me some resources for this process (apart from MS pages)? </p>
  
  <p>Thanks a lot!</p>