diff options
Diffstat (limited to 'arch/sparc/include')
-rw-r--r-- | arch/sparc/include/asm/cycles.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/cycles.h b/arch/sparc/include/asm/cycles.h new file mode 100644 index 0000000..ce0e8ce --- /dev/null +++ b/arch/sparc/include/asm/cycles.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef ASM_CYCLES_H | ||
2 | #define ASM_CYCLES_H | ||
3 | |||
4 | #define NPT_BIT 63 | ||
5 | |||
6 | typedef unsigned long cycles_t; | ||
7 | |||
8 | #define CYCLES_FMT "lu" | ||
9 | |||
10 | static inline cycles_t get_cycles(void) { | ||
11 | cycles_t cycles = 0; | ||
12 | __asm__ __volatile__("rd %%asr24, %0" : "=r" (cycles)); | ||
13 | return cycles & ~(1UL << NPT_BIT); | ||
14 | } | ||
15 | |||
16 | #endif | ||