Changeset 124bc22 in mainline for kernel/arch/mips32/src/interrupt.c
- Timestamp:
- 2019-04-04T18:08:51Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d97627
- Parents:
- e064102
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/interrupt.c
re064102 r124bc22 41 41 #include <ipc/sysipc.h> 42 42 43 #define IRQ_COUNT 844 #define TIMER_IRQ 745 46 function virtual_timer_fnc = NULL;47 static irq_t timer_irq;48 49 43 // TODO: This is SMP unsafe!!! 50 44 … … 52 46 static unsigned long nextcount; 53 47 static unsigned long lastcount; 48 49 /** Table of interrupt handlers. */ 50 int_handler_t int_handler[INTERRUPTS] = {}; 54 51 55 52 /** Disable interrupts. … … 113 110 } 114 111 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) 112 static void timer_interrupt_handler(unsigned int intr) 121 113 { 122 114 if (cp0_count_read() < lastcount) … … 135 127 cp0_compare_write(nextcount); 136 128 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);142 129 clock(); 143 irq_spinlock_lock(&irq->lock, false);144 145 if (virtual_timer_fnc != NULL)146 virtual_timer_fnc();147 130 } 148 131 … … 150 133 void interrupt_init(void) 151 134 { 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); 135 int_handler[INT_TIMER] = timer_interrupt_handler; 159 136 160 137 timer_start(); 161 cp0_unmask_int( TIMER_IRQ);138 cp0_unmask_int(INT_TIMER); 162 139 } 163 140
Note:
See TracChangeset
for help on using the changeset viewer.