1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

Fix /proc/PID/stack in the new per-process page directory world.

I added an RAII helper called OtherTaskPagingScope. While present,
it switches the kernel over to using another task's page directory.
This is perfect for e.g walking the stack in /proc/PID/stack.
This commit is contained in:
Andreas Kling 2018-11-01 11:44:21 +01:00
parent c45f166c63
commit 5891691640
4 changed files with 12 additions and 32 deletions

View file

@ -54,13 +54,10 @@ public:
bool mapSubregion(Task&, Task::Subregion&);
bool unmapSubregion(Task&, Task::Subregion&);
bool mapSubregionsForTask(Task&);
bool unmapSubregionsForTask(Task&);
bool mapRegion(Task&, Task::Region&);
bool unmapRegion(Task&, Task::Region&);
bool mapRegionsForTask(Task&);
bool unmapRegionsForTask(Task&);
void registerZone(Zone&);
void unregisterZone(Zone&);
@ -182,3 +179,13 @@ private:
Vector<PhysicalAddress> m_freePages;
};
struct KernelPagingScope {
KernelPagingScope() { MM.enter_kernel_paging_scope(); }
~KernelPagingScope() { MM.enter_task_paging_scope(*current); }
};
struct OtherTaskPagingScope {
OtherTaskPagingScope(Task& task) { MM.enter_task_paging_scope(task); }
~OtherTaskPagingScope() { MM.enter_task_paging_scope(*current); }
};