kernel: add function to query CPU clock cycle count
This commit is contained in:
@@ -38,3 +38,13 @@ wrmsr:
|
||||
wrmsr
|
||||
|
||||
ret
|
||||
|
||||
|
||||
.global get_cycles
|
||||
.type get_cycles, @function
|
||||
|
||||
get_cycles:
|
||||
rdtsc
|
||||
shl $32, %rdx
|
||||
orq %rdx, %rax
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user