From e8f39e9b3b16cc539b35838876a2d810614acd57 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 24 Jul 2021 21:20:44 +0200 Subject: simplify the struct copy in sysexit() --- src/kernel/arch/i386/sysenter.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/kernel/arch/i386/sysenter.c') diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c index a2810b2..9ba826b 100644 --- a/src/kernel/arch/i386/sysenter.c +++ b/src/kernel/arch/i386/sysenter.c @@ -6,19 +6,9 @@ struct registers _sysexit_regs; // a hack extern void _sysexit_real(); void sysexit(struct registers regs) { - _sysexit_regs = (struct registers) { - .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_regs = regs; + _sysexit_regs.ecx = regs.esp; + _sysexit_regs.edx = regs.eip; _sysexit_real(); } -- cgit v1.2.3