1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:27:44 +00:00

Kernel: Consolidate I386/X86_64 implementations of do_init_context()

We can use ThreadRegisters::set_flags() to avoid the #ifdef's here.
This commit is contained in:
Andreas Kling 2021-08-22 12:42:10 +02:00
parent 7a4f6da61b
commit 492b7152d9

View file

@ -1296,11 +1296,7 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread)
extern "C" FlatPtr do_init_context(Thread* thread, u32 flags) extern "C" FlatPtr do_init_context(Thread* thread, u32 flags)
{ {
VERIFY_INTERRUPTS_DISABLED(); VERIFY_INTERRUPTS_DISABLED();
#if ARCH(I386) thread->regs().set_flags(flags);
thread->regs().eflags = flags;
#else
thread->regs().rflags = flags;
#endif
return Processor::current().init_context(*thread, true); return Processor::current().init_context(*thread, true);
} }