From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 27 23:01:35 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4A1106566C for ; Sat, 27 Feb 2010 23:01:35 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id A26B98FC19 for ; Sat, 27 Feb 2010 23:01:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.49,552,1262559600"; d="scan'208";a="237801981" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 28 Feb 2010 00:01:32 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id BAFF51B0768; Sun, 28 Feb 2010 00:01:32 +0100 (CET) Date: Sun, 28 Feb 2010 00:01:32 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Ed Schouten Message-ID: In-Reply-To: <20100227223524.GU8200@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] extending {amd64|i386} cpu info X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 23:01:35 -0000 hmm...i guess the person who added the CPUID_TO_* macros to /usr/include/machine/specialreg.h thought a CPUID_TO_STEPPING macro wasn't necessary since getting the stepping from cpu_id can be done fairly easy without any shifting and such. a CPUID_TO_STEPPING macro would look something like this: #define CPUID_TO_STEPPING(id) \ ((id) & CPUID_STEPPING) getting the model and family however is more complicated since you have to combine CPUID_{MODEL|FAMILY} and CPUID_EXT_{MODEL|FAMILY}. cheers. alex Ed Schouten schrieb am 2010-02-27: > Hello Alexander, > * Alexander Best wrote: > > + printf(" Stepping = %u" > > + " Model = %u" > > + " Family = %u", > > + cpu_id & CPUID_STEPPING, > > + CPUID_TO_MODEL(cpu_id), > > + CPUID_TO_FAMILY(cpu_id)); > So is there some reason why we don't have a CPUID_TO_STEPPING()? > Greetings,