From 4d5e930c48cded790f77497911706aa8f5ff0965 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 24 Jul 2021 16:55:15 +0200 Subject: save all registers on syscalls --- src/kernel/arch/i386/registers.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/kernel/arch/i386/registers.h (limited to 'src/kernel/arch/i386/registers.h') diff --git a/src/kernel/arch/i386/registers.h b/src/kernel/arch/i386/registers.h new file mode 100644 index 0000000..feba157 --- /dev/null +++ b/src/kernel/arch/i386/registers.h @@ -0,0 +1,13 @@ +#pragma once +#include + +struct registers { + uint32_t eax, ebx, ecx, edx, esi, edi; + void *ebp, *esp, *eip; +}; + +// saves a return value according to the SysV ABI +inline void regs_savereturn(struct registers *regs, uint64_t value) { + regs->eax = value; + regs->edx = value >> 32; +} -- cgit v1.2.3