From f62021663306e46f26b3d3d56af42bac1311befe Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Thu, 11 Jun 2026 09:16:00 +0200 Subject: [PATCH] boot: Fix gdb support for RISC-V This will also allow debugging systemd-boot easily on RISC-V. Note that the following much simpler variant won't work, as we might be missing the optional 'zihintpause' extension: asm volatile("pause"); Signed-off-by: Marcel Ziswiler --- src/boot/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/boot/util.c b/src/boot/util.c index e0d2788c20..0e01fdf917 100644 --- a/src/boot/util.c +++ b/src/boot/util.c @@ -402,6 +402,8 @@ __attribute__((noinline)) void notify_debugger(const char *identity, volatile bo asm volatile("pause"); # elif defined(__aarch64__) asm volatile("wfi"); +# elif defined(__riscv) + asm volatile(".insn i 0x0F, 0, x0, x0, 0x010"); # else BS->Stall(5000); # endif