Bit twiddling on ARM processors under Linux
2009-03-04 00:21:09.602786+00 by Dan Lyke 2 comments
Sometimes you're working on a Linux platform, maybe it's an ARM, maybe it's an Atmel ARM like an AT91SAM9261 or AT91SAM9XE or AT91SAM9RL, and you want to bang some bits but don't want to write a kernel module to do that. Your applications are running as root, and the dog-eared pages of "Linux Device Drivers" seems to suggest that even though the ARM ports are memory mapped, you request access to them via ioperm()
or iopl()
and then read and write to them with insl()
and outsl()
, but just requesting access is always failing.
The correct answer is use mmap()
on /dev/mem
. And all is right with the world.