Changeset 7bcfbbc in mainline
- Timestamp:
- 2007-04-07T23:30:59Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac88c93
- Parents:
- 7e58979
- Location:
- kernel
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/interrupt.c
r7e58979 r7bcfbbc 157 157 158 158 int inum = n - IVT_IRQBASE; 159 bool ack = false; 159 160 ASSERT(inum < IRQ_COUNT); 160 161 ASSERT((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1)); 161 162 162 163 irq_t *irq = irq_dispatch_and_lock(inum); 163 164 if (irq) { … … 165 166 * The IRQ handler was found. 166 167 */ 168 169 if (irq->preack) { 170 /* Send EOI before processing the interrupt */ 171 trap_virtual_eoi(); 172 ack = true; 173 } 167 174 irq->handler(irq, irq->arg); 168 175 spinlock_unlock(&irq->lock); … … 175 182 #endif 176 183 } 177 trap_virtual_eoi(); 184 185 if (!ack) 186 trap_virtual_eoi(); 178 187 } 179 188 -
kernel/arch/ia32/src/drivers/i8254.c
r7e58979 r7bcfbbc 83 83 { 84 84 irq_initialize(&i8254_irq); 85 i8254_irq.preack = true; 85 86 i8254_irq.devno = device_assign_devno(); 86 87 i8254_irq.inr = IRQ_CLK; -
kernel/arch/ia32/src/interrupt.c
r7e58979 r7bcfbbc 177 177 178 178 int inum = n - IVT_IRQBASE; 179 bool ack = false; 179 180 ASSERT(inum < IRQ_COUNT); 180 181 ASSERT((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1)); 181 182 182 183 irq_t *irq = irq_dispatch_and_lock(inum); 183 184 if (irq) { … … 185 186 * The IRQ handler was found. 186 187 */ 188 189 if (irq->preack) { 190 /* Send EOI before processing the interrupt */ 191 trap_virtual_eoi(); 192 ack = true; 193 } 187 194 irq->handler(irq, irq->arg); 188 195 spinlock_unlock(&irq->lock); … … 195 202 #endif 196 203 } 197 trap_virtual_eoi(); 204 205 if (!ack) 206 trap_virtual_eoi(); 198 207 } 199 208 -
kernel/arch/ia32/src/smp/apic.c
r7e58979 r7bcfbbc 170 170 171 171 irq_initialize(&l_apic_timer_irq); 172 l_apic_timer_irq.preack = true; 172 173 l_apic_timer_irq.devno = device_assign_devno(); 173 174 l_apic_timer_irq.inr = IRQ_CLK; -
kernel/arch/ia32xen/src/interrupt.c
r7e58979 r7bcfbbc 177 177 178 178 int inum = n - IVT_IRQBASE; 179 bool ack = false; 179 180 ASSERT(inum < IRQ_COUNT); 180 181 ASSERT((inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1)); 181 182 182 183 irq_t *irq = irq_dispatch_and_lock(inum); 183 184 if (irq) { … … 185 186 * The IRQ handler was found. 186 187 */ 188 189 if (irq->preack) { 190 /* Send EOI before processing the interrupt */ 191 trap_virtual_eoi(); 192 ack = true; 193 } 187 194 irq->handler(irq, irq->arg); 188 195 spinlock_unlock(&irq->lock); … … 195 202 #endif 196 203 } 197 trap_virtual_eoi(); 204 205 if (!ack) 206 trap_virtual_eoi(); 198 207 } 199 208 -
kernel/arch/ppc32/src/interrupt.c
r7e58979 r7bcfbbc 61 61 62 62 while ((inum = pic_get_pending()) != -1) { 63 bool ack = false; 63 64 irq_t *irq = irq_dispatch_and_lock(inum); 64 65 if (irq) { … … 66 67 * The IRQ handler was found. 67 68 */ 69 70 if (irq->preack) { 71 /* Acknowledge the interrupt before processing */ 72 pic_ack_interrupt(inum); 73 ack = true; 74 } 75 68 76 irq->handler(irq, irq->arg); 69 77 spinlock_unlock(&irq->lock); … … 76 84 #endif 77 85 } 78 pic_ack_interrupt(inum); 86 87 if (!ack) 88 pic_ack_interrupt(inum); 79 89 } 80 90 } -
kernel/arch/ppc64/src/interrupt.c
r7e58979 r7bcfbbc 61 61 62 62 while ((inum = pic_get_pending()) != -1) { 63 bool ack = false; 63 64 irq_t *irq = irq_dispatch_and_lock(inum); 64 65 if (irq) { … … 66 67 * The IRQ handler was found. 67 68 */ 69 70 if (irq->preack) { 71 /* Acknowledge the interrupt before processing */ 72 pic_ack_interrupt(inum); 73 ack = true; 74 } 75 68 76 irq->handler(irq, irq->arg); 69 77 spinlock_unlock(&irq->lock); … … 76 84 #endif 77 85 } 78 pic_ack_interrupt(inum); 86 87 if (!ack) 88 pic_ack_interrupt(inum); 79 89 } 80 90 } -
kernel/generic/include/ddi/irq.h
r7e58979 r7bcfbbc 122 122 */ 123 123 SPINLOCK_DECLARE(lock); 124 125 /** Send EOI before processing the interrupt. 126 * This is essential for timer interrupt which 127 * has to be acknowledged before doing preemption 128 * to make sure another timer interrupt will 129 * be eventually generated. 130 */ 131 bool preack; 124 132 125 133 /** Unique device number. -1 if not yet assigned. */ … … 128 136 /** Actual IRQ number. -1 if not yet assigned. */ 129 137 inr_t inr; 130 /** Trigger level of the IRQ. */138 /** Trigger level of the IRQ. */ 131 139 irq_trigger_t trigger; 132 140 /** Claim ownership of the IRQ. */ -
kernel/generic/src/ddi/irq.c
r7e58979 r7bcfbbc 139 139 link_initialize(&irq->link); 140 140 spinlock_initialize(&irq->lock, "irq.lock"); 141 irq->preack = false; 141 142 irq->inr = -1; 142 143 irq->devno = -1;
Note:
See TracChangeset
for help on using the changeset viewer.