diff options
Diffstat (limited to 'src/kernel/arch/i386/sysenter.c')
-rw-r--r-- | src/kernel/arch/i386/sysenter.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c index 91dac2e..f3f5987 100644 --- a/src/kernel/arch/i386/sysenter.c +++ b/src/kernel/arch/i386/sysenter.c @@ -1,6 +1,27 @@ #include <kernel/arch/generic.h> #include <kernel/proc.h> +struct registers_pushad _sysexit_regs; // a hack + +extern void _sysexit_real(); + +void sysexit(struct registers regs) { + _sysexit_regs = (struct registers_pushad) { + .eax = regs.eax, + .ebx = regs.ebx, + .ebp = regs.ebp, + .esi = regs.esi, + .edi = regs.edi, + + // sysexit args + .ecx = regs.esp, + .edx = regs.eip, + + // ESP doesn't matter + }; + _sysexit_real(); +} + void sysenter_stage2(int edi, int esi, void *ebp, void *esp, int ebx, int edx, int ecx, int eax) { |