Blame view
include/asm-powerpc/timex.h
793 Bytes
dd56fdf23
|
1 2 3 4 |
#ifndef _ASM_POWERPC_TIMEX_H #define _ASM_POWERPC_TIMEX_H #ifdef __KERNEL__ |
1da177e4c
|
5 |
/* |
dd56fdf23
|
6 |
* PowerPC architecture timex specifications |
1da177e4c
|
7 |
*/ |
1da177e4c
|
8 |
|
1da177e4c
|
9 |
#include <asm/cputable.h> |
859deea94
|
10 |
#include <asm/reg.h> |
1da177e4c
|
11 |
|
cbd27b8ce
|
12 |
#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ |
1da177e4c
|
13 14 |
typedef unsigned long cycles_t; |
1da177e4c
|
15 16 |
static inline cycles_t get_cycles(void) { |
dd56fdf23
|
17 |
#ifdef __powerpc64__ |
859deea94
|
18 |
return mftb(); |
dd56fdf23
|
19 |
#else |
859deea94
|
20 |
cycles_t ret; |
dd56fdf23
|
21 22 23 24 25 26 |
/* * For the "cycle" counter we use the timebase lower half. * Currently only used on SMP. */ ret = 0; |
1da177e4c
|
27 28 |
__asm__ __volatile__( |
0909c8c2d
|
29 30 |
"97: mftb %0 " |
1da177e4c
|
31 32 33 34 |
"99: " ".section __ftr_fixup,\"a\" " |
0909c8c2d
|
35 36 37 38 |
".align 2 " "98: " |
1da177e4c
|
39 40 41 42 |
" .long %1 " " .long 0 " |
0909c8c2d
|
43 44 45 46 |
" .long 97b-98b " " .long 99b-98b " |
1da177e4c
|
47 48 49 |
".previous" : "=r" (ret) : "i" (CPU_FTR_601)); return ret; |
859deea94
|
50 |
#endif |
1da177e4c
|
51 |
} |
dd56fdf23
|
52 53 |
#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_TIMEX_H */ |