I was reading through the ARM kernel source code in order to better my understanding and came across something interesting.
Inside arch/arm/kernel/entry-armv.S
there is a macro named vector_stub
, that generates a small chunk of assembly followed by a jump table for various ARM
modes. For instance, there is a call to vector_stub irq, IRQ_MODE, 4
which causes the macro to be expanded to a body with label vector_irq
; and the same occurs for vector_dabt
, vector_pabt
, vector_und
, and vector_fiq
.
Inside each of these vector_* jump tables, there is exactly 1 DWORD
with the address of a label with a _usr
suffix.
I'd like to confirm that my understanding is accurate, please see below.
- Does this mean that labels with the
_usr
suffix are executed, only if the interrupt arises when the kernel thread executing on that CPU is in userspace context? For instance,irq_usr
is executed if the interrupt occurs when the kernel thread is in userspace context,dabt_usr
is executed if the interrupt occurs when the kernel thread is in userspace context, and so on. - If [1] is true, then which kernel threads are responsible for handling, say irqs, with a different suffix such as
irq_svc
. I am assuming that this is the handler for an interrupt request that happens in SVC mode. If so, which kernel thread handles this? The kernel thread currently in SVC mode, on whichever CPU receives the interrupt? - If [2] is true, then at what point does the kernel thread finish processing the second interrupt, and return to where it had left off(also in SVC mode)? Is it
ret_from_intr
?