diff options
author | dzwdz | 2024-08-02 01:20:40 +0200 |
---|---|---|
committer | dzwdz | 2024-08-02 01:20:40 +0200 |
commit | e818cab3f1fc4a3d4d0b8e2c9424fb2e7b1dff70 (patch) | |
tree | 5d59d2e0ea74253f5b265cdd542b74daca6dce5a /src/kernel/arch/generic.h | |
parent | 1890868af4b8cf2593a4b0831e2fc69a44ec680b (diff) |
*: use a generic UserRegs type everywhere I'm storing registers
mostly inspired by Plan 9's Ureg, probably obvious from the name
Diffstat (limited to 'src/kernel/arch/generic.h')
-rw-r--r-- | src/kernel/arch/generic.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/kernel/arch/generic.h b/src/kernel/arch/generic.h index a6a14c9..c9431eb 100644 --- a/src/kernel/arch/generic.h +++ b/src/kernel/arch/generic.h @@ -27,8 +27,7 @@ uint64_t uptime_ns(void); void timer_schedule(Proc *p, uint64_t ns); void timer_deschedule(Proc *p); -// src/arch/i386/sysenter.s -_Noreturn void sysexit(CpuRegs); +_Noreturn void sysexit(UserRegs *, char sse[512]); // all of those can allocate memory Pagedir *pagedir_new(void); @@ -52,3 +51,7 @@ int kprintf(const char *fmt, ...); void *debug_caller(size_t depth); void debug_stacktrace(void); + +/** "Applies" an UserRegs struct received from userland over another UserRegs + * without overriding privileged registers. */ +void regs_safecopy(UserRegs *, const UserRegs *); |