summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-01-09 21:39:11 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-09 21:39:11 +0100
commitbb1d3034449ed08e2ffbf5813a5ad9fa30475359 (patch)
treea48cc17fc4683b5fdc1656ac71639540bd8852e2 /arch/arm64/include/asm
parentMerge branch 'dwmac-dwc-qos-eth' (diff)
parentphy state machine: failsafe leave invalid RUNNING state (diff)
downloadlinux-bb1d3034449ed08e2ffbf5813a5ad9fa30475359.tar.xz
linux-bb1d3034449ed08e2ffbf5813a5ad9fa30475359.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'arch/arm64/include/asm')
-rw-r--r--arch/arm64/include/asm/current.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/current.h b/arch/arm64/include/asm/current.h
index f2bcbe2d9889..86c404171305 100644
--- a/arch/arm64/include/asm/current.h
+++ b/arch/arm64/include/asm/current.h
@@ -9,9 +9,17 @@
struct task_struct;
+/*
+ * We don't use read_sysreg() as we want the compiler to cache the value where
+ * possible.
+ */
static __always_inline struct task_struct *get_current(void)
{
- return (struct task_struct *)read_sysreg(sp_el0);
+ unsigned long sp_el0;
+
+ asm ("mrs %0, sp_el0" : "=r" (sp_el0));
+
+ return (struct task_struct *)sp_el0;
}
#define current get_current()