mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
Add a sys$exit and make init_stage2 call it when finished.
This commit is contained in:
parent
79ffdb7205
commit
3a3c57357c
5 changed files with 35 additions and 3 deletions
|
@ -235,6 +235,26 @@ void Task::dumpRegions()
|
|||
}
|
||||
}
|
||||
|
||||
void Task::sys$exit(int status)
|
||||
{
|
||||
cli();
|
||||
kprintf("sys$exit: %s(%u) exit with status %d\n", name().characters(), pid(), status);
|
||||
|
||||
setState(Exiting);
|
||||
dumpRegions();
|
||||
|
||||
s_tasks->remove(this);
|
||||
|
||||
if (!scheduleNewTask()) {
|
||||
kprintf("Task::taskDidCrash: Failed to schedule a new task :(\n");
|
||||
HANG;
|
||||
}
|
||||
|
||||
delete this;
|
||||
|
||||
switchNow();
|
||||
}
|
||||
|
||||
void Task::taskDidCrash(Task* crashedTask)
|
||||
{
|
||||
// NOTE: This is called from an excepton handler, so interrupts are disabled.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue