From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756510AbYGXL01 (ORCPT ); Thu, 24 Jul 2008 07:26:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755503AbYGXLZz (ORCPT ); Thu, 24 Jul 2008 07:25:55 -0400 Received: from nf-out-0910.google.com ([64.233.182.187]:27419 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755371AbYGXLZy (ORCPT ); Thu, 24 Jul 2008 07:25:54 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:user-agent:date:from:to:cc:subject:content-disposition :message-id; b=YpepukppZsPfTWBoeRDngxHCmRJZP8ck5wOkST4/VhCUG+yyZuyBeKQmZtSd1MlMuy AVkiedJNmGVe9mXal0L8L0SJ5HOG1QD9xYSt7m/rCgwCeBv5wwJnP9lfXMVtOrXvH4HM hlUdLyrlUy0HlyfMH4hZ2DSi0v/cw9VXuBpUM= References: <20080724112241.164873410@gmail.com>> User-Agent: quilt/0.46-1 Date: Thu, 01 Jan 1970 03:00:01 +0300 From: Cyrill Gorcunov To: mingo@elte.hu, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, macro@linux-mips.org Cc: gorcunov@gmail.com Subject: [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt Content-Disposition: inline; filename=x86-apic-merge-lapic_get_maxlvt Message-ID: <488866bf.1636440a.2c8e.ffffa160@mx.google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Cyrill Gorcunov --- No code change on binary level. Index: linux-2.6.git/arch/x86/kernel/apic_32.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/apic_32.c 2008-07-24 13:40:58.000000000 +0400 +++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-07-24 13:48:52.000000000 +0400 @@ -226,9 +226,13 @@ int get_physical_broadcast(void) */ int lapic_get_maxlvt(void) { - unsigned int v = apic_read(APIC_LVR); + unsigned int v; - /* 82489DXs do not report # of LVT entries. */ + v = apic_read(APIC_LVR); + /* + * - we always have APIC integrated on 64bit mode + * - 82489DXs do not report # of LVT entries + */ return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; } Index: linux-2.6.git/arch/x86/kernel/apic_64.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/apic_64.c 2008-07-24 13:40:58.000000000 +0400 +++ linux-2.6.git/arch/x86/kernel/apic_64.c 2008-07-24 13:48:38.000000000 +0400 @@ -228,11 +228,14 @@ void __cpuinit enable_NMI_through_LVT0(v */ int lapic_get_maxlvt(void) { - unsigned int v, maxlvt; + unsigned int v; v = apic_read(APIC_LVR); - maxlvt = GET_APIC_MAXLVT(v); - return maxlvt; + /* + * - we always have APIC integrated on 64bit mode + * - 82489DXs do not report # of LVT entries + */ + return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; } /* --