kernel: memory: page_table: Simplify GetPhysicalAddr impl.
This commit is contained in:
parent
c629e544a7
commit
a8292f6cd9
4 changed files with 6 additions and 19 deletions
|
@ -12,11 +12,4 @@ DeviceMemory::DeviceMemory(System& system) : buffer{DramMemoryMap::Size}, system
|
|||
|
||||
DeviceMemory::~DeviceMemory() = default;
|
||||
|
||||
PAddr DeviceMemory::GetPhysicalAddr(VAddr addr) {
|
||||
const u8* const base{system.Memory().GetPointer(addr)};
|
||||
ASSERT(base);
|
||||
const uintptr_t offset{static_cast<uintptr_t>(base - GetPointer(DramMemoryMap::Base))};
|
||||
return DramMemoryMap::Base + offset;
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue