mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this
function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly.
This commit is contained in:
parent
35daccccce
commit
d8ea2a492e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219672
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 24, 2009
|
||||
.Dd March 15, 2011
|
||||
.Dt GET_CYCLECOUNT 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -65,14 +65,14 @@ do not have such a register,
|
||||
so
|
||||
.Fn get_cyclecount
|
||||
on these platforms
|
||||
returns a (non-monotonic) combination of numbers
|
||||
returns a (monotonic) combination of numbers
|
||||
represented by the
|
||||
structure returned by
|
||||
.Xr binuptime 9 .
|
||||
.Pp
|
||||
The
|
||||
.Tn Pentium
|
||||
processors all use the
|
||||
.Tn AMD64 and Intel 64
|
||||
processors use the
|
||||
.Li TSC
|
||||
register.
|
||||
.Pp
|
||||
|
@ -70,15 +70,10 @@ void swi_vm(void *);
|
||||
static __inline uint64_t
|
||||
get_cyclecount(void)
|
||||
{
|
||||
#if defined(I486_CPU) || defined(KLD_MODULE)
|
||||
struct bintime bt;
|
||||
|
||||
if (!tsc_present) {
|
||||
binuptime(&bt);
|
||||
return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
|
||||
}
|
||||
#endif
|
||||
return (rdtsc());
|
||||
binuptime(&bt);
|
||||
return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user