diff options
Diffstat (limited to 'nacl/cpucycles/sparccpuinfo.c')
-rw-r--r-- | nacl/cpucycles/sparccpuinfo.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nacl/cpucycles/sparccpuinfo.c b/nacl/cpucycles/sparccpuinfo.c new file mode 100644 index 00000000..d07aafec --- /dev/null +++ b/nacl/cpucycles/sparccpuinfo.c | |||
@@ -0,0 +1,15 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <sys/types.h> | ||
3 | #include "osfreq.c" | ||
4 | |||
5 | long long cpucycles_sparccpuinfo(void) | ||
6 | { | ||
7 | long long result; | ||
8 | asm volatile("rd %%tick,%0" : "=r" (result)); | ||
9 | return result; | ||
10 | } | ||
11 | |||
12 | long long cpucycles_sparccpuinfo_persecond(void) | ||
13 | { | ||
14 | return osfreq(); | ||
15 | } | ||