mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 14:15:07 +00:00
Kernel: Simplify x86 IOPL sanity check
Move this architecture-specific sanity check (IOPL must be 0) out of Scheduler and into the x86 enter_thread_context(). Also do this for every thread and not just userspace ones.
This commit is contained in:
parent
684d5eed19
commit
a6b5065d94
2 changed files with 4 additions and 10 deletions
|
@ -310,14 +310,6 @@ bool Scheduler::context_switch(Thread* thread)
|
|||
enter_current(*from_thread);
|
||||
VERIFY(thread == Thread::current());
|
||||
|
||||
if (thread->process().is_user_process() && thread->previous_mode() != Thread::PreviousMode::KernelMode && thread->current_trap()) {
|
||||
auto& regs = thread->get_register_dump_from_stack();
|
||||
auto iopl = get_iopl_from_eflags(regs.flags());
|
||||
if (iopl != 0) {
|
||||
PANIC("Switched to thread {} with non-zero IOPL={}", Thread::current()->tid().value(), iopl);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue