artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a6283e
)
copy riscv support from regress/sys/kern/stackpivot/pivot.h
author
deraadt
<deraadt@openbsd.org>
Mon, 17 May 2021 15:31:13 +0000
(15:31 +0000)
committer
deraadt
<deraadt@openbsd.org>
Mon, 17 May 2021 15:31:13 +0000
(15:31 +0000)
regress/usr.bin/lastcomm/pivot.h
patch
|
blob
|
history
diff --git
a/regress/usr.bin/lastcomm/pivot.h
b/regress/usr.bin/lastcomm/pivot.h
index
eec5352
..
fe87baa
100644
(file)
--- a/
regress/usr.bin/lastcomm/pivot.h
+++ b/
regress/usr.bin/lastcomm/pivot.h
@@
-14,6
+14,8
@@
static void pivot(void *newstack) {
asm("mr %%r1, %0; ld %%r3, 0(%%r1); mtlr %%r3; blr;" ::"r"(newstack));
#elif defined(__powerpc__)
asm("mr %%r1, %0; lwz %%r3, 0(%%r1); mtlr %%r3; blr;" ::"r"(newstack));
+#elif defined(__riscv)
+ asm("mv sp, %0; ld ra, 0(sp); jr ra" ::"r"(newstack));
#endif
}