mmap implementation... (problem with remapping!!) - Embedded

This is a discussion on mmap implementation... (problem with remapping!!) - Embedded ; Hello, I have a problem about implementation of mmap for remapping a specific I/O Region. - mmap kernel routine: if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) return -EINVAL; off = vma->vm_pgoff start = TPU_START; len = PAGE_ALIGN((start & ~PAGE_MASK)+TPU_SIZE); if ((vma->vm_end ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: mmap implementation... (problem with remapping!!)

  1. mmap implementation... (problem with remapping!!)


    Hello,

    I have a problem about implementation of mmap for remapping a specific
    I/O Region.

    - mmap kernel routine:
    if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
    return -EINVAL;
    off = vma->vm_pgoff << PAGE_SHIFT;
    start = TPU_START;
    len = PAGE_ALIGN((start & ~PAGE_MASK)+TPU_SIZE);
    if ((vma->vm_end - vma->vm_start + off) > len)
    return -EINVAL;
    off += start;
    vma->vm_pgoff = off >> PAGE_SHIFT;
    /* This is an IO map - tell maydump to skip this VMA */
    vma->vm_flags |= VM_IO;

    /* for PPC arch */
    pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;

    if (io_remap_page_range(vma->vm_start, off, vma->vm_end -
    vma->vm_start, vma->vm_page_prot))
    return -EAGAIN;

    return 0;


    In user space I read always 0xFFFFFFFF in these registers after remapping.
    I think that I made a mistake in this routine but I don't find it.
    My scope is to remap some registers in userspace on a PPC embedded
    architecture.
    I don't have experience about this.

    Please, could you help me?

    teo_icKs.





  2. Re: mmap implementation... (problem with remapping!!)

    Excuse me at all group!.
    This post is O.T. here.


+ Reply to Thread