| From | Sent On | Attachments |
|---|---|---|
| Peter Pentchev | Jul 6, 2001 2:38 am | |
| Arun Sharma | Jul 6, 2001 11:10 am | |
| Mike Smith | Jul 6, 2001 2:00 pm | |
| Mike Smith | Jul 6, 2001 2:35 pm | |
| Lars Eggert | Jul 6, 2001 3:09 pm | |
| Mike Smith | Jul 6, 2001 3:26 pm | |
| Bruce Evans | Jul 7, 2001 4:19 am |
| Subject: | New hw.cpuhz sysctl as per PR i386/27627 | |
|---|---|---|
| From: | Peter Pentchev (ro...@orbitel.bg) | |
| Date: | Jul 6, 2001 2:38:18 am | |
| List: | org.freebsd.freebsd-arch | |
Hi,
Attached is a slight modification of the patch in PR i386/27627. Are there any downsides to implementing this? If not, how should it be extended to allow probing non-TSC/non-i386 timecounters?
G'luck, Peter
--
"yields falsehood, when appended to its quotation." yields falsehood, when
appended to its quotation.
Index: src/sys/i386/isa/clock.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/clock.c,v retrieving revision 1.174 diff -u -r1.174 clock.c --- src/sys/i386/isa/clock.c 2001/05/15 23:22:21 1.174 +++ src/sys/i386/isa/clock.c 2001/07/06 09:11:52 @@ -146,6 +146,10 @@ static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int i8254_ticked; +static u_int cpuhz; + +SYSCTL_INT(_hw, OID_AUTO, cpuhz, CTLFLAG_RD, &cpuhz, 0, "CPU speed in Hz."); + /* * XXX new_function and timer_func should not handle clockframes, but * timer_func currently needs to hold hardclock to handle the @@ -664,7 +668,7 @@ * similar to those for the i8254 clock. */ if (tsc_present) - tsc_freq = rdtsc() - old_tsc; + cpuhz = tsc_freq = rdtsc() - old_tsc;
if (bootverbose) { if (tsc_present)
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message





