diff options
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/arch/i386/registers.h | 12 | ||||
-rw-r--r-- | src/kernel/arch/i386/sysenter.c | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/kernel/arch/i386/registers.h b/src/kernel/arch/i386/registers.h index 1264139..cca374d 100644 --- a/src/kernel/arch/i386/registers.h +++ b/src/kernel/arch/i386/registers.h @@ -1,15 +1,13 @@ #pragma once #include <stdint.h> -// TODO merge registers and registers_pushad - struct registers { - uint32_t eax, ebx, ecx, edx, esi, edi; - void *ebp, *esp, *eip; -}; - -struct registers_pushad { + /* those are in the order of pushad/popad - so you can load/save this + * struct in (almost) one instruction */ uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; + + // not part of pushad/popad, but still useful + uint32_t eip; } __attribute__((__packed__)); // saves a return value according to the SysV ABI diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c index f3f5987..a7c7123 100644 --- a/src/kernel/arch/i386/sysenter.c +++ b/src/kernel/arch/i386/sysenter.c @@ -1,12 +1,12 @@ #include <kernel/arch/generic.h> #include <kernel/proc.h> -struct registers_pushad _sysexit_regs; // a hack +struct registers _sysexit_regs; // a hack extern void _sysexit_real(); void sysexit(struct registers regs) { - _sysexit_regs = (struct registers_pushad) { + _sysexit_regs = (struct registers) { .eax = regs.eax, .ebx = regs.ebx, .ebp = regs.ebp, |