shithub: riscv

Download patch

ref: 6253af7a5ce9ed1f223769b1d690b9f6beca6850
parent: ba59008e1da6bdf87648f9cc44aac83095c49600
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Apr 15 20:26:01 EDT 2025

kernel: refactor syscall and note handling

The differences between the syscall handlers are just
the scallnr register, return register and the address
where we fetch the stack arguments.

So provide a dosyscall() function where we pass the
syscall number, the Sargs* pointer and a uintptr*
for the return value.

The sysnoted() call is a bit special, as it needs
all the registers to be restoed. For this dosyscall()
returns a integer status. When 1, full register
restore is needed.

Also, it was determined that the Sargs* pointer needs
to be alignment checked (now using evenaddr()).

Now all kernels support ratrace syscall tracing.