Processing multiple RTC interrupts

This commit is contained in:
Josh Holtrop 2022-12-14 23:51:35 -05:00
parent 58d685a15b
commit 42ab6f396d
2 changed files with 4 additions and 6 deletions

View File

@ -78,10 +78,7 @@ struct apic
apic_registers.lvt_lint[0].value = idt.INT_LAPIC_LINT0; apic_registers.lvt_lint[0].value = idt.INT_LAPIC_LINT0;
apic_registers.lvt_lint[1].value = idt.INT_LAPIC_LINT1; apic_registers.lvt_lint[1].value = idt.INT_LAPIC_LINT1;
apic_registers.divide_configuration.value = 3u; apic_registers.divide_configuration.value = 3u;
for (size_t i = 0u; i < 24u; i++) configure_io_apic_irq(8u, 0x48u);
{
configure_io_apic_irq(i, i + 0x40u);
}
} }
private static void configure_io_apic_irq(size_t io_apic_irq, size_t interrupt_id) private static void configure_io_apic_irq(size_t io_apic_irq, size_t interrupt_id)
@ -93,7 +90,7 @@ struct apic
io_apic_registers.data.value = entry >> 32u; io_apic_registers.data.value = entry >> 32u;
} }
private static void eoi() public static void eoi()
{ {
apic_registers.eoi.value = 0u; apic_registers.eoi.value = 0u;
} }

View File

@ -5,6 +5,7 @@ module hulk.rtc;
import hulk.cpu; import hulk.cpu;
import hulk.klog; import hulk.klog;
import hulk.apic;
struct rtc struct rtc
{ {
@ -45,7 +46,6 @@ struct rtc
{ {
static __gshared ulong count; static __gshared ulong count;
static __gshared ulong seconds; static __gshared ulong seconds;
klog.writefln("RTC ISR!");
count++; count++;
if ((count % 1024) == 0u) if ((count % 1024) == 0u)
{ {
@ -53,5 +53,6 @@ struct rtc
klog.writefln("Seconds: %u", seconds); klog.writefln("Seconds: %u", seconds);
} }
eoi(); eoi();
apic.eoi();
} }
} }