]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
smp: move cpu_is_offline() definition
authorJan Beulich <jbeulich@suse.com>
Thu, 14 Dec 2023 09:56:07 +0000 (10:56 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 14 Dec 2023 09:56:07 +0000 (10:56 +0100)
It's all the same for the 3 arch-es which have it, and RISC-V would
introduce a 4th instance. Put it in xen/smp.h instead, while still
permitting asm/smp.h to define a custom variant if need be.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@cloud.com>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/include/asm/smp.h
xen/arch/ppc/include/asm/smp.h
xen/arch/x86/include/asm/smp.h
xen/include/xen/smp.h

index bd489793fa8c7bafc78e3071dfc9ea84605f33a2..e99a3a3f535ff6231baba267e7aee2991ecfec53 100644 (file)
@@ -12,8 +12,6 @@ extern unsigned long smp_up_cpu;
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
-
 /*
  * Do we, for platform reasons, need to actually keep CPUs online when we
  * would otherwise prefer them to be off?
index eca43f0e6cf6ece3bb6fff07ee0ab6b7b89ce5ab..7b1517ce185a2524c561c622ed92422918168cb8 100644 (file)
@@ -7,8 +7,6 @@
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
-
 /*
  * Do we, for platform reasons, need to actually keep CPUs online when we
  * would otherwise prefer them to be off?
index 761edfcd34a2cab44376113074b2235cb5bab458..c8c79601343d8f3b92a16be54af411577a095ec5 100644 (file)
@@ -43,7 +43,6 @@ extern u32 x86_cpu_to_apicid[];
 
 #define cpu_physical_id(cpu)   x86_cpu_to_apicid[cpu]
 
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
 extern void cpu_exit_clear(unsigned int cpu);
 extern void cpu_uninit(unsigned int cpu);
 int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm);
index 0a9219173f0fb4d51f07ca40cb26f42a337babf9..2ca9ff1bfcc133c09d66fa5c45ddaba24367d887 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <asm/smp.h>
 
+#ifndef cpu_is_offline
+#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
+#endif
+
 /*
  * stops all CPUs but the current one:
  */