diff options
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; +} |