Rev 576 | Rev 1477 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 576 | Rev 958 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | 51 | ||
52 | 52 | ||
53 | #define CLK_CONST 1193180 |
53 | #define CLK_CONST 1193180 |
54 | #define MAGIC_NUMBER 1194 |
54 | #define MAGIC_NUMBER 1194 |
55 | 55 | ||
56 | static void i8254_interrupt(int n, void *stack); |
56 | static void i8254_interrupt(int n, istate_t *istate); |
57 | 57 | ||
58 | void i8254_init(void) |
58 | void i8254_init(void) |
59 | { |
59 | { |
60 | i8254_normal_operation(); |
60 | i8254_normal_operation(); |
61 | } |
61 | } |
Line 65... | Line 65... | ||
65 | outb(CLK_PORT4, 0x36); |
65 | outb(CLK_PORT4, 0x36); |
66 | pic_disable_irqs(1<<IRQ_CLK); |
66 | pic_disable_irqs(1<<IRQ_CLK); |
67 | outb(CLK_PORT1, (CLK_CONST/HZ) & 0xf); |
67 | outb(CLK_PORT1, (CLK_CONST/HZ) & 0xf); |
68 | outb(CLK_PORT1, (CLK_CONST/HZ) >> 8); |
68 | outb(CLK_PORT1, (CLK_CONST/HZ) >> 8); |
69 | pic_enable_irqs(1<<IRQ_CLK); |
69 | pic_enable_irqs(1<<IRQ_CLK); |
70 | exc_register(VECTOR_CLK, "i8254_clock", i8254_interrupt); |
70 | exc_register(VECTOR_CLK, "i8254_clock", (iroutine) i8254_interrupt); |
71 | } |
71 | } |
72 | 72 | ||
73 | #define LOOPS 150000 |
73 | #define LOOPS 150000 |
74 | #define SHIFT 11 |
74 | #define SHIFT 11 |
75 | void i8254_calibrate_delay_loop(void) |
75 | void i8254_calibrate_delay_loop(void) |
Line 123... | Line 123... | ||
123 | CPU->frequency_mhz = (clk2-clk1)>>SHIFT; |
123 | CPU->frequency_mhz = (clk2-clk1)>>SHIFT; |
124 | 124 | ||
125 | return; |
125 | return; |
126 | } |
126 | } |
127 | 127 | ||
128 | void i8254_interrupt(int n, void *stack) |
128 | void i8254_interrupt(int n, istate_t *istate) |
129 | { |
129 | { |
130 | trap_virtual_eoi(); |
130 | trap_virtual_eoi(); |
131 | clock(); |
131 | clock(); |
132 | } |
132 | } |