mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
Kernel: Use PAE to allow accessing all physical memory beyond 4GB
We already use PAE for the NX bit, but this changes the PhysicalAddress structure to be able to hold 64 bit physical addresses. This allows us to use all the available physical memory.
This commit is contained in:
parent
658b41a06c
commit
ad5d9d648b
7 changed files with 87 additions and 86 deletions
|
@ -68,7 +68,7 @@ struct UsedMemoryRange {
|
|||
|
||||
struct ContiguousReservedMemoryRange {
|
||||
PhysicalAddress start;
|
||||
size_t length {};
|
||||
PhysicalSize length {};
|
||||
};
|
||||
|
||||
enum class PhysicalMemoryRangeType {
|
||||
|
@ -83,7 +83,7 @@ enum class PhysicalMemoryRangeType {
|
|||
struct PhysicalMemoryRange {
|
||||
PhysicalMemoryRangeType type { PhysicalMemoryRangeType::Unknown };
|
||||
PhysicalAddress start;
|
||||
size_t length {};
|
||||
PhysicalSize length {};
|
||||
};
|
||||
|
||||
#define MM Kernel::MemoryManager::the()
|
||||
|
@ -151,12 +151,20 @@ public:
|
|||
OwnPtr<Region> allocate_kernel_region_with_vmobject(VMObject&, size_t, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
||||
OwnPtr<Region> allocate_kernel_region_with_vmobject(const Range&, VMObject&, StringView name, Region::Access access, Region::Cacheable = Region::Cacheable::Yes);
|
||||
|
||||
unsigned user_physical_pages() const { return m_user_physical_pages; }
|
||||
unsigned user_physical_pages_used() const { return m_user_physical_pages_used; }
|
||||
unsigned user_physical_pages_committed() const { return m_user_physical_pages_committed; }
|
||||
unsigned user_physical_pages_uncommitted() const { return m_user_physical_pages_uncommitted; }
|
||||
unsigned super_physical_pages() const { return m_super_physical_pages; }
|
||||
unsigned super_physical_pages_used() const { return m_super_physical_pages_used; }
|
||||
struct SystemMemoryInfo {
|
||||
PhysicalSize user_physical_pages { 0 };
|
||||
PhysicalSize user_physical_pages_used { 0 };
|
||||
PhysicalSize user_physical_pages_committed { 0 };
|
||||
PhysicalSize user_physical_pages_uncommitted { 0 };
|
||||
PhysicalSize super_physical_pages { 0 };
|
||||
PhysicalSize super_physical_pages_used { 0 };
|
||||
};
|
||||
|
||||
SystemMemoryInfo get_system_memory_info()
|
||||
{
|
||||
ScopedSpinLock lock(s_mm_lock);
|
||||
return m_system_memory_info;
|
||||
}
|
||||
|
||||
template<IteratorFunction<VMObject&> Callback>
|
||||
static void for_each_vmobject(Callback callback)
|
||||
|
@ -223,12 +231,7 @@ private:
|
|||
RefPtr<PhysicalPage> m_shared_zero_page;
|
||||
RefPtr<PhysicalPage> m_lazy_committed_page;
|
||||
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_used { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_committed { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_user_physical_pages_uncommitted { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_super_physical_pages { 0 };
|
||||
Atomic<unsigned, AK::MemoryOrder::memory_order_relaxed> m_super_physical_pages_used { 0 };
|
||||
SystemMemoryInfo m_system_memory_info;
|
||||
|
||||
NonnullRefPtrVector<PhysicalRegion> m_user_physical_regions;
|
||||
NonnullRefPtrVector<PhysicalRegion> m_super_physical_regions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue