mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 05:48:08 -05:00
kernel: memory: page_table: Simplify GetPhysicalAddr impl.
This commit is contained in:
@ -936,10 +936,6 @@ ResultVal<VAddr> PageTable::AllocateAndMapMemory(std::size_t needed_num_pages, s
|
||||
return MakeResult<VAddr>(addr);
|
||||
}
|
||||
|
||||
PAddr PageTable::GetPhysicalAddr(VAddr addr) {
|
||||
return system.DeviceMemory().GetPhysicalAddr(addr);
|
||||
}
|
||||
|
||||
ResultCode PageTable::InitializeMemoryLayout(VAddr start, VAddr end) {
|
||||
block_manager = std::make_unique<MemoryBlockManager>(start, end);
|
||||
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
bool is_map_only, VAddr region_start,
|
||||
std::size_t region_num_pages, MemoryState state,
|
||||
MemoryPermission perm, PAddr map_addr = 0);
|
||||
PAddr GetPhysicalAddr(VAddr addr);
|
||||
|
||||
Common::PageTable& PageTableImpl() {
|
||||
return page_table_impl;
|
||||
@ -211,6 +210,9 @@ public:
|
||||
constexpr bool IsInsideASLRRegion(VAddr address, std::size_t size) const {
|
||||
return !IsOutsideASLRRegion(address, size);
|
||||
}
|
||||
constexpr PAddr GetPhysicalAddr(VAddr addr) {
|
||||
return page_table_impl.backing_addr[addr >> Memory::PageBits] + addr;
|
||||
}
|
||||
|
||||
private:
|
||||
constexpr bool Contains(VAddr addr) const {
|
||||
|
Reference in New Issue
Block a user