diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-05-31 15:19:02 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-11 17:57:37 -0500 |
commit | dd9d29e1f6ec74af4ff7df1bbe4d05829887475f (patch) | |
tree | d47e4ee89876a10aa0f1746afe3e5fb5d924bbc3 | |
parent | b39ae3793ab590efbdb8aab63a598071782d32b8 (diff) |
ARM: provide get_cycles() for RealView PB11{MP,76} and Cortex-A8
Use the CCNT register to override the default get_cycles() implementation in
arch/arm/asm/timex.h. This is useful for overhead measurements and debugging.
-rw-r--r-- | arch/arm/mach-realview/include/mach/timex.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-realview/include/mach/timex.h b/arch/arm/mach-realview/include/mach/timex.h index 4eeb069373c2..e8bcc40d1f08 100644 --- a/arch/arm/mach-realview/include/mach/timex.h +++ b/arch/arm/mach-realview/include/mach/timex.h | |||
@@ -21,3 +21,30 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define CLOCK_TICK_RATE (50000000 / 16) | 23 | #define CLOCK_TICK_RATE (50000000 / 16) |
24 | |||
25 | #if defined(CONFIG_MACH_REALVIEW_PB11MP) || defined(CONFIG_MACH_REALVIEW_PB1176) | ||
26 | |||
27 | static inline unsigned long realview_get_arm11_cp15_ccnt(void) | ||
28 | { | ||
29 | unsigned long cycles; | ||
30 | /* Read CP15 CCNT register. */ | ||
31 | asm volatile ("mrc p15, 0, %0, c15, c12, 1" : "=r" (cycles)); | ||
32 | return cycles; | ||
33 | } | ||
34 | |||
35 | #define get_cycles realview_get_arm11_cp15_ccnt | ||
36 | |||
37 | #elif defined(CONFIG_MACH_REALVIEW_PBA8) | ||
38 | |||
39 | |||
40 | static inline unsigned long realview_get_a8_cp15_ccnt(void) | ||
41 | { | ||
42 | unsigned long cycles; | ||
43 | /* Read CP15 CCNT register. */ | ||
44 | asm volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r" (cycles)); | ||
45 | return cycles; | ||
46 | } | ||
47 | |||
48 | #define get_cycles realview_get_a8_cp15_ccnt | ||
49 | |||
50 | #endif | ||