Reply by Mich Rundson May 1, 20082008-05-01
Hi all,

This week I inherited a buggy linux 2.4 device driver which controls a
device through I/O memory. Most of the known bugs were caused by direct
pointer dereferencing to the I/O memory space, without proper use of
readb()/writeb() and friends, so those were easy to fix.

The next step would be to move a big part of the code to userspace,
because a lot of the driver consists of 3d party code which does only do
memory I/O and thus should not necessarily have to live in the kernel.

Accessing the I/O memory should be using mmap() from userspace, but how
should I properly access this memory ? The kernelspace write*()
functions for PPC uses the EIEIO instruction to make sure memory writes
are properly ordered, is there a proper userspace equivalent for this
functions ?

Can anybody point me to some documentation describing how to set this
up ?

Thank you,

Mich