Free physical pages allocated for a process's page directory on exit.

Also use a ProcessPagingScope instead of region aliasing to implement
create-process ELF loading.
This commit is contained in:
Andreas Kling 2018-11-01 23:04:34 +01:00
parent c70afd045e
commit 90ddbca127
Notes: sideshowbarker 2024-07-19 18:34:37 +09:00
8 changed files with 113 additions and 55 deletions

View file

@ -78,7 +78,7 @@ ByteBuffer procfs$pid_vm(Process& process)
ByteBuffer procfs$pid_stack(Process& process)
{
ProcessInspectionScope scope(process);
OtherProcessPagingScope pagingScope(process);
ProcessPagingScope pagingScope(process);
struct RecognizedSymbol {
dword address;
const KSym* ksym;
@ -147,14 +147,14 @@ ByteBuffer procfs$mm()
zonePageCount += zone->m_pages.size();
auto buffer = ByteBuffer::createUninitialized(1024 + 80 * MM.m_zones.size() + zonePageCount * 10);
char* ptr = (char*)buffer.pointer();
ptr += ksprintf(ptr, "Zone count: %u\n", MM.m_zones.size());
ptr += ksprintf(ptr, "Free physical pages: %u\n", MM.m_freePages.size());
for (auto* zone : MM.m_zones) {
ptr += ksprintf(ptr, "Zone %p size: %u\n ", zone, zone->size());
for (auto page : zone->m_pages)
ptr += ksprintf(ptr, "%x ", page);
ptr += ksprintf(ptr, "\n");
}
ptr += ksprintf(ptr, "Zone count: %u\n", MM.m_zones.size());
ptr += ksprintf(ptr, "Free physical pages: %u\n", MM.m_freePages.size());
buffer.trim(ptr - (char*)buffer.pointer());
return buffer;
}