FreeBSD Bugzilla – Attachment 13905 Details for
Bug 26272
Adds a sysctl to get the cpu frequency
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.97 KB, created by
mux
on 2001-04-01 18:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mux
Created:
2001-04-01 18:50:00 UTC
Size:
1.97 KB
patch
obsolete
>diff -cr /usr/src/sys/i386/i386/identcpu.c ./i386/i386/identcpu.c >*** /usr/src/sys/i386/i386/identcpu.c Sat Sep 30 05:32:21 2000 >--- ./i386/i386/identcpu.c Sun Apr 1 19:18:00 2001 >*************** >*** 86,91 **** >--- 86,95 ---- > SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, > cpu_model, 0, "Machine model"); > >+ static char cpu_freq[32] = "unknown"; >+ SYSCTL_STRING(_hw, HW_FREQUENCY, frequency, CTLFLAG_RD, >+ cpu_freq, 0, "Machine frequency"); >+ > static struct cpu_nameclass i386_cpus[] = { > { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ > { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ >*************** >*** 509,526 **** > #endif > #if defined(I586_CPU) > case CPUCLASS_586: >! printf("%d.%02d-MHz ", > (tsc_freq + 4999) / 1000000, > ((tsc_freq + 4999) / 10000) % 100); >! printf("586"); > break; > #endif > #if defined(I686_CPU) > case CPUCLASS_686: >! printf("%d.%02d-MHz ", > (tsc_freq + 4999) / 1000000, > ((tsc_freq + 4999) / 10000) % 100); >! printf("686"); > break; > #endif > default: >--- 513,530 ---- > #endif > #if defined(I586_CPU) > case CPUCLASS_586: >! sprintf(cpu_freq, "%d.%02d-MHz ", > (tsc_freq + 4999) / 1000000, > ((tsc_freq + 4999) / 10000) % 100); >! printf("%s586", cpu_freq); > break; > #endif > #if defined(I686_CPU) > case CPUCLASS_686: >! sprintf(cpu_freq, "%d.%02d-MHz ", > (tsc_freq + 4999) / 1000000, > ((tsc_freq + 4999) / 10000) % 100); >! printf("%s686", cpu_freq); > break; > #endif > default: >diff -cr /usr/src/sys/sys/sysctl.h ./sys/sysctl.h >*** /usr/src/sys/sys/sysctl.h Thu Feb 22 10:29:42 2001 >--- ./sys/sysctl.h Sun Apr 1 19:18:21 2001 >*************** >*** 416,421 **** >--- 416,422 ---- > #define HW_FLOATINGPT 10 /* int: has HW floating point? */ > #define HW_MACHINE_ARCH 11 /* string: machine architecture */ > #define HW_MAXID 12 /* number of valid hw ids */ >+ #define HW_FREQUENCY 13 /* cpu frequency */ > > #define CTL_HW_NAMES { \ > { 0, 0 }, \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 26272
: 13905