title: ARM - What are the differences in the context switch handling, if IRQ happens in USR mode vs SVC mode?
body: <p>I am looking at a very old version of the Linux kernel for learning purposes. Specifically the IRQ handler as linked here <a href="http://lxr.free-electrons.com/source/arch/arm/kernel/entry-armv.S?v=2.4.37#L917" rel="nofollow">IRQ handler</a>.</p>
  
  <p>My understanding from a typical OS 101 course, is that context switches typically happen when the system takes an IRQ. Consequently using Linux as a reference, I have been trying to understand the following:</p>
  
  <ol>
  <li><p>What are the differences in the IRQ handling, if the IRQ were to happen when system is in USR mode (User-Space) vs if the IRQ were to happen when the system is in the SVC mode (Kernel Space). Because it seems like there are two possible paths __irq_svc and __irq_usr.</p></li>
  <li><p>Secondly, what are the implications of the differences (if any) in the above IRQ handling, on the context switching procedure ?</p></li>
  </ol>
  
  <p>I would appreciate some insight in this regard.</p>