Re: RFC: Adding a hw.features[2] sysctl

From: Igor Mozolevsky <igor_at_hybrid-lab.co.uk>
Date: Tue, 15 Jan 2008 11:29:21 +0000
On 14 Jan 2008 18:53:37 +0100, vermaden <vermaden_at_interia.pl> wrote:

> So why not transform this:

>Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
>   Features2=0x1<SSE3>
>   AMD Features=0xe2500800<SYSCALL,NX,MMX+,FFXSR,LM,3DNow!+,3DNow!>
>   AMD Features2=0x3<LAHF,CMP>

>
> into this:
>

> dev.cpu.0.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFLUSH MMX FXSR SSE SSE2 HTT SYSCALL NX MMX+ FFXSR LM 3DNow!+ 3DNow! LAHF CMP

> I also do not like idea of /dev/cpuinfo it is FreeBSD not Linux:
> http://wiki.freebsd.org/AvoidingLinuxisms

Because just like in Linux, you will have to write a parser for that!
And even if there was a lib function or a macro in the header files to
check for features, it would be still significantly more expensive
than using CPUID op.

Then the question really boils down to: who is this feature for? The
user or the programmer? If it's for the user, then they could just as
easily run dmesg to get cpu feature. If it's for the programmer, then
it has to be easier than ripping someone else's cpuid code...


Igor
Received on Tue Jan 15 2008 - 10:29:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:26 UTC