RFC: Adding a hw.features sysctl
igor at hybrid-lab.co.uk
Tue Jan 15 03:29:23 PST 2008
On 14 Jan 2008 18:53:37 +0100, vermaden <vermaden at interia.pl> wrote:
> So why not transform this:
> 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:
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...
More information about the freebsd-current