Changes in kernel/arch/mips32/src/interrupt.c [f4bb404:f5dd4a1] in mainline
- File:
-
- 1 edited
-
kernel/arch/mips32/src/interrupt.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/interrupt.c
rf4bb404 rf5dd4a1 41 41 #include <ipc/sysipc.h> 42 42 43 #define IRQ_COUNT 8 44 #define TIMER_IRQ 7 45 46 function virtual_timer_fnc = NULL; 47 static irq_t timer_irq; 48 43 49 // TODO: This is SMP unsafe!!! 44 50 … … 46 52 static unsigned long nextcount; 47 53 static unsigned long lastcount; 48 49 /** Table of interrupt handlers. */50 int_handler_t int_handler[MIPS_INTERRUPTS] = { };51 54 52 55 /** Disable interrupts. … … 110 113 } 111 114 112 static void timer_interrupt_handler(unsigned int intr) 115 static irq_ownership_t timer_claim(irq_t *irq) 116 { 117 return IRQ_ACCEPT; 118 } 119 120 static void timer_irq_handler(irq_t *irq) 113 121 { 114 122 if (cp0_count_read() < lastcount) … … 127 135 cp0_compare_write(nextcount); 128 136 137 /* 138 * We are holding a lock which prevents preemption. 139 * Release the lock, call clock() and reacquire the lock again. 140 */ 141 irq_spinlock_unlock(&irq->lock, false); 129 142 clock(); 143 irq_spinlock_lock(&irq->lock, false); 144 145 if (virtual_timer_fnc != NULL) 146 virtual_timer_fnc(); 130 147 } 131 148 … … 133 150 void interrupt_init(void) 134 151 { 135 int_handler[INT_TIMER] = timer_interrupt_handler; 152 irq_init(IRQ_COUNT, IRQ_COUNT); 153 154 irq_initialize(&timer_irq); 155 timer_irq.inr = TIMER_IRQ; 156 timer_irq.claim = timer_claim; 157 timer_irq.handler = timer_irq_handler; 158 irq_register(&timer_irq); 136 159 137 160 timer_start(); 138 cp0_unmask_int( INT_TIMER);161 cp0_unmask_int(TIMER_IRQ); 139 162 } 140 163
Note:
See TracChangeset
for help on using the changeset viewer.
