lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20100324121428.27881.96956.stgit@localhost.localdomain>
Date:	Wed, 24 Mar 2010 12:14:44 +0000
From:	Alan Cox <alan@...ux.intel.com>
To:	linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: [PATCH] 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.

Signed-off-by: Alan Cox <alan@...ux.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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ