1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

Generate a basic /proc/summary file with some info about all tasks.

This commit is contained in:
Andreas Kling 2018-10-23 12:44:46 +02:00
parent ed2422d7af
commit 63e253bac9
5 changed files with 35 additions and 5 deletions

View file

@ -95,6 +95,15 @@ void Task::allocateLDT()
m_tss.ldt = newLDTSelector;
}
Vector<Task*> Task::allTasks()
{
Vector<Task*> tasks;
tasks.ensureCapacity(s_tasks->sizeSlow());
for (auto* task = s_tasks->head(); task; task = task->next())
tasks.append(task);
return tasks;
}
Task::Region* Task::allocateRegion(size_t size, String&& name)
{
// FIXME: This needs sanity checks. What if this overlaps existing regions?