]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: assembler: add optimized ldr/str macros to load variables from memory
authorArd Biesheuvel <ardb@kernel.org>
Fri, 26 Nov 2021 18:37:27 +0000 (19:37 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 6 Dec 2021 11:49:16 +0000 (12:49 +0100)
commitce839175c083dd485af0793842082f9f10ac8f21
tree0df6541cd53851dd56dc5a8013c29378b890d261
parent5ef4007c8cc2365e193a1fecf6b700790878ab04
ARM: assembler: add optimized ldr/str macros to load variables from memory

We will be adding variable loads to various hot paths, so it makes sense
to add a helper macro that can load variables from asm code without the
use of literal pool entries. On v7 or later, we can simply use MOVW/MOVT
pairs, but on earlier cores, this requires a bit of hackery to emit a
instruction sequence that implements this using a sequence of ADD/LDR
instructions.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com> # ARMv7M
arch/arm/include/asm/assembler.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-header.S