diff options
author | David S. Miller <davem@davemloft.net> | 2017-01-09 21:39:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-09 21:39:11 +0100 |
commit | bb1d3034449ed08e2ffbf5813a5ad9fa30475359 (patch) | |
tree | a48cc17fc4683b5fdc1656ac71639540bd8852e2 /arch/arm64/include/asm | |
parent | Merge branch 'dwmac-dwc-qos-eth' (diff) | |
parent | phy state machine: failsafe leave invalid RUNNING state (diff) | |
download | linux-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.h | 10 |
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() |