[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mmap for pci memory



Hi All,

I am trying to implement mmap call for high pci memory. I could find out the pci

region using  pci_resource_start() and pci_resource_len() functions.

i found out that for region 0 the start address is 0x20000000 and length is 4MB

Now i want to implement mmap for this memory space so that from user space i can write directly on this memory.

I found out the system RAM top address using __pa(high_memory) function. It gives

me the address 0xA000000. I know that pci memory is very high memory and

i tried to use

 remap_page_range(vma->vm_start,0x20000000, 4M, PAGE_SHARED)

But from user space memory appears to be fragmented and mmap call does not work properly. Exactly how to mmap high PCI memory. I know that remap_page_range generates page table but i doubt whether this function is doing its required job??.

I understand that first high PCI memory has to be mapped to system memory and then i can go ahead for mmap. But how to do this exactly???

Please help

Regards,

Alok



Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more