]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Fix gdb support for RISC-V
authorMarcel Ziswiler <marcel.ziswiler@codethink.co.uk>
Thu, 11 Jun 2026 07:16:00 +0000 (09:16 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 14 Jun 2026 22:23:22 +0000 (07:23 +0900)
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 <marcel.ziswiler@codethink.co.uk>
src/boot/util.c

index e0d2788c202330bae1a6adca8b0f0801d432d94e..0e01fdf917140a68cdea91e9f23853e77c8df6de 100644 (file)
@@ -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