[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/4] arm/percpu: Move {get, set}_processor_id() into smp.h



For cleanup purposes, it is necessary for asm/percpu.h to not use
DECLARE_PER_CPU() itself.  asm/smp.h is arguably a better place for it to
live anyway.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
---
 xen/include/asm-arm/percpu.h | 6 ------
 xen/include/asm-arm/smp.h    | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-arm/percpu.h b/xen/include/asm-arm/percpu.h
index 264120b192..5ce81a1707 100644
--- a/xen/include/asm-arm/percpu.h
+++ b/xen/include/asm-arm/percpu.h
@@ -25,12 +25,6 @@ void percpu_init_areas(void);
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
-DECLARE_PER_CPU(unsigned int, cpu_id);
-#define get_processor_id()    (this_cpu(cpu_id))
-#define set_processor_id(id)  do {                      \
-    WRITE_SYSREG(__per_cpu_offset[id], TPIDR_EL2);      \
-    this_cpu(cpu_id) = (id);                            \
-} while(0)
 #endif
 
 #endif /* __ARM_PERCPU_H__ */
diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
index fdbcefa241..7d4edfa0a0 100644
--- a/xen/include/asm-arm/smp.h
+++ b/xen/include/asm-arm/smp.h
@@ -7,11 +7,19 @@
 #include <asm/current.h>
 #endif
 
+DECLARE_PER_CPU(unsigned int, cpu_id);
 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))
 
+#define get_processor_id()     this_cpu(cpu_id)
+#define set_processor_id(id)                            \
+do {                                                    \
+    WRITE_SYSREG(__per_cpu_offset[(id)], TPIDR_EL2);    \
+    this_cpu(cpu_id) = (id);                            \
+} while ( 0 )
+
 #define raw_smp_processor_id() (get_processor_id())
 
 /*
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.