From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 14:32:37 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D475316A41B; Mon, 14 Jan 2008 14:32:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id BC89D13C4D3; Mon, 14 Jan 2008 14:32:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by elvis.mu.org (Postfix) with ESMTP id 28DDA1A4D84; Mon, 14 Jan 2008 06:29:25 -0800 (PST) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 14 Jan 2008 09:18:45 -0500 User-Agent: KMail/1.9.7 References: <1200197787.67286.13.camel@shumai.marcuscom.com> In-Reply-To: <1200197787.67286.13.camel@shumai.marcuscom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801140918.45895.jhb@freebsd.org> Cc: 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 14:32:37 -0000 On Saturday 12 January 2008 11:16:27 pm Joe Marcus Clarke wrote: > I find it would be useful to have the list of CPU features available via > a sysctl. Currently, he only ways to get this information are to have > linprocfs mounted, or parse dmesg.boot (if it exists). Attached are > patches to add hw.features and hw.features2 sysctls for i386 and amd64 > (where a list of CPU features is applicable). The results are identical > to the Features and Features2 strings from dmesg: > > hw.features2: 0x41d > hw.features: > 0xbfebfbff > > Comments? I would put this under machdep. rather than hw. since it is x86-specific. I also think having feature and feature2 might be a bit odd as you have to query two different nodes. Someday there might be a features3 when features2 runs out of bits and then all the apps would have to be updated again perhaps. Maybe something like: machdep.cpufeature.FPU=1 machdep.cpufeature.VME=1 Or maybe if you use named nodes like this you could do dev.cpu.X.FPU=1, dev.cpu.X.VME=1, etc. (possibly dev.cpu.X.feature.FPU=1, etc.) -- John Baldwin