Changeset f6cf76f in mainline for kernel/arch/ia32


Ignore:
Timestamp:
2019-04-05T18:30:19Z (7 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.

Location:
kernel/arch/ia32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/include/arch/interrupt.h

    rf4bb404 rf6cf76f  
    6363/* NS16550 at COM1 */
    6464#define IRQ_NS16550   4
    65 #define IRQ_PIC_SPUR 7
     65#define IRQ_PIC0_SPUR 7
    6666#define IRQ_MOUSE     12
     67#define IRQ_PIC1_SPUR 15
    6768
    6869/* This one must have four least significant bits set to ones */
     
    8182#define VECTOR_XM                 (IVT_EXCBASE + EXC_XM)
    8283#define VECTOR_CLK                (IVT_IRQBASE + IRQ_CLK)
    83 #define VECTOR_PIC_SPUR           (IVT_IRQBASE + IRQ_PIC_SPUR)
     84#define VECTOR_PIC0_SPUR          (IVT_IRQBASE + IRQ_PIC0_SPUR)
     85#define VECTOR_PIC1_SPUR          (IVT_IRQBASE + IRQ_PIC1_SPUR)
    8486#define VECTOR_SYSCALL            IVT_FREEBASE
    8587#define VECTOR_TLB_SHOOTDOWN_IPI  (IVT_FREEBASE + 1)
  • 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.