diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-04-14 16:06:17 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-04-14 16:06:17 +0000 |
commit | 57208e6b0559a68e6741a23a430d6431cd17a4c3 (patch) | |
tree | aa9e315e4e7704313ddd08030c20f7ac66bedad8 /regress/usr.bin | |
parent | da96ca576b628fc2fc39e8dac2381055d04872f8 (diff) |
Unify pivot.h; brings powerpc/powerpc64 support to the usr.bin/lastcomm
regress test.
ok bluhm@
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/lastcomm/pivot.h | 6 |
1 files changed, 4 insertions, 2 deletions
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 } |