Cross-platformizing MMIO stuff.

MSVC build likely needs some fixes.