[PATCH 1/3] arm: smh: specify Thumb trap instruction
Tom Rini
trini at konsulko.com
Thu Nov 3 17:57:10 CET 2022
On Wed, Oct 05, 2022 at 05:38:47PM +0100, Andre Przywara wrote:
> The ARM semihosting interface uses different trap instructions for
> different architectures and instruction sets. So far we were using
> AArch64 and ARMv7-M, and had an untested v7-A entry. The latter does
> not work when building for Thumb, as can be verified by using
> qemu_arm_defconfig, then enabling SEMIHOSTING and SYS_THUMB_BUILD:
> ==========
> {standard input}:35: Error: invalid swi expression
> {standard input}:35: Error: value of 1193046 too large for field of 2 bytes at 0
> ==========
>
> Fix this by providing the recommended instruction[1] for Thumb, and
> using the ARM instruction only when not building for Thumb. This also
> removes some comment, as QEMU for ARM allows to now test this case.
> Also use the opportunity to clean up the inline assembly, and just define
> the actual trap instruction inside #ifdef's, to improve readability.
>
> [1] https://developer.arm.com/documentation/dui0471/g/Semihosting/The-semihosting-interface?lang=en
>
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20221103/fa0cf235/attachment.sig>
More information about the U-Boot
mailing list