summaryrefslogtreecommitdiff
path: root/kernel/hal/timestamp.asm
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hal/timestamp.asm')
-rw-r--r--kernel/hal/timestamp.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/hal/timestamp.asm b/kernel/hal/timestamp.asm
new file mode 100644
index 0000000..b56bedb
--- /dev/null
+++ b/kernel/hal/timestamp.asm
@@ -0,0 +1,19 @@
+
+ [BITS 32]
+
+GLOBAL HalReadTimestampCounter
+EXTERN g_ullTimeStampCounter
+
+[SECTION .text]
+;;;
+;;; ULONGLONG
+;;; HalReadTimestampCounter(void)
+;;;
+;;; Function to read the processor's timestamp counter
+;;;
+HalReadTimestampCounter:
+ ALIGN 4
+ rdtsc
+ mov [g_ullTimeStampCounter], edx
+ mov [g_ullTimeStampCounter+4], eax
+ ret