aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/cycles.h
blob: ce0e8ceb323ca94393bc3735b830060b8accf879 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef ASM_CYCLES_H
#define ASM_CYCLES_H

#define NPT_BIT 63

typedef unsigned long cycles_t;

#define CYCLES_FMT "lu"

static inline cycles_t get_cycles(void) {
	cycles_t cycles = 0;
	__asm__ __volatile__("rd %%asr24, %0" : "=r" (cycles));
	return cycles & ~(1UL << NPT_BIT);
}

#endif