Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2008 09:18:45 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Joe Marcus Clarke <marcus@freebsd.org>, current <current@freebsd.org>
Subject:   Re: RFC: Adding a hw.features[2] sysctl
Message-ID:  <200801140918.45895.jhb@freebsd.org>
In-Reply-To: <1200197787.67286.13.camel@shumai.marcuscom.com>
References:  <1200197787.67286.13.camel@shumai.marcuscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 12 January 2008 11:16:27 pm Joe Marcus Clarke wrote:
> I find it would be useful to have the list of CPU features available via
> a sysctl.  Currently, he only ways to get this information are to have
> linprocfs mounted, or parse dmesg.boot (if it exists).  Attached are
> patches to add hw.features and hw.features2 sysctls for i386 and amd64
> (where a list of CPU features is applicable).  The results are identical
> to the Features and Features2 strings from dmesg:
> 
> hw.features2: 0x41d<SSE3,RSVD2,MON,DS_CPL,CNXT-ID>
> hw.features:
> 0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
> 
> Comments?

I would put this under machdep. rather than hw. since it is x86-specific.

I also think having feature and feature2 might be a bit odd as you have to
query two different nodes.  Someday there might be a features3 when
features2 runs out of bits and then all the apps would have to be updated
again perhaps.  Maybe something like:

machdep.cpufeature.FPU=1
machdep.cpufeature.VME=1

Or maybe if you use named nodes like this you could do dev.cpu.X.FPU=1,
dev.cpu.X.VME=1, etc. (possibly dev.cpu.X.feature.FPU=1, etc.)

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801140918.45895.jhb>