arm/percpu: Move {get,set}_processor_id() into current.h
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 26 Jul 2019 19:41:03 +0000 (20:41 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Aug 2019 13:06:28 +0000 (14:06 +0100)
For cleanup purposes, it is necessary for asm/percpu.h to not use
DECLARE_PER_CPU() itself.  asm/current.h is arguably a better place for this
functionality to live anyway.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/include/asm-arm/current.h
xen/include/asm-arm/percpu.h

index c4af66fbb9325e80b71cbd215ba21019f7ddcd28..1653e89d30af5e42accf30728beb91efd27a570c 100644 (file)
@@ -39,6 +39,15 @@ static inline struct cpu_info *get_cpu_info(void)
 
 #define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
 
+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_CURRENT_H__ */
index 9584b830d4ebcb7aec3e40d25c24065be7c8c624..011016347be7054e7cbd377e514c79241a005227 100644 (file)
@@ -27,12 +27,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__ */