summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormortimer <mortimer@cvs.openbsd.org>2019-07-29 02:08:33 +0000
committermortimer <mortimer@cvs.openbsd.org>2019-07-29 02:08:33 +0000
commit06244faed33605df894c0780258d828f56dc8915 (patch)
tree86f071ee27f1edc06a62dc8ce4ffa5ce566bfa1e
parent80ca41df275af01360f25a16cd6928f8a87aee4b (diff)
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
}