]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm64/kernel/smp.c
arm64: make cpu number a percpu variable
[karo-tx-linux.git] / arch / arm64 / kernel / smp.c
index f64401faa091652e8ff2e7b282d2db63ad608c3f..6f42c68e457fcf4b461ace2c1d7f42bfcab36386 100644 (file)
@@ -58,6 +58,9 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/ipi.h>
 
+DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number);
+EXPORT_PER_CPU_SYMBOL(cpu_number);
+
 /*
  * as from 2.5, kernels no longer have an init_tasks structure
  * so we need some other way of telling a new secondary core
@@ -719,6 +722,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
         */
        for_each_possible_cpu(cpu) {
 
+               per_cpu(cpu_number, cpu) = cpu;
+
                if (cpu == smp_processor_id())
                        continue;