If you want to handle IRQ nestly, you have to deal with the very low level asm, which is one part of the heart of the OS.
Back to the code. I assume you have some idea of the ARM core registers. The most important thing in nesting IRQ is saving the states the ISR would return to. When IRQ happens, CPU will save the old CPSR to SPSR_irq and old PC to LR_irq and IRQ will be disabled. So, before jumping into the real ISR, you have to push {R0-R12}, LR_irq and SPSR_irq into the stack. Note, the IRQ is disabled right now and nothing would disturb you(unless the FIQ, but FIQ use other set of registers which does not interfere with IRQ registers). After that, you are safe to jump to the real ISR and enable IRQ.
When return from ISR, disable IRQ, and retrieve the SPSR from the stack, then do a LDM {R0-R12,PC}^ will get you back from where the interrupt happened.
P.S. If you only target AAPCS, you can only save {R0-R3, R12} in the entry, as the C function will not clobber {R4-R11}.