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

From: Nathan Lay <nslay_at_comcast.net>
Date: Sun, 13 Jan 2008 20:59:12 -0500
Igor Mozolevsky wrote:
> On 13/01/2008, Peter Jeremy <peterjeremy_at_optushome.com.au> wrote:
>
>   
>> IMHO, no.  Virtually all similar FreeBSD information is exported via
>> sysctl and this sort of information fits neatly into the existing
>> MIB tree as either dev.cpu.N.features or hw.cpu.features
>>     
>
> /dev/sndstat?
>
> If it's in /dev you can do neat tricks like ioctl-ing queries (like
> ioctl(/dev/cpuinfo, CINFOCTL_HAS_FEATURES, CINFO_SSE3|CINFO_SSSE3))
> instead of having *every* app parse the result of a sysctl; most of
> the time you'd only want to check for specific feature , it's much
> easier to do an ioctl that returns a boolean.
>
> Igor
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>
>   
Or perhaps, create an ioctl that returns a bitmask of all available CPU 
features.  This way, only one ioctl() call is necessary and allows 
programs to query any and all features in an inexpensive way.  Calling 
ioctl() for each feature query is comparably more expensive.

Best Regards,
Nathan Lay
Received on Mon Jan 14 2008 - 01:11:49 UTC

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