Interrupt nesting in FreeRTOS - IA32 port on GCC

rekharamapai wrote on Tuesday, September 24, 2019:

Hi,

I was trying understand how nesting of Interrupts for IA32 is handled by FreeRTOS.

The IA32 manual says
“When an interrupt is handled through an interrupt gate, the IF flag is automatically cleared, which disables maskable hardware interrupts.”
This means the architecture does not support nesting of interrupts.
But I found that the variable ulInterruptNesting is declared in FreeRTOS (IA32 port on GCC) to know when to switch to the interrupt stack and when to save/restore a complete context. But, other than the increment and decrement of this variable, it is not used to decide when to save/restore a complete context (See vPortTimerHandler).

Based on IA32 and GCC compiler:

  1. I wanted to know whether vPortTimerHandler is invoked through interrupt gate, and
  2. If nesting is permitted, how ulInterruptNesting variable is used to control the context save/restore?

Thanks.

rtel wrote on Tuesday, September 24, 2019:

Did you see this section of the FreeRTOS IA32 documentation:
https://www.freertos.org/RTOS_Intel_Quark_Galileo_GCC.html#interrupts -
perhaps it provides the information you are looking for - or at least
tells you which function in the code to look at.