2

I am looking at a very old version of the Linux kernel for learning purposes. Specifically the IRQ handler as linked here IRQ handler.

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:

  1. 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.

  2. Secondly, what are the implications of the differences (if any) in the above IRQ handling, on the context switching procedure ?

I would appreciate some insight in this regard.

TheLoneJoker
  • 1,589
  • 1
  • 23
  • 36
  • @artless-noise I have seen a lot of good answers from you in the ARM domain. Was hoping if you may have some thoughts on this. – TheLoneJoker Oct 28 '14 at 07:41
  • This question on [arm exception stacks](http://stackoverflow.com/questions/22928904/linux-kernel-arm-exception-stack-init) has the answers. `LCvectors` is the real vector table. They jump to a *stub*; `vector_IRQ` for IRQs (they are copied, etc in this version). `vector_IRQ` save some registers, changes modes, and does a *table jump* to `__irq_usr`, `__irq_svc` or `__irq_invalid`. `irq_usr` and `irq_svc` are mainly the same except `ret_to_user` which will reschedule; the `irq_svc` just returns to where it was. That code maybe rescheduling as well and it will decide who runs, w. irq noted. – artless noise Oct 28 '14 at 15:14

0 Answers0