Changes in kernel/arch/ia64/src/drivers/it.c [84afc7b:da1bafb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/drivers/it.c
r84afc7b rda1bafb 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 67 65 if (config.cpu_active == 1) { 68 66 irq_initialize(&it_irq); … … 83 81 } 84 82 85 /* initialize Interval Timer external interrupt vector */ 83 /* Initialize Interval Timer external interrupt vector */ 84 cr_itv_t itv; 85 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 * 106 107 */ 107 108 irq_ownership_t it_claim(irq_t *irq) … … 113 114 void it_interrupt(irq_t *irq) 114 115 { 115 int64_t c;116 int64_t m;117 118 116 eoi_write(EOI); 119 117 120 m = itm_read();118 int64_t itm = itm_read(); 121 119 122 while ( 1) {123 c = itc_read();124 c += IT_SERVICE_CLOCKS;125 126 m += IT_DELTA;127 if ( m -c < 0)120 while (true) { 121 int64_t itc = itc_read(); 122 itc += IT_SERVICE_CLOCKS; 123 124 itm += IT_DELTA; 125 if (itm - itc < 0) 128 126 CPU->missed_clock_ticks++; 129 127 else … … 131 129 } 132 130 133 itm_write( m);134 srlz_d(); /* propagate changes */135 131 itm_write(itm); 132 srlz_d(); /* Propagate changes */ 133 136 134 /* 137 135 * We are holding a lock which prevents preemption. 138 136 * Release the lock, call clock() and reacquire the lock again. 139 137 */ 140 spinlock_unlock(&irq->lock);138 irq_spinlock_unlock(&irq->lock, false); 141 139 clock(); 142 spinlock_lock(&irq->lock);140 irq_spinlock_lock(&irq->lock, false); 143 141 } 144 142
Note:
See TracChangeset
for help on using the changeset viewer.