From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 15 21:19:54 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AEE616A47A for ; Thu, 15 Jun 2006 21:19:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E73843D76 for ; Thu, 15 Jun 2006 21:19:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k5FLJiYN050549; Thu, 15 Jun 2006 17:19:47 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andriy Gapon Date: Thu, 15 Jun 2006 17:08:09 -0400 User-Agent: KMail/1.9.1 References: <44903A53.9030007@icyb.net.ua> <200606151310.34246.jhb@freebsd.org> <4491A5BA.9060801@icyb.net.ua> In-Reply-To: <4491A5BA.9060801@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606151708.10218.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jun 2006 17:19:47 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1541/Thu Jun 15 15:36:31 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: apic detection 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: Thu, 15 Jun 2006 21:19:54 -0000 On Thursday 15 June 2006 14:23, Andriy Gapon wrote: > on 15/06/2006 20:10 John Baldwin said the following: > > On Wednesday 14 June 2006 12:33, Andriy Gapon wrote: > >> What is proper way to check from a driver/module if APIC is being used ? > >> Or even narrower, if local APIC timer is being used ? > > > > There isn't currently. Why do you need to know? > > > > There is a driver that I am working on that could change frequency of > local APIC timer by changing FSB frequency and I want to make that > driver smarter and refuse to attach if local APIC timer is used. I know > that in 6.X and CURRENT local APIC timer is always used and in 5.X it is > never used, but I want my driver to handle environment more generally. It it always used if APIC is used. > I am thinking, can I just somehow check if IRQ0 is in use ? Would it be > something close to proper solution ? On x86 there is a variable called 'using_lapic_timer' that is available in sys/i386/isa/clock.c (and the amd64 equivalent), but I think it is static to that file, so you probably can't get to it. Other than that there really isn't a current way to know as the vast majority of the system does not (and should not) know or care. -- John Baldwin