Kernel: Fix type for PageDirectory::s_cr3_map

This commit is contained in:
Gunnar Beutner 2021-06-28 03:23:21 +02:00 committed by Andreas Kling
parent a0c1af4327
commit cdcb75709a
Notes: sideshowbarker 2024-07-18 11:25:11 +09:00
2 changed files with 5 additions and 5 deletions

View file

@ -14,15 +14,15 @@
namespace Kernel { namespace Kernel {
static AK::Singleton<HashMap<u32, PageDirectory*>> s_cr3_map; static AK::Singleton<HashMap<FlatPtr, PageDirectory*>> s_cr3_map;
static HashMap<u32, PageDirectory*>& cr3_map() static HashMap<FlatPtr, PageDirectory*>& cr3_map()
{ {
VERIFY_INTERRUPTS_DISABLED(); VERIFY_INTERRUPTS_DISABLED();
return *s_cr3_map; return *s_cr3_map;
} }
RefPtr<PageDirectory> PageDirectory::find_by_cr3(u32 cr3) RefPtr<PageDirectory> PageDirectory::find_by_cr3(FlatPtr cr3)
{ {
ScopedSpinLock lock(s_mm_lock); ScopedSpinLock lock(s_mm_lock);
return cr3_map().get(cr3).value_or({}); return cr3_map().get(cr3).value_or({});

View file

@ -28,11 +28,11 @@ public:
return page_directory; return page_directory;
} }
static NonnullRefPtr<PageDirectory> create_kernel_page_directory() { return adopt_ref(*new PageDirectory); } static NonnullRefPtr<PageDirectory> create_kernel_page_directory() { return adopt_ref(*new PageDirectory); }
static RefPtr<PageDirectory> find_by_cr3(u32); static RefPtr<PageDirectory> find_by_cr3(FlatPtr);
~PageDirectory(); ~PageDirectory();
u32 cr3() const FlatPtr cr3() const
{ {
#if ARCH(X86_64) #if ARCH(X86_64)
return m_pml4t->paddr().get(); return m_pml4t->paddr().get();