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


Ignore:
Timestamp:
2019-04-05T18:30:19Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
29beac8
Parents:
f4bb404
Message:

Move PIC spurious IRQ handling into arch code

As each architecture or even machine does IRQs differently, the genarch
i8259 driver cannot register the PIC spurious IRQ interrupt itself.

File:
1 edited

Legend:

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

    rf4bb404 rf6cf76f  
    172172        bool ack = false;
    173173        assert(inum < IRQ_COUNT);
    174         assert((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1));
     174        assert(inum != IRQ_PIC0_SPUR);
     175        assert(inum != IRQ_PIC1_SPUR);
     176        assert(inum != IRQ_PIC1);
    175177
    176178        irq_t *irq = irq_dispatch_and_lock(inum);
     
    201203}
    202204
     205static void pic_spurious(unsigned int n, istate_t *istate)
     206{
     207        /*
     208         * XXX: Examine ISR to figure out whether this is indeed a spurious
     209         *      or actual IRQ.
     210         */
     211#ifdef CONFIG_DEBUG
     212        log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt", CPU->id);
     213#endif
     214}
     215
    203216void interrupt_init(void)
    204217{
     
    209222
    210223        for (i = 0; i < IRQ_COUNT; i++) {
    211                 if ((i != IRQ_PIC_SPUR) && (i != IRQ_PIC1))
     224                if ((i != IRQ_PIC0_SPUR) && (i != IRQ_PIC1_SPUR)
     225                    && (i != IRQ_PIC1))
    212226                        exc_register(IVT_IRQBASE + i, "irq", true,
    213227                            (iroutine_t) irq_interrupt);
     
    218232        exc_register(VECTOR_SS, "ss_fault", true, (iroutine_t) ss_fault);
    219233        exc_register(VECTOR_GP, "gp_fault", true, (iroutine_t) gp_fault);
     234        exc_register(VECTOR_PIC0_SPUR, "pic0_spurious", true,
     235            (iroutine_t) pic_spurious);
     236        exc_register(VECTOR_PIC1_SPUR, "pic1_spurious", true,
     237            (iroutine_t) pic_spurious);
    220238
    221239#ifdef CONFIG_SMP
Note: See TracChangeset for help on using the changeset viewer.