@@ -16,4 +16,13 @@
extern int __init pci_numachip_init(void);
+#ifdef CONFIG_X86_NUMACHIP
+extern bool is_numachip_system(void);
+#else
+static inline bool is_numachip_system(void)
+{
+ return 0;
+}
+#endif
+
#endif /* _ASM_X86_NUMACHIP_NUMACHIP_H */
@@ -30,7 +30,7 @@
#include <asm/apic_flat_64.h>
#include <asm/pgtable.h>
-static int numachip_system __read_mostly;
+static bool numachip_system __read_mostly;
static const struct apic apic_numachip __refconst;
@@ -173,11 +173,16 @@ static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
}
}
+bool is_numachip_system(void)
+{
+ return numachip_system;
+}
+
static int __init numachip_system_init(void)
{
unsigned int val;
- if (!numachip_system)
+ if (!is_numachip_system())
return 0;
x86_cpuinit.fixup_cpu_id = fixup_cpu_id;
Add safe function to check if Numachip is detected, to be used elsewhere. Signed-off-by: Daniel J Blueman <daniel@numascale.com> --- arch/x86/include/asm/numachip/numachip.h | 9 +++++++++ arch/x86/kernel/apic/apic_numachip.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-)