Rev 3403 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3403 | Rev 4343 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <arch/cp0.h> |
39 | #include <arch/cp0.h> |
40 | #include <time/clock.h> |
40 | #include <time/clock.h> |
41 | #include <ipc/sysipc.h> |
41 | #include <ipc/sysipc.h> |
42 | #include <ddi/device.h> |
42 | #include <ddi/device.h> |
43 | 43 | ||
44 | #define IRQ_COUNT 8 |
44 | #define IRQ_COUNT 8 |
45 | #define TIMER_IRQ 7 |
45 | #define TIMER_IRQ 7 |
- | 46 | #define DORDER_IRQ 5 |
|
46 | 47 | ||
47 | function virtual_timer_fnc = NULL; |
48 | function virtual_timer_fnc = NULL; |
48 | static irq_t timer_irq; |
49 | static irq_t timer_irq; |
49 | 50 | ||
50 | /** Disable interrupts. |
51 | /** Disable interrupts. |
Line 98... | Line 99... | ||
98 | lastcount = cp0_count_read(); |
99 | lastcount = cp0_count_read(); |
99 | nextcount = cp0_compare_value + cp0_count_read(); |
100 | nextcount = cp0_compare_value + cp0_count_read(); |
100 | cp0_compare_write(nextcount); |
101 | cp0_compare_write(nextcount); |
101 | } |
102 | } |
102 | 103 | ||
103 | static irq_ownership_t timer_claim(void) |
104 | static irq_ownership_t timer_claim(void *instance) |
104 | { |
105 | { |
105 | return IRQ_ACCEPT; |
106 | return IRQ_ACCEPT; |
106 | } |
107 | } |
107 | 108 | ||
108 | static void timer_irq_handler(irq_t *irq, void *arg, ...) |
109 | static void timer_irq_handler(irq_t *irq) |
109 | { |
110 | { |
110 | unsigned long drift; |
111 | unsigned long drift; |
111 | 112 | ||
112 | if (cp0_count_read() < lastcount) |
113 | if (cp0_count_read() < lastcount) |
113 | /* Count overflow detected */ |
114 | /* Count overflow detected */ |