mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: [PATCH] x86: Add a platform_type helper
Date: Wed, 24 Mar 2010 12:14:44 +0000	[thread overview]
Message-ID: <20100324121428.27881.96956.stgit@localhost.localdomain> (raw)

Various x86 drivers for embedded stuff will need to know the platform they
are running on to do runtime setup. Having them all grovelling around at
boot_params.hdr.hardware_subarch seems a bad idea, so export it as an
inline function that hides all the details of how the value arrives.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 arch/x86/include/asm/setup.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 86b1506..4008446 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -60,6 +60,12 @@ static inline void x86_mrst_early_setup(void) { }
  */
 extern struct boot_params boot_params;
 
+/* Isolate the internal knowledge from the generic callers */
+extern __inline int x86_platform_type(void)
+{
+	return boot_params.hdr.hardware_subarch;
+}
+
 /*
  * Do NOT EVER look at the BIOS memory size location.
  * It does not work on many machines.


                 reply	other threads:[~2010-03-24 12:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100324121428.27881.96956.stgit@localhost.localdomain \
    --to=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®