~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/sh/include/asm/trace-clock.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2007,2008 Giuseppe Cavallaro <peppe.cavallaro@st.com>
3
 
 *                         Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
4
 
 *
5
 
 * Trace clock definitions for SuperH.
6
 
 */
7
 
 
8
 
#ifndef _ASM_SH_TRACE_CLOCK_H
9
 
#define _ASM_SH_TRACE_CLOCK_H
10
 
 
11
 
#include <linux/clocksource.h>
12
 
#include <asm/clock.h>
13
 
 
14
 
/*
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).
20
 
 */
21
 
#define TC_HW_BITS                      32
22
 
 
23
 
/* Expected maximum interrupt latency in ms : 15ms, *2 for security */
24
 
#define TC_EXPECTED_INTERRUPT_LATENCY   30
25
 
 
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);
31
 
 
32
 
static inline u32 trace_clock_read32(void)
33
 
{
34
 
        return sh_read_timer_count();
35
 
}
36
 
 
37
 
static inline u64 trace_clock_read64(void)
38
 
{
39
 
        return trace_clock_read_synthetic_tsc();
40
 
}
41
 
 
42
 
static inline u64 trace_clock_frequency(void)
43
 
{
44
 
        return sh_get_clock_frequency();
45
 
}
46
 
 
47
 
static inline u32 trace_clock_freq_scale(void)
48
 
{
49
 
        return 1;
50
 
}
51
 
 
52
 
static inline int get_trace_clock(void)
53
 
{
54
 
        get_synthetic_tsc();
55
 
        return 0;
56
 
}
57
 
 
58
 
static inline void put_trace_clock(void)
59
 
{
60
 
        put_synthetic_tsc();
61
 
}
62
 
 
63
 
static inline void set_trace_clock_is_sync(int state)
64
 
{
65
 
}
66
 
#endif /* _ASM_SH_TRACE_CLOCK_H */