kernel: add function to query CPU clock cycle count

This commit is contained in:
2023-04-22 21:07:34 +01:00
parent a8a6ff123e
commit e7fe5a8f8e
5 changed files with 23 additions and 0 deletions

View File

@@ -38,3 +38,13 @@ wrmsr:
wrmsr
ret
.global get_cycles
.type get_cycles, @function
get_cycles:
rdtsc
shl $32, %rdx
orq %rdx, %rax
ret