ROSS
ppc64le.c
Go to the documentation of this file.
1#include <ross.h>
2
3extern unsigned long long g_tw_clock_rate;
4
5static const tw_optdef clock_opts [] =
6{
7 TWOPT_GROUP("ROSS Timing"),
8 TWOPT_ULONGLONG("clock-rate", g_tw_clock_rate, "CPU Clock Rate"),
10};
11
13{
14
15 // reset from default to 512MHz as that's the timebase for the POWER9 system.
16 g_tw_clock_rate = 512000000.0;
17 return clock_opts;
18}
19
21{
22 unsigned int tbl, tbu0, tbu1;
23
24 do {
25 __asm__ __volatile__ ("mftbu %0" : "=r"(tbu0));
26 __asm__ __volatile__ ("mftb %0" : "=r"(tbl));
27 __asm__ __volatile__ ("mftbu %0" : "=r"(tbu1));
28 } while (tbu0 != tbu1);
29
30 return (((unsigned long long)tbu0) << 32) | tbl;
31}
32
33void
35{
36 me->clock_time = 0;
38}
39
42{
44 return me->clock_time;
45}
static const tw_optdef clock_opts[]
Definition aarch64.c:13
uint64_t tw_clock
Definition aarch64.h:6
unsigned long long g_tw_clock_rate
#define TWOPT_GROUP(h)
Definition tw-opts.h:30
#define TWOPT_ULONGLONG(n, v, h)
Definition tw-opts.h:32
#define TWOPT_END()
Definition tw-opts.h:39
tw_clock tw_clock_now(tw_pe *me)
Definition ppc64le.c:41
const tw_optdef * tw_clock_setup(void)
Definition ppc64le.c:12
void tw_clock_init(tw_pe *me)
Definition ppc64le.c:34
tw_clock tw_clock_read(void)
Definition ppc64le.c:20
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