From owner-freebsd-current@FreeBSD.ORG Fri Nov 19 16:21:25 2010 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 9FBDD1065674; Fri, 19 Nov 2010 16:21:25 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 439D58FC15; Fri, 19 Nov 2010 16:21:24 +0000 (UTC) Received: by yxh35 with SMTP id 35so2875488yxh.13 for ; Fri, 19 Nov 2010 08:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=8Z+yC0ilfTRbgWr3NYwWl3q4yI5+5G0JGhbvRhcpaqI=; b=q+O+qFq+/XuyqAL5DEN/ietfuZJ8tfm7IGUE+kX+e6eRidw/p5hn4UPF4cf1uOjaC3 pXQ4QgpUc+Hv62CGXLLvexwzO+Q3Q7hFZksmonzVJOaf17AsoTLyv2M5iNktBvmuFsPX i8P1gIgnW6qQ5Dvy2z5t2v9JjK0qPYtUS2KGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=bT0q4Kn568uWVnUJIPcDs7UreuFBKFEZdl8gkMOOLQTS8F1ax4opIS/SDq5FzvP9uV thIXp8iuM9KlEnTaCwq+KKDve2qg/cYXTe9T9HfwrMJG1Upjh01iGPg5/JUkALjZ9W4U jYj7dusKwE0AkX8ptyh2ROLgvZ5U5joMUksVI= Received: by 10.204.97.143 with SMTP id l15mr2261073bkn.127.1290183683115; Fri, 19 Nov 2010 08:21:23 -0800 (PST) Received: from ernst.jennejohn.org (p578E3432.dip.t-dialin.net [87.142.52.50]) by mx.google.com with ESMTPS id p34sm947484bkf.15.2010.11.19.08.21.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Nov 2010 08:21:22 -0800 (PST) Date: Fri, 19 Nov 2010 17:21:20 +0100 From: Gary Jennejohn To: Andriy Gapon Message-ID: <20101119172120.7fd14c9f@ernst.jennejohn.org> In-Reply-To: <4CE69A49.4080801@freebsd.org> References: <4CE69A49.4080801@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: new cpuid bits X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 16:21:25 -0000 On Fri, 19 Nov 2010 17:39:53 +0200 Andriy Gapon wrote: > > Guys, > > I would like to add definitions for couple more useful CPUID bits, but I am > greatly confused about how to name them. > I failed to deduce the naming convention from the existing definitions and I am > not sure how to make the names proper and descriptive. > > The bits in question are returned by CPUID.6 in EAX and ECX. > CPUID.6 block is described by both AMD and Intel as "Thermal and Power Management > (Leaf)". Bits in EAX are defined only for Intel at present, the bit in ECX is > defined for both. > > Description/naming of the bits from the specifications: > EAX[0]: Digital temperature sensor is supported if set > EAX[1]: Intel Turbo Boost Technology Available > EAX[2]: ARAT. APIC-Timer-always-running feature is supported if set. > ECX[0]: > Intel: Hardware Coordination Feedback Capability (Presence of Bits MCNT and ACNT > MSRs). > AMD: EffFreq: effective frequency interface. > > How does the following look to you? > I will appreciate suggestions/comments. > Thanks! > > Index: sys/amd64/include/specialreg.h > =================================================================== > --- sys/amd64/include/specialreg.h (revision 215524) > +++ sys/amd64/include/specialreg.h (working copy) > @@ -136,6 +136,15 @@ > #define CPUID2_AESNI 0x02000000 > > /* > + * Important bits in the Thermal and Power Management flags > + * CPUID.6 EAX and ECX. > + */ > +#define CPUTPM1_SENSOR 0x00000001 > +#define CPUTPM1_TURBO 0x00000002 > +#define CPUTPM1_ARAT 0x00000004 > +#define CPUTPM2_EFFREQ 0x00000001 > + > +/* > * Important bits in the AMD extended cpuid flags > */ > #define AMDID_SYSCALL 0x00000800 > Maybe add a comment in which register the bits are to be found, like in the text? -- Gary Jennejohn