Rev 1926 | Rev 2218 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1926 | Rev 1928 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** @file |
32 | /** @file |
33 | */ |
33 | */ |
34 | 34 | ||
- | 35 | #include <ddi/irq.h> |
|
35 | #include <interrupt.h> |
36 | #include <interrupt.h> |
36 | #include <arch/interrupt.h> |
37 | #include <arch/interrupt.h> |
37 | #include <arch/types.h> |
38 | #include <arch/types.h> |
38 | #include <arch.h> |
39 | #include <arch.h> |
39 | #include <time/clock.h> |
40 | #include <time/clock.h> |
40 | #include <ipc/sysipc.h> |
41 | #include <ipc/sysipc.h> |
41 | #include <arch/drivers/pic.h> |
42 | #include <arch/drivers/pic.h> |
42 | #include <arch/mm/tlb.h> |
43 | #include <arch/mm/tlb.h> |
- | 44 | #include <print.h> |
|
43 | 45 | ||
44 | 46 | ||
45 | void start_decrementer(void) |
47 | void start_decrementer(void) |
46 | { |
48 | { |
47 | asm volatile ( |
49 | asm volatile ( |
Line 54... | Line 56... | ||
54 | 56 | ||
55 | /** Handler of external interrupts */ |
57 | /** Handler of external interrupts */ |
56 | static void exception_external(int n, istate_t *istate) |
58 | static void exception_external(int n, istate_t *istate) |
57 | { |
59 | { |
58 | int inum; |
60 | int inum; |
59 | 61 | ||
60 | while ((inum = pic_get_pending()) != -1) { |
62 | while ((inum = pic_get_pending()) != -1) { |
61 | exc_dispatch(inum + INT_OFFSET, istate); |
63 | irq_t *irq = irq_dispatch_and_lock(inum); |
- | 64 | if (irq) { |
|
- | 65 | /* |
|
- | 66 | * The IRQ handler was found. |
|
- | 67 | */ |
|
- | 68 | irq->handler(irq, irq->arg); |
|
- | 69 | spinlock_unlock(&irq->lock); |
|
- | 70 | } else { |
|
- | 71 | /* |
|
- | 72 | * Spurious interrupt. |
|
- | 73 | */ |
|
- | 74 | #ifdef CONFIG_DEBUG |
|
- | 75 | printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum); |
|
- | 76 | #endif |
|
- | 77 | } |
|
62 | pic_ack_interrupt(inum); |
78 | pic_ack_interrupt(inum); |
63 | } |
79 | } |
64 | } |
80 | } |
65 | 81 | ||
66 | 82 |