blob: f7b7adb3fdbba6ab95a6f6282479b7920e4acf0d [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From dfb22e4d6662bf72879eda806eaa78c7b52b519e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 25 Jan 2022 20:29:14 -0800
4Subject: [PATCH] vm_dump.c: Define REG_S1 and REG_S2 for musl/riscv
5
6These defines are missing in musl, there is a possible
7patch to add them to musl, but we need a full list of
8these names for mcontext that can be added once for all
9
10Upstream-Status: Inappropriate [musl bug]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 vm_dump.c | 5 +++++
14 1 file changed, 5 insertions(+)
15
16diff --git a/vm_dump.c b/vm_dump.c
17index a98f5aa..957b785 100644
18--- a/vm_dump.c
19+++ b/vm_dump.c
20@@ -39,6 +39,11 @@
21
22 #define MAX_POSBUF 128
23
24+#if defined(__riscv) && !defined(__GLIBC__)
25+# define REG_S1 9
26+# define REG_S2 18
27+#endif
28+
29 #define VM_CFP_CNT(ec, cfp) \
30 ((rb_control_frame_t *)((ec)->vm_stack + (ec)->vm_stack_size) - \
31 (rb_control_frame_t *)(cfp))
32--
332.35.0
34