summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-02-04 09:29:13 -0500
committerRich Felker <dalias@aerifal.cx>2020-02-04 09:29:13 -0500
commit329e79299daaa994b8e75941331a1093051ea5d9 (patch)
tree667e2c3188c6e84df5f5739afb8d42c2635c13b6
parent5a105f19b5aae79dd302899e634b6b18b3dcd0d6 (diff)
downloadmusl-329e79299daaa994b8e75941331a1093051ea5d9.tar.gz
move riscv64 register index constants to signal.h
under _GNU_SOURCE for namespace cleanliness, analogous to other archs. the original placement in sys/reg.h seems not to have been motivated; such a header isn't even present on other implementations.
-rw-r--r--arch/riscv64/bits/reg.h6
-rw-r--r--arch/riscv64/bits/signal.h9
2 files changed, 9 insertions, 6 deletions
diff --git a/arch/riscv64/bits/reg.h b/arch/riscv64/bits/reg.h
index c800788c..2633f39d 100644
--- a/arch/riscv64/bits/reg.h
+++ b/arch/riscv64/bits/reg.h
@@ -1,8 +1,2 @@
#undef __WORDSIZE
#define __WORDSIZE 64
-#define REG_PC 0
-#define REG_RA 1
-#define REG_SP 2
-#define REG_TP 4
-#define REG_S0 8
-#define REG_A0 10
diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h
index 2ff4be30..b006334f 100644
--- a/arch/riscv64/bits/signal.h
+++ b/arch/riscv64/bits/signal.h
@@ -35,6 +35,15 @@ typedef struct mcontext_t {
union __riscv_mc_fp_state __fpregs;
} mcontext_t;
+#if defined(_GNU_SOURCE)
+#define REG_PC 0
+#define REG_RA 1
+#define REG_SP 2
+#define REG_TP 4
+#define REG_S0 8
+#define REG_A0 10
+#endif
+
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t;
typedef unsigned long gregset_t[32];