Use APIC for interrupts rather than PIC.

Still rely on the PIT for now rather than the local APIC timer.
This commit is contained in:
Drew Galbraith 2023-06-07 13:40:36 -07:00
parent 7c9d1075eb
commit add533071b
7 changed files with 160 additions and 32 deletions

13
zion/common/msr.cpp Normal file
View file

@ -0,0 +1,13 @@
#include "common/msr.h"
uint64_t GetMSR(uint32_t msr) {
uint32_t lo, hi;
asm("rdmsr" : "=a"(lo), "=d"(hi) : "c"(msr));
return (static_cast<uint64_t>(hi) << 32) | lo;
}
void SetMSR(uint32_t msr, uint64_t val) {
uint32_t lo = static_cast<uint32_t>(val);
uint32_t hi = val >> 32;
asm("wrmsr" ::"a"(lo), "d"(hi), "c"(msr));
}