summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
authordzwdz2021-07-24 21:20:44 +0200
committerdzwdz2021-07-24 21:20:44 +0200
commite8f39e9b3b16cc539b35838876a2d810614acd57 (patch)
tree9529a15f8658b97152a4fe58c83a3fe31104c0cc /src/kernel/arch
parent687d18815da5742d201e876e71b8c0209a097a21 (diff)
simplify the struct copy in sysexit()
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/i386/sysenter.c16
1 files changed, 3 insertions, 13 deletions
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();
}