mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 08:35:26 +00:00
Kernel: Add mapping from page directory base (PDB) to PageDirectory
This allows the page fault code to find the owning PageDirectory and corresponding process for faulting regions. The mapping is implemented as a global hash map right now, which is definitely not optimal. We can come up with something better when it becomes necessary.
This commit is contained in:
@@ -333,7 +333,7 @@ int Process::do_exec(String path, Vector<String> arguments, Vector<String> envir
|
||||
u32 entry_eip = 0;
|
||||
// FIXME: Is there a race here?
|
||||
auto old_page_directory = move(m_page_directory);
|
||||
m_page_directory = PageDirectory::create_for_userspace();
|
||||
m_page_directory = PageDirectory::create_for_userspace(*this);
|
||||
#ifdef MM_DEBUG
|
||||
dbgprintf("Process %u exec: PD=%x created\n", pid(), m_page_directory.ptr());
|
||||
#endif
|
||||
@@ -590,7 +590,7 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
|
||||
{
|
||||
dbgprintf("Process: New process PID=%u with name=%s\n", m_pid, m_name.characters());
|
||||
|
||||
m_page_directory = PageDirectory::create_for_userspace(fork_parent ? &fork_parent->page_directory().range_allocator() : nullptr);
|
||||
m_page_directory = PageDirectory::create_for_userspace(*this, fork_parent ? &fork_parent->page_directory().range_allocator() : nullptr);
|
||||
#ifdef MM_DEBUG
|
||||
dbgprintf("Process %u ctor: PD=%x created\n", pid(), m_page_directory.ptr());
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user