18 #ifndef _LIB_COBALT_SH_TSC_H
19 #define _LIB_COBALT_SH_TSC_H
23 struct xnarch_tsc_area {
25 #if __BYTE_ORDER == __BIG_ENDIAN
33 unsigned long counter_pa;
36 extern volatile struct xnarch_tsc_area *__cobalt_sh_tsc;
38 extern volatile unsigned long *__cobalt_sh_tcnt;
40 static inline unsigned long long cobalt_read_tsc(
void)
42 unsigned long long tsc;
45 tsc = __cobalt_sh_tsc->tsc.high;
46 low = *__cobalt_sh_tcnt ^ 0xffffffffUL;
47 if (low < __cobalt_sh_tsc->tsc.low)
49 tsc = (tsc << 32)|low;