[Top] [All Lists]

Re: mmap problem another :)

To: Dmitriy Tochansky <>
Subject: Re: mmap problem another :)
From: Dan Malek <>
Date: Thu, 9 Dec 2004 09:36:11 -0500
In-reply-to: <>
Original-recipient: rfc822;
References: <>

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

<Prev in Thread] Current Thread [Next in Thread>