Skip to contentSkip to conversation

x86: Add a platform_type helper

PATCH New Alan Cox 1 participant 1 message Mar 24, 2010 x86

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 x86: Add a platform_type helper

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.

---

 arch/x86/include/asm/setup.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/x86/include/asm/setup.h +6 -0
index 86b1506..4008446 100644
@@ -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.