x86: Add a platform_type helper
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.
Signed-off-by Alan Cox <[email protected]>
---
arch/x86/include/asm/setup.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/x86/include/asm/setup.h +6 -0
@@ -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 __inlineint 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.