Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 3071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2218
Line 58... Line 58...
58
static void exception_external(int n, istate_t *istate)
58
static void exception_external(int n, istate_t *istate)
59
{
59
{
60
    int inum;
60
    int inum;
61
   
61
   
62
    while ((inum = pic_get_pending()) != -1) {
62
    while ((inum = pic_get_pending()) != -1) {
-
 
63
        bool ack = false;
63
        irq_t *irq = irq_dispatch_and_lock(inum);
64
        irq_t *irq = irq_dispatch_and_lock(inum);
64
        if (irq) {
65
        if (irq) {
65
            /*
66
            /*
66
             * The IRQ handler was found.
67
             * The IRQ handler was found.
67
             */
68
             */
-
 
69
           
-
 
70
            if (irq->preack) {
-
 
71
                /* Acknowledge the interrupt before processing */
-
 
72
                pic_ack_interrupt(inum);
-
 
73
                ack = true;
-
 
74
            }
-
 
75
           
68
            irq->handler(irq, irq->arg);
76
            irq->handler(irq, irq->arg);
69
            spinlock_unlock(&irq->lock);
77
            spinlock_unlock(&irq->lock);
70
        } else {
78
        } else {
71
            /*
79
            /*
72
             * Spurious interrupt.
80
             * Spurious interrupt.
73
             */
81
             */
74
#ifdef CONFIG_DEBUG
82
#ifdef CONFIG_DEBUG
75
            printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum);
83
            printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum);
76
#endif
84
#endif
77
        }
85
        }
-
 
86
       
-
 
87
        if (!ack)
78
        pic_ack_interrupt(inum);
88
            pic_ack_interrupt(inum);
79
    }
89
    }
80
}
90
}
81
 
91
 
82
 
92
 
83
static void exception_decrementer(int n, istate_t *istate)
93
static void exception_decrementer(int n, istate_t *istate)