Changes in kernel/arch/ia64/src/drivers/it.c [da1bafb:84afc7b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/drivers/it.c
rda1bafb r84afc7b 34 34 35 35 /** Interval Timer driver. */ 36 36 37 37 #include <arch/drivers/it.h> 38 38 #include <arch/interrupt.h> … … 45 45 #include <arch.h> 46 46 47 #define IT_SERVICE_CLOCKS 47 #define IT_SERVICE_CLOCKS 64 48 48 49 #define FREQ_NUMERATOR_SHIFT 50 #define FREQ_NUMERATOR_MASK 49 #define FREQ_NUMERATOR_SHIFT 32 50 #define FREQ_NUMERATOR_MASK 0xffffffff00000000ULL 51 51 52 #define FREQ_DENOMINATOR_SHIFT 53 #define FREQ_DENOMINATOR_MASK 52 #define FREQ_DENOMINATOR_SHIFT 0 53 #define FREQ_DENOMINATOR_MASK 0xffffffffULL 54 54 55 55 uint64_t it_delta; … … 63 63 void it_init(void) 64 64 { 65 cr_itv_t itv; 66 65 67 if (config.cpu_active == 1) { 66 68 irq_initialize(&it_irq); … … 81 83 } 82 84 83 /* Initialize Interval Timer external interrupt vector */ 84 cr_itv_t itv; 85 85 /* initialize Interval Timer external interrupt vector */ 86 86 itv.value = itv_read(); 87 87 itv.vector = INTERRUPT_TIMER; 88 88 itv.m = 0; 89 89 itv_write(itv.value); 90 91 /* Set Interval Timer Counter to zero */90 91 /* set Interval Timer Counter to zero */ 92 92 itc_write(0); 93 93 94 /* Generate first Interval Timer interrupt in IT_DELTA ticks */94 /* generate first Interval Timer interrupt in IT_DELTA ticks */ 95 95 itm_write(IT_DELTA); 96 97 /* Propagate changes */96 97 /* propagate changes */ 98 98 srlz_d(); 99 99 } … … 104 104 * 105 105 * @return Always IRQ_ACCEPT. 106 *107 106 */ 108 107 irq_ownership_t it_claim(irq_t *irq) … … 114 113 void it_interrupt(irq_t *irq) 115 114 { 115 int64_t c; 116 int64_t m; 117 116 118 eoi_write(EOI); 117 119 118 int64_t itm = itm_read();120 m = itm_read(); 119 121 120 while ( true) {121 int64_t itc = itc_read();122 itc += IT_SERVICE_CLOCKS;123 124 itm += IT_DELTA;125 if ( itm - itc < 0)122 while (1) { 123 c = itc_read(); 124 c += IT_SERVICE_CLOCKS; 125 126 m += IT_DELTA; 127 if (m - c < 0) 126 128 CPU->missed_clock_ticks++; 127 129 else … … 129 131 } 130 132 131 itm_write( itm);132 srlz_d(); /* Propagate changes */133 133 itm_write(m); 134 srlz_d(); /* propagate changes */ 135 134 136 /* 135 137 * We are holding a lock which prevents preemption. 136 138 * Release the lock, call clock() and reacquire the lock again. 137 139 */ 138 irq_spinlock_unlock(&irq->lock, false);140 spinlock_unlock(&irq->lock); 139 141 clock(); 140 irq_spinlock_lock(&irq->lock, false);142 spinlock_lock(&irq->lock); 141 143 } 142 144
Note:
See TracChangeset
for help on using the changeset viewer.