002142e40a47d912363964094234ea89d106fe58
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
4 #ifndef __LTT_USERTRACE_PPC_H
5 #define __LTT_USERTRACE_PPC_H
8 #include "ltt/atomic-ppc64.h"
9 #include "ltt/system-ppc64.h"
11 #include "ltt/ppc_asm-ppc.h"
12 #include "ltt/atomic-ppc.h"
13 #include "ltt/system-ppc.h"
16 #define CPU_FTR_601 0x00000100
18 #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
20 typedef uint64_t cycles_t
;
22 /* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */
23 static inline unsigned long get_tbl(void)
27 //#if defined(CONFIG_403GCX)
28 // asm volatile("mfspr %0, 0x3dd" : "=r" (tbl));
30 asm volatile("mftb %0" : "=r" (tbl
));
35 static inline unsigned int get_tbu(void)
39 //#if defined(CONFIG_403GCX)
40 // asm volatile("mfspr %0, 0x3dc" : "=r" (tbu));
42 asm volatile("mftbu %0" : "=r" (tbu
));
49 static inline uint64_t get_tb(void)
54 static inline uint64_t get_tb(void)
56 unsigned int tbhi
, tblo
, tbhi2
;
62 } while (tbhi
!= tbhi2
);
64 return ((uint64_t)tbhi
<< 32) | tblo
;
68 static inline cycles_t
get_cycles(void)
74 #endif /* __LTT_USERTRACE_PPC_H */
This page took 0.035053 seconds and 4 git commands to generate.