armv5te: make 'ret lr' produce iinterworking 'bx lr'
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 27 Feb 2017 19:19:07 +0000 (20:19 +0100)
committerRaspbian forward porter <root@raspbian.org>
Wed, 26 Apr 2017 14:08:28 +0000 (14:08 +0000)
commit6823d4264fc2ac9c6f8be778fec6aebb8fae2d7e
tree3c24ee6755d7da1e31b5b9b11d9bd5d9734d9d77
parent2ebfedb344beaeb581dc36df52e0a6e3e70ad47d
armv5te: make 'ret lr' produce iinterworking 'bx lr'

Current ARM assembler helper for the 'return to caller' pseudo-instruction
turns 'ret lr' into 'mov pc, lr' for ARMv5TE. This causes the core to remain
in its current ARM state even when the routine doing the 'ret' was called
from Thumb-1 state, triggering an undefined instruction exception.

This causes early run-time failures in all boards compiled using the Thumb-1
instruction set (for instance the Open-RD family).

ARMv5TE supports 'bx lr' which properly implements interworking and thus
correctly returns to Thumb-1 state from ARM state.

This change makes 'ret lr' turn into 'bx lr' for ARMv5TE.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Gbp-Pq: Topic upstream/openrd
Gbp-Pq: Name 0001-armv5te-make-ret-lr-produce-iinterworking-bx-lr.patch
arch/arm/include/asm/assembler.h