From f03ebfd6f95010dde4f369e901a1ce4ac22a5a2a Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 17 May 2021 15:31:13 +0000 Subject: [PATCH] copy riscv support from regress/sys/kern/stackpivot/pivot.h --- regress/usr.bin/lastcomm/pivot.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regress/usr.bin/lastcomm/pivot.h b/regress/usr.bin/lastcomm/pivot.h index eec535278ee..fe87baab431 100644 --- 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 } -- 2.20.1