I presume that code is a part of some userspace driver. As such, what is exactly wrong working directly with /dev/mem? If I remember correctly, the approach of userspace drivers is an officially blessed practice and is actually recommended for embedded developers.