missinglinkelectronics / libuio

UserspaceIO helper library
GNU Lesser General Public License v2.1
30 stars 28 forks source link

barriers? #4

Open RobertBerger opened 9 years ago

RobertBerger commented 9 years ago

Hi,

Say we expose registers of an FPGA through UIO to user space and say we need to guarantee a certain sequence of write operations without having the compiler and/or processor reordering the writes e.g. write a block of registers (order does not matter), but writing a specific bit in a specific register at the end would start a timer (all the others need to be written before this one is written).

In kernel space I would use barriers or write e.g. to IO ports on x86 to guarantee this. How would I do this with UIO and/or with libuio. Maybe I am totally wrong here, but I see a potential reordering problem and if so maybe new functions should be added to libuio.

Another thing I am kind of missing are atomic bit operations, so the compiler does not optimize things away it should not.

What do you think?

Thanks,

Robert