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:
parent
7c9d1075eb
commit
add533071b
7 changed files with 160 additions and 32 deletions
13
zion/common/msr.cpp
Normal file
13
zion/common/msr.cpp
Normal 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));
|
||||
}
|
||||
6
zion/common/msr.h
Normal file
6
zion/common/msr.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint64_t GetMSR(uint32_t msr);
|
||||
void SetMSR(uint32_t msr, uint64_t val);
|
||||
Loading…
Add table
Add a link
Reference in a new issue