[PATCH v2 3/8] ARM: add macro to perform far branches (b/bl)

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Mar 13 09:40:06 PDT 2015


On Fri, Mar 13, 2015 at 01:07:27PM +0100, Ard Biesheuvel wrote:
> +	.macro	bl_abs, target, c=
> +#if defined(CONFIG_CPU_32v7) || defined(CONFIG_CPU_32v7M)
> +	movt\c	lr, #:upper16:\target
> +	movw\c	lr, #:lower16:\target
> +	blx\c	lr

So I've looked this up, and it's valid, which is surprising because BLX
itself writes to LR - the read from LR must happen before BLX itself
writes to LR.  Thankfully, because of the pipelining, this is probably
guaranteed.

I wonder whether there will be any errata on this... maybe on non-ARM
CPUs?  It'll be interesting to find out what happens once we merge
this... :)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list