We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 46f2d13 + 93e9618 commit 13feb0bCopy full SHA for 13feb0b
src/greenlet/platform/switch_riscv_unix.h
@@ -11,9 +11,14 @@
11
static int
12
slp_switch(void)
13
{
14
- long fp;
15
int ret;
+#if __riscv_xlen == 32
16
+ long fp;
17
long *stackref, stsizediff;
18
+#else
19
+ int fp;
20
+ int *stackref, stsizediff;
21
+#endif
22
__asm__ volatile ("" : : : REGS_TO_SAVE);
23
__asm__ volatile ("mv %0, fp" : "=r" (fp) : );
24
__asm__ volatile ("mv %0, sp" : "=r" (stackref) : );
@@ -28,7 +33,11 @@ slp_switch(void)
28
33
SLP_RESTORE_STATE();
29
34
}
30
35
36
37
+ __asm__ volatile ("lw fp, %0" : : "m" (fp));
38
31
39
__asm__ volatile ("ld fp, %0" : : "m" (fp));
40
32
41
__asm__ volatile ("mv %0, zero" : "=r" (ret) : );
42
return ret;
43
0 commit comments