aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/cycles.h
blob: 73632f83b6eeb71e39d1a662d92890f4aecbf0f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef ASM_CYCLES_H
#define ASM_CYCLES_H

typedef unsigned long cycles_t;

#define CYCLES_FMT "lu"

/* system call wrapper */
int null_call(cycles_t *timestamp);

static inline cycles_t get_cycles(void)
{
	cycles_t c;
	/* On the ARM11 MPCore chips, userspace cannot access the cycle counter
	 * directly. So ask the kernel to read it instead. Eventually, this
	 * should support newer ARM chips that do allow accessing the cycle
	 * counter in userspace.
	 */
	null_call(&c);
	return c;
}

#endif