mmap() file operations and changing vm_start - Powerpc

This is a discussion on mmap() file operations and changing vm_start - Powerpc ; I am working on an embedded board running linux 2.4.28. I 've got a driver module written that provides access to I/O and reserved memory. I have noticed that user mmap() calls handled in my mmap() file operations routine return ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: mmap() file operations and changing vm_start

  1. mmap() file operations and changing vm_start

    I am working on an embedded board running linux 2.4.28. I 've got a
    driver module written that provides access to I/O and reserved memory.

    I have noticed that user mmap() calls handled in my mmap() file operations
    routine return a one-to-one mapping (between virtual and physical addresses)
    for some addresses but not for others.

    <= 0x9000 0000 -- one to one
    >= 0xa000 0000 -- NON one to one


    I thought about modifying the "vm_start" parameter but I dont think thats a
    "safe" hack. MAP_FIXED returns an error message and doesnt even enter my
    mmap() file operations routine.

    I am currently re-reading the mmap and dma section of the linux device driver
    manual but I would like pointers on a way around this.

    Note the physical address I am trying get at : 0xb000 0000 isnt in conflict ...
    meaning there arent any virtual addresss allocated between 0xb000 0000 and
    0xbfff ffff so I should be able to get at this.

    But the "vm_start" argument i am passed is consistently a virtual address
    below this value.

    Thanks in advance

  2. Re: mmap() file operations and changing vm_start

    sam wrote:
    > I am working on an embedded board running linux 2.4.28. I 've got a
    > driver module written that provides access to I/O and reserved memory.
    >
    > I have noticed that user mmap() calls handled in my mmap() file operations
    > routine return a one-to-one mapping (between virtual and physical addresses)
    > for some addresses but not for others.
    >
    > <= 0x9000 0000 -- one to one
    >
    >>= 0xa000 0000 -- NON one to one

    >
    >
    > I thought about modifying the "vm_start" parameter but I dont think thats a
    > "safe" hack. MAP_FIXED returns an error message and doesnt even enter my
    > mmap() file operations routine.
    >
    > I am currently re-reading the mmap and dma section of the linux device driver
    > manual but I would like pointers on a way around this.
    >
    > Note the physical address I am trying get at : 0xb000 0000 isnt in conflict ...
    > meaning there arent any virtual addresss allocated between 0xb000 0000 and
    > 0xbfff ffff so I should be able to get at this.
    >
    > But the "vm_start" argument i am passed is consistently a virtual address
    > below this value.
    >
    > Thanks in advance


    If this is plain x86 Linux, the process stack will be at the
    top of the address range, up to 0xbfffffff. It reserves space
    for downward growth.

    Why do you need an one-to-one mapping?

    --

    Tauno Voipio
    tauno voipio (at) iki fi


  3. Re: mmap() file operations and changing vm_start

    sam wrote:
    > I am working on an embedded board running linux 2.4.28. I 've got a
    > driver module written that provides access to I/O and reserved memory.
    >
    > I have noticed that user mmap() calls handled in my mmap() file operations
    > routine return a one-to-one mapping (between virtual and physical addresses)
    > for some addresses but not for others.
    >
    > <= 0x9000 0000 -- one to one
    >
    >>= 0xa000 0000 -- NON one to one


    This isn't a MIPS processor by any chance ?

    What happens when you call mmap() on /dev/mem to do the same operations
    you are talking about ?



  4. Re: mmap() file operations and changing vm_start

    > This isn't a MIPS processor by any chance ?

    No, its an MPC7400 ... PPC

    > What happens when you call mmap() on /dev/mem to do the same operations
    > you are talking about ?


    Same results ... for that particular address (0xb000 0000) I am getting
    a virtual address in lower memory. NOT a one-to-one mapping.

    I am digging into the Understanding Linux Kernel book.
    I am reading something about a 3G interval limit imposed
    on user mode linear addresses.

    0xb000 0000 - 0xbfff ffff would violate this.
    just about


  5. Re: mmap() file operations and changing vm_start

    > If this is plain x86 Linux, the process stack will be
    > at the top of the address range, up to 0xbfffffff. It
    > reserves space for downward growth.


    Ah no ... thank god ... I had my fill of protected mode
    issues...

    This is a PPC processor based system. Does the above still
    apply? Mind you I am just developing a driver/support/BSP
    package and havent dug that deep into the process memory map.

    I am thinking I should

    > Why do you need an one-to-one mapping?


    It would simply things a great deal. Both from the developer
    as well as the user standpoint.

    Besides I have a one-to-one mapping for the peripherals the
    design group placed below 0xa000 0000 ... for the sake of
    consistency I would like the same for the ONE peripheral placed
    above 0xa000 0000


+ Reply to Thread