From owner-freebsd-current@FreeBSD.ORG Tue Jan 15 11:29:23 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 3C4A516A419 for ; Tue, 15 Jan 2008 11:29:23 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id CE8A313C442 for ; Tue, 15 Jan 2008 11:29:22 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so81654uge.37 for ; Tue, 15 Jan 2008 03:29:21 -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=ICNgYZ3vyrQdOPkzDoTfK4rh4kK/eedH5NGyd3gSUDs=; b=iZ7fHZrTDIkrB9JLWhPXJd4lp9pixM4xSqoYnD15Rp8ZKBdTIeXhfpZckAzYAWT5mE0oxJ2GhR9CyW7HZ2XXaXsSQMl7d8J59xmcNSKO4JtyshO2uW1+5RAYgjYfSlg9RqEggziAEm70zd7hLJ565HEHNwXW5+GdYhvL1Wj4Qj4= 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=cg7rt43EZsgXWuSX0YhIrye+pyBuI0PYpbRivUBIA/OvPJQdtX6QlTPZNwHomBBjK6urldJTGQovgM3/FBunQRmWWvYPu70fBDcUmeTkte1DRg0HmKCQ3J4BL1mXDRw0DWfQsK6tHQDhBTl+0BUk3SOtkajjof/oNkS24sibgyc= Received: by 10.66.239.2 with SMTP id m2mr712130ugh.26.1200396561256; Tue, 15 Jan 2008 03:29:21 -0800 (PST) Received: by 10.66.248.11 with HTTP; Tue, 15 Jan 2008 03:29:21 -0800 (PST) Message-ID: Date: Tue, 15 Jan 2008 11:29:21 +0000 From: "Igor Mozolevsky" Sender: mozolevsky@gmail.com To: vermaden In-Reply-To: <20080114175337.775EF3E8846@f38.poczta.interia.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080114175337.775EF3E8846@f38.poczta.interia.pl> X-Google-Sender-Auth: 7a97b86211aef9d5 Cc: freebsd-current@freebsd.org 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: Tue, 15 Jan 2008 11:29:23 -0000 On 14 Jan 2008 18:53:37 +0100, vermaden wrote: > So why not transform this: >Features=0x178bfbff > Features2=0x1 > AMD Features=0xe2500800 > AMD Features2=0x3 > > into this: > > dev.cpu.0.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFLUSH MMX FXSR SSE SSE2 HTT SYSCALL NX MMX+ FFXSR LM 3DNow!+ 3DNow! LAHF CMP > I also do not like idea of /dev/cpuinfo it is FreeBSD not Linux: > http://wiki.freebsd.org/AvoidingLinuxisms Because just like in Linux, you will have to write a parser for that! And even if there was a lib function or a macro in the header files to check for features, it would be still significantly more expensive than using CPUID op. Then the question really boils down to: who is this feature for? The user or the programmer? If it's for the user, then they could just as easily run dmesg to get cpu feature. If it's for the programmer, then it has to be easier than ripping someone else's cpuid code... Igor