Do not divide the APIC if we are debugging

This commit is contained in:
Alex 2022-10-28 08:38:18 +03:00
parent 2f3608d864
commit 4fced18138
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -300,7 +300,10 @@ namespace APIC
LVTTimer timer = {.raw = 0};
timer.Vector = Vector;
timer.TimerMode = 0;
this->lapic->Write(APIC_TDCR, DivideBy128);
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) != 0)
this->lapic->Write(APIC_TDCR, DivideBy128);
else
this->lapic->Write(APIC_TDCR, DivideBy16);
this->lapic->Write(APIC_TICR, Ticks * Miliseconds);
this->lapic->Write(APIC_TIMER, timer.raw);
}