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.

= 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

Reply to
sam
Loading thread data ...

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
Reply to
Tauno Voipio

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 ?

Reply to
Geronimo W. Christ Esq

No, its an MPC7400 ... PPC

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
Reply to
sam

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

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
sam

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.