Skip to content

semihosting: use assembly conduit functions

Andre Przywara u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm: semihosting: replace inline assembly with assembly filearch/arm/lib/semihosting.S arch/arm/lib/semihosting.c+31 -472 replies
2/2riscv: semihosting: replace inline assembly with assembly filearch/riscv/lib/semihosting.S arch/riscv/lib/semihosting.c+22 -242 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSean Anderson
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] semihosting: use assembly conduit functions

Hi,

to trigger the actual semihosting action in the debugger, we used some carefully constructed inline assembly sequence. This was motivated by the trigger being really just a single instruction, so originally this could be neatly inlined by the compiler.
However we now have a separate function anyway, so inlining is no longer happening. On top of that the inline assembly was really fragile and hard to read.

To clean that up, just use actual assembly functions, which does away with all the tricks to force the compiler into submission. Patch 1 is for ARM, patch 2 for RISC-V.
Briefly tested on arm and aarch64 QEMU, and on an ARMv8 fastmodel, plus compile-tested for RISC-V. Please test it on your system!

Cheers,
Andre

P.S. This idea came up before, but I don't remember if patches were floating around already. If there were, apologies for my ignorance, and I will be all too happy to use those patches instead of mine here, just point me to them.

Andre Przywara (2):
arm: semihosting: replace inline assembly with assembly file
riscv: semihosting: replace inline assembly with assembly file

 arch/arm/lib/semihosting.S   | 31 ++++++++++++++++++++++++
 arch/arm/lib/semihosting.c   | 47 ------------------------------------
 arch/riscv/lib/semihosting.S | 22 +++++++++++++++++
 arch/riscv/lib/semihosting.c | 24 ------------------
 4 files changed, 53 insertions(+), 71 deletions(-)
 create mode 100644 arch/arm/lib/semihosting.S
 delete mode 100644 arch/arm/lib/semihosting.c
 create mode 100644 arch/riscv/lib/semihosting.S
 delete mode 100644 arch/riscv/lib/semihosting.c
Signature · 1 line
2.25.1