mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
AArch64: Fix HP_TIMING_DIFF computation [BZ# 29329]
Fix the computation to allow for cntfrq_el0 being larger than 1GHz. Assume cntfrq_el0 is a multiple of 1MHz to increase the maximum interval (1024 seconds at 1GHz). Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
This commit is contained in:
parent
8b014a1b1f
commit
311a7e0256
@ -41,7 +41,7 @@ typedef uint64_t hp_timing_t;
|
|||||||
#define HP_TIMING_DIFF(Diff, Start, End) \
|
#define HP_TIMING_DIFF(Diff, Start, End) \
|
||||||
({ hp_timing_t freq; \
|
({ hp_timing_t freq; \
|
||||||
__asm__ __volatile__ ("mrs %0, cntfrq_el0" : "=r" (freq)); \
|
__asm__ __volatile__ ("mrs %0, cntfrq_el0" : "=r" (freq)); \
|
||||||
(Diff) = ((End) - (Start)) * (UINT64_C(1000000000) / freq); \
|
(Diff) = (((End) - (Start)) * UINT64_C(1000000000 >> 6)) / (freq >> 6); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#endif /* hp-timing.h */
|
#endif /* hp-timing.h */
|
||||||
|
Loading…
Reference in New Issue
Block a user