title: How to clear BCM2835 Interrupt Clear Register?
body: <p>I'm looking into how to make an operating system for Raspberry Pi, and in the OSDev barebones tutorial for the Raspberry Pi, the following code is used to clear any pending interrupts.</p>
  
  <pre><code>// Clear pending interrupts.
  mmio_write(UART0_ICR, 0x7FF);
  </code></pre>
  
  <p>The function <code>mmio_write</code> is as follows.</p>
  
  <pre><code>static inline void mmio_write(uint32_t reg, uint32_t data){
      *(volatile uint32_t *)reg = data;
  }
  </code></pre>
  
  <p>Why is this value significant, and how does it clear the interrupts?</p>