RE: Réf. : Re: Réf. : RE: mmap : please help !
stephane.fillod at thomson.net
Fri Apr 15 00:51:16 EST 2005
Sophie CARAYOL wrote:
>But, the real question is : if you use the /dev/mem (with open() and mmap
>()), could you use, in the user space, the pointer returned by the mmap
>function to access the physical memory or do you have to use read/write (on
>the file descriptor) to access physical memory because i haven't the same
>results according to the used method.
The read/write method is a heavy weight method, while the pointer returned by mmap is light and very efficient way in user-space, and It just works(tm).
Have you made sure the read/write is bypassing caching/speculative mode?
Can some timing issues explain the difference? Are you reading/writing
the right number of bytes?
Can you check both methods on a ReadOnly hardware register, with a known
value to be read?
>Thanks for 'od' but i haven't in my packages.
Anything else from dd with hexdump to your own built peek & poke?
What about mempoke from Conor McLoughlin?
More information about the Linuxppc-embedded