From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 02:14:24 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 F138D16A469 for ; Mon, 14 Jan 2008 02:14:24 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9A413C459 for ; Mon, 14 Jan 2008 02:14:23 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so1166563uge.37 for ; Sun, 13 Jan 2008 18:14:22 -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=ts+20FgFDupaykcbi6TVnenFEYZFygFfZ8Hrz7yqEhE=; b=k5hZGcDBuIqJvs4eVRTLdQXOxga9+IrBJpf3GcPT64DN8Lny4siyiMHgtNOQubWJFVfD4e569VvFukNjxpQPkKygwPzTILNxe9PDxgk2WugZu3BR1JWp7O9jA7EJ3ltOV37ypOhuI9bUzxZRKwTgpR6yJXuDKaUVAUcP4Q0uABQ= 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=i3QkFiPU0oC9WKGjN02obCnsv5fFRbtO85x4ZatX7A1vznCpdqR44ZfG+1NQSpSTMwuSTndO8siSr7MPncXdd+JAB8mrte4UReM0HfqlVNrTHL3OXTgbnwDj+hMrUEhUr/17kKxQiRN3s1gaaVHrNlDtPtIZXeuzLEbb0cVj6oo= Received: by 10.67.26.7 with SMTP id d7mr2574530ugj.23.1200276862823; Sun, 13 Jan 2008 18:14:22 -0800 (PST) Received: by 10.66.248.11 with HTTP; Sun, 13 Jan 2008 18:14:22 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 02:14:22 +0000 From: "Igor Mozolevsky" Sender: mozolevsky@gmail.com To: "Nathan Lay" In-Reply-To: <478AC1F0.10500@comcast.net> 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: 44691e75f9d14c51 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:14:25 -0000 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... The idea is to allow the flexibility, so that the programmers/users are free to choose what suits them, and not being forced into having to do only one thing. :-) Igor