Changeset cea12e9 in mainline for kernel/arch/ia32/src/drivers/i8254.c
- Timestamp:
- 2006-10-27T11:13:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 16d71f41
- Parents:
- 8c84448
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/drivers/i8254.c
r8c84448 rcea12e9 50 50 #include <arch.h> 51 51 #include <time/delay.h> 52 #include <interrupt.h> 52 #include <ddi/irq.h> 53 #include <ddi/device.h> 53 54 54 55 #define CLK_PORT1 0x40 … … 58 59 #define MAGIC_NUMBER 1194 59 60 60 static void i8254_interrupt(int n, istate_t *istate); 61 static irq_t i8254_irq; 62 63 static irq_ownership_t i8254_claim(void) 64 { 65 return IRQ_ACCEPT; 66 } 67 68 static void i8254_irq_handler(irq_t *irq, void *arg, ...) 69 { 70 clock(); 71 } 61 72 62 73 void i8254_init(void) 63 74 { 75 irq_initialize(&i8254_irq); 76 i8254_irq.devno = device_assign_devno(); 77 i8254_irq.inr = IRQ_CLK; 78 i8254_irq.claim = i8254_claim; 79 i8254_irq.handler = i8254_irq_handler; 80 irq_register(&i8254_irq); 81 64 82 i8254_normal_operation(); 65 83 } … … 68 86 { 69 87 outb(CLK_PORT4, 0x36); 70 pic_disable_irqs(1<<IRQ_CLK); 71 outb(CLK_PORT1, (CLK_CONST/HZ) & 0xf); 72 outb(CLK_PORT1, (CLK_CONST/HZ) >> 8); 73 pic_enable_irqs(1<<IRQ_CLK); 74 exc_register(VECTOR_CLK, "i8254_clock", (iroutine) i8254_interrupt); 88 pic_disable_irqs(1 << IRQ_CLK); 89 outb(CLK_PORT1, (CLK_CONST / HZ) & 0xf); 90 outb(CLK_PORT1, (CLK_CONST / HZ) >> 8); 91 pic_enable_irqs(1 << IRQ_CLK); 75 92 } 76 93 … … 130 147 } 131 148 132 void i8254_interrupt(int n, istate_t *istate)133 {134 trap_virtual_eoi();135 clock();136 }137 138 149 /** @} 139 150 */
Note:
See TracChangeset
for help on using the changeset viewer.