From: deraadt Date: Mon, 17 May 2021 15:31:13 +0000 (+0000) Subject: copy riscv support from regress/sys/kern/stackpivot/pivot.h X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f03ebfd6f95010dde4f369e901a1ce4ac22a5a2a;p=openbsd copy riscv support from regress/sys/kern/stackpivot/pivot.h --- 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 }