summaryrefslogtreecommitdiff
path: root/nacl/cpucycles/x86cpuinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/cpucycles/x86cpuinfo.c')
-rw-r--r--nacl/cpucycles/x86cpuinfo.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nacl/cpucycles/x86cpuinfo.c b/nacl/cpucycles/x86cpuinfo.c
new file mode 100644
index 00000000..3fb0a1b0
--- /dev/null
+++ b/nacl/cpucycles/x86cpuinfo.c
@@ -0,0 +1,15 @@
1#include <stdio.h>
2#include <sys/types.h>
3#include "osfreq.c"
4
5long long cpucycles_x86cpuinfo(void)
6{
7 long long result;
8 asm volatile(".byte 15;.byte 49" : "=A" (result));
9 return result;
10}
11
12long long cpucycles_x86cpuinfo_persecond(void)
13{
14 return osfreq();
15}