summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2021-04-14 16:06:17 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2021-04-14 16:06:17 +0000
commit57208e6b0559a68e6741a23a430d6431cd17a4c3 (patch)
treeaa9e315e4e7704313ddd08030c20f7ac66bedad8 /regress
parentda96ca576b628fc2fc39e8dac2381055d04872f8 (diff)
Unify pivot.h; brings powerpc/powerpc64 support to the usr.bin/lastcomm
regress test. ok bluhm@
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/kern/stackpivot/pivot.h2
-rw-r--r--regress/usr.bin/lastcomm/pivot.h6
2 files changed, 5 insertions, 3 deletions
diff --git a/regress/sys/kern/stackpivot/pivot.h b/regress/sys/kern/stackpivot/pivot.h
index 46a35611119..eec535278ee 100644
--- a/regress/sys/kern/stackpivot/pivot.h
+++ b/regress/sys/kern/stackpivot/pivot.h
@@ -1,7 +1,7 @@
#ifndef REGRESS_PIVOT_H
#define REGRESS_PIVOT_H
-static void pivot(size_t *newstack) {
+static void pivot(void *newstack) {
#if defined(__aarch64__)
asm("mov sp, %0; ldr lr, [sp]; ret;" ::"r"(newstack));
#elif defined(__amd64__)
diff --git a/regress/usr.bin/lastcomm/pivot.h b/regress/usr.bin/lastcomm/pivot.h
index 5cd1c4ef78d..eec535278ee 100644
--- a/regress/usr.bin/lastcomm/pivot.h
+++ b/regress/usr.bin/lastcomm/pivot.h
@@ -1,5 +1,3 @@
-/* $OpenBSD: pivot.h,v 1.1 2019/09/10 19:01:24 bluhm Exp $ */
-
#ifndef REGRESS_PIVOT_H
#define REGRESS_PIVOT_H
@@ -12,6 +10,10 @@ static void pivot(void *newstack) {
asm("mov %0, %%esp; retl;" ::"r"(newstack));
#elif defined(__mips64__)
asm("move $sp, %0; ld $ra, 0($sp); jr $ra;" ::"r"(newstack));
+#elif defined(__powerpc64__)
+ 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));
#endif
}