mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 08:52:27 +00:00
ARMv6 and greater introduced a new instruction ("bx") which can be used
to return from function calls. Recent CPUs perform better when the
"bx lr" instruction is used rather than the "mov pc, lr" instruction,
and this sequence is strongly recommended to be used by the ARM
architecture manual (section A.4.1.1).
We provide a new macro "ret" with all its variants for the condition
code which will resolve to the appropriate instruction.
Rather than doing this piecemeal, and miss some instances, change all
the "mov pc" instances to use the new macro, with the exception of
the "movs" instruction and the kprobes code. This allows us to detect
the "mov pc, lr" case and fix it up - and also gives us the possibility
of deploying this for other registers depending on the CPU selection.
Reported-by: Will Deacon <[email protected]>
Tested-by: Stephen Warren <[email protected]> # Tegra Jetson TK1
Tested-by: Robert Jarzmik <[email protected]> # mioa701_bootresume.S
Tested-by: Andrew Lunn <[email protected]> # Kirkwood
Tested-by: Shawn Guo <[email protected]>
Tested-by: Tony Lindgren <[email protected]> # OMAPs
Tested-by: Gregory CLEMENT <[email protected]> # Armada XP, 375, 385
Acked-by: Sekhar Nori <[email protected]> # DaVinci
Acked-by: Christoffer Dall <[email protected]> # kvm/hyp
Acked-by: Haojian Zhuang <[email protected]> # PXA3xx
Acked-by: Stefano Stabellini <[email protected]> # Xen
Tested-by: Uwe Kleine-König <[email protected]> # ARMv7M
Tested-by: Simon Horman <[email protected]> # Shmobile
Signed-off-by: Russell King <[email protected]>
52 lines
1.3 KiB
ArmAsm
52 lines
1.3 KiB
ArmAsm
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
#include <linux/linkage.h>
|
|
#include <linux/init.h>
|
|
#include <asm/assembler.h>
|
|
|
|
#include "proc-macros.S"
|
|
|
|
ENTRY(nop_flush_icache_all)
|
|
ret lr
|
|
ENDPROC(nop_flush_icache_all)
|
|
|
|
.globl nop_flush_kern_cache_all
|
|
.equ nop_flush_kern_cache_all, nop_flush_icache_all
|
|
|
|
.globl nop_flush_kern_cache_louis
|
|
.equ nop_flush_kern_cache_louis, nop_flush_icache_all
|
|
|
|
.globl nop_flush_user_cache_all
|
|
.equ nop_flush_user_cache_all, nop_flush_icache_all
|
|
|
|
.globl nop_flush_user_cache_range
|
|
.equ nop_flush_user_cache_range, nop_flush_icache_all
|
|
|
|
.globl nop_coherent_kern_range
|
|
.equ nop_coherent_kern_range, nop_flush_icache_all
|
|
|
|
ENTRY(nop_coherent_user_range)
|
|
mov r0, 0
|
|
ret lr
|
|
ENDPROC(nop_coherent_user_range)
|
|
|
|
.globl nop_flush_kern_dcache_area
|
|
.equ nop_flush_kern_dcache_area, nop_flush_icache_all
|
|
|
|
.globl nop_dma_flush_range
|
|
.equ nop_dma_flush_range, nop_flush_icache_all
|
|
|
|
.globl nop_dma_map_area
|
|
.equ nop_dma_map_area, nop_flush_icache_all
|
|
|
|
.globl nop_dma_unmap_area
|
|
.equ nop_dma_unmap_area, nop_flush_icache_all
|
|
|
|
__INITDATA
|
|
|
|
@ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
|
|
define_cache_functions nop
|