FreeBSD Bugzilla – Attachment 8733 Details for
Bug 18154
[sysctl] [patch] Add cpu class and features flags sysctls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.49 KB, created by
toasty
on 2000-04-22 09:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
toasty
Created:
2000-04-22 09:20:01 UTC
Size:
2.49 KB
patch
obsolete
>diff --exclude=*compile* -r -u sys-orig/i386/i386/identcpu.c sys/i386/i386/identcpu.c >--- sys-orig/i386/i386/identcpu.c Sat Jan 29 01:49:02 2000 >+++ sys/i386/i386/identcpu.c Sat Apr 22 02:23:16 2000 >@@ -78,6 +78,9 @@ > > u_int cyrix_did; /* Device ID of Cyrix CPU */ > int cpu_class = CPUCLASS_386; /* least common denominator */ >+SYSCTL_INT(_hw, HW_CPUCLASS, cpu_class, CTLFLAG_RD, >+ &cpu_class, 0, "CPU class"); >+ > char machine[] = "i386"; > SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, > machine, 0, "Machine class"); >@@ -86,6 +89,23 @@ > SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, > cpu_model, 0, "Machine model"); > >+SYSCTL_NODE(_hw, OID_AUTO, features, CTLFLAG_RW, 0, >+ "CPU features"); >+ >+int featuresmmx; >+SYSCTL_INT(_hw_features, OID_AUTO, mmx, CTLFLAG_RD, >+ &featuresmmx, 0, "MMX Support"); >+ >+int features3dnow; >+SYSCTL_INT(_hw_features, OID_AUTO, 3dnow, CTLFLAG_RD, >+ &features3dnow, 0, "3DNow! Support"); >+ >+int featuressimd; >+SYSCTL_INT(_hw_features, OID_AUTO, simd, CTLFLAG_RD, >+ &featuressimd, 0, "SIMD Support"); >+ >+ >+ > static struct cpu_nameclass i386_cpus[] = { > { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ > { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ >@@ -580,6 +600,10 @@ > "\037<b30>" > "\040<b31>" > ); >+ if (cpu_feature & 0x800000) >+ featuresmmx = 1; >+ if (cpu_feature & 0x2000000) >+ features3dnow = 1; > } > if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > nreg >= 0x80000001) >@@ -987,7 +1011,9 @@ > "\034<b27>" > "\035<b28>" > "\036<b29>" >- "\037DSP" /* AMD 3DNow! Instruction Extensions */ >- "\0403DNow!" >+ "\037DSP" >+ "\0403DNow!" /* AMD 3DNow! Instruction Extensions */ > ); >+ if (regs[3] & 0x80000000) >+ features3dnow = 1; > } >diff --exclude=*compile* -r -u sys-orig/sys/sysctl.h sys/sys/sysctl.h >--- sys-orig/sys/sysctl.h Thu Feb 10 12:51:58 2000 >+++ sys/sys/sysctl.h Sat Apr 22 02:29:57 2000 >@@ -346,7 +346,8 @@ > #define HW_DISKSTATS 9 /* struct: diskstats[] */ > #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_CPUCLASS 12 /* int: class of cpu <machine/cpuclass.h> */ >+#define HW_MAXID 13 /* number of valid hw ids */ > > #define CTL_HW_NAMES { \ > { 0, 0 }, \ >@@ -360,6 +361,8 @@ > { "disknames", CTLTYPE_STRUCT }, \ > { "diskstats", CTLTYPE_STRUCT }, \ > { "floatingpoint", CTLTYPE_INT }, \ >+ { "machinearch", CTLTYPE_STRING }, \ >+ { "cpuclass", CTLTYPE_INT }, \ > } > > /*
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 18154
: 8733