Date: Mon, 14 Jan 2008 02:15:49 +0000 From: "Igor Mozolevsky" <igor@hybrid-lab.co.uk> To: "Nathan Lay" <nslay@comcast.net> Cc: Kostik Belousov <kostikbel@gmail.com>, Peter Jeremy <peterjeremy@optushome.com.au>, Joe Marcus Clarke <marcus@freebsd.org>, current <current@freebsd.org> Subject: Re: RFC: Adding a hw.features[2] sysctl Message-ID: <a2b6592c0801131815k1b339f10taf47164a2766d6f2@mail.gmail.com> In-Reply-To: <a2b6592c0801131814m353cca38xc26a8bc508fd0778@mail.gmail.com> References: <1200197787.67286.13.camel@shumai.marcuscom.com> <20080113064450.GW57756@deviant.kiev.zoral.com.ua> <20080113182457.GN929@server.vk2pj.dyndns.org> <a2b6592c0801131721w25afae5bg3dcf6a90c1a3d2b7@mail.gmail.com> <478AC1F0.10500@comcast.net> <a2b6592c0801131814m353cca38xc26a8bc508fd0778@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 14/01/2008, Igor Mozolevsky <igor@hybrid-lab.co.uk> wrote: > On 14/01/2008, Nathan Lay <nslay@comcast.net> wrote: > > Igor Mozolevsky wrote: > > > On 13/01/2008, Peter Jeremy <peterjeremy@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. > > > > 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. > > You won't you'd OR all of the features you want to check; but yes, > having a param that returns the whole lot would also be great, as well > as the driver returning human-readable representation if it was open > for writing... ... for reading... It's getting late here!..
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a2b6592c0801131815k1b339f10taf47164a2766d6f2>