Post #2085723
2022-12-06 17:00 UTC
And when we represent I/O as calls to imported functions, instead of loads and stores to mapped memory, we make the code easier to virtualize.
For example, one could write an emulator for the hardware just by having an implementation of the functions.
Replies (1)
-
@lenary@types.pl 2022-12-06 18:12
@sunfish in fact, in C you often need to hide your MMIO accesses behind a call, because the compiler is usually more conservative about external calls than `volatile` accesses. And yes, you do get virtualisation "for free". Citation about miscompiles: https://www.cs.utah.edu/~regehr/papers/emsoft08-preprint.pdf