diff options
author | dzwdz | 2021-07-24 16:55:15 +0200 |
---|---|---|
committer | dzwdz | 2021-07-24 16:55:15 +0200 |
commit | 4d5e930c48cded790f77497911706aa8f5ff0965 (patch) | |
tree | b256d379f5841d28a74fb28b6d01720cb14a5878 /src/kernel/arch/i386/registers.h | |
parent | 67a359d8c4b9f5cb3d2e1fb9602ebe5dfd3978cf (diff) |
save all registers on syscalls
Diffstat (limited to 'src/kernel/arch/i386/registers.h')
-rw-r--r-- | src/kernel/arch/i386/registers.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 <stdint.h> + +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; +} |