public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/2] semihosting: use assembly conduit functions
@ 2023-02-07 15:21 Andre Przywara
  2023-02-07 15:21 ` [PATCH 1/2] arm: semihosting: replace inline assembly with assembly file Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andre Przywara @ 2023-02-07 15:21 UTC (permalink / raw)
  To: Sean Anderson, Kautuk Consul; +Cc: Simon Glass, Tom Rini, u-boot

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

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-07 17:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 15:21 [PATCH 0/2] semihosting: use assembly conduit functions Andre Przywara
2023-02-07 15:21 ` [PATCH 1/2] arm: semihosting: replace inline assembly with assembly file Andre Przywara
2023-02-09 23:07   ` Sean Anderson
2023-03-07 17:52   ` Tom Rini
2023-02-07 15:21 ` [PATCH 2/2] riscv: " Andre Przywara
2023-02-09 23:07   ` Sean Anderson
2023-03-07 17:52   ` Tom Rini
2023-02-09 23:08 ` [PATCH 0/2] semihosting: use assembly conduit functions Sean Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox