Hardware interview practice
Read a changing MMIO register
Firmware polls a device status register whose value may change independently of the CPU. The register is mapped at a fixed physical address. Why should the C access use a volatile-qualified MMIO pointer?
Choose one
Answer choices
- A. It tells the compiler that each access is observable and must actually read or write the addressed register rather than reuse or remove the access.
- B. It prevents the device from changing the register while firmware is reading it.
- C. It converts the physical address into a cache-coherent virtual address automatically.
- D. It makes the hardware register atomic and supplies all required CPU and interconnect memory barriers.
