// defer our call to RestoreTPL() to the in-progress outer instance\r
// of the same interrupt handler.\r
//\r
+ ASSERT (GetInterruptState () == FALSE);\r
if (InterruptedTPL == IsrState->InProgressRestoreTPL) {\r
//\r
// Trigger outer instance of this interrupt handler to perform the\r
//\r
// Check shared state loop invariants.\r
//\r
+ ASSERT (GetInterruptState () == FALSE);\r
ASSERT (IsrState->InProgressRestoreTPL < InterruptedTPL);\r
ASSERT (IsrState->DeferredRestoreTPL == FALSE);\r
\r
\r
//\r
// Call RestoreTPL() to allow event notifications to be\r
- // dispatched. This will implicitly re-enable interrupts.\r
+ // dispatched. This will implicitly re-enable interrupts (if\r
+ // InterruptedTPL is below TPL_HIGH_LEVEL), even though we are\r
+ // still inside the interrupt handler.\r
//\r
gBS->RestoreTPL (InterruptedTPL);\r
\r
//\r
// Re-disable interrupts after the call to RestoreTPL() to ensure\r
- // that we have exclusive access to the shared state.\r
+ // that we have exclusive access to the shared state. Interrupts\r
+ // will be re-enabled by the IRET or equivalent instruction when\r
+ // we subsequently return from the interrupt handler.\r
//\r
DisableInterrupts ();\r
\r