proc: add current_pt_regs

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-21 20:21:44 -04:00
commit 3ca26e6068
2 changed files with 6 additions and 0 deletions

View file

@ -2,6 +2,11 @@
#include <kernel/syscall.h>
#include <arch/proc.h>
struct pt_regs *current_pt_regs()
{
return (struct pt_regs *)(tls_get()->kernel_rsp - sizeof(struct pt_regs));
}
static inline i64 _do_syscall(struct pt_regs *regs)
{
syscall_t c = get_syscall(regs->rax);