summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormortimer <mortimer@openbsd.org>2019-07-29 02:08:32 +0000
committermortimer <mortimer@openbsd.org>2019-07-29 02:08:32 +0000
commite0f21b2ad7ba4ab4768ed28c90559e4cad9d31ba (patch)
tree5866a27dc7873664be5d1a6501933d6c808109d0
parentAdd iavf(4), a driver for Intel Ethernet Adaptive Virtual Functions. (diff)
downloadwireguard-openbsd-e0f21b2ad7ba4ab4768ed28c90559e4cad9d31ba.tar.xz
wireguard-openbsd-e0f21b2ad7ba4ab4768ed28c90559e4cad9d31ba.zip
regress: Add mips64 stack pivot asm for octeon in stackpivot tests
-rw-r--r--regress/sys/kern/stackpivot/Makefile3
-rw-r--r--regress/sys/kern/stackpivot/pivot.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/regress/sys/kern/stackpivot/Makefile b/regress/sys/kern/stackpivot/Makefile
index 0dd6af71e8c..c5cdb14313d 100644
--- a/regress/sys/kern/stackpivot/Makefile
+++ b/regress/sys/kern/stackpivot/Makefile
@@ -1,6 +1,7 @@
.if ${MACHINE} != "amd64" && \
- ${MACHINE} != "i386"
+ ${MACHINE} != "i386" && \
+ ${MACHINE} != "octeon"
REGRESS_TARGETS=run-regress-skiparch
run-regress-skiparch:
# Need stack pivot asm for this arch
diff --git a/regress/sys/kern/stackpivot/pivot.h b/regress/sys/kern/stackpivot/pivot.h
index 4f13a45bacf..7fd948b3f2f 100644
--- a/regress/sys/kern/stackpivot/pivot.h
+++ b/regress/sys/kern/stackpivot/pivot.h
@@ -6,6 +6,8 @@ static void pivot(size_t *newstack) {
asm("mov %0, %%rsp; retq;" ::"r"(newstack));
#elif defined(__i386__)
asm("mov %0, %%esp; retl;" ::"r"(newstack));
+#elif defined(__mips64__)
+ asm("move $sp, %0; ld $ra, 0($sp); jr $ra;" ::"r"(newstack));
#endif
}