Take the 2-minute tour ×

Does the interrupt handler use the stack of the task that's interrupted or a separate stack as its stack? (PowerPC, VxWorks)

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

In VxWorks, there is a specific stack for interrupts. All Interrupt handlers share that same stack, which is located just above where the vxWorks image is loaded.

I believe the default stack size is 5K, but can easily be changed with the kernel configurator.

The ISR mechanism works roughly this way:
You can think of VxWorks as typically installs an assembly code wrapper around your ISR code.

On Entry, it automatically saves the general purpose registers (on the ISR stack) so the executing context (another ISR or a task) state is preserved.

On Exit, the registers are restored, but in addition, the OS scheduler is called to see if the just finished ISR changed the state of a higher priority task. If this happened, then the higher priority task resumes. If no higher priority tasks are available, then the original task is restored.

share|improve this answer
Thanks. Can you tell me how the ISR switches from the stack of the interrupted task to the specific stack? –  xiaokaoy Nov 12 '12 at 5:33
Thanks again. Thank you. –  xiaokaoy Nov 29 '12 at 0:41
add comment

xiaokaoy, There is a pretty good description of how interrupts work in the VxWorks Programmer's Guide section 2.6. If you don't have a copy, it's available online from many sources.

share|improve this answer
Thank you. I'll try to find it. –  xiaokaoy Nov 29 '12 at 0:42
add comment

This is architecture dependent. From the VxWorks Kernel Programmer's Guide (v6.8):

All ISRs use the same interrupt stack. [...]

CAUTION: Some architectures do not permit using a separate interrupt stack, and ISRs use the stack of the interrupted task. [...] See the VxWorks reference for your BSP to determine whether your architecture supports a separate interrupt stack.

In your case, PowerPC does support a separate shared interrupt stack (per core).

share|improve this answer
add comment

Your Answer


