From 961f727448019047433ac1b045f8075f269ba9f7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 19 Aug 2021 21:53:53 +0200 Subject: Kernel: Consolidate a bunch of i386/x86_64 code paths Add some arch-specific getters and setters that allow us to merge blocks that were previously specific to either ARCH(I386) or ARCH(X86_64). --- Kernel/Syscalls/thread.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Kernel/Syscalls') diff --git a/Kernel/Syscalls/thread.cpp b/Kernel/Syscalls/thread.cpp index e3c3ff9e07..ec4b567f03 100644 --- a/Kernel/Syscalls/thread.cpp +++ b/Kernel/Syscalls/thread.cpp @@ -60,14 +60,10 @@ KResultOr Process::sys$create_thread(void* (*entry)(void*), Userspacedetach(); auto& regs = thread->regs(); -#if ARCH(I386) - regs.eip = (FlatPtr)entry; - regs.eflags = 0x0202; - regs.esp = user_sp.value(); -#else - regs.rip = (FlatPtr)entry; - regs.rflags = 0x0202; - regs.rsp = user_sp.value(); + regs.set_ip((FlatPtr)entry); + regs.set_flags(0x0202); + regs.set_sp(user_sp.value()); +#if ARCH(X86_64) regs.rdi = params.rdi; regs.rsi = params.rsi; regs.rdx = params.rdx; -- cgit v1.2.3