forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/x86/include/asm/cpumask.h
....@@ -11,5 +11,23 @@
1111
1212 extern void setup_cpu_local_masks(void);
1313
14
+/*
15
+ * NMI and MCE exceptions need cpu_is_offline() _really_ early,
16
+ * provide an arch_ special for them to avoid instrumentation.
17
+ */
18
+#if NR_CPUS > 1
19
+static __always_inline bool arch_cpu_online(int cpu)
20
+{
21
+ return arch_test_bit(cpu, cpumask_bits(cpu_online_mask));
22
+}
23
+#else
24
+static __always_inline bool arch_cpu_online(int cpu)
25
+{
26
+ return cpu == 0;
27
+}
28
+#endif
29
+
30
+#define arch_cpu_is_offline(cpu) unlikely(!arch_cpu_online(cpu))
31
+
1432 #endif /* __ASSEMBLY__ */
1533 #endif /* _ASM_X86_CPUMASK_H */