summaryrefslogtreecommitdiff
path: root/asm/asm_x86.s
diff options
context:
space:
mode:
Diffstat (limited to 'asm/asm_x86.s')
-rw-r--r--asm/asm_x86.s17
1 files changed, 17 insertions, 0 deletions
diff --git a/asm/asm_x86.s b/asm/asm_x86.s
index 3481ec2..7f0f56b 100644
--- a/asm/asm_x86.s
+++ b/asm/asm_x86.s
@@ -24,6 +24,9 @@
.global x86_get_cr
.global x86_set_cr
+// timer
+.global x86_rdtscp
+
x86_outb:
mov 4(%esp), %edx
mov 8(%esp), %eax
@@ -132,3 +135,17 @@ x86_invlpg:
mov 4(%esp), %eax // addr
invlpg (%eax)
ret
+
+#x86_rdtscp:
+# rdtscp
+# ret
+# https://stackoverflow.com/questions/12631856/difference-between-rdtscp-rdtsc-memory-and-cpuid-rdtsc
+x86_rdtscp:
+ lfence #intel
+ rdtsc
+ ret
+
+#x86_rdtscp:
+# mfence #amd
+# rdtsc
+# ret