ROSS
ppc.c
Go to the documentation of this file.
1#include <ross.h>
2
3#ifndef __GNUC__
4# error gcc asm extensions required
5#endif
6#if !(defined __ppc__ || defined __PPC__)
7# error only ppc platform supported
8#endif
9
11{
12 unsigned long tbu;
13 unsigned long tb1;
14 unsigned long tbu1;
15
16 do {
17 asm volatile(
18 "mftbu %2\n\t"
19 "mftb %0\n\t"
20 "mftbu %1\n\t"
21 : "=r"(tb1), "=r"(tbu), "=r"(tbu1) );
22 } while (tbu != tbu1);
23
24 return ( ((tw_clock)tbu) << 32 ) | tb1;
25}
26
27void
29{
30 me->clock_time = 0;
32}
33
36{
38 return me->clock_time;
39}
uint64_t tw_clock
Definition aarch64.h:6
tw_clock tw_clock_now(tw_pe *me)
Definition ppc.c:35
void tw_clock_init(tw_pe *me)
Definition ppc.c:28
tw_clock tw_clock_read(void)
Definition ppc.c:10
Holds the entire PE state.
Definition ross-types.h:416
tw_clock clock_offset
Initial clock value for this PE.
Definition ross-types.h:437
tw_clock clock_time
Most recent clock value for this PE.
Definition ross-types.h:438