[patch 1/3] x86: apic,io-apic - generalize lapic_get_version helper

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Wednesday, September 24, 2008 - 9:46 am

By doing so we are able to not duplicate code in
io_apic.c at least in one case.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/apic.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic.c	2008-09-24 16:57:54.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic.c	2008-09-24 19:17:20.000000000 +0400
@@ -163,14 +163,6 @@ static DEFINE_PER_CPU(struct clock_event
 static unsigned long apic_phys;
 
 /*
- * Get the LAPIC version
- */
-static inline int lapic_get_version(void)
-{
-	return GET_APIC_VERSION(apic_read(APIC_LVR));
-}
-
-/*
  * Check, if the APIC is integrated or a separate chip
  */
 static inline int lapic_is_integrated(void)
Index: linux-2.6.git/arch/x86/kernel/io_apic.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/io_apic.c	2008-09-24 19:08:14.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/io_apic.c	2008-09-24 19:19:03.000000000 +0400
@@ -2759,8 +2759,7 @@ static inline void __init check_timer(vo
 
 	local_irq_save(flags);
 
-        ver = apic_read(APIC_LVR);
-        ver = GET_APIC_VERSION(ver);
+	ver = lapic_get_version();
 
 	/*
 	 * get/set the timer IRQ vector:
Index: linux-2.6.git/include/asm-x86/apic.h
===================================================================
--- linux-2.6.git.orig/include/asm-x86/apic.h	2008-09-22 17:42:35.000000000 +0400
+++ linux-2.6.git/include/asm-x86/apic.h	2008-09-24 19:16:58.000000000 +0400
@@ -132,6 +132,12 @@ extern struct apic_ops *apic_ops;
 #define apic_wait_icr_idle (apic_ops->wait_icr_idle)
 #define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle)
 
+/* Get the LAPIC version */
+static inline int lapic_get_version(void)
+{
+	return GET_APIC_VERSION(apic_read(APIC_LVR));
+}
+
 extern int get_physical_broadcast(void);
 
 #ifdef CONFIG_X86_64

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/3] x86: apic,io-apic - generalize lapic_get_versi ..., Cyrill Gorcunov, (Wed Sep 24, 9:46 am)