All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Ingo Molnar <mingo@elte.hu>,
	x86@kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] x86: make apic_* operations inline functions
Date: Mon, 9 Feb 2009 12:05:47 -0800	[thread overview]
Message-ID: <3c552ac8a747d6c26d13302c54d71dae9f56f4ac.1234296039.git.jeremy.fitzhardinge@citrix.com> (raw)
In-Reply-To: <cover.1234296039.git.jeremy.fitzhardinge@citrix.com>

Mainly to get proper type-checking and consistency.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 arch/x86/include/asm/apic.h |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index b03711d..f4835a1 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -139,12 +139,35 @@ struct apic_ops {
 
 extern struct apic_ops *apic_ops;
 
-#define apic_read (apic_ops->read)
-#define apic_write (apic_ops->write)
-#define apic_icr_read (apic_ops->icr_read)
-#define apic_icr_write (apic_ops->icr_write)
-#define apic_wait_icr_idle (apic_ops->wait_icr_idle)
-#define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle)
+static inline u32 apic_read(u32 reg)
+{
+	return apic_ops->read(reg);
+}
+
+static inline void apic_write(u32 reg, u32 val)
+{
+	apic_ops->write(reg, val);
+}
+
+static inline u64 apic_icr_read(void)
+{
+	return apic_ops->icr_read();
+}
+
+static inline void apic_icr_write(u32 low, u32 high)
+{
+	apic_ops->icr_write(low, high);
+}
+
+static inline void apic_wait_icr_idle(void)
+{
+	apic_ops->wait_icr_idle();
+}
+
+static inline u32 safe_apic_wait_icr_idle(void)
+{
+	return apic_ops->safe_wait_icr_idle();
+}
 
 extern int get_physical_broadcast(void);
 
-- 
1.6.0.6



  parent reply	other threads:[~2009-02-10 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 20:00 [PATCH] *** SUBJECT HERE *** Jeremy Fitzhardinge
2009-02-09 20:05 ` [PATCH] x86: unstatic mp_find_ioapic so it can be used elsewhere Jeremy Fitzhardinge
2009-02-09 20:05 ` [PATCH] x86: unstatic ioapic entry funcs Jeremy Fitzhardinge
2009-02-09 20:05 ` Jeremy Fitzhardinge [this message]
2009-02-09 20:05 ` [PATCH] x86: add mp_find_ioapic_pin Jeremy Fitzhardinge
2009-02-09 20:05 ` [PATCH] xen: expose enable_IO_APIC for 32-bit Ian Campbell
2009-02-11  8:36   ` Yinghai Lu
2009-02-11  9:51 ` apic cleanups Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-12-16 20:33 [PATCH] x86: make apic_* operations inline functions Jeremy Fitzhardinge

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=3c552ac8a747d6c26d13302c54d71dae9f56f4ac.1234296039.git.jeremy.fitzhardinge@citrix.com \
    --to=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.