File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -105,16 +105,6 @@ double UnscaledCycleClock::Frequency() {
105105
106106#elif defined(__aarch64__)
107107
108- // System timer of ARMv8 runs at a different frequency than the CPU's.
109- // The frequency is fixed, typically in the range 1-50MHz. It can be
110- // read at CNTFRQ special register. We assume the OS has set up
111- // the virtual timer properly.
112- int64_t UnscaledCycleClock::Now () {
113- int64_t virtual_timer_value;
114- asm volatile (" mrs %0, cntvct_el0" : " =r" (virtual_timer_value));
115- return virtual_timer_value;
116- }
117-
118108double UnscaledCycleClock::Frequency () {
119109 uint64_t aarch64_timer_frequency;
120110 asm volatile (" mrs %0, cntfrq_el0" : " =r" (aarch64_timer_frequency));
Original file line number Diff line number Diff line change @@ -85,6 +85,18 @@ inline int64_t UnscaledCycleClock::Now() {
8585 return static_cast <int64_t >((high << 32 ) | low);
8686}
8787
88+ #elif defined(__aarch64__)
89+
90+ // System timer of ARMv8 runs at a different frequency than the CPU's.
91+ // The frequency is fixed, typically in the range 1-50MHz. It can be
92+ // read at CNTFRQ special register. We assume the OS has set up
93+ // the virtual timer properly.
94+ inline int64_t UnscaledCycleClock::Now () {
95+ int64_t virtual_timer_value;
96+ asm volatile (" mrs %0, cntvct_el0" : " =r" (virtual_timer_value));
97+ return virtual_timer_value;
98+ }
99+
88100#endif
89101
90102} // namespace base_internal
You can’t perform that action at this time.
0 commit comments