feat: GICv2 and timer

fix: TimerReset in GIC.c now uses kTimerFrequency
This commit is contained in:
karina
2026-04-29 08:46:13 +04:00
parent 270aae56b4
commit 7fcb50587e
10 changed files with 181 additions and 5 deletions
+14
View File
@@ -0,0 +1,14 @@
#include <Arch/Timer.h>
#include <Arch/GIC.h>
void TimerInitialize() {
GICEnableInterrupt(kTimerIRQ);
TimerReset(kTimerFrequency);
}
void TimerReset(UInt64 interval) {
UInt64 frequency;
__asm__ volatile ("mrs %0, cntfrq_el0" : "=r"(frequency));
__asm__ volatile ("msr cntp_tval_el0, %0" :: "r"(frequency /interval));
__asm__ volatile ("msr cntp_ctl_el0, %0" :: "r" (1));
}