2023-02-05 10:27:29 +00:00
|
|
|
|
|
|
|
|
.global ml_halt_cpu
|
|
|
|
|
.type ml_halt_cpu, @function
|
|
|
|
|
|
|
|
|
|
ml_halt_cpu:
|
|
|
|
|
1: cli
|
|
|
|
|
hlt
|
|
|
|
|
jmp 1b
|
2023-03-18 19:35:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.global ml_this_cpu
|
|
|
|
|
.type ml_this_cpu, @function
|
|
|
|
|
|
|
|
|
|
ml_this_cpu:
|
|
|
|
|
movq %gs:0, %rax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.global rdmsr
|
|
|
|
|
.type rdmsr, @function
|
|
|
|
|
|
|
|
|
|
rdmsr:
|
|
|
|
|
mov %rdi, %rcx
|
|
|
|
|
rdmsr
|
|
|
|
|
shl $32, %rdx
|
|
|
|
|
orq %rax, %rdx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.global wrmsr
|
|
|
|
|
.type wrmsr, @function
|
|
|
|
|
|
|
|
|
|
wrmsr:
|
|
|
|
|
mov %rdi, %rcx
|
|
|
|
|
mov %rsi, %rax
|
|
|
|
|
mov %rsi, %rdx
|
|
|
|
|
shr $32, %rdx
|
|
|
|
|
|
|
|
|
|
wrmsr
|
|
|
|
|
|
|
|
|
|
ret
|