Changeset 323a5aaf in mainline for kernel/arch/ia64/src/interrupt.c


Ignore:
Timestamp:
2008-11-30T12:17:56Z (16 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ad9e47
Parents:
57e76cb
Message:

Legacy IRQ support, uspace NS16550 support, some minor changes

File:
1 edited

Legend:

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

    r57e76cb r323a5aaf  
    236236}
    237237
    238 static void end_of_local_irq()
     238static void end_of_local_irq(void)
    239239{
    240240        asm volatile ("mov cr.eoi=r0;;");
     
    244244void external_interrupt(uint64_t vector, istate_t *istate)
    245245{
    246         irq_t *irq;
    247246        cr_ivr_t ivr;
    248247       
     
    250249        srlz_d();
    251250
    252         irq = irq_dispatch_and_lock(ivr.vector);
    253         if (irq) {
    254                 irq->handler(irq, irq->arg);
    255                 spinlock_unlock(&irq->lock);
    256         } else {
    257251                switch (ivr.vector) {
    258252                case INTERRUPT_SPURIOUS:
     
    271265
    272266                default:
    273                         panic("\nUnhandled External Interrupt Vector %d\n",
    274                             ivr.vector);
     267                        {
     268
     269                                int ack=false;
     270                                irq_t *irq = irq_dispatch_and_lock(ivr.vector);
     271                                if (irq) {
     272                                        /*
     273                                         * The IRQ handler was found.
     274                                         */
     275                 
     276                                        if (irq->preack) {
     277                                                /* Send EOI before processing the interrupt */
     278                                                end_of_local_irq();
     279                                                ack=true;
     280                                        }
     281                                        irq->handler(irq, irq->arg);
     282                                        spinlock_unlock(&irq->lock);
     283                                } else {
     284                                        /*
     285                                         * Unhandled interrupt.
     286                                         */
     287                                        end_of_local_irq();
     288                                        ack=true;
     289#ifdef CONFIG_DEBUG
     290                                        printf("\nUnhandled External Interrupt Vector %d\n",ivr.vector);
     291#endif
     292                                }
     293                                if(!ack) end_of_local_irq();
     294
     295                        }       
     296
     297
    275298                        break;
    276299                }
    277         }
    278300}
    279301
Note: See TracChangeset for help on using the changeset viewer.