diff options
author | dzwdz | 2023-09-19 15:38:34 +0200 |
---|---|---|
committer | dzwdz | 2023-09-19 15:38:34 +0200 |
commit | 8b0953d8cdbf676cf100bcb0f77a0c82755b53ae (patch) | |
tree | 9ebfdfa1bf8bd7d663b35482b622338a14c8133c /src/kernel/arch/amd64/interrupts/irq.c | |
parent | 14fd2aecd074fb93bb509df0c1cedd1f1055a4a6 (diff) |
kernel: use HPET timer for sleeps
not strictly necessary, but this should improve:
1. sleep performance
2. power efficiency when idle
Diffstat (limited to 'src/kernel/arch/amd64/interrupts/irq.c')
-rw-r--r-- | src/kernel/arch/amd64/interrupts/irq.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/kernel/arch/amd64/interrupts/irq.c b/src/kernel/arch/amd64/interrupts/irq.c index e900450..f2f11fb 100644 --- a/src/kernel/arch/amd64/interrupts/irq.c +++ b/src/kernel/arch/amd64/interrupts/irq.c @@ -5,12 +5,6 @@ static const int PIC1 = 0x20; static const int PIC2 = 0xA0; -static void pit_init(void) { - uint16_t divisor = 1193; - port_out8(0x40, divisor & 0xFF); - port_out8(0x40, divisor >> 8); -} - void irq_init(void) { port_out8(PIC1, 0x11); /* start init sequence */ port_out8(PIC2, 0x11); @@ -26,15 +20,13 @@ void irq_init(void) { uint16_t mask = 0xffff; mask &= ~(1 << 2); // cascade mask &= ~(1 << IRQ_COM1); - mask &= ~(1 << IRQ_PIT); mask &= ~(1 << IRQ_PS2KB); mask &= ~(1 << IRQ_PS2MOUSE); mask &= ~(1 << IRQ_RTL8139); + mask &= ~(1 << IRQ_HPET); port_out8(PIC1+1, mask & 0xff); port_out8(PIC2+1, (mask >> 8) & 0xff); - - pit_init(); } void irq_eoi(uint8_t line) { |