From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 02:11:49 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D5D416A469 for ; Mon, 14 Jan 2008 02:11:49 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from QMTA06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 1AAE313C467 for ; Mon, 14 Jan 2008 02:11:49 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from OMTA10.emeryville.ca.mail.comcast.net ([76.96.30.28]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id clwF1Y0090cQ2SL0A0GV00; Mon, 14 Jan 2008 02:00:48 +0000 Received: from ANTENNA.LOCAL ([68.35.224.189]) by OMTA10.emeryville.ca.mail.comcast.net with comcast id cq0A1Y00C45o48c8W00000; Mon, 14 Jan 2008 02:00:13 +0000 X-Authority-Analysis: v=1.0 c=1 a=BZmrEeO8dF8A:10 a=6I5d2MoRAAAA:8 a=MbspKBtSGnA9ootLD3YA:9 a=1FReDUxnbgyspRhoDaAA:7 a=NU6lWFkGJ18aFOZtgV0iK9EYWuQA:4 a=SV7veod9ZcQA:10 a=a24e7YDjOykA:10 Message-ID: <478AC1F0.10500@comcast.net> Date: Sun, 13 Jan 2008 20:59:12 -0500 From: Nathan Lay User-Agent: Thunderbird 2.0.0.9 (X11/20071230) MIME-Version: 1.0 To: Igor Mozolevsky References: <1200197787.67286.13.camel@shumai.marcuscom.com> <20080113064450.GW57756@deviant.kiev.zoral.com.ua> <20080113182457.GN929@server.vk2pj.dyndns.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , Peter Jeremy , Joe Marcus Clarke , current Subject: Re: RFC: Adding a hw.features[2] sysctl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 02:11:49 -0000 Igor Mozolevsky wrote: > On 13/01/2008, Peter Jeremy 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@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