aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/smp.h
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-15 07:53:22 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-15 07:53:22 +0000
commitc46479e146062205f7bf1f1d73d9dde277251cf2 (patch)
tree126ac23af01755de160adac30e27157781e5bb9a /arch/arm64/include/asm/smp.h
parent2684a6c505531426bb7d4c8a68aab91abe6af05c (diff)
parentfbc4ea9a080b1523a6e77562645d9d79c6368a25 (diff)
downloadv4.4-nougat-iot-release.tar.gz
Change-Id: I9624021a4a6df994f06c0dcbee05ce5a15a11cfa
Diffstat (limited to 'arch/arm64/include/asm/smp.h')
-rw-r--r--arch/arm64/include/asm/smp.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
index 2013a4dc5124..a05033beb2a2 100644
--- a/arch/arm64/include/asm/smp.h
+++ b/arch/arm64/include/asm/smp.h
@@ -16,11 +16,20 @@
#ifndef __ASM_SMP_H
#define __ASM_SMP_H
+#include <asm/percpu.h>
+
#include <linux/threads.h>
#include <linux/cpumask.h>
#include <linux/thread_info.h>
-#define raw_smp_processor_id() (current_thread_info()->cpu)
+DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
+
+/*
+ * We don't use this_cpu_read(cpu_number) as that has implicit writes to
+ * preempt_count, and associated (compiler) barriers, that we'd like to avoid
+ * the expense of. If we're preemptible, the value can be stale at use anyway.
+ */
+#define raw_smp_processor_id() (*this_cpu_ptr(&cpu_number))
struct seq_file;
@@ -57,6 +66,9 @@ asmlinkage void secondary_start_kernel(void);
*/
struct secondary_data {
void *stack;
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+ struct task_struct *task;
+#endif
};
extern struct secondary_data secondary_data;
extern void secondary_entry(void);