From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 02:15:51 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 3216916A419 for ; Mon, 14 Jan 2008 02:15:51 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id B762E13C46B for ; Mon, 14 Jan 2008 02:15:50 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so1166735uge.37 for ; Sun, 13 Jan 2008 18:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=zCXTDK21wuwzA5IRJotUPy+5E0wtHQ5tm1jEbdyESt8=; b=Oz+Om4m/0c186UnjgG01vZqTis692W98wnfobkALB3MlZgfL6eeM6y3bX4QeT+ITAjaRfvrDX+d93hapDwL33L4tH/qnShzs9S1LTGcMlaQJkV2NqvNmgqVPFz5Dxnjfzob/xBNDcPwLLdVuViZH9y4osHmBs56EDOeXad9arXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=FWH59KspSvi7DN9+JL25DOKMpMQE7Eu+PJ/Fn9nPj+akxh54uVmAYJHFqUi1F9dsO2LMYh8a/wy7CKA7CMgMQ7XyYxnWRYe1uKQPJaFubEYJyB7BMHptnWTJaN4er7LfetvVMtnWkc0othcuCC7p+tbJDdgxGIIPq25Uljmc5i8= Received: by 10.66.248.5 with SMTP id v5mr3245429ugh.17.1200276949547; Sun, 13 Jan 2008 18:15:49 -0800 (PST) Received: by 10.66.248.11 with HTTP; Sun, 13 Jan 2008 18:15:49 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 02:15:49 +0000 From: "Igor Mozolevsky" Sender: mozolevsky@gmail.com To: "Nathan Lay" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1200197787.67286.13.camel@shumai.marcuscom.com> <20080113064450.GW57756@deviant.kiev.zoral.com.ua> <20080113182457.GN929@server.vk2pj.dyndns.org> <478AC1F0.10500@comcast.net> X-Google-Sender-Auth: 2ef278e5138c0541 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:15:51 -0000 On 14/01/2008, Igor Mozolevsky wrote: > On 14/01/2008, Nathan Lay wrote: > > 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. > > > > 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!..