summaryrefslogtreecommitdiff
path: root/rdtsc.S
diff options
context:
space:
mode:
Diffstat (limited to 'rdtsc.S')
-rw-r--r--rdtsc.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/rdtsc.S b/rdtsc.S
new file mode 100644
index 0000000..fcac04d
--- /dev/null
+++ b/rdtsc.S
@@ -0,0 +1,13 @@
+global rdtsc
+
+section .text
+rdtsc:
+ mfence
+ lfence
+ rdtsc
+ lfence
+ shl rdx, 32
+ mov edx, eax
+ mov rax, rdx
+ ret
+