2
* Copyright (C) 2007,2008 Giuseppe Cavallaro <peppe.cavallaro@st.com>
3
* Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
5
* Trace clock definitions for SuperH.
8
#ifndef _ASM_SH_TRACE_CLOCK_H
9
#define _ASM_SH_TRACE_CLOCK_H
11
#include <linux/clocksource.h>
12
#include <asm/clock.h>
15
* Number of hardware clock bits. The higher order bits are expected to be 0.
16
* If the hardware clock source has more than 32 bits, the bits higher than the
17
* 32nd will be truncated by a cast to a 32 bits unsigned. Range : 1 - 32.
18
* (too few bits would be unrealistic though, since we depend on the timer to
19
* detect the overflows).
23
/* Expected maximum interrupt latency in ms : 15ms, *2 for security */
24
#define TC_EXPECTED_INTERRUPT_LATENCY 30
26
extern u64 trace_clock_read_synthetic_tsc(void);
27
extern u64 sh_get_clock_frequency(void);
28
extern u32 sh_read_timer_count(void);
29
extern void get_synthetic_tsc(void);
30
extern void put_synthetic_tsc(void);
32
static inline u32 trace_clock_read32(void)
34
return sh_read_timer_count();
37
static inline u64 trace_clock_read64(void)
39
return trace_clock_read_synthetic_tsc();
42
static inline u64 trace_clock_frequency(void)
44
return sh_get_clock_frequency();
47
static inline u32 trace_clock_freq_scale(void)
52
static inline int get_trace_clock(void)
58
static inline void put_trace_clock(void)
63
static inline void set_trace_clock_is_sync(int state)
66
#endif /* _ASM_SH_TRACE_CLOCK_H */