Re: mmap problem another :)

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

 




On Dec 9, 2004, at 8:12 AM, Dmitriy Tochansky wrote:

Look ret = io_remap_page_range(start, offset, size, vma->vm_page_prot); remaps
from "offset" which I got from pci_resource_start (curdev, IOMEM0); its ok
from first board where it eq 0x40000000 but on second it 0x40002040

Read the memory mapping docuemntation and understand the APIs. All of the Linux mapping functions, whether mmap() from an application or in the kernel are going to align on page boundaries.

The address of 0x40002040 is going to be aligned to a page boundary,
so you have to consider the offset into that page to the base of the
device, plus the register offset.  The kernel mapping functions,
like remap_page_range, are going to force the alignment because
that is what we expect in the kernel.  An mmap() with an unaligned
address will generate an error.


-- Dan



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux