Unbreak sys$sigreturn() after colonel process changes.

This commit is contained in:
Andreas Kling 2018-11-07 23:21:32 +01:00
parent 43f40a3050
commit f792349853
Notes: sideshowbarker 2024-07-19 18:32:07 +09:00
3 changed files with 9 additions and 8 deletions

View file

@ -321,7 +321,7 @@ int Process::exec(const String& path, Vector<String>&& arguments, Vector<String>
kprintf("Process %u (%s) exec'd %s @ %p\n", pid(), name().characters(), path.characters(), m_tss.eip);
#endif
set_state(ExecPhase1);
set_state(Skip1SchedulerPass);
if (current == this) {
bool success = Scheduler::yield();
@ -822,6 +822,7 @@ void Process::sys$sigreturn()
dbgprintf("sys$sigreturn in %s(%u)\n", name().characters(), pid());
dbgprintf(" -> resuming execution at %w:%x\n", m_tss.cs, m_tss.eip);
#endif
set_state(Skip1SchedulerPass);
Scheduler::yield();
kprintf("sys$sigreturn failed in %s(%u)\n", name().characters(), pid());
ASSERT_NOT_REACHED();

View file

@ -43,8 +43,8 @@ public:
Invalid = 0,
Runnable,
Running,
ExecPhase1,
ExecPhase2,
Skip1SchedulerPass,
Skip0SchedulerPasses,
Dead,
Forgiven,
BeingInspected,
@ -306,8 +306,8 @@ static inline const char* toString(Process::State state)
case Process::Runnable: return "Runnable";
case Process::Running: return "Running";
case Process::Dead: return "Dead";
case Process::ExecPhase1: return "ExecPhase1";
case Process::ExecPhase2: return "ExecPhase2";
case Process::Skip1SchedulerPass: return "Skip1";
case Process::Skip0SchedulerPasses: return "Skip0";
case Process::Forgiven: return "Forgiven";
case Process::BlockedSleep: return "Sleep";
case Process::BlockedWait: return "Wait";

View file

@ -56,12 +56,12 @@ bool Scheduler::pick_next()
return true;
}
if (process.state() == Process::ExecPhase1) {
process.set_state(Process::ExecPhase2);
if (process.state() == Process::Skip1SchedulerPass) {
process.set_state(Process::Skip0SchedulerPasses);
return true;
}
if (process.state() == Process::ExecPhase2) {
if (process.state() == Process::Skip0SchedulerPasses) {
process.set_state(Process::Runnable);
return true;
}