Skip to content

Commit 7c282ef

Browse files
John David Anglinsshaulnv
authored andcommitted
Implement get_cycles for hppa architecture
1 parent 6ab70de commit 7c282ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/get_clock.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ static inline cycles_t get_cycles()
124124
return perf_get_cycles();
125125
}
126126

127+
#elif defined(__hppa__)
128+
typedef unsigned long long cycles_t;
129+
static inline cycles_t get_cycles(void)
130+
{
131+
cycles_t clk;
132+
asm volatile("mfctl %%cr16, %0" : "=r" (clk));
133+
return clk;
134+
}
127135
#else
128136
#warning get_cycles not implemented for this architecture: attempt asm/timex.h
129137
#include <asm/timex.h>

0 commit comments

Comments
 (0)