1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

Kernel: Fix signal delivery

When delivering urgent signals to the current thread
we need to check if we should be unblocked, and if not
we need to yield to another process.

We also need to make sure that we suppress context switches
during Process::exec() so that we don't clobber the registers
that it sets up (eip mainly) by a context switch. To be able
to do that we add the concept of a critical section, which are
similar to Process::m_in_irq but different in that they can be
requested at any time. Calls to Scheduler::yield and
Scheduler::donate_to will return instantly without triggering
a context switch, but the processor will then asynchronously
trigger a context switch once the critical section is left.
This commit is contained in:
Tom 2020-07-03 05:19:50 -06:00 committed by Andreas Kling
parent a308b176ce
commit e373e5f007
12 changed files with 242 additions and 95 deletions

View file

@ -463,8 +463,8 @@ private:
private:
friend class SchedulerData;
friend class WaitQueue;
bool unlock_process_if_locked();
void relock_process();
bool unlock_process_if_locked(u32& prev_crit);
void relock_process(bool did_unlock, u32 prev_crit);
String backtrace_impl() const;
void reset_fpu_state();