[PATCH v3 23/29] arm64: Catch non-emulated semihosting calls
Tom Rini
trini at konsulko.com
Sun Apr 3 02:16:37 CEST 2022
On Tue, Mar 22, 2022 at 04:59:31PM -0400, Sean Anderson wrote:
> If a debugger is not attached to U-Boot, semihosting calls will raise a
> synchronous abort exception. Try to catch this and disable semihosting
> so we can e.g. use another uart if one is available. In the immediate
> case, we return an error, since it is not always possible to check for
> semihosting beforehand (debug uart, user-initiated load command, etc.)
>
> We handle all possible semihosting instructions, which is probably
> overkill. However, we do need to keep track of what instruction set
> we're using so that we don't suppress an actual error.
>
> A future enhancement could try to determine semihosting capability by
> inspecting the processor state. There's an example of this at [1] for
> RISC-V. The equivalent for ARM would inspect the monitor modei
> enable/select bits of the DSCR. However, as the article notes, an
> exception handler is still helpful in order to catch disconnected
> debuggers.
>
> [1] https://tomverbeure.github.io/2021/12/30/Semihosting-on-RISCV.html#avoiding-hangs-when-a-debugger-is-not-connected
>
> Signed-off-by: Sean Anderson <sean.anderson at seco.com>
Applied to u-boot/next, 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/20220402/83f5ebab/attachment.sig>
More information about the U-Boot
mailing list