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>
#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__ */
#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__ */