Changeset 7bcfbbc in mainline for kernel/arch/amd64/src/interrupt.c


Ignore:
Timestamp:
2007-04-07T23:30:59Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ac88c93
Parents:
7e58979
Message:

support the possibility to send EOI or Interrupt Acknowledgement
prior to processing the interrupt
(this is essential on some architectures to prevent preemption deadlock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/interrupt.c

    r7e58979 r7bcfbbc  
    157157       
    158158        int inum = n - IVT_IRQBASE;
     159        bool ack = false;
    159160        ASSERT(inum < IRQ_COUNT);
    160161        ASSERT((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1));
    161 
     162       
    162163        irq_t *irq = irq_dispatch_and_lock(inum);
    163164        if (irq) {
     
    165166                 * The IRQ handler was found.
    166167                 */
     168                 
     169                if (irq->preack) {
     170                        /* Send EOI before processing the interrupt */
     171                        trap_virtual_eoi();
     172                        ack = true;
     173                }
    167174                irq->handler(irq, irq->arg);
    168175                spinlock_unlock(&irq->lock);
     
    175182#endif
    176183        }
    177         trap_virtual_eoi();
     184       
     185        if (!ack)
     186                trap_virtual_eoi();
    178187}
    179188
Note: See TracChangeset for help on using the changeset viewer.