From: Cyrill Gorcunov <gorcunov@gmail.com>
To: mingo@elte.hu, macro@linux-mips.org, yhlu.kernel@gmail.com
Cc: linux-kernel@vger.kernel.org, Cyrill Gorcunov <gorcunov@gmail.com>
Subject: [patch 1/3] x86: apic,io-apic - generalize lapic_get_version helper
Date: Wed, 24 Sep 2008 20:46:19 +0400 [thread overview]
Message-ID: <48da6f73.0305560a.6192.5784@mx.google.com> (raw)
In-Reply-To: 20080924164618.588609232@gmail.com
[-- Attachment #1: x86-apic-get-version --]
[-- Type: text/plain, Size: 1913 bytes --]
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
--
next parent reply other threads:[~2008-09-24 16:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080924164618.588609232@gmail.com>
2008-09-24 16:46 ` Cyrill Gorcunov [this message]
2008-09-24 16:46 ` [patch 2/3] x86: apic - simplify lapic_get_maxlvt Cyrill Gorcunov
2008-09-24 18:58 ` Hiroshi Shimamoto
2008-09-24 19:17 ` Yinghai Lu
2008-09-24 19:18 ` Cyrill Gorcunov
2008-09-24 19:24 ` Cyrill Gorcunov
2008-09-24 16:46 ` [patch 3/3] x86: apic - remove dead ifdef from lapic_is_integrated Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48da6f73.0305560a.6192.5784@mx.google.com \
--to=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mingo@elte.hu \
--cc=yhlu.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox