bsd-user: Implement RISC-V signal trampoline setup functions
authorMark Corbin <mark@dibsco.co.uk>
Mon, 16 Sep 2024 15:51:16 +0000 (01:51 +1000)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 2 Oct 2024 05:11:52 +0000 (15:11 +1000)
commit2931709ed917bf7e0db545bda941625e3c3aee1e
tree6c10b91727e70b9d2f1a27f7cbb2cb967c18a5f3
parent07e26711201e8374bf86d24b6803de36dad123ee
bsd-user: Implement RISC-V signal trampoline setup functions

Added functions for setting up the RISC-V signal trampoline and signal
frame:

'set_sigtramp_args()': Configures the RISC-V CPU state with arguments
for the signal handler. It sets up the registers with the signal
number,pointers to the signal info and user context, the signal handler
address, and the signal frame pointer.

'setup_sigframe_arch()': Initializes the signal frame with the current
machine context.This function copies the context from the CPU state to
the signal frame, preparing it for the signal handler.

Signed-off-by: Mark Corbin <mark@dibsco.co.uk>
Signed-off-by: Ajeet Singh <itachis@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Co-authored-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240916155119.14610-15-itachis@FreeBSD.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
bsd-user/riscv/signal.c [new file with mode: 0644]