3

I am unable to fathom the term Pending Interrupts. I mean, the way I see asynchronous events is like "Time, tide and Interrupts" wait for none.

Then what is this pending interrupts. How can I service a request that has come in the past, which has gone.

Can someone please explain with a scenario where this is used.

Edit: Definition wise it is understood (English sense), but If I am supposed to process Interrupts that had occurred before, am I looking at some buffering of data on the hardware device ?.

RootPhoenix
  • 1,626
  • 1
  • 22
  • 40
  • Related: [When an interrupt occurs, what happens to instructions in the pipeline?](https://stackoverflow.com/q/8902132). A CPU can't always jump to an interrupt handler on the first clock cycle after an interrupt is raised, so there will be cycles where interrupts are pending. – Peter Cordes Jul 15 '18 at 13:26

3 Answers3

9

Normally the CPU will check with the Programmer Interrupt Controller (PIC) to see if there is an interrupt after each instruction is executed.

The PIC will not send interrupts while an interrupt service routine (ISR) is active (until the iret instruction is encountered).

A program can also signal that interrupts should be held by clearing the interrupt flag (IF).

Pending interrupts are one that the PIC has registered, but that have not yet been sent to the CPU.

http://wiki.osdev.org/Interrupts

Eric J.
  • 147,927
  • 63
  • 340
  • 553
  • Dear Eric. Definition wise its fine but If I am supposed to process Interrupts that had occurred some time back, am I looking at some buffering of data on the hardware device ?. – RootPhoenix Mar 14 '15 at 16:49
  • 1
    When writing software, there is absolutely nothing you can do about pending interrupts, because you don't know (yet) that they exist. You just finish processing the current ISR, then the pending interrupt will present itself as the current interrupt. – Eric J. Mar 14 '15 at 16:50
  • 1
    Ok. So for software, it like any normal interrupt has occured. I do not care whether it had occured earlier or not. Thanks. – RootPhoenix Mar 14 '15 at 16:53
  • 1
    Yes. In fact, any interrupt occurred earlier than when you see it, even if it was not originally pending. The interrupt is generated, it goes to the PIC, then the PIC signals the CPU. – Eric J. Mar 14 '15 at 16:58
1

The conditions that triggered an interrupt have always occurred in the past. A pending interrupt is simply an interrupt that has occurred, is enabled, but hasn't made it through the interrupt prioritization process to have its handler executed.

Interrupts wait for many things: instruction completion, other interrupts, periods where interrupts are disabled...

DrC
  • 7,528
  • 1
  • 22
  • 37
0

pending : An interrupt from a source to The GIC that is recognized as asserted in hardware, or generated by software, and is waiting to be serviced by a target processor
---- arm gic architecture

leesagacious
  • 182
  • 1
  • 8