Changeset f6cf76f in mainline for kernel/arch/ia32/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/ia32/src/interrupt.c

    rf4bb404 rf6cf76f  
    192192        bool ack = false;
    193193        assert(inum < IRQ_COUNT);
    194         assert((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1));
     194        assert(inum != IRQ_PIC0_SPUR);
     195        assert(inum != IRQ_PIC1_SPUR);
     196        assert(inum != IRQ_PIC1);
    195197
    196198        irq_t *irq = irq_dispatch_and_lock(inum);
     
    220222}
    221223
     224static void pic_spurious(unsigned int n, istate_t *istate)
     225{
     226        /*
     227         * XXX: Examine ISR to figure out whether this is indeed a spurious
     228         *      or actual IRQ.
     229         */
     230#ifdef CONFIG_DEBUG
     231        log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt", CPU->id);
     232#endif
     233}
     234
    222235void interrupt_init(void)
    223236{
     
    228241
    229242        for (i = 0; i < IRQ_COUNT; i++) {
    230                 if ((i != IRQ_PIC_SPUR) && (i != IRQ_PIC1))
     243                if ((i != IRQ_PIC0_SPUR) && (i != IRQ_PIC1_SPUR) &&
     244                    (i != IRQ_PIC1))
    231245                        exc_register(IVT_IRQBASE + i, "irq", true,
    232246                            (iroutine_t) irq_interrupt);
     
    239253        exc_register(VECTOR_GP, "gp_fault", true, (iroutine_t) gp_fault);
    240254        exc_register(VECTOR_XM, "simd_fp", true, (iroutine_t) simd_fp_exception);
     255        exc_register(VECTOR_PIC0_SPUR, "pic0_spurious", true,
     256            (iroutine_t) pic_spurious);
     257        exc_register(VECTOR_PIC1_SPUR, "pic1_spurious", true,
     258            (iroutine_t) pic_spurious);
    241259
    242260#ifdef CONFIG_SMP
Note: See TracChangeset for help on using the changeset viewer.