aboutsummaryrefslogtreecommitdiffstats
path: root/arch/c6x/include/asm/timex.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:39:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:39:40 -0500
commit06792c4dde2ad143928cc95c1ba218c6269c494b (patch)
tree92bdd4631612c9e3d8e5f6f06839f75c5473300a /arch/c6x/include/asm/timex.h
parent4690dfa8cd66c37fbe99bb8cd5baa86102110776 (diff)
parent166c0eaedfc3157dc1394c27e827add19f05fb27 (diff)
Merge tag 'for-linux-3.3-merge-window' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming
* tag 'for-linux-3.3-merge-window' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming: (29 commits) C6X: replace tick_nohz_stop/restart_sched_tick calls C6X: add register_cpu call C6X: deal with memblock API changes C6X: fix timer64 initialization C6X: fix layout of EMIFA registers C6X: MAINTAINERS C6X: DSCR - Device State Configuration Registers C6X: EMIF - External Memory Interface C6X: general SoC support C6X: library code C6X: headers C6X: ptrace support C6X: loadable module support C6X: cache control C6X: clocks C6X: build infrastructure C6X: syscalls C6X: interrupt handling C6X: time management C6X: signal management ...
Diffstat (limited to 'arch/c6x/include/asm/timex.h')
-rw-r--r--arch/c6x/include/asm/timex.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/c6x/include/asm/timex.h b/arch/c6x/include/asm/timex.h
new file mode 100644
index 000000000000..508c3ec971f9
--- /dev/null
+++ b/arch/c6x/include/asm/timex.h
@@ -0,0 +1,33 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
6 *
7 * Modified for 2.6.34: Mark Salter <msalter@redhat.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef _ASM_C6X_TIMEX_H
14#define _ASM_C6X_TIMEX_H
15
16#define CLOCK_TICK_RATE ((1000 * 1000000UL) / 6)
17
18/* 64-bit timestamp */
19typedef unsigned long long cycles_t;
20
21static inline cycles_t get_cycles(void)
22{
23 unsigned l, h;
24
25 asm volatile (" dint\n"
26 " mvc .s2 TSCL,%0\n"
27 " mvc .s2 TSCH,%1\n"
28 " rint\n"
29 : "=b"(l), "=b"(h));
30 return ((cycles_t)h << 32) | l;
31}
32
33#endif /* _ASM_C6X_TIMEX_H */