add support for MSRs and basic bitwise ops

This commit is contained in:
Michael Shaw 2023-02-28 18:07:12 -05:00
commit d5ea43e05a
3 changed files with 52 additions and 0 deletions

29
init/msr.S Normal file
View file

@ -0,0 +1,29 @@
.global rdmsr
rdmsr:
pushq %rbp
movq %rsp, %rbp
movl %edi, %ecx
rdmsr
shlq $20, %rdx
orq %rdx, %rax
popq %rbp
ret
.global wrmsr
wrmsr:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rdx
shrq $20, %rdx
movl %esi, %eax
movl %edi, %ecx
wrmsr
popq %rbp
ret