Processing multiple RTC interrupts
This commit is contained in:
parent
58d685a15b
commit
42ab6f396d
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user