mmap-issue

Thomas Skibo thomasskibo at sbcglobal.net
Fri Jan 16 18:10:03 UTC 2015



> On Jan 16, 2015, at 9:10 AM, Manuel Stühn <freebsdnewbie at freenet.de> wrote:
> 
> 
> I mapped for testing purposes the AM335x-GPIO-registers from /dev/mem.
> Writing into these mmap'ed registers for toggling some LEDs does not immediatly take effect. I have to call it several times to get one LED-toggle. Is there any data caching I'm missing?
> 
> Thanks for hints.
> 

Yes.  On arm, /dev/mem always maps pages into user space with the data cache enabled.  I’ve run into this too.

To work around it, I ported some code from another architecture (I can’t remember which) into sys/arm/arm/mem.c to allow memcontrol(8) to declare some physical addresses as uncacheable.  I don’t know if this is a proper long-term solution.

This patch has been lying around on my computer for a while and so I haven’t tested it in a while.

-------
Thomas Skibo
thomasskibo at sbcglobal.net

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.memrange.txt
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20150116/e9acd63b/attachment.txt>


More information about the freebsd-arm mailing list