From: Andrew Cooper Date: Fri, 26 Jul 2019 19:41:03 +0000 (+0100) Subject: arm/percpu: Move {get,set}_processor_id() into current.h X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~1764 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a3d7a321554b7a10b97c1fd3cc70aea2151ddc1;p=xen.git arm/percpu: Move {get,set}_processor_id() into current.h 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 Acked-by: Julien Grall --- diff --git a/xen/include/asm-arm/current.h b/xen/include/asm-arm/current.h index c4af66fbb9..1653e89d30 100644 --- a/xen/include/asm-arm/current.h +++ b/xen/include/asm-arm/current.h @@ -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__ */ diff --git a/xen/include/asm-arm/percpu.h b/xen/include/asm-arm/percpu.h index 9584b830d4..011016347b 100644 --- a/xen/include/asm-arm/percpu.h +++ b/xen/include/asm-arm/percpu.h @@ -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__ */